Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
c2b0f200
Commit
c2b0f200
authored
Jul 17, 2010
by
Matteo Bruni
Committed by
Alexandre Julliard
Jul 19, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3dx9: Check dcl input instruction syntax against shader version.
parent
0ea6f795
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
34 additions
and
5 deletions
+34
-5
asmparser.c
dlls/d3dx9_36/asmparser.c
+0
-5
asmshader.y
dlls/d3dx9_36/asmshader.y
+22
-0
asm.c
dlls/d3dx9_36/tests/asm.c
+12
-0
No files found.
dlls/d3dx9_36/asmparser.c
View file @
c2b0f200
...
...
@@ -152,11 +152,6 @@ static void asmparser_dcl_input_ps_2(struct asm_parser *This, DWORD usage, DWORD
struct
instruction
instr
;
if
(
!
This
->
shader
)
return
;
if
(
usage
!=
0
)
{
asmparser_message
(
This
,
"Line %u: Unsupported usage in dcl instruction
\n
"
,
This
->
line_no
);
set_parse_status
(
This
,
PARSE_ERR
);
return
;
}
instr
.
dstmod
=
mod
;
instr
.
shift
=
0
;
This
->
funcs
->
dstreg
(
This
,
&
instr
,
reg
);
...
...
dlls/d3dx9_36/asmshader.y
View file @
c2b0f200
...
...
@@ -549,6 +549,12 @@ instruction: INSTR_ADD omods dreg ',' sregs
asm_ctx.line_no);
set_parse_status(&asm_ctx, PARSE_ERR);
}
if(asm_ctx.shader->version == BWRITERPS_VERSION(2, 0) ||
asm_ctx.shader->version == BWRITERPS_VERSION(2, 1)) {
asmparser_message(&asm_ctx, "Line %u: Declaration not supported in PS 2\n",
asm_ctx.line_no);
set_parse_status(&asm_ctx, PARSE_ERR);
}
ZeroMemory(®, sizeof(reg));
reg.type = $4.type;
reg.regnum = $4.regnum;
...
...
@@ -566,6 +572,12 @@ instruction: INSTR_ADD omods dreg ',' sregs
asm_ctx.line_no);
set_parse_status(&asm_ctx, PARSE_ERR);
}
if(asm_ctx.shader->version == BWRITERPS_VERSION(2, 0) ||
asm_ctx.shader->version == BWRITERPS_VERSION(2, 1)) {
asmparser_message(&asm_ctx, "Line %u: Declaration not supported in PS 2\n",
asm_ctx.line_no);
set_parse_status(&asm_ctx, PARSE_ERR);
}
ZeroMemory(®, sizeof(reg));
reg.type = $4.type;
reg.regnum = $4.regnum;
...
...
@@ -583,6 +595,11 @@ instruction: INSTR_ADD omods dreg ',' sregs
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 semantic\n",
asm_ctx.line_no);
set_parse_status(&asm_ctx, PARSE_ERR);
}
ZeroMemory(®, sizeof(reg));
reg.type = $3.type;
reg.regnum = $3.regnum;
...
...
@@ -600,6 +617,11 @@ instruction: INSTR_ADD omods dreg ',' sregs
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 semantic\n",
asm_ctx.line_no);
set_parse_status(&asm_ctx, PARSE_ERR);
}
ZeroMemory(®, sizeof(reg));
reg.type = $3.type;
reg.regnum = $3.regnum;
...
...
dlls/d3dx9_36/tests/asm.c
View file @
c2b0f200
...
...
@@ -1377,6 +1377,18 @@ static void failure_test(void) {
/* shader 47: no samplers in vs_2_0 */
"vs_2_0
\n
"
"dcl_2d s2
\n
"
,
/* shader 48: semantic required in vs dcl input instruction */
"vs_2_0
\n
"
"dcl v0
\n
"
,
/* shader 49: semantic not allowed in ps dcl input instruction*/
"ps_2_0
\n
"
"dcl_position0 v0
\n
"
,
/* shader 50: dcl instruction not in ps_1_x */
"ps_1_4
\n
"
"dcl_position0 v0
\n
"
,
/* shader 51: no dcl output instruction in < vs 3.0 */
"vs_2_0
\n
"
"dcl_positiont0 o0
\n
"
,
};
HRESULT
hr
;
unsigned
int
i
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment