Revert no-color attachment change, instead suppress DX12 & Vulkan validation layer messages

This commit is contained in:
SRSaunders 2024-05-11 18:32:01 -04:00
parent 70a616e6eb
commit 37927c94a3
3 changed files with 6 additions and 9 deletions

View file

@ -88,12 +88,6 @@ nvrhi::GraphicsPipelineHandle PipelineCache::GetOrCreatePipeline( const Pipeline
// Specialize the state with the state key.
GetRenderState( key.state, key, pipelineDesc.renderState );
// SRS - if no color attachments (e.g. atlas), disable fragment shader to avoid validation warnings
if( key.framebuffer->GetApiObject()->getDesc().colorAttachments.size() == 0 )
{
pipelineDesc.PS = nvrhi::ShaderHandle( NULL );
}
auto pipeline = device->createGraphicsPipeline( pipelineDesc, key.framebuffer->GetApiObject() );
pipelineHash.Add( h, pipelines.Append( { key, pipeline } ) );

View file

@ -384,6 +384,7 @@ bool DeviceManager_DX12::CreateDeviceAndSwapChain()
D3D12_MESSAGE_ID_CLEARDEPTHSTENCILVIEW_MISMATCHINGCLEARVALUE,
D3D12_MESSAGE_ID_CLEARRENDERTARGETVIEW_MISMATCHINGCLEARVALUE,
D3D12_MESSAGE_ID_COMMAND_LIST_STATIC_DESCRIPTOR_RESOURCE_DIMENSION_MISMATCH, // descriptor validation doesn't understand acceleration structures
D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_RENDERTARGETVIEW_NOT_SET, // disable warning when there is no color attachment (e.g. shadow atlas)
D3D12_MESSAGE_ID_RESOURCE_BARRIER_BEFORE_AFTER_MISMATCH // barrier validation error caused by cinematics - not sure how to fix, suppress for now
};

View file

@ -1254,11 +1254,13 @@ bool DeviceManager_VK::CreateDeviceAndSwapChain()
#else
enabledExtensions.layers.insert( "VK_LAYER_KHRONOS_validation" );
// SRS - Suppress WARNING-Shader-OutputNotConsumed: by design for vertex shader layouts
// SRS - Suppress specific [ WARNING-Shader-OutputNotConsumed ] false positive validation warnings which are by design:
// 0xc81ad50e: vkCreateGraphicsPipelines(): pCreateInfos[0].pVertexInputState Vertex attribute at location X not consumed by vertex shader.
// 0x9805298c: vkCreateGraphicsPipelines(): pCreateInfos[0] fragment shader writes to output location 0 with no matching attachment.
#ifdef _WIN32
SetEnvironmentVariable( "VK_LAYER_MESSAGE_ID_FILTER", "0xc81ad50e" );
SetEnvironmentVariable( "VK_LAYER_MESSAGE_ID_FILTER", "0xc81ad50e;0x9805298c" );
#else
setenv( "VK_LAYER_MESSAGE_ID_FILTER", "0xc81ad50e", 1 );
setenv( "VK_LAYER_MESSAGE_ID_FILTER", "0xc81ad50e:0x9805298c", 1 );
#endif
}