Matteo Bruni : d3dx9: Disallow sampler declarations where not supported.

Alexandre Julliard julliard at winehq.org
Thu Jun 10 12:22:50 CDT 2010


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

Author: Matteo Bruni <matteo.mystral at gmail.com>
Date:   Tue Jun  8 16:13:59 2010 +0200

d3dx9: Disallow sampler declarations where not supported.

---

 dlls/d3dx9_36/asmparser.c |   11 +++++++++--
 dlls/d3dx9_36/tests/asm.c |    3 +++
 2 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/dlls/d3dx9_36/asmparser.c b/dlls/d3dx9_36/asmparser.c
index 528e6b3..4e7f018 100644
--- a/dlls/d3dx9_36/asmparser.c
+++ b/dlls/d3dx9_36/asmparser.c
@@ -178,6 +178,13 @@ static void asmparser_dcl_sampler(struct asm_parser *This, DWORD samptype,
     }
 }
 
+static void asmparser_dcl_sampler_unsupported(struct asm_parser *This, DWORD samptype,
+					      DWORD mod, DWORD regnum,
+					      unsigned int line_no) {
+    asmparser_message(This, "Line %u: Sampler declaration unsupported in this shader version\n", This->line_no);
+    set_parse_status(This, PARSE_ERR);
+}
+
 static void asmparser_sincos(struct asm_parser *This, DWORD mod, DWORD shift,
                              const struct shader_reg *dst,
                              const struct src_regs *srcs) {
@@ -779,7 +786,7 @@ static const struct asmparser_backend parser_vs_1 = {
 
     asmparser_dcl_output,
     asmparser_dcl_input,
-    asmparser_dcl_sampler,
+    asmparser_dcl_sampler_unsupported,
 
     asmparser_end,
 
@@ -799,7 +806,7 @@ static const struct asmparser_backend parser_vs_2 = {
 
     asmparser_dcl_output,
     asmparser_dcl_input,
-    asmparser_dcl_sampler,
+    asmparser_dcl_sampler_unsupported,
 
     asmparser_end,
 
diff --git a/dlls/d3dx9_36/tests/asm.c b/dlls/d3dx9_36/tests/asm.c
index 6255d02..276a6e2 100644
--- a/dlls/d3dx9_36/tests/asm.c
+++ b/dlls/d3dx9_36/tests/asm.c
@@ -1374,6 +1374,9 @@ static void failure_test(void) {
         /* shader 46: no tx registers in ps_3_0 */
         "ps_3_0\n"
         "dcl t2\n",
+        /* shader 47: no samplers in vs_2_0 */
+        "vs_2_0\n"
+        "dcl_2d s2\n",
     };
     HRESULT hr;
     unsigned int i;




More information about the wine-cvs mailing list