From fef30dac2c422f9460a79dc47f216c42be31f68a Mon Sep 17 00:00:00 2001 From: Henri Verbeet Date: Tue, 23 Jan 2024 19:31:41 +0100 Subject: [PATCH] vkd3d-shader/d3dbc: Do not fail parsing the shader when undeclared inputs are encountered. These can be disassembled by D3DDisassemble() just fine, and perhaps more importantly, shader model 1 vertex shaders do not require dcl_ instructions in Direct3D 8. --- libs/vkd3d-shader/d3dbc.c | 2 +- tests/hlsl_d3d12.c | 10 ++++------ 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/libs/vkd3d-shader/d3dbc.c b/libs/vkd3d-shader/d3dbc.c index 4ba001ea..a4ca7aa2 100644 --- a/libs/vkd3d-shader/d3dbc.c +++ b/libs/vkd3d-shader/d3dbc.c @@ -587,7 +587,7 @@ static void add_signature_mask(struct vkd3d_shader_sm1_parser *sm1, bool output, if (!(element = find_signature_element_by_register_index(signature, register_index))) { - vkd3d_shader_parser_error(&sm1->p, VKD3D_SHADER_ERROR_D3DBC_UNDECLARED_SEMANTIC, + vkd3d_shader_parser_warning(&sm1->p, VKD3D_SHADER_ERROR_D3DBC_UNDECLARED_SEMANTIC, "%s register %u was used without being declared.", output ? "Output" : "Input", register_index); return; } diff --git a/tests/hlsl_d3d12.c b/tests/hlsl_d3d12.c index 272b8aca..28007e3a 100644 --- a/tests/hlsl_d3d12.c +++ b/tests/hlsl_d3d12.c @@ -1583,18 +1583,16 @@ static void test_disassemble_shader(void) ok(hr == E_INVALIDARG, "Got hr %#x.\n", hr); hr = D3DDisassemble(vs_1_1, sizeof(vs_1_1), 0, NULL, &blob); - todo ok(hr == S_OK, "Got hr %#x.\n", hr); - if (SUCCEEDED(hr)) - ID3D10Blob_Release(blob); + ok(hr == S_OK, "Got hr %#x.\n", hr); + ID3D10Blob_Release(blob); hr = D3DDisassemble(vs_2_0, sizeof(vs_2_0), 0, NULL, &blob); ok(hr == S_OK, "Got hr %#x.\n", hr); ID3D10Blob_Release(blob); hr = D3DDisassemble(vs_3_0, sizeof(vs_3_0), 0, NULL, &blob); - todo ok(hr == S_OK, "Got hr %#x.\n", hr); - if (SUCCEEDED(hr)) - ID3D10Blob_Release(blob); + ok(hr == S_OK, "Got hr %#x.\n", hr); + ID3D10Blob_Release(blob); hr = D3DDisassemble(vs_4_0, sizeof(vs_4_0), 0, NULL, &blob); todo ok(hr == S_OK, "Got hr %#x.\n", hr);