From f42c682d349b6276c217d88c912009265df73b67 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Mon, 8 May 2023 22:01:14 +0200 Subject: [PATCH] Revert "Merge pull request #16628 from hrydgard/remove-fog-fshader-flag" This reverts commit 10dee90c8311cbf0cd728e34011464aa3787f6d6, reversing changes made to 34c11c8acfa59cb19f5665f6304779f793c43b46. --- GPU/Common/FragmentShaderGenerator.cpp | 21 ++++++++++----- GPU/Common/ShaderCommon.h | 2 +- GPU/Common/ShaderId.cpp | 2 ++ GPU/Common/ShaderId.h | 2 +- GPU/Common/ShaderUniforms.cpp | 35 ++++++++++--------------- GPU/Common/ShaderUniforms.h | 2 +- GPU/Common/SoftwareTransformCommon.cpp | 6 ++--- GPU/Common/VertexShaderGenerator.cpp | 16 +++--------- GPU/Directx9/ShaderManagerDX9.cpp | 36 +++++++++++--------------- GPU/GLES/ShaderManagerGLES.cpp | 35 +++++++++++-------------- GPU/GPUCommonHW.cpp | 10 +++---- GPU/Vulkan/ShaderManagerVulkan.cpp | 2 +- 12 files changed, 77 insertions(+), 92 deletions(-) diff --git a/GPU/Common/FragmentShaderGenerator.cpp b/GPU/Common/FragmentShaderGenerator.cpp index 4cd163feab..d2b5315d82 100644 --- a/GPU/Common/FragmentShaderGenerator.cpp +++ b/GPU/Common/FragmentShaderGenerator.cpp @@ -97,6 +97,7 @@ bool GenerateFragmentShader(const FShaderID &id, char *buffer, const ShaderLangu p.ApplySamplerMetadata(arrayTexture ? samplersStereo : samplersMono); bool doTexture = id.Bit(FS_BIT_DO_TEXTURE); + bool enableFog = id.Bit(FS_BIT_ENABLE_FOG); bool enableAlphaTest = id.Bit(FS_BIT_ALPHA_TEST); bool alphaTestAgainstZero = id.Bit(FS_BIT_ALPHA_AGAINST_ZERO); @@ -259,7 +260,9 @@ bool GenerateFragmentShader(const FShaderID &id, char *buffer, const ShaderLangu WRITE(p, "float u_texNoAlpha : register(c%i);\n", CONST_PS_TEX_NO_ALPHA); WRITE(p, "float u_texMul : register(c%i);\n", CONST_PS_TEX_MUL); } - WRITE(p, "float3 u_fogcolor : register(c%i);\n", CONST_PS_FOGCOLOR); + if (enableFog) { + WRITE(p, "float3 u_fogcolor : register(c%i);\n", CONST_PS_FOGCOLOR); + } if (texture3D) { WRITE(p, "float u_mipBias : register(c%i);\n", CONST_PS_MIPBIAS); } @@ -423,8 +426,10 @@ bool GenerateFragmentShader(const FShaderID &id, char *buffer, const ShaderLangu WRITE(p, "%s %s lowp vec4 v_color0;\n", shading, compat.varying_fs); WRITE(p, "%s %s lowp vec3 v_color1;\n", shading, compat.varying_fs); - *uniformMask |= DIRTY_FOGCOLOR; - WRITE(p, "uniform vec3 u_fogcolor;\n"); + if (enableFog) { + *uniformMask |= DIRTY_FOGCOLOR; + WRITE(p, "uniform vec3 u_fogcolor;\n"); + } WRITE(p, "%s %s float v_fogdepth;\n", compat.varying_fs, highpFog ? "highp" : "mediump"); if (doTexture) { WRITE(p, "%s %s vec3 v_texcoord;\n", compat.varying_fs, highpTexcoord ? "highp" : "mediump"); @@ -531,7 +536,9 @@ bool GenerateFragmentShader(const FShaderID &id, char *buffer, const ShaderLangu if (compat.shaderLanguage == HLSL_D3D11 || compat.shaderLanguage == HLSL_D3D9) { WRITE(p, " vec4 v_color0 = In.v_color0;\n"); WRITE(p, " vec3 v_color1 = In.v_color1;\n"); - WRITE(p, " float v_fogdepth = In.v_fogdepth;\n"); + if (enableFog) { + WRITE(p, " float v_fogdepth = In.v_fogdepth;\n"); + } if (doTexture) { WRITE(p, " vec3 v_texcoord = In.v_texcoord;\n"); } @@ -857,8 +864,10 @@ bool GenerateFragmentShader(const FShaderID &id, char *buffer, const ShaderLangu WRITE(p, " vec4 v = v_color0 + s;\n"); } - WRITE(p, " float fogCoef = clamp(v_fogdepth, 0.0, 1.0);\n"); - WRITE(p, " v = mix(vec4(u_fogcolor, v.a), v, fogCoef);\n"); + if (enableFog) { + WRITE(p, " float fogCoef = clamp(v_fogdepth, 0.0, 1.0);\n"); + WRITE(p, " v = mix(vec4(u_fogcolor, v.a), v, fogCoef);\n"); + } // Texture access is at half texels [0.5/256, 255.5/256], but colors are normalized [0, 255]. // So we have to scale to account for the difference. diff --git a/GPU/Common/ShaderCommon.h b/GPU/Common/ShaderCommon.h index 380a9e240a..5130242240 100644 --- a/GPU/Common/ShaderCommon.h +++ b/GPU/Common/ShaderCommon.h @@ -47,7 +47,7 @@ enum : uint64_t { DIRTY_PROJMATRIX = 1ULL << 0, DIRTY_PROJTHROUGHMATRIX = 1ULL << 1, DIRTY_FOGCOLOR = 1ULL << 2, - DIRTY_FOGCOEFENABLE = 1ULL << 3, + DIRTY_FOGCOEF = 1ULL << 3, DIRTY_TEXENV = 1ULL << 4, DIRTY_ALPHACOLORREF = 1ULL << 5, diff --git a/GPU/Common/ShaderId.cpp b/GPU/Common/ShaderId.cpp index cc9875a6ef..75c9d72c88 100644 --- a/GPU/Common/ShaderId.cpp +++ b/GPU/Common/ShaderId.cpp @@ -189,6 +189,7 @@ std::string FragmentShaderDesc(const FShaderID &id) { if (id.Bit(FS_BIT_CLEARMODE)) desc << "Clear "; if (id.Bit(FS_BIT_DO_TEXTURE)) desc << (id.Bit(FS_BIT_3D_TEXTURE) ? "Tex3D " : "Tex "); if (id.Bit(FS_BIT_DO_TEXTURE_PROJ)) desc << "TexProj "; + if (id.Bit(FS_BIT_ENABLE_FOG)) desc << "Fog "; if (id.Bit(FS_BIT_FLATSHADE)) desc << "Flat "; if (id.Bit(FS_BIT_BGRA_TEXTURE)) desc << "BGRA "; switch ((ShaderDepalMode)id.Bits(FS_BIT_SHADER_DEPAL_MODE, 2)) { @@ -325,6 +326,7 @@ void ComputeFragmentShaderID(FShaderID *id_out, const ComputedPipelineState &pip id.SetBit(FS_BIT_TEST_DISCARD_TO_ZERO, !NeedsTestDiscard()); } + id.SetBit(FS_BIT_ENABLE_FOG, enableFog); id.SetBit(FS_BIT_DO_TEXTURE_PROJ, doTextureProjection); // 2 bits diff --git a/GPU/Common/ShaderId.h b/GPU/Common/ShaderId.h index 406d12931c..45bd12dc6e 100644 --- a/GPU/Common/ShaderId.h +++ b/GPU/Common/ShaderId.h @@ -80,7 +80,7 @@ enum FShaderBit : uint8_t { FS_BIT_COLOR_TEST = 17, FS_BIT_COLOR_TEST_FUNC = 18, // 2 bits FS_BIT_COLOR_AGAINST_ZERO = 20, - // 1 free bit + FS_BIT_ENABLE_FOG = 21, FS_BIT_DO_TEXTURE_PROJ = 22, // 1 free bit FS_BIT_STENCIL_TO_ALPHA = 24, // 2 bits diff --git a/GPU/Common/ShaderUniforms.cpp b/GPU/Common/ShaderUniforms.cpp index 173574fadd..ee952d1f97 100644 --- a/GPU/Common/ShaderUniforms.cpp +++ b/GPU/Common/ShaderUniforms.cpp @@ -174,28 +174,21 @@ void BaseUpdateUniforms(UB_VS_FS_Base *ub, uint64_t dirtyUniforms, bool flipView ConvertMatrix4x3To3x4Transposed(ub->tex, gstate.tgenMatrix); } - if (dirtyUniforms & DIRTY_FOGCOEFENABLE) { - if (gstate.isFogEnabled() && !gstate.isModeThrough()) { - float fogcoef[2] = { - getFloat24(gstate.fog1), - getFloat24(gstate.fog2), - }; - // The PSP just ignores infnan here (ignoring IEEE), so take it down to a valid float. - // Workaround for https://github.com/hrydgard/ppsspp/issues/5384#issuecomment-38365988 - if (my_isnanorinf(fogcoef[0])) { - // Not really sure what a sensible value might be, but let's try 64k. - fogcoef[0] = std::signbit(fogcoef[0]) ? -65535.0f : 65535.0f; - } - if (my_isnanorinf(fogcoef[1])) { - fogcoef[1] = std::signbit(fogcoef[1]) ? -65535.0f : 65535.0f; - } - CopyFloat2(ub->fogCoef, fogcoef); - } else { - // not very useful values, use as marker for disabled fog. - // could also burn one extra uniform. - ub->fogCoef[0] = -65536.0f; - ub->fogCoef[1] = -65536.0f; + if (dirtyUniforms & DIRTY_FOGCOEF) { + float fogcoef[2] = { + getFloat24(gstate.fog1), + getFloat24(gstate.fog2), + }; + // The PSP just ignores infnan here (ignoring IEEE), so take it down to a valid float. + // Workaround for https://github.com/hrydgard/ppsspp/issues/5384#issuecomment-38365988 + if (my_isnanorinf(fogcoef[0])) { + // Not really sure what a sensible value might be, but let's try 64k. + fogcoef[0] = std::signbit(fogcoef[0]) ? -65535.0f : 65535.0f; } + if (my_isnanorinf(fogcoef[1])) { + fogcoef[1] = std::signbit(fogcoef[1]) ? -65535.0f : 65535.0f; + } + CopyFloat2(ub->fogCoef, fogcoef); } if (dirtyUniforms & DIRTY_TEX_ALPHA_MUL) { diff --git a/GPU/Common/ShaderUniforms.h b/GPU/Common/ShaderUniforms.h index fe04ad0ced..cd9120d8ef 100644 --- a/GPU/Common/ShaderUniforms.h +++ b/GPU/Common/ShaderUniforms.h @@ -9,7 +9,7 @@ enum : uint64_t { DIRTY_BASE_UNIFORMS = DIRTY_WORLDMATRIX | DIRTY_PROJTHROUGHMATRIX | DIRTY_VIEWMATRIX | DIRTY_TEXMATRIX | DIRTY_ALPHACOLORREF | - DIRTY_PROJMATRIX | DIRTY_FOGCOLOR | DIRTY_FOGCOEFENABLE | DIRTY_TEXENV | DIRTY_TEX_ALPHA_MUL | DIRTY_STENCILREPLACEVALUE | + DIRTY_PROJMATRIX | DIRTY_FOGCOLOR | DIRTY_FOGCOEF | DIRTY_TEXENV | DIRTY_TEX_ALPHA_MUL | DIRTY_STENCILREPLACEVALUE | DIRTY_ALPHACOLORMASK | DIRTY_SHADERBLEND | DIRTY_COLORWRITEMASK | DIRTY_UVSCALEOFFSET | DIRTY_TEXCLAMP | DIRTY_DEPTHRANGE | DIRTY_MATAMBIENTALPHA | DIRTY_BEZIERSPLINE | DIRTY_DEPAL, DIRTY_LIGHT_UNIFORMS = diff --git a/GPU/Common/SoftwareTransformCommon.cpp b/GPU/Common/SoftwareTransformCommon.cpp index 9aff2c301e..b918a0d458 100644 --- a/GPU/Common/SoftwareTransformCommon.cpp +++ b/GPU/Common/SoftwareTransformCommon.cpp @@ -241,11 +241,9 @@ void SoftwareTransform::Decode(int prim, u32 vertType, const DecVtxFormat &decVt // Ignore color1 and fog, never used in throughmode anyway. // The w of uv is also never used (hardcoded to 1.0.) - vert.fog = 1.0; } } else { const Vec4f materialAmbientRGBA = Vec4f::FromRGBA(gstate.getMaterialAmbientRGBA()); - bool fogEnabled = gstate.isFogEnabled(); // Okay, need to actually perform the full transform. for (int index = 0; index < maxIndex; index++) { reader.Goto(index); @@ -254,6 +252,7 @@ void SoftwareTransform::Decode(int prim, u32 vertType, const DecVtxFormat &decVt Vec4f c0 = Vec4f(1, 1, 1, 1); Vec4f c1 = Vec4f(0, 0, 0, 0); float uv[3] = {0, 0, 1}; + float fogCoef = 1.0f; float out[3]; float pos[3]; @@ -415,10 +414,11 @@ void SoftwareTransform::Decode(int prim, u32 vertType, const DecVtxFormat &decVt // Transform the coord by the view matrix. Vec3ByMatrix43(v, out, gstate.viewMatrix); + fogCoef = (v[2] + fog_end) * fog_slope; // TODO: Write to a flexible buffer, we don't always need all four components. Vec3ByMatrix44(transformed[index].pos, v, projMatrix_.m); - transformed[index].fog = fogEnabled ? (v[2] + fog_end) * fog_slope : 1.0f; + transformed[index].fog = fogCoef; memcpy(&transformed[index].uv, uv, 3 * sizeof(float)); transformed[index].color0_32 = c0.ToRGBA(); transformed[index].color1_32 = c1.ToRGBA(); diff --git a/GPU/Common/VertexShaderGenerator.cpp b/GPU/Common/VertexShaderGenerator.cpp index 4404ec254b..1027a15632 100644 --- a/GPU/Common/VertexShaderGenerator.cpp +++ b/GPU/Common/VertexShaderGenerator.cpp @@ -576,10 +576,8 @@ bool GenerateVertexShader(const VShaderID &id, char *buffer, const ShaderLanguag WRITE(p, "uniform lowp vec4 u_matambientalpha;\n"); // matambient + matalpha *uniformMask |= DIRTY_MATAMBIENTALPHA; } - if (useHWTransform) { - WRITE(p, "uniform highp vec2 u_fogcoef;\n"); - *uniformMask |= DIRTY_FOGCOEFENABLE; - } + WRITE(p, "uniform highp vec2 u_fogcoef;\n"); + *uniformMask |= DIRTY_FOGCOEF; if (!isModeThrough) { WRITE(p, "uniform highp vec4 u_depthRange;\n"); @@ -1292,14 +1290,8 @@ bool GenerateVertexShader(const VShaderID &id, char *buffer, const ShaderLanguag } } - // Compute fogdepth. [branch] works around an apparent d3d9 shader compiler bug. - if (compat.shaderLanguage == HLSL_D3D9) - WRITE(p, " [branch]\n"); - WRITE(p, " if (u_fogcoef.x <= -65535.0 && u_fogcoef.y <= -65535.0) {\n"); - WRITE(p, " %sv_fogdepth = 1.0;\n", compat.vsOutPrefix); - WRITE(p, " } else {\n"); - WRITE(p, " %sv_fogdepth = (viewPos.z + u_fogcoef.x) * u_fogcoef.y;\n", compat.vsOutPrefix); - WRITE(p, " }\n"); + // Compute fogdepth + WRITE(p, " %sv_fogdepth = (viewPos.z + u_fogcoef.x) * u_fogcoef.y;\n", compat.vsOutPrefix); } if (clipClampedDepth) { diff --git a/GPU/Directx9/ShaderManagerDX9.cpp b/GPU/Directx9/ShaderManagerDX9.cpp index 809e6e89dd..845984e342 100644 --- a/GPU/Directx9/ShaderManagerDX9.cpp +++ b/GPU/Directx9/ShaderManagerDX9.cpp @@ -338,7 +338,7 @@ void ShaderManagerDX9::PSUpdateUniforms(u64 dirtyUniforms) { } const uint64_t vsUniforms = DIRTY_PROJMATRIX | DIRTY_PROJTHROUGHMATRIX | DIRTY_WORLDMATRIX | DIRTY_VIEWMATRIX | DIRTY_TEXMATRIX | -DIRTY_FOGCOEFENABLE | DIRTY_BONE_UNIFORMS | DIRTY_UVSCALEOFFSET | DIRTY_DEPTHRANGE | DIRTY_CULLRANGE | +DIRTY_FOGCOEF | DIRTY_BONE_UNIFORMS | DIRTY_UVSCALEOFFSET | DIRTY_DEPTHRANGE | DIRTY_CULLRANGE | DIRTY_AMBIENT | DIRTY_MATAMBIENTALPHA | DIRTY_MATSPECULAR | DIRTY_MATDIFFUSE | DIRTY_MATEMISSIVE | DIRTY_LIGHT0 | DIRTY_LIGHT1 | DIRTY_LIGHT2 | DIRTY_LIGHT3; void ShaderManagerDX9::VSUpdateUniforms(u64 dirtyUniforms) { @@ -385,27 +385,21 @@ void ShaderManagerDX9::VSUpdateUniforms(u64 dirtyUniforms) { if (dirtyUniforms & DIRTY_TEXMATRIX) { VSSetMatrix4x3_3(CONST_VS_TEXMTX, gstate.tgenMatrix); } - if (dirtyUniforms & DIRTY_FOGCOEFENABLE) { - if (gstate.isFogEnabled() && !gstate.isModeThrough()) { - float fogcoef[2] = { - getFloat24(gstate.fog1), - getFloat24(gstate.fog2), - }; - // The PSP just ignores infnan here (ignoring IEEE), so take it down to a valid float. - // Workaround for https://github.com/hrydgard/ppsspp/issues/5384#issuecomment-38365988 - if (my_isnanorinf(fogcoef[0])) { - // Not really sure what a sensible value might be, but let's try 64k. - fogcoef[0] = std::signbit(fogcoef[0]) ? -65535.0f : 65535.0f; - } - if (my_isnanorinf(fogcoef[1])) { - fogcoef[1] = std::signbit(fogcoef[1]) ? -65535.0f : 65535.0f; - } - VSSetFloatArray(CONST_VS_FOGCOEF, fogcoef, 2); - } else { - // not very useful values, use as marker for disabled fog. - float fogcoef[2] = { -65536.0f, -65536.0f }; - VSSetFloatArray(CONST_VS_FOGCOEF, fogcoef, 2); + if (dirtyUniforms & DIRTY_FOGCOEF) { + float fogcoef[2] = { + getFloat24(gstate.fog1), + getFloat24(gstate.fog2), + }; + // The PSP just ignores infnan here (ignoring IEEE), so take it down to a valid float. + // Workaround for https://github.com/hrydgard/ppsspp/issues/5384#issuecomment-38365988 + if (my_isnanorinf(fogcoef[0])) { + // Not really sure what a sensible value might be, but let's try 64k. + fogcoef[0] = std::signbit(fogcoef[0]) ? -65535.0f : 65535.0f; } + if (my_isnanorinf(fogcoef[1])) { + fogcoef[1] = std::signbit(fogcoef[1]) ? -65535.0f : 65535.0f; + } + VSSetFloatArray(CONST_VS_FOGCOEF, fogcoef, 2); } // TODO: Could even set all bones in one go if they're all dirty. #ifdef USE_BONE_ARRAY diff --git a/GPU/GLES/ShaderManagerGLES.cpp b/GPU/GLES/ShaderManagerGLES.cpp index 0e88bc1220..ee4b99ff8a 100644 --- a/GPU/GLES/ShaderManagerGLES.cpp +++ b/GPU/GLES/ShaderManagerGLES.cpp @@ -488,26 +488,21 @@ void LinkedShader::UpdateUniforms(const ShaderID &vsid, bool useBufferedRenderin SetVRCompat(VR_COMPAT_FOG_COLOR, gstate.fogcolor); } } - if (dirty & DIRTY_FOGCOEFENABLE) { - if (gstate.isFogEnabled() && !gstate.isModeThrough()) { - float fogcoef[2] = { - getFloat24(gstate.fog1), - getFloat24(gstate.fog2), - }; - // The PSP just ignores infnan here (ignoring IEEE), so take it down to a valid float. - // Workaround for https://github.com/hrydgard/ppsspp/issues/5384#issuecomment-38365988 - if (my_isnanorinf(fogcoef[0])) { - // Not really sure what a sensible value might be, but let's try 64k. - fogcoef[0] = std::signbit(fogcoef[0]) ? -65535.0f : 65535.0f; - } - if (my_isnanorinf(fogcoef[1])) { - fogcoef[1] = std::signbit(fogcoef[1]) ? -65535.0f : 65535.0f; - } - render_->SetUniformF(&u_fogcoef, 2, fogcoef); - } else { - float fogcoef[2] = { -65536.0f, -65536.0f }; - render_->SetUniformF(&u_fogcoef, 2, fogcoef); + if (dirty & DIRTY_FOGCOEF) { + float fogcoef[2] = { + getFloat24(gstate.fog1), + getFloat24(gstate.fog2), + }; + // The PSP just ignores infnan here (ignoring IEEE), so take it down to a valid float. + // Workaround for https://github.com/hrydgard/ppsspp/issues/5384#issuecomment-38365988 + if (my_isnanorinf(fogcoef[0])) { + // Not really sure what a sensible value might be, but let's try 64k. + fogcoef[0] = std::signbit(fogcoef[0]) ? -65535.0f : 65535.0f; } + if (my_isnanorinf(fogcoef[1])) { + fogcoef[1] = std::signbit(fogcoef[1]) ? -65535.0f : 65535.0f; + } + render_->SetUniformF(&u_fogcoef, 2, fogcoef); } if (dirty & DIRTY_UVSCALEOFFSET) { const float invW = 1.0f / (float)gstate_c.curTextureWidth; @@ -970,7 +965,7 @@ enum class CacheDetectFlags { }; #define CACHE_HEADER_MAGIC 0x83277592 -#define CACHE_VERSION 28 +#define CACHE_VERSION 29 struct CacheHeader { uint32_t magic; diff --git a/GPU/GPUCommonHW.cpp b/GPU/GPUCommonHW.cpp index 667867bc44..02f4065d29 100644 --- a/GPU/GPUCommonHW.cpp +++ b/GPU/GPUCommonHW.cpp @@ -70,13 +70,13 @@ const CommonCommandTableEntry commonCommandTable[] = { { GE_CMD_ZBUFWIDTH, FLAG_FLUSHBEFOREONCHANGE }, { GE_CMD_FOGCOLOR, FLAG_FLUSHBEFOREONCHANGE, DIRTY_FOGCOLOR }, - { GE_CMD_FOG1, FLAG_FLUSHBEFOREONCHANGE, DIRTY_FOGCOEFENABLE }, - { GE_CMD_FOG2, FLAG_FLUSHBEFOREONCHANGE, DIRTY_FOGCOEFENABLE }, + { GE_CMD_FOG1, FLAG_FLUSHBEFOREONCHANGE, DIRTY_FOGCOEF }, + { GE_CMD_FOG2, FLAG_FLUSHBEFOREONCHANGE, DIRTY_FOGCOEF }, // These affect the fragment shader so need flushing. { GE_CMD_CLEARMODE, FLAG_FLUSHBEFOREONCHANGE, DIRTY_BLEND_STATE | DIRTY_DEPTHSTENCIL_STATE | DIRTY_RASTER_STATE | DIRTY_VIEWPORTSCISSOR_STATE | DIRTY_CULLRANGE | DIRTY_VERTEXSHADER_STATE | DIRTY_FRAGMENTSHADER_STATE | DIRTY_GEOMETRYSHADER_STATE }, { GE_CMD_TEXTUREMAPENABLE, FLAG_FLUSHBEFOREONCHANGE, DIRTY_VERTEXSHADER_STATE | DIRTY_FRAGMENTSHADER_STATE | DIRTY_GEOMETRYSHADER_STATE }, - { GE_CMD_FOGENABLE, FLAG_FLUSHBEFOREONCHANGE, DIRTY_FOGCOEFENABLE }, + { GE_CMD_FOGENABLE, FLAG_FLUSHBEFOREONCHANGE, DIRTY_FRAGMENTSHADER_STATE }, { GE_CMD_TEXMODE, FLAG_FLUSHBEFOREONCHANGE, DIRTY_TEXTURE_PARAMS | DIRTY_FRAGMENTSHADER_STATE }, { GE_CMD_TEXSHADELS, FLAG_FLUSHBEFOREONCHANGE, DIRTY_VERTEXSHADER_STATE }, // Raster state for Direct3D 9, uncommon. @@ -828,7 +828,7 @@ void GPUCommonHW::Execute_VertexType(u32 op, u32 diff) { gstate_c.Dirty(DIRTY_UVSCALEOFFSET); // Switching between through and non-through, we need to invalidate a bunch of stuff. if (diff & GE_VTYPE_THROUGH_MASK) - gstate_c.Dirty(DIRTY_RASTER_STATE | DIRTY_VIEWPORTSCISSOR_STATE | DIRTY_FRAGMENTSHADER_STATE | DIRTY_GEOMETRYSHADER_STATE | DIRTY_CULLRANGE | DIRTY_FOGCOEFENABLE); + gstate_c.Dirty(DIRTY_RASTER_STATE | DIRTY_VIEWPORTSCISSOR_STATE | DIRTY_FRAGMENTSHADER_STATE | DIRTY_GEOMETRYSHADER_STATE | DIRTY_CULLRANGE); } } @@ -850,7 +850,7 @@ void GPUCommonHW::Execute_VertexTypeSkinning(u32 op, u32 diff) { gstate_c.Dirty(DIRTY_VERTEXSHADER_STATE); } if (diff & GE_VTYPE_THROUGH_MASK) - gstate_c.Dirty(DIRTY_RASTER_STATE | DIRTY_VIEWPORTSCISSOR_STATE | DIRTY_FRAGMENTSHADER_STATE | DIRTY_GEOMETRYSHADER_STATE | DIRTY_CULLRANGE | DIRTY_FOGCOEFENABLE); + gstate_c.Dirty(DIRTY_RASTER_STATE | DIRTY_VIEWPORTSCISSOR_STATE | DIRTY_FRAGMENTSHADER_STATE | DIRTY_GEOMETRYSHADER_STATE | DIRTY_CULLRANGE); } void GPUCommonHW::Execute_Prim(u32 op, u32 diff) { diff --git a/GPU/Vulkan/ShaderManagerVulkan.cpp b/GPU/Vulkan/ShaderManagerVulkan.cpp index 0dc930bd5b..23759f4962 100644 --- a/GPU/Vulkan/ShaderManagerVulkan.cpp +++ b/GPU/Vulkan/ShaderManagerVulkan.cpp @@ -516,7 +516,7 @@ enum class VulkanCacheDetectFlags { }; #define CACHE_HEADER_MAGIC 0xff51f420 -#define CACHE_VERSION 42 +#define CACHE_VERSION 43 struct VulkanCacheHeader { uint32_t magic;