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_glsl_context_get_set.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_glsl_context_get_set.cpp')
-rw-r--r-- | src/shader_recompiler/backend/glsl/emit_glsl_context_get_set.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/shader_recompiler/backend/glsl/emit_glsl_context_get_set.cpp b/src/shader_recompiler/backend/glsl/emit_glsl_context_get_set.cpp index 83ce6fcbb..4d35be152 100644 --- a/src/shader_recompiler/backend/glsl/emit_glsl_context_get_set.cpp +++ b/src/shader_recompiler/backend/glsl/emit_glsl_context_get_set.cpp @@ -269,6 +269,15 @@ void EmitSetAttribute(EmitContext& ctx, IR::Attribute attr, std::string_view val const u32 element{static_cast<u32>(attr) % 4}; const char swizzle{"xyzw"[element]}; switch (attr) { + case IR::Attribute::Layer: + if (ctx.stage != Stage::Geometry && + !ctx.profile.support_viewport_index_layer_non_geometry) { + // LOG_WARNING(..., "Shader stores viewport layer but device does not support viewport + // layer extension"); + break; + } + ctx.Add("gl_Layer=ftoi({});", value); + break; case IR::Attribute::PointSize: ctx.Add("gl_PointSize={};", value); break; @@ -279,7 +288,8 @@ void EmitSetAttribute(EmitContext& ctx, IR::Attribute attr, std::string_view val ctx.Add("gl_Position.{}={};", swizzle, value); break; case IR::Attribute::ViewportIndex: - if (ctx.stage != Stage::Geometry && !ctx.profile.support_gl_vertex_viewport_layer) { + if (ctx.stage != Stage::Geometry && + !ctx.profile.support_viewport_index_layer_non_geometry) { // LOG_WARNING(..., "Shader stores viewport index but device does not support viewport // layer extension"); break; |