Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- dlls/d3d10/d3d10_private.h | 1 + dlls/d3d10/effect.c | 12 ++++++++++++ dlls/d3d10/tests/effect.c | 9 +-------- 3 files changed, 14 insertions(+), 8 deletions(-)
diff --git a/dlls/d3d10/d3d10_private.h b/dlls/d3d10/d3d10_private.h index 5e406110988..64c445ec07a 100644 --- a/dlls/d3d10/d3d10_private.h +++ b/dlls/d3d10/d3d10_private.h @@ -107,6 +107,7 @@ struct d3d10_effect_shader_variable { ID3D10ShaderReflection *reflection; ID3D10Blob *input_signature; + ID3D10Blob *bytecode; union { ID3D10VertexShader *vs; diff --git a/dlls/d3d10/effect.c b/dlls/d3d10/effect.c index d2d0817673d..a74dad3763d 100644 --- a/dlls/d3d10/effect.c +++ b/dlls/d3d10/effect.c @@ -606,6 +606,11 @@ static HRESULT parse_fx10_shader(const char *data, size_t data_size, DWORD offse
D3DGetInputSignatureBlob(ptr, dxbc_size, &v->u.shader.input_signature);
+ if (FAILED(hr = D3DCreateBlob(dxbc_size, &v->u.shader.bytecode))) + return hr; + + memcpy(ID3D10Blob_GetBufferPointer(v->u.shader.bytecode), ptr, dxbc_size); + if (FAILED(hr = get_fx10_shader_resources(v, ptr, dxbc_size))) return hr;
@@ -2589,6 +2594,8 @@ static void d3d10_effect_shader_variable_destroy(struct d3d10_effect_shader_vari s->reflection->lpVtbl->Release(s->reflection); if (s->input_signature) ID3D10Blob_Release(s->input_signature); + if (s->bytecode) + ID3D10Blob_Release(s->bytecode);
switch (type) { @@ -6830,6 +6837,11 @@ static HRESULT STDMETHODCALLTYPE d3d10_effect_shader_variable_GetShaderDesc( if (s->input_signature) desc->pInputSignature = ID3D10Blob_GetBufferPointer(s->input_signature); desc->SODecl = s->stream_output_declaration; + if (s->bytecode) + { + desc->pBytecode = ID3D10Blob_GetBufferPointer(s->bytecode); + desc->BytecodeLength = ID3D10Blob_GetBufferSize(s->bytecode); + } if (s->reflection) { if (SUCCEEDED(hr = s->reflection->lpVtbl->GetDesc(s->reflection, &shader_desc))) diff --git a/dlls/d3d10/tests/effect.c b/dlls/d3d10/tests/effect.c index 3ca1eed0603..4eb2e5876de 100644 --- a/dlls/d3d10/tests/effect.c +++ b/dlls/d3d10/tests/effect.c @@ -5887,10 +5887,8 @@ static void test_effect_optimize(void) ok(hr == S_OK, "Failed to get shader description, hr %#x.\n", hr); ok(!!shaderdesc.pInputSignature, "Expected input signature.\n"); ok(!shaderdesc.IsInline, "Unexpected inline flag.\n"); -todo_wine { ok(!!shaderdesc.pBytecode, "Expected bytecode.\n"); ok(!!shaderdesc.BytecodeLength, "Unexpected bytecode length.\n"); -} ok(!strcmp(shaderdesc.SODecl, "SV_POSITION.x"), "Unexpected stream output declaration %s.\n", shaderdesc.SODecl); ok(!!shaderdesc.NumInputSignatureEntries, "Unexpected input signature count.\n"); ok(!!shaderdesc.NumOutputSignatureEntries, "Unexpected output signature count.\n"); @@ -5903,9 +5901,9 @@ todo_wine ok(hr == S_OK, "Failed to get shader description, hr %#x.\n", hr); ok(!!shaderdesc.pInputSignature, "Expected input signature.\n"); ok(!shaderdesc.IsInline, "Unexpected inline flag.\n"); +todo_wine { ok(!shaderdesc.pBytecode, "Unexpected bytecode.\n"); ok(!shaderdesc.BytecodeLength, "Unexpected bytecode length.\n"); -todo_wine { ok(!shaderdesc.SODecl, "Unexpected stream output declaration %p.\n", shaderdesc.SODecl); ok(!shaderdesc.NumInputSignatureEntries, "Unexpected input signature count.\n"); ok(!shaderdesc.NumOutputSignatureEntries, "Unexpected output signature count.\n"); @@ -5950,28 +5948,23 @@ static void test_effect_shader_description(void) ok(!shaderdesc.BytecodeLength, "Unexpected bytecode length %u.\n", shaderdesc.BytecodeLength); hr = s->lpVtbl->GetShaderDesc(s, 3, &shaderdesc); ok(hr == S_OK, "Failed to get shader description, hr %#x.\n", hr); -todo_wine ok(shaderdesc.BytecodeLength == 424, "Unexpected bytecode length %u.\n", shaderdesc.BytecodeLength); hr = s->lpVtbl->GetShaderDesc(s, 4, &shaderdesc); ok(hr == S_OK, "Failed to get shader description, hr %#x.\n", hr); -todo_wine ok(shaderdesc.BytecodeLength == 424, "Unexpected bytecode length %u.\n", shaderdesc.BytecodeLength); hr = s->lpVtbl->GetShaderDesc(s, 5, &shaderdesc); ok(hr == S_OK, "Failed to get shader description, hr %#x.\n", hr); -todo_wine ok(shaderdesc.BytecodeLength == 420, "Unexpected bytecode length %u.\n", shaderdesc.BytecodeLength); hr = s->lpVtbl->GetShaderDesc(s, 6, &shaderdesc); ok(hr == S_OK, "Failed to get shader description, hr %#x.\n", hr); -todo_wine ok(shaderdesc.BytecodeLength == 516, "Unexpected bytecode length %u.\n", shaderdesc.BytecodeLength); ok(!shaderdesc.SODecl, "Unexpected SO declaration %p.\n", shaderdesc.SODecl); hr = s->lpVtbl->GetShaderDesc(s, 7, &shaderdesc); ok(hr == S_OK, "Failed to get shader description, hr %#x.\n", hr); -todo_wine ok(shaderdesc.BytecodeLength == 516, "Unexpected bytecode length %u.\n", shaderdesc.BytecodeLength); ok(!strcmp(shaderdesc.SODecl, "SV_POSITION.x"), "Unexpected SO declaration %s.\n",