diff options
| author | Rodrigo Locatti <reinuseslisp@airmail.cc> | 2019-12-16 01:26:11 -0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-12-16 01:26:11 -0300 |
| commit | eac075692be0df873df04cbe8e09296f64d1dfe1 (patch) | |
| tree | ba39ab7d01d91a606aabd41f84ed11455b283459 /src/video_core/renderer_opengl | |
| parent | 3d511536114c28d19cf700077ca98b77743311e0 (diff) | |
| parent | c0ee0aa1a8266b0f5c5568cf1af3cb6247156720 (diff) | |
Merge pull request #3219 from FernandoS27/fix-bindless
Corrections and fixes to TLD4S & bindless samplers failing
Diffstat (limited to 'src/video_core/renderer_opengl')
| -rw-r--r-- | src/video_core/renderer_opengl/gl_shader_decompiler.cpp | 29 |
1 files changed, 21 insertions, 8 deletions
diff --git a/src/video_core/renderer_opengl/gl_shader_decompiler.cpp b/src/video_core/renderer_opengl/gl_shader_decompiler.cpp index fa7049bbe..d1ae4be6d 100644 --- a/src/video_core/renderer_opengl/gl_shader_decompiler.cpp +++ b/src/video_core/renderer_opengl/gl_shader_decompiler.cpp @@ -1076,7 +1076,7 @@ private: } std::string GenerateTexture(Operation operation, const std::string& function_suffix, - const std::vector<TextureIR>& extras) { + const std::vector<TextureIR>& extras, bool sepparate_dc = false) { constexpr std::array coord_constructors = {"float", "vec2", "vec3", "vec4"}; const auto meta = std::get_if<MetaTexture>(&operation.GetMeta()); @@ -1091,7 +1091,8 @@ private: expr += "Offset"; } expr += '(' + GetSampler(meta->sampler) + ", "; - expr += coord_constructors.at(count + (has_array ? 1 : 0) + (has_shadow ? 1 : 0) - 1); + expr += coord_constructors.at(count + (has_array ? 1 : 0) + + (has_shadow && !sepparate_dc ? 1 : 0) - 1); expr += '('; for (std::size_t i = 0; i < count; ++i) { expr += Visit(operation[i]).AsFloat(); @@ -1104,9 +1105,14 @@ private: expr += ", float(" + Visit(meta->array).AsInt() + ')'; } if (has_shadow) { - expr += ", " + Visit(meta->depth_compare).AsFloat(); + if (sepparate_dc) { + expr += "), " + Visit(meta->depth_compare).AsFloat(); + } else { + expr += ", " + Visit(meta->depth_compare).AsFloat() + ')'; + } + } else { + expr += ')'; } - expr += ')'; for (const auto& variant : extras) { if (const auto argument = std::get_if<TextureArgument>(&variant)) { @@ -1706,10 +1712,17 @@ private: ASSERT(meta); const auto type = meta->sampler.IsShadow() ? Type::Float : Type::Int; - return {GenerateTexture(operation, "Gather", - {TextureAoffi{}, TextureArgument{type, meta->component}}) + - GetSwizzle(meta->element), - Type::Float}; + if (meta->sampler.IsShadow()) { + return {GenerateTexture(operation, "Gather", {TextureAoffi{}}, true) + + GetSwizzle(meta->element), + Type::Float}; + } else { + return {GenerateTexture(operation, "Gather", + {TextureAoffi{}, TextureArgument{type, meta->component}}, + false) + + GetSwizzle(meta->element), + Type::Float}; + } } Expression TextureQueryDimensions(Operation operation) { |
