diff --git a/src/rendering/vulkan/renderer/vk_renderstate.cpp b/src/rendering/vulkan/renderer/vk_renderstate.cpp index 3392de2b39..7817687439 100644 --- a/src/rendering/vulkan/renderer/vk_renderstate.cpp +++ b/src/rendering/vulkan/renderer/vk_renderstate.cpp @@ -325,7 +325,10 @@ void VkRenderState::ApplyStreamData() mStreamData.uVertexColor = mColor.vec; mStreamData.uVertexNormal = mNormal.vec; - mStreamData.timer = static_cast((double)(screen->FrameTime - firstFrame) * (double)mShaderTimer / 1000.); + if (mMaterial.mMaterial && mMaterial.mMaterial->tex) + mStreamData.timer = static_cast((double)(screen->FrameTime - firstFrame) * (double)mMaterial.mMaterial->tex->shaderspeed / 1000.); + else + mStreamData.timer = 0.0f; if (mGlowEnabled) { @@ -507,9 +510,6 @@ void VkRenderState::ApplyMaterial() mCommandBuffer->bindDescriptorSet(VK_PIPELINE_BIND_POINT_GRAPHICS, passManager->GetPipelineLayout(mRenderPassKey.NumTextureLayers), 1, base->GetDescriptorSet(mMaterial)); } - if (mMaterial.mMaterial && mMaterial.mMaterial->tex) - mShaderTimer = mMaterial.mMaterial->tex->shaderspeed; - mMaterial.mChanged = false; } } diff --git a/src/rendering/vulkan/renderer/vk_renderstate.h b/src/rendering/vulkan/renderer/vk_renderstate.h index 41d3293091..0158454ce7 100644 --- a/src/rendering/vulkan/renderer/vk_renderstate.h +++ b/src/rendering/vulkan/renderer/vk_renderstate.h @@ -87,8 +87,6 @@ protected: int mColorMask = 15; int mCullMode = 0; - float mShaderTimer = 0.0f; - MatricesUBO mMatrices = {}; StreamData mStreamData = {}; PushConstants mPushConstants = {};