diff options
| author | iwubcode <iwubcode@users.noreply.github.com> | 2023-01-07 12:30:29 -0600 |
|---|---|---|
| committer | iwubcode <iwubcode@users.noreply.github.com> | 2023-08-20 18:53:27 -0500 |
| commit | 931a8aa4139bddbc59a9cf94ca8e15f05000960c (patch) | |
| tree | e43aab9761999f50ac9b50598f5d1a4f9394d6a0 /Source/Core/VideoCommon/PixelShaderGen.cpp | |
| parent | 675544ec2beb6ba8c3d766b3dfe52e6e8cc30c0d (diff) | |
VideoCommon: add milliseconds elapsed time value to pixel shaders as a uniform to be able to support animation effects in custom shaders
Diffstat (limited to 'Source/Core/VideoCommon/PixelShaderGen.cpp')
| -rw-r--r-- | Source/Core/VideoCommon/PixelShaderGen.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/Source/Core/VideoCommon/PixelShaderGen.cpp b/Source/Core/VideoCommon/PixelShaderGen.cpp index 326cd975d9..69fdc36efc 100644 --- a/Source/Core/VideoCommon/PixelShaderGen.cpp +++ b/Source/Core/VideoCommon/PixelShaderGen.cpp @@ -406,6 +406,7 @@ void WritePixelShaderCommonHeader(ShaderCode& out, APIType api_type, "\tbool blend_subtract_alpha;\n" "\tbool logic_op_enable;\n" "\tuint logic_op_mode;\n" + "\tuint time_ms;\n" "}};\n\n"); out.Write("#define bpmem_combiners(i) (bpmem_pack1[(i)].xy)\n" "#define bpmem_tevind(i) (bpmem_pack1[(i)].z)\n" @@ -869,6 +870,9 @@ void WriteCustomShaderStructImpl(ShaderCode* out, u32 num_stages, bool per_pixel // Actual data will be filled out in the tev stage code, just set the // stage count for now out->Write("\tcustom_data.tev_stage_count = {};\n", num_stages); + + // Time + out->Write("\tcustom_data.time_ms = time_ms;\n"); } static void WriteStage(ShaderCode& out, const pixel_shader_uid_data* uid_data, int n, |
