summaryrefslogtreecommitdiff
path: root/Source/Core/VideoCommon/UberShaderPixel.cpp
diff options
context:
space:
mode:
authorPokechu22 <Pokechu022@gmail.com>2021-04-18 19:51:02 -0700
committerPokechu22 <Pokechu022@gmail.com>2021-05-07 16:37:47 -0700
commite1d45e9ba66d3ba7d6769e36c0fc82ceb5028ecb (patch)
tree4502381e619088293b8c6d047f964269223edfd4 /Source/Core/VideoCommon/UberShaderPixel.cpp
parentb5844ab195a38303e5fb82a7f6804a726fa8fb7a (diff)
UberShaderPixel: always run indirect stage logic
Hardware testing has confirmed that fb_addprev and wrapping both run even when the indirect stage is disabled.
Diffstat (limited to 'Source/Core/VideoCommon/UberShaderPixel.cpp')
-rw-r--r--Source/Core/VideoCommon/UberShaderPixel.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/Source/Core/VideoCommon/UberShaderPixel.cpp b/Source/Core/VideoCommon/UberShaderPixel.cpp
index a029f58812..642896a3dc 100644
--- a/Source/Core/VideoCommon/UberShaderPixel.cpp
+++ b/Source/Core/VideoCommon/UberShaderPixel.cpp
@@ -287,6 +287,8 @@ ShaderCode GenPixelShader(APIType ApiType, const ShaderHostConfig& host_config,
// ======================
const auto LookupIndirectTexture = [&out, stereo](std::string_view out_var_name,
std::string_view in_index_name) {
+ // in_index_name is the indirect stage, not the tev stage
+ // bpmem_iref is packed differently from RAS1_IREF
out.Write("{{\n"
" uint iref = bpmem_iref({});\n"
" if ( iref != 0u)\n"
@@ -304,6 +306,10 @@ ShaderCode GenPixelShader(APIType ApiType, const ShaderHostConfig& host_config,
"[texmap].xy, {})).abg;\n",
in_index_name, in_index_name, in_index_name, in_index_name, out_var_name,
stereo ? "float(layer)" : "0.0");
+ // There is always a bit set in bpmem_iref if the data is valid (matrix is not off, and the
+ // indirect texture stage is enabled). If the matrix is off, the result doesn't matter; if the
+ // indirect texture stage is disabled, the result is undefined (and produces a glitchy pattern
+ // on hardware, different from this).
out.Write(" }}\n"
" else\n"
" {{\n"