summaryrefslogtreecommitdiff
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
306 SetupImages(bindings); 306 SetupImages(bindings);
307 SetupTextures(bindings); 307 SetupTextures(bindings);
308 DefineHelperFunctions(); 308 DefineHelperFunctions();
309 DefineConstants();
309} 310}
310 311
311void EmitContext::SetupExtensions(std::string&) { 312void EmitContext::SetupExtensions(std::string&) {
@@ -339,6 +340,9 @@ void EmitContext::SetupExtensions(std::string&) {
339 if (!info.uses_int64) { 340 if (!info.uses_int64) {
340 header += "#extension GL_ARB_gpu_shader_int64 : enable\n"; 341 header += "#extension GL_ARB_gpu_shader_int64 : enable\n";
341 } 342 }
343 if (profile.support_gl_warp_intrinsics) {
344 header += "#extension GL_NV_shader_thread_shuffle : enable\n";
345 }
342 } 346 }
343 if (info.stores_viewport_index && profile.support_viewport_index_layer_non_geometry && 347 if (info.stores_viewport_index && profile.support_viewport_index_layer_non_geometry &&
344 stage != Stage::Geometry) { 348 stage != Stage::Geometry) {
@@ -605,4 +609,11 @@ void EmitContext::SetupTextures(Bindings& bindings) {
605 } 609 }
606} 610}
607 611
612void EmitContext::DefineConstants() {
613 if (info.uses_fswzadd) {
614 header += "const float FSWZ_A[]=float[4](-1.f,1.f,-1.f,0.f);"
615 "const float FSWZ_B[]=float[4](-1.f,-1.f,1.f,-1.f);";
616 }
617}
618
608} // namespace Shader::Backend::GLSL 619} // namespace Shader::Backend::GLSL