Handle AS/MS subobjects explicitly, ignore empty ones. Closes #2193

* If we get passed an empty/degenerate AS or MS we can ignore it, the
  application is responsible for ensuring that it doesn't pass any *actual*
  shaders here.
This commit is contained in:
baldurk
2021-03-01 11:44:37 +00:00
parent c5e885a28b
commit 9849fcd7f9
3 changed files with 25 additions and 0 deletions
+20
View File
@@ -1167,6 +1167,26 @@ D3D12_EXPANDED_PIPELINE_STATE_STREAM_DESC::D3D12_EXPANDED_PIPELINE_STATE_STREAM_
ITER_ADV(D3D12_VIEW_INSTANCING_DESC);
break;
}
case D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_AS:
{
if(ptr->data.shader.BytecodeLength > 0)
{
RDCERR("AS passed to D3D12_PIPELINE_STATE_STREAM_DESC but mesh shaders not supported");
errored = true;
}
ITER_ADV(D3D12_SHADER_BYTECODE);
break;
}
case D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_MS:
{
if(ptr->data.shader.BytecodeLength > 0)
{
RDCERR("MS passed to D3D12_PIPELINE_STATE_STREAM_DESC but mesh shaders not supported");
errored = true;
}
ITER_ADV(D3D12_SHADER_BYTECODE);
break;
}
default:
{
RDCERR("Unknown subobject type %d", obj->type);
+2
View File
@@ -459,6 +459,8 @@ struct D3D12_EXPANDED_PIPELINE_STATE_STREAM_DESC
// construct from the stream descriptor
D3D12_EXPANDED_PIPELINE_STATE_STREAM_DESC(const D3D12_PIPELINE_STATE_STREAM_DESC &stream);
bool errored = false;
// graphics properties
ID3D12RootSignature *pRootSignature = NULL;
D3D12_SHADER_BYTECODE VS = {};
@@ -194,6 +194,9 @@ HRESULT WrappedID3D12Device::CreatePipelineState(const D3D12_PIPELINE_STATE_STRE
D3D12_PACKED_PIPELINE_STATE_STREAM_DESC unwrappedDesc = expandedDesc;
unwrappedDesc.Unwrap();
if(expandedDesc.errored)
return E_INVALIDARG;
if(ppPipelineState == NULL)
return m_pDevice3->CreatePipelineState(unwrappedDesc.AsDescStream(), riid, ppPipelineState);