summaryrefslogtreecommitdiffstats
path: root/src/shader_recompiler/backend/glsl/emit_context.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/shader_recompiler/backend/glsl/emit_context.cpp')
-rw-r--r--src/shader_recompiler/backend/glsl/emit_context.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/shader_recompiler/backend/glsl/emit_context.cpp b/src/shader_recompiler/backend/glsl/emit_context.cpp
index ed0955da0..6c2828644 100644
--- a/src/shader_recompiler/backend/glsl/emit_context.cpp
+++ b/src/shader_recompiler/backend/glsl/emit_context.cpp
@@ -306,6 +306,7 @@ EmitContext::EmitContext(IR::Program& program, Bindings& bindings, const Profile
SetupImages(bindings);
SetupTextures(bindings);
DefineHelperFunctions();
+ DefineConstants();
}
void EmitContext::SetupExtensions(std::string&) {
@@ -339,6 +340,9 @@ void EmitContext::SetupExtensions(std::string&) {
if (!info.uses_int64) {
header += "#extension GL_ARB_gpu_shader_int64 : enable\n";
}
+ if (profile.support_gl_warp_intrinsics) {
+ header += "#extension GL_NV_shader_thread_shuffle : enable\n";
+ }
}
if (info.stores_viewport_index && profile.support_viewport_index_layer_non_geometry &&
stage != Stage::Geometry) {
@@ -605,4 +609,11 @@ void EmitContext::SetupTextures(Bindings& bindings) {
}
}
+void EmitContext::DefineConstants() {
+ if (info.uses_fswzadd) {
+ header += "const float FSWZ_A[]=float[4](-1.f,1.f,-1.f,0.f);"
+ "const float FSWZ_B[]=float[4](-1.f,-1.f,1.f,-1.f);";
+ }
+}
+
} // namespace Shader::Backend::GLSL