Change D3D12 GPU backend to respect has_depth_stencil_target

This commit is contained in:
jsoulier
2025-02-26 00:35:37 -05:00
committed by Sam Lantinga
parent cf819ca818
commit 9464aaa8af

View File

@@ -3014,7 +3014,9 @@ static SDL_GPUGraphicsPipeline *D3D12_CreateGraphicsPipeline(
psoDesc.SampleDesc.Count = SDLToD3D12_SampleCount[createinfo->multisample_state.sample_count];
psoDesc.SampleDesc.Quality = (createinfo->multisample_state.sample_count > SDL_GPU_SAMPLECOUNT_1) ? D3D12_STANDARD_MULTISAMPLE_PATTERN : 0;
if (createinfo->target_info.has_depth_stencil_target) {
psoDesc.DSVFormat = SDLToD3D12_DepthFormat[createinfo->target_info.depth_stencil_format];
}
psoDesc.NumRenderTargets = createinfo->target_info.num_color_targets;
for (uint32_t i = 0; i < createinfo->target_info.num_color_targets; i += 1) {
psoDesc.RTVFormats[i] = SDLToD3D12_TextureFormat[createinfo->target_info.color_target_descriptions[i].format];