diff options
| author | 2021-06-07 18:29:13 -0400 | |
|---|---|---|
| committer | 2021-07-22 21:51:37 -0400 | |
| commit | fc0db612abedbba8245f94d03049f65d78819b26 (patch) | |
| tree | 57904777ada6b9bf6db9e4108a30b1d0aa99bdd4 /src/shader_recompiler/backend/glsl | |
| parent | glsl: Remove output generic indexing for geometry stage (diff) | |
| download | yuzu-fc0db612abedbba8245f94d03049f65d78819b26.tar.gz yuzu-fc0db612abedbba8245f94d03049f65d78819b26.tar.xz yuzu-fc0db612abedbba8245f94d03049f65d78819b26.zip | |
glsl: Conditionally use GL_EXT_shader_image_load_formatted
Fix for SULD.D
Diffstat (limited to 'src/shader_recompiler/backend/glsl')
| -rw-r--r-- | src/shader_recompiler/backend/glsl/emit_context.cpp | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/src/shader_recompiler/backend/glsl/emit_context.cpp b/src/shader_recompiler/backend/glsl/emit_context.cpp index 50a7a7447..8cbb2ec57 100644 --- a/src/shader_recompiler/backend/glsl/emit_context.cpp +++ b/src/shader_recompiler/backend/glsl/emit_context.cpp | |||
| @@ -206,6 +206,20 @@ void SetupOutPerVertex(EmitContext& ctx, std::string& header) { | |||
| 206 | header += "out int gl_ViewportIndex;"; | 206 | header += "out int gl_ViewportIndex;"; |
| 207 | } | 207 | } |
| 208 | } | 208 | } |
| 209 | |||
| 210 | bool UsesTyplessImage(const Info& info) { | ||
| 211 | for (const auto& desc : info.image_buffer_descriptors) { | ||
| 212 | if (desc.format == ImageFormat::Typeless) { | ||
| 213 | return true; | ||
| 214 | } | ||
| 215 | } | ||
| 216 | for (const auto& desc : info.image_descriptors) { | ||
| 217 | if (desc.format == ImageFormat::Typeless) { | ||
| 218 | return true; | ||
| 219 | } | ||
| 220 | } | ||
| 221 | return false; | ||
| 222 | } | ||
| 209 | } // Anonymous namespace | 223 | } // Anonymous namespace |
| 210 | 224 | ||
| 211 | EmitContext::EmitContext(IR::Program& program, Bindings& bindings, const Profile& profile_, | 225 | EmitContext::EmitContext(IR::Program& program, Bindings& bindings, const Profile& profile_, |
| @@ -281,8 +295,7 @@ EmitContext::EmitContext(IR::Program& program, Bindings& bindings, const Profile | |||
| 281 | 295 | ||
| 282 | void EmitContext::SetupExtensions(std::string&) { | 296 | void EmitContext::SetupExtensions(std::string&) { |
| 283 | // TODO: track this usage | 297 | // TODO: track this usage |
| 284 | header += "#extension GL_ARB_sparse_texture2 : enable\n" | 298 | header += "#extension GL_ARB_sparse_texture2 : enable\n"; |
| 285 | "#extension GL_EXT_shader_image_load_formatted : enable\n"; | ||
| 286 | if (profile.support_gl_texture_shadow_lod) { | 299 | if (profile.support_gl_texture_shadow_lod) { |
| 287 | header += "#extension GL_EXT_texture_shadow_lod : enable\n"; | 300 | header += "#extension GL_EXT_texture_shadow_lod : enable\n"; |
| 288 | } | 301 | } |
| @@ -318,6 +331,9 @@ void EmitContext::SetupExtensions(std::string&) { | |||
| 318 | stage != Stage::Geometry) { | 331 | stage != Stage::Geometry) { |
| 319 | header += "#extension GL_ARB_shader_viewport_layer_array : enable\n"; | 332 | header += "#extension GL_ARB_shader_viewport_layer_array : enable\n"; |
| 320 | } | 333 | } |
| 334 | if (UsesTyplessImage(info)) { | ||
| 335 | header += "#extension GL_EXT_shader_image_load_formatted : enable\n"; | ||
| 336 | } | ||
| 321 | } | 337 | } |
| 322 | 338 | ||
| 323 | void EmitContext::DefineConstantBuffers(Bindings& bindings) { | 339 | void EmitContext::DefineConstantBuffers(Bindings& bindings) { |