d3dx9: Allow sampler declaration without sampler type.
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 @@
}
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 @@
"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]));