Matteo Bruni : d3dcompiler: Initialize and fix compilation messages generation.

Alexandre Julliard julliard at winehq.org
Tue Jul 10 19:01:42 CDT 2012


Module: wine
Branch: master
Commit: 110249d6645cde5bef02c4c4b84d294fd949cd06
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=110249d6645cde5bef02c4c4b84d294fd949cd06

Author: Matteo Bruni <mbruni at codeweavers.com>
Date:   Tue Jul 10 15:39:45 2012 +0200

d3dcompiler: Initialize and fix compilation messages generation.

---

 dlls/d3dcompiler_43/hlsl.y |   16 ++++++++++++++++
 1 files changed, 16 insertions(+), 0 deletions(-)

diff --git a/dlls/d3dcompiler_43/hlsl.y b/dlls/d3dcompiler_43/hlsl.y
index 183f436..b4c9b25 100644
--- a/dlls/d3dcompiler_43/hlsl.y
+++ b/dlls/d3dcompiler_43/hlsl.y
@@ -926,6 +926,8 @@ struct bwriter_shader *parse_hlsl(enum shader_type type, DWORD major, DWORD mino
     struct hlsl_type *hlsl_type, *next_type;
     struct hlsl_ir_var *var, *next_var;
 
+    hlsl_ctx.status = PARSE_SUCCESS;
+    hlsl_ctx.messages.size = hlsl_ctx.messages.capacity = 0;
     hlsl_ctx.line_no = 1;
     hlsl_ctx.source_file = d3dcompiler_strdup("");
     hlsl_ctx.cur_scope = NULL;
@@ -951,6 +953,20 @@ struct bwriter_shader *parse_hlsl(enum shader_type type, DWORD major, DWORD mino
         }
     }
 
+    TRACE("Compilation status = %d\n", hlsl_ctx.status);
+    if (messages)
+    {
+        if (hlsl_ctx.messages.size)
+            *messages = hlsl_ctx.messages.string;
+        else
+            *messages = NULL;
+    }
+    else
+    {
+        if (hlsl_ctx.messages.capacity)
+            d3dcompiler_free(hlsl_ctx.messages.string);
+    }
+
     d3dcompiler_free(hlsl_ctx.source_file);
     TRACE("Freeing functions IR.\n");
     LIST_FOR_EACH_ENTRY(function, &hlsl_ctx.functions, struct hlsl_ir_function_decl, node.entry)




More information about the wine-cvs mailing list