diff options
Diffstat (limited to 'src/shader_recompiler')
| -rw-r--r-- | src/shader_recompiler/backend/glsl/emit_context.cpp | 9 | ||||
| -rw-r--r-- | src/shader_recompiler/profile.h | 2 |
2 files changed, 9 insertions, 2 deletions
diff --git a/src/shader_recompiler/backend/glsl/emit_context.cpp b/src/shader_recompiler/backend/glsl/emit_context.cpp index 9c3fd44ba..6f769fa10 100644 --- a/src/shader_recompiler/backend/glsl/emit_context.cpp +++ b/src/shader_recompiler/backend/glsl/emit_context.cpp | |||
| @@ -5,6 +5,7 @@ | |||
| 5 | #include "shader_recompiler/backend/bindings.h" | 5 | #include "shader_recompiler/backend/bindings.h" |
| 6 | #include "shader_recompiler/backend/glsl/emit_context.h" | 6 | #include "shader_recompiler/backend/glsl/emit_context.h" |
| 7 | #include "shader_recompiler/frontend/ir/program.h" | 7 | #include "shader_recompiler/frontend/ir/program.h" |
| 8 | #include "shader_recompiler/profile.h" | ||
| 8 | 9 | ||
| 9 | namespace Shader::Backend::GLSL { | 10 | namespace Shader::Backend::GLSL { |
| 10 | 11 | ||
| @@ -40,8 +41,12 @@ void EmitContext::SetupExtensions(std::string& header) { | |||
| 40 | header += "#extension NV_shader_atomic_fp16_vector : enable\n"; | 41 | header += "#extension NV_shader_atomic_fp16_vector : enable\n"; |
| 41 | } | 42 | } |
| 42 | if (info.uses_fp16) { | 43 | if (info.uses_fp16) { |
| 43 | // TODO: AMD | 44 | if (profile.support_gl_nv_gpu_shader_5) { |
| 44 | header += "#extension GL_NV_gpu_shader5 : enable\n"; | 45 | header += "#extension GL_NV_gpu_shader5 : enable\n"; |
| 46 | } | ||
| 47 | if (profile.support_gl_amd_gpu_shader_half_float) { | ||
| 48 | header += "#extension GL_AMD_gpu_shader_half_float : enable\n"; | ||
| 49 | } | ||
| 45 | } | 50 | } |
| 46 | } | 51 | } |
| 47 | 52 | ||
diff --git a/src/shader_recompiler/profile.h b/src/shader_recompiler/profile.h index 3109fb69c..5d269368a 100644 --- a/src/shader_recompiler/profile.h +++ b/src/shader_recompiler/profile.h | |||
| @@ -83,6 +83,8 @@ struct Profile { | |||
| 83 | bool support_demote_to_helper_invocation{}; | 83 | bool support_demote_to_helper_invocation{}; |
| 84 | bool support_int64_atomics{}; | 84 | bool support_int64_atomics{}; |
| 85 | bool support_derivative_control{}; | 85 | bool support_derivative_control{}; |
| 86 | bool support_gl_nv_gpu_shader_5{}; | ||
| 87 | bool support_gl_amd_gpu_shader_half_float{}; | ||
| 86 | 88 | ||
| 87 | bool warp_size_potentially_larger_than_guest{}; | 89 | bool warp_size_potentially_larger_than_guest{}; |
| 88 | 90 | ||