Fix render pass resource checking
This commit is contained in:
@@ -249,7 +249,7 @@ bool SortDecal(Decal* const& a, Decal* const& b)
|
||||
void GBufferPass::RenderDebug(RenderContext& renderContext)
|
||||
{
|
||||
// Check if has resources loaded
|
||||
if (setupResources())
|
||||
if (checkIfSkipPass())
|
||||
return;
|
||||
|
||||
// Cache data
|
||||
|
||||
@@ -170,7 +170,8 @@ bool GlobalSignDistanceFieldPass::setupResources()
|
||||
_csGenerateMip1 = shader->GetCS("CS_GenerateMip", 1);
|
||||
|
||||
// Init buffer
|
||||
_modelsBuffer = New<DynamicStructuredBuffer>(64u * (uint32)sizeof(ModelRasterizeData), (uint32)sizeof(ModelRasterizeData), false, TEXT("GlobalSDF.ModelsBuffer"));
|
||||
if (!_modelsBuffer)
|
||||
_modelsBuffer = New<DynamicStructuredBuffer>(64u * (uint32)sizeof(ModelRasterizeData), (uint32)sizeof(ModelRasterizeData), false, TEXT("GlobalSDF.ModelsBuffer"));
|
||||
|
||||
// Create pipeline state
|
||||
GPUPipelineState::Description psDesc = GPUPipelineState::Description::DefaultFullscreenTriangle;
|
||||
@@ -229,7 +230,7 @@ bool GlobalSignDistanceFieldPass::Get(const RenderBuffers* buffers, BindingData&
|
||||
bool GlobalSignDistanceFieldPass::Render(RenderContext& renderContext, GPUContext* context, BindingData& result)
|
||||
{
|
||||
// Skip if not supported
|
||||
if (setupResources())
|
||||
if (checkIfSkipPass())
|
||||
return true;
|
||||
if (renderContext.List->Scenes.Count() == 0)
|
||||
return true;
|
||||
|
||||
@@ -186,7 +186,7 @@ void GlobalSurfaceAtlasPass::Dispose()
|
||||
bool GlobalSurfaceAtlasPass::Render(RenderContext& renderContext, GPUContext* context, BindingData& result)
|
||||
{
|
||||
// Skip if not supported
|
||||
if (setupResources())
|
||||
if (checkIfSkipPass())
|
||||
return true;
|
||||
if (renderContext.List->Scenes.Count() == 0)
|
||||
return true;
|
||||
|
||||
@@ -245,7 +245,7 @@ void MotionBlurPass::RenderDebug(RenderContext& renderContext, GPUTextureView* f
|
||||
{
|
||||
auto context = GPUDevice::Instance->GetMainContext();
|
||||
const auto motionVectors = renderContext.Buffers->MotionVectors;
|
||||
if (!motionVectors->IsAllocated() || setupResources())
|
||||
if (!motionVectors->IsAllocated() || checkIfSkipPass())
|
||||
{
|
||||
context->Draw(frame);
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user