| 352 | } |
| 353 | |
| 354 | void Skybox::CreatePSOs(DXGI_FORMAT rtFormat, uint32 numMSAASamples) |
| 355 | { |
| 356 | D3D12_INPUT_ELEMENT_DESC inputElements[] = |
| 357 | { |
| 358 | { "POSITION", 0, DXGI_FORMAT_R32G32B32_FLOAT, 0, D3D12_APPEND_ALIGNED_ELEMENT, D3D12_INPUT_CLASSIFICATION_PER_VERTEX_DATA, 0 }, |
| 359 | }; |
| 360 | |
| 361 | D3D12_GRAPHICS_PIPELINE_STATE_DESC psoDesc = { }; |
| 362 | psoDesc.pRootSignature = rootSignature; |
| 363 | psoDesc.VS = vertexShader.ByteCode(); |
| 364 | psoDesc.PS = pixelShader.ByteCode(); |
| 365 | psoDesc.RasterizerState = DX12::GetRasterizerState(RasterizerState::NoCull); |
| 366 | psoDesc.BlendState = DX12::GetBlendState(BlendState::Disabled); |
| 367 | psoDesc.DepthStencilState = DX12::GetDepthState(DepthState::Enabled); |
| 368 | psoDesc.SampleMask = UINT_MAX; |
| 369 | psoDesc.PrimitiveTopologyType = D3D12_PRIMITIVE_TOPOLOGY_TYPE_TRIANGLE; |
| 370 | psoDesc.NumRenderTargets = 1; |
| 371 | psoDesc.RTVFormats[0] = rtFormat; |
| 372 | psoDesc.SampleDesc.Count = numMSAASamples; |
| 373 | psoDesc.SampleDesc.Quality = numMSAASamples > 1 ? DX12::StandardMSAAPattern : 0; |
| 374 | psoDesc.InputLayout.pInputElementDescs = inputElements; |
| 375 | psoDesc.InputLayout.NumElements = ArraySize_(inputElements); |
| 376 | DXCall(DX12::Device->CreateGraphicsPipelineState(&psoDesc, IID_PPV_ARGS(&pipelineState))); |
| 377 | } |
| 378 | |
| 379 | void Skybox::DestroyPSOs() |
| 380 | { |
no test coverage detected