ryujinx/Ryujinx.Graphics.Shader/Translation
riperiperi 79adba4402
Add support for render scale to vertex stage. (#2763)
* Add support for render scale to vertex stage.

Occasionally games read off textureSize on the vertex stage to inform the fragment shader what size a texture is without querying in there. Scales were not present in the vertex shader to correct the sizes, so games were providing the raw upscaled texture size to the fragment shader, which was incorrect.

One downside is that the fragment and vertex support buffer description must be identical, so the full size scales array must be defined when used. I don't think this will have an impact though. Another is that the fragment texture count must be updated when vertex shader textures are used. I'd like to correct this so that the update is folded into the update for the scales.

Also cleans up a bunch of things, like it making no sense to call CommitRenderScale for each stage.

Fixes render scale causing a weird offset bloom in Super Mario Party and Clubhouse Games. Clubhouse Games still has a pixelated look in a number of its games due to something else it does in the shader.

* Split out support buffer update, lazy updates.

* Commit support buffer before compute dispatch

* Remove unnecessary qualifier.

* Address Feedback
2022-01-08 14:48:48 -03:00
..
Optimizations Fix bindless/global memory elimination with inverted predicates (#2826) 2021-11-08 12:57:28 -03:00
AttributeConsts.cs Support shader gl_Color, gl_SecondaryColor and gl_TexCoord built-ins (#2817) 2021-11-08 13:18:46 -03:00
ControlFlowGraph.cs Rewrite shader decoding stage (#2698) 2021-10-12 22:35:31 +02:00
Dominance.cs Rewrite shader decoding stage (#2698) 2021-10-12 22:35:31 +02:00
EmitterContext.cs Add support for fragment shader interlock (#2768) 2021-10-28 19:53:12 -03:00
EmitterContextInsts.cs Implement remaining shader double-precision instructions (#2845) 2021-12-08 17:54:12 -03:00
FeatureFlags.cs Support shader gl_Color, gl_SecondaryColor and gl_TexCoord built-ins (#2817) 2021-11-08 13:18:46 -03:00
FunctionMatch.cs Add support for fragment shader interlock (#2768) 2021-10-28 19:53:12 -03:00
GlobalMemory.cs Fix shader 8-bit and 16-bit STS/STG (#2741) 2021-10-18 20:24:15 -03:00
RegisterUsage.cs Use multiple dest operands for shader call instructions (#1975) 2021-02-01 11:13:38 +11:00
Rewriter.cs Fix shader integer from/to double conversion (#2831) 2021-11-14 21:37:07 -03:00
ShaderConfig.cs Add support for render scale to vertex stage. (#2763) 2022-01-08 14:48:48 -03:00
ShaderHeader.cs Rewrite shader decoding stage (#2698) 2021-10-12 22:35:31 +02:00
Ssa.cs Use multiple dest operands for shader call instructions (#1975) 2021-02-01 11:13:38 +11:00
TargetApi.cs Allow shader language and target API to be specified on the shader translator (#2402) 2021-07-06 21:20:06 +02:00
TargetLanguage.cs shadertools: Prepare for new target Languages and APIs (#2465) 2021-07-18 12:49:39 +02:00
TranslationCounts.cs Replace BGRA and scale uniforms with a uniform block (#2496) 2021-08-11 21:33:43 +02:00
TranslationFlags.cs Fix shader regression on Intel iGPUs by reverting layout changes (#1425) 2020-07-29 08:01:11 +10:00
TranslationOptions.cs Allow shader language and target API to be specified on the shader translator (#2402) 2021-07-06 21:20:06 +02:00
Translator.cs Support shader gl_Color, gl_SecondaryColor and gl_TexCoord built-ins (#2817) 2021-11-08 13:18:46 -03:00
TranslatorContext.cs Support shader gl_Color, gl_SecondaryColor and gl_TexCoord built-ins (#2817) 2021-11-08 13:18:46 -03:00