diff --git a/src/common/rendering/hwrenderer/data/hw_renderstate.h b/src/common/rendering/hwrenderer/data/hw_renderstate.h index 455c101f94..0ec17495be 100644 --- a/src/common/rendering/hwrenderer/data/hw_renderstate.h +++ b/src/common/rendering/hwrenderer/data/hw_renderstate.h @@ -236,9 +236,6 @@ protected: int mSoftLight; int mLightMode = -1; - float mAlphaThreshold; - - int mColorMapSpecial; float mColorMapFlash; @@ -274,7 +271,7 @@ public: mTextureClamp = 0; mTextureModeFlags = 0; mStreamData.uDesaturationFactor = 0.0f; - mAlphaThreshold = 0.5f; + mStreamData.uAlphaThreshold = 0.5f; mModelMatrixEnabled = false; mTextureMatrixEnabled = false; mSplitEnabled = false; @@ -578,8 +575,8 @@ public: void AlphaFunc(int func, float thresh) { - if (func == Alpha_Greater) mAlphaThreshold = thresh; - else mAlphaThreshold = thresh - 0.001f; + if (func == Alpha_Greater) mStreamData.uAlphaThreshold = thresh; + else mStreamData.uAlphaThreshold = thresh - 0.001f; } void SetLightIndex(int index) diff --git a/src/common/rendering/vulkan/vk_renderstate.cpp b/src/common/rendering/vulkan/vk_renderstate.cpp index f21c2d2665..b262acf0e4 100644 --- a/src/common/rendering/vulkan/vk_renderstate.cpp +++ b/src/common/rendering/vulkan/vk_renderstate.cpp @@ -244,7 +244,7 @@ void VkRenderState::ApplyRenderPass(int dt) pipelineKey.ShaderKey.EffectState = mTextureEnabled ? effectState : SHADER_NoTexture; if (r_skipmats && pipelineKey.ShaderKey.EffectState >= 3 && pipelineKey.ShaderKey.EffectState <= 4) pipelineKey.ShaderKey.EffectState = 0; - pipelineKey.ShaderKey.AlphaTest = mAlphaThreshold >= 0.f; + pipelineKey.ShaderKey.AlphaTest = mStreamData.uAlphaThreshold >= 0.f; } int uTextureMode = GetTextureModeAndFlags((mMaterial.mMaterial && mMaterial.mMaterial->Source()->isHardwareCanvas()) ? TM_OPAQUE : TM_NORMAL); @@ -395,8 +395,6 @@ void VkRenderState::ApplyStreamData() else mStreamData.timer = 0.0f; - mStreamData.uAlphaThreshold = mAlphaThreshold; - if (mMaterial.mMaterial) { auto source = mMaterial.mMaterial->Source();