Fix GPU lgihtmaps baking error
This commit is contained in:
@@ -398,18 +398,18 @@ void ShadowsOfMordor::Builder::onJobRender(GPUContext* context)
|
|||||||
context->BindUA(0, _irradianceReduction->View());
|
context->BindUA(0, _irradianceReduction->View());
|
||||||
context->BindSR(0, radianceMap);
|
context->BindSR(0, radianceMap);
|
||||||
context->Dispatch(_shader->GetShader()->GetCS("CS_Integrate"), 1, HEMISPHERES_RESOLUTION, 1);
|
context->Dispatch(_shader->GetShader()->GetCS("CS_Integrate"), 1, HEMISPHERES_RESOLUTION, 1);
|
||||||
|
context->ResetUA();
|
||||||
|
context->ResetSR();
|
||||||
|
|
||||||
// Downscale H-basis to 1x1 and copy results to lightmap data buffer
|
// Downscale H-basis to 1x1 and copy results to lightmap data buffer
|
||||||
context->BindUA(0, lightmapEntry.LightmapData->View());
|
context->BindUA(0, lightmapEntry.LightmapData->View());
|
||||||
context->FlushState();
|
|
||||||
context->BindSR(0, _irradianceReduction->View());
|
context->BindSR(0, _irradianceReduction->View());
|
||||||
// TODO: cache shader handle
|
// TODO: cache shader handle
|
||||||
context->Dispatch(_shader->GetShader()->GetCS("CS_Reduction"), 1, NUM_SH_TARGETS, 1);
|
context->Dispatch(_shader->GetShader()->GetCS("CS_Reduction"), 1, NUM_SH_TARGETS, 1);
|
||||||
|
|
||||||
// Unbind slots now to make rendering backend live easier
|
// Unbind slots now to make rendering backend live easier
|
||||||
context->UnBindSR(0);
|
context->ResetSR();
|
||||||
context->UnBindUA(0);
|
context->ResetUA();
|
||||||
context->FlushState();
|
|
||||||
|
|
||||||
// Keep GPU busy
|
// Keep GPU busy
|
||||||
if (hemispheresToRenderBeforeSyncLeft-- < 0)
|
if (hemispheresToRenderBeforeSyncLeft-- < 0)
|
||||||
@@ -473,9 +473,8 @@ void ShadowsOfMordor::Builder::onJobRender(GPUContext* context)
|
|||||||
blurPasses = 0; // TODO: fix CS_Dilate passes on D3D12 (probably UAV synchronization issue)
|
blurPasses = 0; // TODO: fix CS_Dilate passes on D3D12 (probably UAV synchronization issue)
|
||||||
for (int32 blurPassIndex = 0; blurPassIndex < blurPasses; blurPassIndex++)
|
for (int32 blurPassIndex = 0; blurPassIndex < blurPasses; blurPassIndex++)
|
||||||
{
|
{
|
||||||
context->UnBindSR(0);
|
context->ResetSR();
|
||||||
context->UnBindUA(0);
|
context->ResetUA();
|
||||||
context->FlushState();
|
|
||||||
|
|
||||||
context->BindSR(0, lightmapEntry.LightmapData->View());
|
context->BindSR(0, lightmapEntry.LightmapData->View());
|
||||||
context->BindUA(0, scene->TempLightmapData->View());
|
context->BindUA(0, scene->TempLightmapData->View());
|
||||||
|
|||||||
Reference in New Issue
Block a user