Fixes
This commit is contained in:
@@ -18,9 +18,8 @@ LODPreviewMaterialShader::LODPreviewMaterialShader()
|
||||
|
||||
const MaterialInfo& LODPreviewMaterialShader::GetInfo() const
|
||||
{
|
||||
if (_material)
|
||||
return _material->GetInfo();
|
||||
return MaterialInfo();
|
||||
ASSERT_LOW_LAYER(_material);
|
||||
return _material->GetInfo();
|
||||
}
|
||||
|
||||
bool LODPreviewMaterialShader::IsReady() const
|
||||
|
||||
@@ -151,7 +151,11 @@ void MaterialComplexityMaterialShader::Draw(RenderContext& renderContext, GPUCon
|
||||
}
|
||||
|
||||
// Draw transparency into Light buffer to include it into complexity drawing
|
||||
context->SetRenderTarget(*renderContext.Buffers->DepthBuffer, lightBuffer);
|
||||
GPUTexture* depthBuffer = renderContext.Buffers->DepthBuffer;
|
||||
GPUTextureView* readOnlyDepthBuffer = depthBuffer->View();
|
||||
if (depthBuffer->GetDescription().Flags & GPUTextureFlags::ReadOnlyDepthView)
|
||||
readOnlyDepthBuffer = depthBuffer->ViewReadOnlyDepth();
|
||||
context->SetRenderTarget(readOnlyDepthBuffer, lightBuffer);
|
||||
auto& distortionList = renderContext.List->DrawCallsLists[(int32)DrawCallsListType::Distortion];
|
||||
if (!distortionList.IsEmpty())
|
||||
{
|
||||
|
||||
@@ -503,9 +503,7 @@ void VolumetricFogPass::Render(RenderContext& renderContext)
|
||||
|
||||
context->Dispatch(_csInitialize, groupCountX, groupCountY, groupCountZ);
|
||||
|
||||
context->UnBindUA(0);
|
||||
context->UnBindUA(1);
|
||||
context->FlushState();
|
||||
context->ResetUA();
|
||||
}
|
||||
|
||||
// Render local fog particles
|
||||
@@ -656,6 +654,9 @@ void VolumetricFogPass::Render(RenderContext& renderContext)
|
||||
|
||||
const int32 csIndex = cache.TemporalReprojection ? 1 : 0;
|
||||
context->Dispatch(_csLightScattering.Get(csIndex), groupCountX, groupCountY, groupCountZ);
|
||||
|
||||
context->ResetSR();
|
||||
context->ResetUA();
|
||||
}
|
||||
|
||||
// Release resources
|
||||
@@ -689,20 +690,18 @@ void VolumetricFogPass::Render(RenderContext& renderContext)
|
||||
{
|
||||
PROFILE_GPU("Final Integration");
|
||||
|
||||
context->ResetSR();
|
||||
context->BindUA(0, integratedLightScattering->ViewVolume());
|
||||
context->FlushState();
|
||||
context->BindSR(0, lightScattering->ViewVolume());
|
||||
|
||||
context->Dispatch(_csFinalIntegration, groupCountX, groupCountY, 1);
|
||||
}
|
||||
|
||||
// Cleanup
|
||||
context->UnBindUA(0);
|
||||
context->ResetUA();
|
||||
context->ResetSR();
|
||||
context->ResetRenderTarget();
|
||||
auto viewport = renderContext.Task->GetViewport();
|
||||
context->SetViewportAndScissors(viewport);
|
||||
context->FlushState();
|
||||
}
|
||||
|
||||
void VolumetricFogPass::InitCircleBuffer()
|
||||
|
||||
Reference in New Issue
Block a user