Module: wine Branch: master Commit: 5bb403ceb2be5f727c24a87bee35e72fdd6b41aa URL: http://source.winehq.org/git/wine.git/?a=commit;h=5bb403ceb2be5f727c24a87bee...
Author: Matteo Bruni matteo.mystral@gmail.com Date: Tue Jun 8 03:20:20 2010 +0200
d3dx9: Allow sampler declaration without sampler type.
---
dlls/d3dx9_36/asmshader.y | 15 +++++++++++++++ dlls/d3dx9_36/tests/asm.c | 5 +++++ 2 files changed, 20 insertions(+), 0 deletions(-)
diff --git a/dlls/d3dx9_36/asmshader.y b/dlls/d3dx9_36/asmshader.y index 0c335b4..689a8fd 100644 --- a/dlls/d3dx9_36/asmshader.y +++ b/dlls/d3dx9_36/asmshader.y @@ -618,6 +618,21 @@ instruction: INSTR_ADD omods dreg ',' sregs } asm_ctx.funcs->dcl_sampler(&asm_ctx, $2, $3.mod, $4, asm_ctx.line_no); } + | INSTR_DCL omods REG_SAMPLER + { + TRACE("Sampler declared\n"); + if($2.shift != 0) { + asmparser_message(&asm_ctx, "Line %u: Shift modifier not allowed here\n", + asm_ctx.line_no); + set_parse_status(&asm_ctx, PARSE_ERR); + } + if(asm_ctx.shader->type != ST_PIXEL) { + asmparser_message(&asm_ctx, "Line %u: Declaration needs a sampler type\n", + asm_ctx.line_no); + set_parse_status(&asm_ctx, PARSE_ERR); + } + asm_ctx.funcs->dcl_sampler(&asm_ctx, BWRITERSTT_UNKNOWN, $2.mod, $3, asm_ctx.line_no); + } | INSTR_DCL sampdcl omods dcl_inputreg { TRACE("Error rule: sampler decl of input reg\n"); diff --git a/dlls/d3dx9_36/tests/asm.c b/dlls/d3dx9_36/tests/asm.c index dda0e2b..5f2e49a 100644 --- a/dlls/d3dx9_36/tests/asm.c +++ b/dlls/d3dx9_36/tests/asm.c @@ -1216,6 +1216,11 @@ static void ps_3_0_test(void) { "dcl v0\n", {0xffff0300, 0x0200001f, 0x80000000, 0x900f0000, 0x0000ffff} }, + { /* shader 16 */ + "ps_3_0\n" + "dcl s2\n", + {0xffff0300, 0x0200001f, 0x80000000, 0xa00f0802, 0x0000ffff} + }, };
exec_tests("ps_3_0", tests, sizeof(tests) / sizeof(tests[0]));