mirror of
https://github.com/hyprwm/Hyprland
synced 2024-11-22 23:25:59 +01:00
renderer: add support for gles3.2 screen shaders
This commit is contained in:
parent
c34ad12183
commit
7587cadd0a
2 changed files with 12 additions and 1 deletions
|
@ -547,7 +547,7 @@ void CHyprOpenGLImpl::applyScreenShader(const std::string& path) {
|
|||
|
||||
std::string fragmentShader((std::istreambuf_iterator<char>(infile)), (std::istreambuf_iterator<char>()));
|
||||
|
||||
m_sFinalScreenShader.program = createProgram(TEXVERTSRC, fragmentShader, true);
|
||||
m_sFinalScreenShader.program = createProgram(fragmentShader.starts_with("#version 320 es") ? TEXVERTSRC320 : TEXVERTSRC, fragmentShader, true);
|
||||
|
||||
if (!m_sFinalScreenShader.program) {
|
||||
g_pConfigManager->addParseError("Screen shader parser: Screen shader parse failed");
|
||||
|
|
|
@ -80,6 +80,17 @@ void main() {
|
|||
v_texcoord = texcoord;
|
||||
})#";
|
||||
|
||||
inline const std::string TEXVERTSRC320 = R"#(#version 320 es
|
||||
uniform mat3 proj;
|
||||
in vec2 pos;
|
||||
in vec2 texcoord;
|
||||
out vec2 v_texcoord;
|
||||
|
||||
void main() {
|
||||
gl_Position = vec4(proj * vec3(pos, 1.0), 1.0);
|
||||
v_texcoord = texcoord;
|
||||
})#";
|
||||
|
||||
inline const std::string TEXFRAGSRCRGBA = R"#(
|
||||
precision highp float;
|
||||
varying vec2 v_texcoord; // is in 0-1
|
||||
|
|
Loading…
Reference in a new issue