Commit 5a5844d4 authored by Matteo Bruni's avatar Matteo Bruni Committed by Alexandre Julliard

d3dx9: Disallow sampler declarations where not supported.

parent a74978df
...@@ -178,6 +178,13 @@ static void asmparser_dcl_sampler(struct asm_parser *This, DWORD samptype, ...@@ -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, static void asmparser_sincos(struct asm_parser *This, DWORD mod, DWORD shift,
const struct shader_reg *dst, const struct shader_reg *dst,
const struct src_regs *srcs) { const struct src_regs *srcs) {
...@@ -779,7 +786,7 @@ static const struct asmparser_backend parser_vs_1 = { ...@@ -779,7 +786,7 @@ static const struct asmparser_backend parser_vs_1 = {
asmparser_dcl_output, asmparser_dcl_output,
asmparser_dcl_input, asmparser_dcl_input,
asmparser_dcl_sampler, asmparser_dcl_sampler_unsupported,
asmparser_end, asmparser_end,
...@@ -799,7 +806,7 @@ static const struct asmparser_backend parser_vs_2 = { ...@@ -799,7 +806,7 @@ static const struct asmparser_backend parser_vs_2 = {
asmparser_dcl_output, asmparser_dcl_output,
asmparser_dcl_input, asmparser_dcl_input,
asmparser_dcl_sampler, asmparser_dcl_sampler_unsupported,
asmparser_end, asmparser_end,
......
...@@ -1374,6 +1374,9 @@ static void failure_test(void) { ...@@ -1374,6 +1374,9 @@ static void failure_test(void) {
/* shader 46: no tx registers in ps_3_0 */ /* shader 46: no tx registers in ps_3_0 */
"ps_3_0\n" "ps_3_0\n"
"dcl t2\n", "dcl t2\n",
/* shader 47: no samplers in vs_2_0 */
"vs_2_0\n"
"dcl_2d s2\n",
}; };
HRESULT hr; HRESULT hr;
unsigned int i; unsigned int i;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment