[PATCH 2/5] d3d10/effect: Store stream output declaration for inline shaders too.

Nikolay Sivov nsivov at codeweavers.com
Wed Sep 1 08:04:31 CDT 2021


Signed-off-by: Nikolay Sivov <nsivov at codeweavers.com>
---
 dlls/d3d10/effect.c       | 16 +++++++++++++++-
 dlls/d3d10/tests/effect.c |  4 +---
 2 files changed, 16 insertions(+), 4 deletions(-)

diff --git a/dlls/d3d10/effect.c b/dlls/d3d10/effect.c
index d521684f788..25a0db10a25 100644
--- a/dlls/d3d10/effect.c
+++ b/dlls/d3d10/effect.c
@@ -1629,7 +1629,7 @@ static HRESULT parse_fx10_object(const char *data, size_t data_size,
 {
     ID3D10EffectVariable *variable = &null_variable.ID3D10EffectVariable_iface;
     const char *data_ptr = NULL;
-    DWORD offset;
+    DWORD offset, sodecl_offset;
     enum d3d10_effect_object_operation operation;
     HRESULT hr;
     struct d3d10_effect *effect = o->pass->technique->effect;
@@ -1761,6 +1761,7 @@ static HRESULT parse_fx10_object(const char *data, size_t data_size,
             data_ptr = data + offset;
             read_dword(&data_ptr, &offset);
             TRACE("Effect object starts at offset %#x.\n", offset);
+            read_dword(&data_ptr, &sodecl_offset);
 
             if (FAILED(hr = parse_fx10_anonymous_shader(effect,
                     &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;
             ++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)
             {
                 case D3D10_EOT_VERTEXSHADER:
diff --git a/dlls/d3d10/tests/effect.c b/dlls/d3d10/tests/effect.c
index f59686c26a3..a9d077566e0 100644
--- a/dlls/d3d10/tests/effect.c
+++ b/dlls/d3d10/tests/effect.c
@@ -3672,10 +3672,8 @@ if (0)
     hr = pdesc.pShaderVariable->lpVtbl->GetShaderDesc(pdesc.pShaderVariable, 0, &shaderdesc);
     ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
     ok(shaderdesc.IsInline, "Unexpected inline flag.\n");
-todo_wine {
-    ok(shaderdesc.SODecl && !strcmp(shaderdesc.SODecl, "SV_POSITION.y"), "Unexpected stream output declaration %s.\n",
+    ok(!strcmp(shaderdesc.SODecl, "SV_POSITION.y"), "Unexpected stream output declaration %s.\n",
                 shaderdesc.SODecl);
-}
 
     v = effect->lpVtbl->GetVariableByName(effect, "g_so");
     gs = v->lpVtbl->AsShader(v);
-- 
2.33.0




More information about the wine-devel mailing list