Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- dlls/d3d10/d3d10_private.h | 1 + dlls/d3d10/effect.c | 12 ++++++++++++ dlls/d3d10/tests/effect.c | 4 +--- 3 files changed, 14 insertions(+), 3 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 aa0eef8852d..4f93f24600d 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) { @@ -6795,6 +6802,11 @@ static HRESULT STDMETHODCALLTYPE d3d10_effect_shader_variable_GetShaderDesc( memset(desc, 0, sizeof(*desc)); if (v->u.shader.input_signature) desc->pInputSignature = ID3D10Blob_GetBufferPointer(v->u.shader.input_signature); + if (v->u.shader.bytecode) + { + desc->pBytecode = ID3D10Blob_GetBufferPointer(v->u.shader.bytecode); + desc->BytecodeLength = ID3D10Blob_GetBufferSize(v->u.shader.bytecode); + } desc->SODecl = v->u.shader.stream_output_declaration; if (v->u.shader.reflection) { diff --git a/dlls/d3d10/tests/effect.c b/dlls/d3d10/tests/effect.c index 17ebafcec37..9ac3c6f314c 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 != 0, "Unexpected bytecode length.\n"); -} ok(!strcmp(shaderdesc.SODecl, "SV_POSITION.x"), "Unexpected stream output declaration %s.\n", shaderdesc.SODecl); ok(shaderdesc.NumInputSignatureEntries != 0, "Unexpected input signature count.\n"); ok(shaderdesc.NumOutputSignatureEntries != 0, "Unexpected input 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 == 0, "Unexpected bytecode length.\n"); -todo_wine { ok(!shaderdesc.SODecl, "Unexpected stream output declaration %p.\n", shaderdesc.SODecl); ok(shaderdesc.NumInputSignatureEntries == 0, "Unexpected input signature count.\n"); ok(shaderdesc.NumOutputSignatureEntries == 0, "Unexpected output signature count.\n");