d3d12: GPU based validation issue on fbo-clear-formats piglit
Running the spec@arb_depth_buffer_float@fbo-clear-formats stencil
piglit test with D3D12_DEBUG=debuglayer,gpuvalidator
reveals the following issue:
[133924] D3D12 ERROR: GPU-BASED VALIDATION: Draw, Incompatible resource state: Resource: 0x000002154E1D9F40:'Unnamed ID3D12Resource Object', Subresource Index: [1], Descriptor heap index to DescriptorTableStart: [0], Descriptor heap index FromTableStart: [0], Binding Type In Descriptor: SRV, Resource State: D3D12_RESOURCE_STATE_COPY_DEST(0x400) (Promoted from COMMON state), Index of Descriptor Range: 0, Shader Stage: PIXEL, Root Parameter Index: [1], Draw Index: [510], Shader Code: <couldn't find file location in debug info>, Asm Instruction Range: [0x1-0xffffffff], Asm Operand Index: [0], Command List: 0x000002154DB00290:'Unnamed ID3D12GraphicsCommandList Object', SRV/UAV/CBV Descriptor Heap: 0x000002154DC1CA80:'Unnamed ID3D12DescriptorHeap Object', Sampler Descriptor Heap: 0x000002154D992BE0:'Unnamed ID3D12DescriptorHeap Object', Pipeline State: 0x000002154EAA0C20:'Unnamed ID3D12PipelineState Object', [ EXECUTION ERROR #942: GPU_BASED_VALIDATION_INCOMPATIBLE_RESOURCE_STATE]
It seems we're missing some state-transition here.
The test itself passes for me, but it could very well be that this fail on another vendor.