d3d12: Add support for primitive restart.

This commit is contained in:
Vincent Lejeune 2015-10-25 17:53:18 +01:00
parent fe902cbb13
commit bc7e30517b
2 changed files with 6 additions and 0 deletions

View file

@ -292,6 +292,9 @@ bool D3D12GSRender::LoadProgram()
prop.Blend.RenderTarget[i].RenderTargetWriteMask = mask;
prop.IASet = m_IASet;
if (!!rsx::method_registers[NV4097_SET_RESTART_INDEX_ENABLE])
prop.CutValue = ((rsx::method_registers[NV4097_SET_INDEX_ARRAY_DMA] >> 4) == CELL_GCM_DRAW_INDEX_ARRAY_TYPE_32) ?
D3D12_INDEX_BUFFER_STRIP_CUT_VALUE_0xFFFFFFFF : D3D12_INDEX_BUFFER_STRIP_CUT_VALUE_0xFFFF;
m_PSO = m_cachePSO.getGraphicPipelineState(&vertex_program, &fragment_program, prop, std::make_pair(m_device.Get(), m_rootSignatures));
return m_PSO != nullptr;

View file

@ -16,6 +16,7 @@ struct D3D12PipelineProperties
unsigned numMRT : 3;
D3D12_DEPTH_STENCIL_DESC DepthStencil;
D3D12_RASTERIZER_DESC Rasterization;
D3D12_INDEX_BUFFER_STRIP_CUT_VALUE CutValue;
bool operator==(const D3D12PipelineProperties &in) const
{
@ -219,6 +220,8 @@ struct D3D12Traits
graphicPipelineStateDesc.SampleMask = UINT_MAX;
graphicPipelineStateDesc.NodeMask = 1;
graphicPipelineStateDesc.IBStripCutValue = pipelineProperties.CutValue;
extraData.first->CreateGraphicsPipelineState(&graphicPipelineStateDesc, IID_PPV_ARGS(&std::get<0>(*result)));
std::get<1>(*result) = vertexProgramData.vertex_shader_inputs;
return result;