summaryrefslogtreecommitdiff
path: root/src/render
diff options
context:
space:
mode:
authorVaxry <vaxry@vaxry.net>2024-03-18 04:15:04 +0000
committerVaxry <vaxry@vaxry.net>2024-03-18 04:15:04 +0000
commit7587cadd0a4e94c9ba42c00307854052798cf9b2 (patch)
tree3fc268de0c1e50d79e2b3d329deba613e72e8db1 /src/render
parentc34ad12183506cb5f52bfb65b44e3a274e996fc3 (diff)
renderer: add support for gles3.2 screen shaders
Diffstat (limited to 'src/render')
-rw-r--r--src/render/OpenGL.cpp2
-rw-r--r--src/render/shaders/Textures.hpp11
2 files changed, 12 insertions, 1 deletions
diff --git a/src/render/OpenGL.cpp b/src/render/OpenGL.cpp
index 30803885..f79a10d1 100644
--- a/src/render/OpenGL.cpp
+++ b/src/render/OpenGL.cpp
@@ -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");
diff --git a/src/render/shaders/Textures.hpp b/src/render/shaders/Textures.hpp
index 5e346c1e..59c7304f 100644
--- a/src/render/shaders/Textures.hpp
+++ b/src/render/shaders/Textures.hpp
@@ -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