From e41480ebb74fcf3a1ee90e9b9aac9e3fb5d1b307 Mon Sep 17 00:00:00 2001 From: salh Date: Fri, 17 Apr 2026 23:00:09 +0300 Subject: [PATCH] fix(gpu): allow VS-expanded primitives in D3D12 pipeline cache MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit TranslateAnalyzedShader and CreateD3D12Pipeline assumed host vertex type was only kVertex for non-tessellation paths. Point/rectangle list expansion uses kPointListAsTriangleStrip and kRectangleListAsTriangleStrip while still emitting a vertex shader — accept those types for logging and PSO creation. Made-with: Cursor --- .../src/graphics/d3d12/pipeline_cache.cpp | 20 +++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/thirdparty/rexglue-sdk/src/graphics/d3d12/pipeline_cache.cpp b/thirdparty/rexglue-sdk/src/graphics/d3d12/pipeline_cache.cpp index cf44f404..29f9c29b 100644 --- a/thirdparty/rexglue-sdk/src/graphics/d3d12/pipeline_cache.cpp +++ b/thirdparty/rexglue-sdk/src/graphics/d3d12/pipeline_cache.cpp @@ -1087,9 +1087,17 @@ bool PipelineCache::TranslateAnalyzedShader(DxbcShaderTranslator& translator, case Shader::HostVertexShaderType::kQuadDomainPatchIndexed: host_shader_type = "patch-indexed quad domain"; break; + case Shader::HostVertexShaderType::kVertex: + host_shader_type = "vertex"; + break; + case Shader::HostVertexShaderType::kPointListAsTriangleStrip: + host_shader_type = "vertex (point list expanded to strip)"; + break; + case Shader::HostVertexShaderType::kRectangleListAsTriangleStrip: + host_shader_type = "vertex (rectangle list expanded to strip)"; + break; default: - assert(modification.vertex.host_vertex_shader_type == - Shader::HostVertexShaderType::kVertex); + assert_unhandled_case(modification.vertex.host_vertex_shader_type); host_shader_type = "vertex"; } } else { @@ -2797,8 +2805,12 @@ ID3D12PipelineState* PipelineCache::CreateD3D12Pipeline( state_desc.DS.pShaderBytecode = runtime_description.vertex_shader->translated_binary().data(); state_desc.DS.BytecodeLength = runtime_description.vertex_shader->translated_binary().size(); } else { - assert_true(host_vertex_shader_type == Shader::HostVertexShaderType::kVertex); - if (host_vertex_shader_type != Shader::HostVertexShaderType::kVertex) { + const bool host_vs_is_translated_vertex_blob = + host_vertex_shader_type == Shader::HostVertexShaderType::kVertex || + host_vertex_shader_type == Shader::HostVertexShaderType::kPointListAsTriangleStrip || + host_vertex_shader_type == Shader::HostVertexShaderType::kRectangleListAsTriangleStrip; + assert_true(host_vs_is_translated_vertex_blob); + if (!host_vs_is_translated_vertex_blob) { // Fallback vertex shaders are not needed on Direct3D 12. return nullptr; }