move gl_light_shadow_filter from HWViewpointUniforms to VkShaderKey
This commit is contained in:
parent
55144b3330
commit
e75d8d35eb
8 changed files with 24 additions and 18 deletions
|
|
@ -645,7 +645,6 @@ public:
|
|||
matrices.mGlobVis = 1.f;
|
||||
matrices.mPalLightLevels = palLightLevels;
|
||||
matrices.mClipLine.X = -10000000.0f;
|
||||
matrices.mShadowFilter = gl_light_shadow_filter;
|
||||
matrices.mProjectionMatrix.ortho(0, (float)width, (float)height, 0, -1.0f, 1.0f);
|
||||
matrices.CalcDependencies();
|
||||
return SetViewpoint(matrices);
|
||||
|
|
|
|||
|
|
@ -37,7 +37,6 @@ struct HWViewpointUniforms
|
|||
int mViewHeight = 0;
|
||||
float mClipHeight = 0.f;
|
||||
float mClipHeightDirection = 0.f;
|
||||
int mShadowFilter = 1;
|
||||
|
||||
int mLightTilesWidth = 0;
|
||||
|
||||
|
|
|
|||
|
|
@ -256,6 +256,11 @@ std::unique_ptr<VulkanShader> VkShaderManager::LoadFragShader(FString shadername
|
|||
|
||||
if (key.UseRaytrace) definesBlock << "#define USE_RAYTRACE\n";
|
||||
if (key.UseRaytracePrecise) definesBlock << "#define USE_RAYTRACE_PRECISE\n";
|
||||
|
||||
definesBlock << "#define SHADOWMAP_FILTER ";
|
||||
definesBlock << std::to_string(key.ShadowmapFilter).c_str();
|
||||
definesBlock << "\n";
|
||||
|
||||
if (key.UseShadowmap) definesBlock << "#define USE_SHADOWMAP\n";
|
||||
if (key.UseLevelMesh) definesBlock << "#define USE_LEVELMESH\n";
|
||||
|
||||
|
|
|
|||
|
|
@ -101,7 +101,8 @@ public:
|
|||
uint64_t LightBlendMode : 2; // LIGHT_BLEND_CLAMPED , LIGHT_BLEND_COLORED_CLAMP , LIGHT_BLEND_UNCLAMPED
|
||||
uint64_t LightAttenuationMode : 1; // LIGHT_ATTENUATION_LINEAR , LIGHT_ATTENUATION_INVERSE_SQUARE
|
||||
uint64_t UseRaytracePrecise : 1; // USE_RAYTRACE_PRECISE
|
||||
uint64_t Unused : 36;
|
||||
uint64_t ShadowmapFilter : 4; // SHADOWMAP_FILTER
|
||||
uint64_t Unused : 32;
|
||||
};
|
||||
uint64_t AsQWORD = 0;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -305,6 +305,7 @@ void VkRenderState::ApplyRenderPass(int dt)
|
|||
pipelineKey.ShaderKey.UseShadowmap = gl_light_shadows == 1;
|
||||
pipelineKey.ShaderKey.UseRaytrace = gl_light_shadows >= 2;
|
||||
pipelineKey.ShaderKey.UseRaytracePrecise = gl_light_shadows >= 3;
|
||||
pipelineKey.ShaderKey.ShadowmapFilter = std::clamp(int(gl_light_shadow_filter), 0, 15);
|
||||
|
||||
pipelineKey.ShaderKey.GBufferPass = mRenderTarget.DrawBuffers > 1;
|
||||
|
||||
|
|
@ -1069,6 +1070,8 @@ void VkRenderState::ApplyLevelMeshPipeline(VulkanCommandBuffer* cmdbuffer, VkPip
|
|||
pipelineKey.ShaderKey.UseShadowmap = gl_light_shadows == 1;
|
||||
pipelineKey.ShaderKey.UseRaytrace = gl_light_shadows >= 2;
|
||||
pipelineKey.ShaderKey.UseRaytracePrecise = gl_light_shadows >= 3;
|
||||
pipelineKey.ShaderKey.ShadowmapFilter = std::clamp(int(gl_light_shadow_filter), 0, 15);
|
||||
|
||||
pipelineKey.ShaderKey.GBufferPass = mRenderTarget.DrawBuffers > 1;
|
||||
|
||||
// State overridden by the renderstate drawing the mesh
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue