Forráskód Böngészése

Change D3D12 GPU backend to respect has_depth_stencil_target

jsoulier 1 hónapja
szülő
commit
9464aaa8af
1 módosított fájl, 3 hozzáadás és 1 törlés
  1. 3 1
      src/gpu/d3d12/SDL_gpu_d3d12.c

+ 3 - 1
src/gpu/d3d12/SDL_gpu_d3d12.c

@@ -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;
 
-    psoDesc.DSVFormat = SDLToD3D12_DepthFormat[createinfo->target_info.depth_stencil_format];
+    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];