d3d10/effect: Store stream output declaration for inline shaders too.

Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Matteo Bruni <mbruni@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Nikolay Sivov 2021-09-02 16:25:07 +02:00 committed by Alexandre Julliard
parent ff32b78e78
commit a3a2ae7d97
2 changed files with 17 additions and 5 deletions

View File

@ -1629,7 +1629,7 @@ static HRESULT parse_fx10_object(const char *data, size_t data_size,
{ {
ID3D10EffectVariable *variable = &null_variable.ID3D10EffectVariable_iface; ID3D10EffectVariable *variable = &null_variable.ID3D10EffectVariable_iface;
const char *data_ptr = NULL; const char *data_ptr = NULL;
DWORD offset; DWORD offset, sodecl_offset;
enum d3d10_effect_object_operation operation; enum d3d10_effect_object_operation operation;
HRESULT hr; HRESULT hr;
struct d3d10_effect *effect = o->pass->technique->effect; struct d3d10_effect *effect = o->pass->technique->effect;
@ -1753,7 +1753,7 @@ static HRESULT parse_fx10_object(const char *data, size_t data_size,
return E_FAIL; return E_FAIL;
} }
if (offset >= data_size || !require_space(offset, 1, sizeof(DWORD), data_size)) if (offset >= data_size || !require_space(offset, 2, sizeof(DWORD), data_size))
{ {
WARN("Invalid offset %#x (data size %#lx).\n", offset, (long)data_size); WARN("Invalid offset %#x (data size %#lx).\n", offset, (long)data_size);
return E_FAIL; return E_FAIL;
@ -1761,6 +1761,7 @@ static HRESULT parse_fx10_object(const char *data, size_t data_size,
data_ptr = data + offset; data_ptr = data + offset;
read_dword(&data_ptr, &offset); read_dword(&data_ptr, &offset);
TRACE("Effect object starts at offset %#x.\n", offset); TRACE("Effect object starts at offset %#x.\n", offset);
read_dword(&data_ptr, &sodecl_offset);
if (FAILED(hr = parse_fx10_anonymous_shader(effect, if (FAILED(hr = parse_fx10_anonymous_shader(effect,
&effect->anonymous_shaders[effect->anonymous_shader_current], o->type))) &effect->anonymous_shaders[effect->anonymous_shader_current], o->type)))
@ -1770,6 +1771,19 @@ static HRESULT parse_fx10_object(const char *data, size_t data_size,
variable = &v->ID3D10EffectVariable_iface; variable = &v->ID3D10EffectVariable_iface;
++effect->anonymous_shader_current; ++effect->anonymous_shader_current;
if (sodecl_offset)
{
TRACE("Anonymous shader stream output declaration at offset %#x.\n", sodecl_offset);
if (!fx10_copy_string(data, data_size, sodecl_offset,
&v->u.shader.stream_output_declaration))
{
ERR("Failed to copy stream output declaration.\n");
return E_OUTOFMEMORY;
}
TRACE("Stream output declaration: %s.\n", debugstr_a(v->u.shader.stream_output_declaration));
}
switch (o->type) switch (o->type)
{ {
case D3D10_EOT_VERTEXSHADER: case D3D10_EOT_VERTEXSHADER:

View File

@ -3672,10 +3672,8 @@ if (0)
hr = pdesc.pShaderVariable->lpVtbl->GetShaderDesc(pdesc.pShaderVariable, 0, &shaderdesc); hr = pdesc.pShaderVariable->lpVtbl->GetShaderDesc(pdesc.pShaderVariable, 0, &shaderdesc);
ok(hr == S_OK, "Unexpected hr %#x.\n", hr); ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
ok(shaderdesc.IsInline, "Unexpected inline flag.\n"); ok(shaderdesc.IsInline, "Unexpected inline flag.\n");
todo_wine { ok(!strcmp(shaderdesc.SODecl, "SV_POSITION.y"), "Unexpected stream output declaration %s.\n",
ok(shaderdesc.SODecl && !strcmp(shaderdesc.SODecl, "SV_POSITION.y"), "Unexpected stream output declaration %s.\n",
shaderdesc.SODecl); shaderdesc.SODecl);
}
v = effect->lpVtbl->GetVariableByName(effect, "g_so"); v = effect->lpVtbl->GetVariableByName(effect, "g_so");
gs = v->lpVtbl->AsShader(v); gs = v->lpVtbl->AsShader(v);