diff options
author | ameerj <52414509+ameerj@users.noreply.github.com> | 2021-06-05 08:41:29 +0200 |
---|---|---|
committer | ameerj <52414509+ameerj@users.noreply.github.com> | 2021-07-23 03:51:37 +0200 |
commit | 421847cf1e33d5b95c9aa272bf3cf69afda3d964 (patch) | |
tree | a7fd72bf902697a9a32c18f023b0fb282a7029bf /src/shader_recompiler/backend/glsl/emit_context.cpp | |
parent | glsl: Fix image gather logic (diff) | |
download | yuzu-421847cf1e33d5b95c9aa272bf3cf69afda3d964.tar yuzu-421847cf1e33d5b95c9aa272bf3cf69afda3d964.tar.gz yuzu-421847cf1e33d5b95c9aa272bf3cf69afda3d964.tar.bz2 yuzu-421847cf1e33d5b95c9aa272bf3cf69afda3d964.tar.lz yuzu-421847cf1e33d5b95c9aa272bf3cf69afda3d964.tar.xz yuzu-421847cf1e33d5b95c9aa272bf3cf69afda3d964.tar.zst yuzu-421847cf1e33d5b95c9aa272bf3cf69afda3d964.zip |
Diffstat (limited to 'src/shader_recompiler/backend/glsl/emit_context.cpp')
-rw-r--r-- | src/shader_recompiler/backend/glsl/emit_context.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/shader_recompiler/backend/glsl/emit_context.cpp b/src/shader_recompiler/backend/glsl/emit_context.cpp index 76cf0bdf0..50a7a7447 100644 --- a/src/shader_recompiler/backend/glsl/emit_context.cpp +++ b/src/shader_recompiler/backend/glsl/emit_context.cpp @@ -197,7 +197,7 @@ void SetupOutPerVertex(EmitContext& ctx, std::string& header) { if (ctx.info.stores_clip_distance) { header += "float gl_ClipDistance[];"; } - if (ctx.info.stores_viewport_index && ctx.profile.support_gl_vertex_viewport_layer && + if (ctx.info.stores_viewport_index && ctx.profile.support_viewport_index_layer_non_geometry && ctx.stage != Stage::Geometry) { header += "int gl_ViewportIndex;"; } @@ -314,7 +314,7 @@ void EmitContext::SetupExtensions(std::string&) { header += "#extension GL_ARB_gpu_shader_int64 : enable\n"; } } - if (info.stores_viewport_index && profile.support_gl_vertex_viewport_layer && + if (info.stores_viewport_index && profile.support_viewport_index_layer_non_geometry && stage != Stage::Geometry) { header += "#extension GL_ARB_shader_viewport_layer_array : enable\n"; } @@ -497,12 +497,13 @@ std::string EmitContext::DefineGlobalMemoryFunctions() { void EmitContext::SetupImages(Bindings& bindings) { image_buffer_bindings.reserve(info.image_buffer_descriptors.size()); for (const auto& desc : info.image_buffer_descriptors) { + image_buffer_bindings.push_back(bindings.image); const auto indices{bindings.image + desc.count}; + const auto format{ImageFormatString(desc.format)}; for (u32 index = bindings.image; index < indices; ++index) { - header += fmt::format("layout(binding={}) uniform uimageBuffer img{};", bindings.image, - index); + header += fmt::format("layout(binding={}{}) uniform uimageBuffer img{};", + bindings.image, format, index); } - image_buffer_bindings.push_back(bindings.image); bindings.image += desc.count; } image_bindings.reserve(info.image_descriptors.size()); |