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
555f6349
Commit
555f6349
authored
May 08, 2012
by
Matteo Bruni
Committed by
Alexandre Julliard
May 08, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3dcompiler: Make set_parse_status() more general.
parent
167612ae
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
125 additions
and
122 deletions
+125
-122
asmparser.c
dlls/d3dcompiler_43/asmparser.c
+69
-69
asmshader.l
dlls/d3dcompiler_43/asmshader.l
+1
-1
asmshader.y
dlls/d3dcompiler_43/asmshader.y
+40
-46
d3dcompiler_private.h
dlls/d3dcompiler_43/d3dcompiler_private.h
+15
-6
No files found.
dlls/d3dcompiler_43/asmparser.c
View file @
555f6349
...
...
@@ -79,7 +79,7 @@ static void asmparser_constF(struct asm_parser *This, DWORD reg, float x, float
TRACE_
(
parsed_shader
)(
"def c%u, %f, %f, %f, %f
\n
"
,
reg
,
x
,
y
,
z
,
w
);
if
(
!
add_constF
(
This
->
shader
,
reg
,
x
,
y
,
z
,
w
))
{
ERR
(
"Out of memory
\n
"
);
set_parse_status
(
Thi
s
,
PARSE_ERR
);
set_parse_status
(
&
This
->
statu
s
,
PARSE_ERR
);
}
}
...
...
@@ -89,7 +89,7 @@ static void asmparser_constB(struct asm_parser *This, DWORD reg, BOOL x) {
TRACE_
(
parsed_shader
)(
"def b%u, %s
\n
"
,
reg
,
x
?
"true"
:
"false"
);
if
(
!
add_constB
(
This
->
shader
,
reg
,
x
))
{
ERR
(
"Out of memory
\n
"
);
set_parse_status
(
Thi
s
,
PARSE_ERR
);
set_parse_status
(
&
This
->
statu
s
,
PARSE_ERR
);
}
}
...
...
@@ -99,7 +99,7 @@ static void asmparser_constI(struct asm_parser *This, DWORD reg, INT x, INT y, I
TRACE_
(
parsed_shader
)(
"def i%u, %d, %d, %d, %d
\n
"
,
reg
,
x
,
y
,
z
,
w
);
if
(
!
add_constI
(
This
->
shader
,
reg
,
x
,
y
,
z
,
w
))
{
ERR
(
"Out of memory
\n
"
);
set_parse_status
(
Thi
s
,
PARSE_ERR
);
set_parse_status
(
&
This
->
statu
s
,
PARSE_ERR
);
}
}
...
...
@@ -108,18 +108,18 @@ static void asmparser_dcl_output(struct asm_parser *This, DWORD usage, DWORD num
if
(
!
This
->
shader
)
return
;
if
(
This
->
shader
->
type
==
ST_PIXEL
)
{
asmparser_message
(
This
,
"Line %u: Output register declared in a pixel shader
\n
"
,
This
->
line_no
);
set_parse_status
(
Thi
s
,
PARSE_ERR
);
set_parse_status
(
&
This
->
statu
s
,
PARSE_ERR
);
}
if
(
!
record_declaration
(
This
->
shader
,
usage
,
num
,
0
,
TRUE
,
reg
->
regnum
,
reg
->
u
.
writemask
,
FALSE
))
{
ERR
(
"Out of memory
\n
"
);
set_parse_status
(
Thi
s
,
PARSE_ERR
);
set_parse_status
(
&
This
->
statu
s
,
PARSE_ERR
);
}
}
static
void
asmparser_dcl_output_unsupported
(
struct
asm_parser
*
This
,
DWORD
usage
,
DWORD
num
,
const
struct
shader_reg
*
reg
)
{
asmparser_message
(
This
,
"Line %u: Output declaration unsupported in this shader version
\n
"
,
This
->
line_no
);
set_parse_status
(
Thi
s
,
PARSE_ERR
);
set_parse_status
(
&
This
->
statu
s
,
PARSE_ERR
);
}
static
void
asmparser_dcl_input
(
struct
asm_parser
*
This
,
DWORD
usage
,
DWORD
num
,
...
...
@@ -132,7 +132,7 @@ static void asmparser_dcl_input(struct asm_parser *This, DWORD usage, DWORD num,
(
mod
!=
BWRITERSPDM_MSAMPCENTROID
&&
mod
!=
BWRITERSPDM_PARTIALPRECISION
)))
{
asmparser_message
(
This
,
"Line %u: Unsupported modifier in dcl instruction
\n
"
,
This
->
line_no
);
set_parse_status
(
Thi
s
,
PARSE_ERR
);
set_parse_status
(
&
This
->
statu
s
,
PARSE_ERR
);
return
;
}
...
...
@@ -143,7 +143,7 @@ static void asmparser_dcl_input(struct asm_parser *This, DWORD usage, DWORD num,
if
(
!
record_declaration
(
This
->
shader
,
usage
,
num
,
mod
,
FALSE
,
reg
->
regnum
,
reg
->
u
.
writemask
,
FALSE
))
{
ERR
(
"Out of memory
\n
"
);
set_parse_status
(
Thi
s
,
PARSE_ERR
);
set_parse_status
(
&
This
->
statu
s
,
PARSE_ERR
);
}
}
...
...
@@ -157,7 +157,7 @@ static void asmparser_dcl_input_ps_2(struct asm_parser *This, DWORD usage, DWORD
This
->
funcs
->
dstreg
(
This
,
&
instr
,
reg
);
if
(
!
record_declaration
(
This
->
shader
,
usage
,
num
,
mod
,
FALSE
,
instr
.
dst
.
regnum
,
instr
.
dst
.
u
.
writemask
,
FALSE
))
{
ERR
(
"Out of memory
\n
"
);
set_parse_status
(
Thi
s
,
PARSE_ERR
);
set_parse_status
(
&
This
->
statu
s
,
PARSE_ERR
);
}
}
...
...
@@ -165,7 +165,7 @@ static void asmparser_dcl_input_unsupported(struct asm_parser *This,
DWORD
usage
,
DWORD
num
,
DWORD
mod
,
const
struct
shader_reg
*
reg
)
{
asmparser_message
(
This
,
"Line %u: Input declaration unsupported in this shader version
\n
"
,
This
->
line_no
);
set_parse_status
(
Thi
s
,
PARSE_ERR
);
set_parse_status
(
&
This
->
statu
s
,
PARSE_ERR
);
}
static
void
asmparser_dcl_sampler
(
struct
asm_parser
*
This
,
DWORD
samptype
,
...
...
@@ -177,12 +177,12 @@ static void asmparser_dcl_sampler(struct asm_parser *This, DWORD samptype,
(
mod
!=
BWRITERSPDM_MSAMPCENTROID
&&
mod
!=
BWRITERSPDM_PARTIALPRECISION
)))
{
asmparser_message
(
This
,
"Line %u: Unsupported modifier in dcl instruction
\n
"
,
This
->
line_no
);
set_parse_status
(
Thi
s
,
PARSE_ERR
);
set_parse_status
(
&
This
->
statu
s
,
PARSE_ERR
);
return
;
}
if
(
!
record_sampler
(
This
->
shader
,
samptype
,
mod
,
regnum
))
{
ERR
(
"Out of memory
\n
"
);
set_parse_status
(
Thi
s
,
PARSE_ERR
);
set_parse_status
(
&
This
->
statu
s
,
PARSE_ERR
);
}
}
...
...
@@ -190,7 +190,7 @@ 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
(
Thi
s
,
PARSE_ERR
);
set_parse_status
(
&
This
->
statu
s
,
PARSE_ERR
);
}
static
void
asmparser_sincos
(
struct
asm_parser
*
This
,
DWORD
mod
,
DWORD
shift
,
...
...
@@ -200,14 +200,14 @@ static void asmparser_sincos(struct asm_parser *This, DWORD mod, DWORD shift,
if
(
!
srcs
||
srcs
->
count
!=
3
)
{
asmparser_message
(
This
,
"Line %u: sincos (vs 2) has an incorrect number of source registers
\n
"
,
This
->
line_no
);
set_parse_status
(
Thi
s
,
PARSE_ERR
);
set_parse_status
(
&
This
->
statu
s
,
PARSE_ERR
);
return
;
}
instr
=
alloc_instr
(
3
);
if
(
!
instr
)
{
ERR
(
"Error allocating memory for the instruction
\n
"
);
set_parse_status
(
Thi
s
,
PARSE_ERR
);
set_parse_status
(
&
This
->
statu
s
,
PARSE_ERR
);
return
;
}
...
...
@@ -223,7 +223,7 @@ static void asmparser_sincos(struct asm_parser *This, DWORD mod, DWORD shift,
if
(
!
add_instruction
(
This
->
shader
,
instr
))
{
ERR
(
"Out of memory
\n
"
);
set_parse_status
(
Thi
s
,
PARSE_ERR
);
set_parse_status
(
&
This
->
statu
s
,
PARSE_ERR
);
}
}
...
...
@@ -277,14 +277,14 @@ static void asmparser_texcoord(struct asm_parser *This, DWORD mod, DWORD shift,
if
(
srcs
)
{
asmparser_message
(
This
,
"Line %u: Source registers in texcoord instruction
\n
"
,
This
->
line_no
);
set_parse_status
(
Thi
s
,
PARSE_ERR
);
set_parse_status
(
&
This
->
statu
s
,
PARSE_ERR
);
return
;
}
instr
=
alloc_instr
(
1
);
if
(
!
instr
)
{
ERR
(
"Error allocating memory for the instruction
\n
"
);
set_parse_status
(
Thi
s
,
PARSE_ERR
);
set_parse_status
(
&
This
->
statu
s
,
PARSE_ERR
);
return
;
}
...
...
@@ -303,7 +303,7 @@ static void asmparser_texcoord(struct asm_parser *This, DWORD mod, DWORD shift,
if
(
!
add_instruction
(
This
->
shader
,
instr
))
{
ERR
(
"Out of memory
\n
"
);
set_parse_status
(
Thi
s
,
PARSE_ERR
);
set_parse_status
(
&
This
->
statu
s
,
PARSE_ERR
);
}
}
...
...
@@ -314,14 +314,14 @@ static void asmparser_texcrd(struct asm_parser *This, DWORD mod, DWORD shift,
if
(
!
srcs
||
srcs
->
count
!=
1
)
{
asmparser_message
(
This
,
"Line %u: Wrong number of source registers in texcrd instruction
\n
"
,
This
->
line_no
);
set_parse_status
(
Thi
s
,
PARSE_ERR
);
set_parse_status
(
&
This
->
statu
s
,
PARSE_ERR
);
return
;
}
instr
=
alloc_instr
(
1
);
if
(
!
instr
)
{
ERR
(
"Error allocating memory for the instruction
\n
"
);
set_parse_status
(
Thi
s
,
PARSE_ERR
);
set_parse_status
(
&
This
->
statu
s
,
PARSE_ERR
);
return
;
}
...
...
@@ -336,7 +336,7 @@ static void asmparser_texcrd(struct asm_parser *This, DWORD mod, DWORD shift,
if
(
!
add_instruction
(
This
->
shader
,
instr
))
{
ERR
(
"Out of memory
\n
"
);
set_parse_status
(
Thi
s
,
PARSE_ERR
);
set_parse_status
(
&
This
->
statu
s
,
PARSE_ERR
);
}
}
...
...
@@ -346,7 +346,7 @@ static void asmparser_texkill(struct asm_parser *This,
if
(
!
instr
)
{
ERR
(
"Error allocating memory for the instruction
\n
"
);
set_parse_status
(
Thi
s
,
PARSE_ERR
);
set_parse_status
(
&
This
->
statu
s
,
PARSE_ERR
);
return
;
}
...
...
@@ -367,7 +367,7 @@ static void asmparser_texkill(struct asm_parser *This,
if
(
!
add_instruction
(
This
->
shader
,
instr
))
{
ERR
(
"Out of memory
\n
"
);
set_parse_status
(
Thi
s
,
PARSE_ERR
);
set_parse_status
(
&
This
->
statu
s
,
PARSE_ERR
);
}
}
...
...
@@ -378,7 +378,7 @@ static void asmparser_texhelper(struct asm_parser *This, DWORD mod, DWORD shift,
if
(
!
instr
)
{
ERR
(
"Error allocating memory for the instruction
\n
"
);
set_parse_status
(
Thi
s
,
PARSE_ERR
);
set_parse_status
(
&
This
->
statu
s
,
PARSE_ERR
);
return
;
}
...
...
@@ -403,7 +403,7 @@ static void asmparser_texhelper(struct asm_parser *This, DWORD mod, DWORD shift,
if
(
!
add_instruction
(
This
->
shader
,
instr
))
{
ERR
(
"Out of memory
\n
"
);
set_parse_status
(
Thi
s
,
PARSE_ERR
);
set_parse_status
(
&
This
->
statu
s
,
PARSE_ERR
);
}
}
...
...
@@ -423,14 +423,14 @@ static void asmparser_texld14(struct asm_parser *This, DWORD mod, DWORD shift,
if
(
!
srcs
||
srcs
->
count
!=
1
)
{
asmparser_message
(
This
,
"Line %u: texld (PS 1.4) has a wrong number of source registers
\n
"
,
This
->
line_no
);
set_parse_status
(
Thi
s
,
PARSE_ERR
);
set_parse_status
(
&
This
->
statu
s
,
PARSE_ERR
);
return
;
}
instr
=
alloc_instr
(
2
);
if
(
!
instr
)
{
ERR
(
"Error allocating memory for the instruction
\n
"
);
set_parse_status
(
Thi
s
,
PARSE_ERR
);
set_parse_status
(
&
This
->
statu
s
,
PARSE_ERR
);
return
;
}
...
...
@@ -457,7 +457,7 @@ static void asmparser_texld14(struct asm_parser *This, DWORD mod, DWORD shift,
if
(
!
add_instruction
(
This
->
shader
,
instr
))
{
ERR
(
"Out of memory
\n
"
);
set_parse_status
(
Thi
s
,
PARSE_ERR
);
set_parse_status
(
&
This
->
statu
s
,
PARSE_ERR
);
}
}
...
...
@@ -565,7 +565,7 @@ static void asmparser_instr(struct asm_parser *This, DWORD opcode,
if
(
src_count
!=
expectednsrcs
)
{
asmparser_message
(
This
,
"Line %u: Wrong number of source registers
\n
"
,
This
->
line_no
);
set_parse_status
(
Thi
s
,
PARSE_ERR
);
set_parse_status
(
&
This
->
statu
s
,
PARSE_ERR
);
return
;
}
...
...
@@ -588,7 +588,7 @@ static void asmparser_instr(struct asm_parser *This, DWORD opcode,
instr
=
alloc_instr
(
src_count
);
if
(
!
instr
)
{
ERR
(
"Error allocating memory for the instruction
\n
"
);
set_parse_status
(
Thi
s
,
PARSE_ERR
);
set_parse_status
(
&
This
->
statu
s
,
PARSE_ERR
);
return
;
}
...
...
@@ -603,7 +603,7 @@ static void asmparser_instr(struct asm_parser *This, DWORD opcode,
if
(
!
add_instruction
(
This
->
shader
,
instr
))
{
ERR
(
"Out of memory
\n
"
);
set_parse_status
(
Thi
s
,
PARSE_ERR
);
set_parse_status
(
&
This
->
statu
s
,
PARSE_ERR
);
}
}
...
...
@@ -676,7 +676,7 @@ static void check_legacy_srcmod(struct asm_parser *This, DWORD srcmod) {
asmparser_message
(
This
,
"Line %u: Source modifier %s not supported in this shader version
\n
"
,
This
->
line_no
,
debug_print_srcmod
(
srcmod
));
set_parse_status
(
Thi
s
,
PARSE_ERR
);
set_parse_status
(
&
This
->
statu
s
,
PARSE_ERR
);
}
}
...
...
@@ -685,7 +685,7 @@ static void check_abs_srcmod(struct asm_parser *This, DWORD srcmod) {
asmparser_message
(
This
,
"Line %u: Source modifier %s not supported in this shader version
\n
"
,
This
->
line_no
,
debug_print_srcmod
(
srcmod
));
set_parse_status
(
Thi
s
,
PARSE_ERR
);
set_parse_status
(
&
This
->
statu
s
,
PARSE_ERR
);
}
}
...
...
@@ -695,7 +695,7 @@ static void check_loop_swizzle(struct asm_parser *This,
(
src
->
rel_reg
&&
src
->
rel_reg
->
type
==
BWRITERSPR_LOOP
&&
src
->
rel_reg
->
u
.
swizzle
!=
BWRITERVS_NOSWIZZLE
))
{
asmparser_message
(
This
,
"Line %u: Swizzle not allowed on aL register
\n
"
,
This
->
line_no
);
set_parse_status
(
Thi
s
,
PARSE_ERR
);
set_parse_status
(
&
This
->
statu
s
,
PARSE_ERR
);
}
}
...
...
@@ -703,7 +703,7 @@ static void check_shift_dstmod(struct asm_parser *This, DWORD shift) {
if
(
shift
!=
0
)
{
asmparser_message
(
This
,
"Line %u: Shift modifiers not supported in this shader version
\n
"
,
This
->
line_no
);
set_parse_status
(
Thi
s
,
PARSE_ERR
);
set_parse_status
(
&
This
->
statu
s
,
PARSE_ERR
);
}
}
...
...
@@ -713,7 +713,7 @@ static void check_ps_dstmod(struct asm_parser *This, DWORD dstmod) {
asmparser_message
(
This
,
"Line %u: Instruction modifier %s not supported in this shader version
\n
"
,
This
->
line_no
,
debug_print_dstmod
(
dstmod
));
set_parse_status
(
Thi
s
,
PARSE_ERR
);
set_parse_status
(
&
This
->
statu
s
,
PARSE_ERR
);
}
}
...
...
@@ -777,7 +777,7 @@ static void asmparser_srcreg_vs_1(struct asm_parser *This,
asmparser_message
(
This
,
"Line %u: Source register %s not supported in VS 1
\n
"
,
This
->
line_no
,
debug_print_srcreg
(
src
));
set_parse_status
(
Thi
s
,
PARSE_ERR
);
set_parse_status
(
&
This
->
statu
s
,
PARSE_ERR
);
}
check_legacy_srcmod
(
This
,
src
->
srcmod
);
check_abs_srcmod
(
This
,
src
->
srcmod
);
...
...
@@ -810,7 +810,7 @@ static void asmparser_srcreg_vs_2(struct asm_parser *This,
asmparser_message
(
This
,
"Line %u: Source register %s not supported in VS 2
\n
"
,
This
->
line_no
,
debug_print_srcreg
(
src
));
set_parse_status
(
Thi
s
,
PARSE_ERR
);
set_parse_status
(
&
This
->
statu
s
,
PARSE_ERR
);
}
check_loop_swizzle
(
This
,
src
);
check_legacy_srcmod
(
This
,
src
->
srcmod
);
...
...
@@ -841,7 +841,7 @@ static void asmparser_srcreg_vs_3(struct asm_parser *This,
asmparser_message
(
This
,
"Line %u: Source register %s not supported in VS 3.0
\n
"
,
This
->
line_no
,
debug_print_srcreg
(
src
));
set_parse_status
(
Thi
s
,
PARSE_ERR
);
set_parse_status
(
&
This
->
statu
s
,
PARSE_ERR
);
}
check_loop_swizzle
(
This
,
src
);
check_legacy_srcmod
(
This
,
src
->
srcmod
);
...
...
@@ -865,7 +865,7 @@ static void asmparser_srcreg_ps_1_0123(struct asm_parser *This,
asmparser_message
(
This
,
"Line %u: Source register %s not supported in <== PS 1.3
\n
"
,
This
->
line_no
,
debug_print_srcreg
(
src
));
set_parse_status
(
Thi
s
,
PARSE_ERR
);
set_parse_status
(
&
This
->
statu
s
,
PARSE_ERR
);
}
check_abs_srcmod
(
This
,
src
->
srcmod
);
reg
=
map_oldps_register
(
src
,
FALSE
);
...
...
@@ -889,7 +889,7 @@ static void asmparser_srcreg_ps_1_4(struct asm_parser *This,
asmparser_message
(
This
,
"Line %u: Source register %s not supported in PS 1.4
\n
"
,
This
->
line_no
,
debug_print_srcreg
(
src
));
set_parse_status
(
Thi
s
,
PARSE_ERR
);
set_parse_status
(
&
This
->
statu
s
,
PARSE_ERR
);
}
check_abs_srcmod
(
This
,
src
->
srcmod
);
reg
=
map_oldps_register
(
src
,
TRUE
);
...
...
@@ -918,7 +918,7 @@ static void asmparser_srcreg_ps_2(struct asm_parser *This,
asmparser_message
(
This
,
"Line %u: Source register %s not supported in PS 2.0
\n
"
,
This
->
line_no
,
debug_print_srcreg
(
src
));
set_parse_status
(
Thi
s
,
PARSE_ERR
);
set_parse_status
(
&
This
->
statu
s
,
PARSE_ERR
);
}
check_legacy_srcmod
(
This
,
src
->
srcmod
);
check_abs_srcmod
(
This
,
src
->
srcmod
);
...
...
@@ -950,7 +950,7 @@ static void asmparser_srcreg_ps_2_x(struct asm_parser *This,
asmparser_message
(
This
,
"Line %u: Source register %s not supported in PS 2.x
\n
"
,
This
->
line_no
,
debug_print_srcreg
(
src
));
set_parse_status
(
Thi
s
,
PARSE_ERR
);
set_parse_status
(
&
This
->
statu
s
,
PARSE_ERR
);
}
check_legacy_srcmod
(
This
,
src
->
srcmod
);
check_abs_srcmod
(
This
,
src
->
srcmod
);
...
...
@@ -981,7 +981,7 @@ static void asmparser_srcreg_ps_3(struct asm_parser *This,
asmparser_message
(
This
,
"Line %u: Source register %s not supported in PS 3.0
\n
"
,
This
->
line_no
,
debug_print_srcreg
(
src
));
set_parse_status
(
Thi
s
,
PARSE_ERR
);
set_parse_status
(
&
This
->
statu
s
,
PARSE_ERR
);
}
check_loop_swizzle
(
This
,
src
);
check_legacy_srcmod
(
This
,
src
->
srcmod
);
...
...
@@ -997,7 +997,7 @@ static void asmparser_dstreg_vs_1(struct asm_parser *This,
asmparser_message
(
This
,
"Line %u: Destination register %s not supported in VS 1
\n
"
,
This
->
line_no
,
debug_print_dstreg
(
dst
));
set_parse_status
(
Thi
s
,
PARSE_ERR
);
set_parse_status
(
&
This
->
statu
s
,
PARSE_ERR
);
}
check_ps_dstmod
(
This
,
instr
->
dstmod
);
check_shift_dstmod
(
This
,
instr
->
shift
);
...
...
@@ -1015,7 +1015,7 @@ static void asmparser_dstreg_vs_2(struct asm_parser *This,
asmparser_message
(
This
,
"Line %u: Destination register %s not supported in VS 2.0
\n
"
,
This
->
line_no
,
debug_print_dstreg
(
dst
));
set_parse_status
(
Thi
s
,
PARSE_ERR
);
set_parse_status
(
&
This
->
statu
s
,
PARSE_ERR
);
}
check_ps_dstmod
(
This
,
instr
->
dstmod
);
check_shift_dstmod
(
This
,
instr
->
shift
);
...
...
@@ -1031,7 +1031,7 @@ static void asmparser_dstreg_vs_3(struct asm_parser *This,
asmparser_message
(
This
,
"Line %u: Destination register %s not supported in VS 3.0
\n
"
,
This
->
line_no
,
debug_print_dstreg
(
dst
));
set_parse_status
(
Thi
s
,
PARSE_ERR
);
set_parse_status
(
&
This
->
statu
s
,
PARSE_ERR
);
}
check_ps_dstmod
(
This
,
instr
->
dstmod
);
check_shift_dstmod
(
This
,
instr
->
shift
);
...
...
@@ -1048,7 +1048,7 @@ static void asmparser_dstreg_ps_1_0123(struct asm_parser *This,
asmparser_message
(
This
,
"Line %u: Destination register %s not supported in PS 1
\n
"
,
This
->
line_no
,
debug_print_dstreg
(
dst
));
set_parse_status
(
Thi
s
,
PARSE_ERR
);
set_parse_status
(
&
This
->
statu
s
,
PARSE_ERR
);
}
reg
=
map_oldps_register
(
dst
,
FALSE
);
memcpy
(
&
instr
->
dst
,
&
reg
,
sizeof
(
reg
));
...
...
@@ -1064,7 +1064,7 @@ static void asmparser_dstreg_ps_1_4(struct asm_parser *This,
asmparser_message
(
This
,
"Line %u: Destination register %s not supported in PS 1
\n
"
,
This
->
line_no
,
debug_print_dstreg
(
dst
));
set_parse_status
(
Thi
s
,
PARSE_ERR
);
set_parse_status
(
&
This
->
statu
s
,
PARSE_ERR
);
}
reg
=
map_oldps_register
(
dst
,
TRUE
);
memcpy
(
&
instr
->
dst
,
&
reg
,
sizeof
(
reg
));
...
...
@@ -1080,7 +1080,7 @@ static void asmparser_dstreg_ps_2(struct asm_parser *This,
asmparser_message
(
This
,
"Line %u: Destination register %s not supported in PS 2.0
\n
"
,
This
->
line_no
,
debug_print_dstreg
(
dst
));
set_parse_status
(
Thi
s
,
PARSE_ERR
);
set_parse_status
(
&
This
->
statu
s
,
PARSE_ERR
);
}
check_shift_dstmod
(
This
,
instr
->
shift
);
reg
=
map_oldps_register
(
dst
,
TRUE
);
...
...
@@ -1097,7 +1097,7 @@ static void asmparser_dstreg_ps_2_x(struct asm_parser *This,
asmparser_message
(
This
,
"Line %u: Destination register %s not supported in PS 2.x
\n
"
,
This
->
line_no
,
debug_print_dstreg
(
dst
));
set_parse_status
(
Thi
s
,
PARSE_ERR
);
set_parse_status
(
&
This
->
statu
s
,
PARSE_ERR
);
}
check_shift_dstmod
(
This
,
instr
->
shift
);
reg
=
map_oldps_register
(
dst
,
TRUE
);
...
...
@@ -1112,7 +1112,7 @@ static void asmparser_dstreg_ps_3(struct asm_parser *This,
asmparser_message
(
This
,
"Line %u: Destination register %s not supported in PS 3.0
\n
"
,
This
->
line_no
,
debug_print_dstreg
(
dst
));
set_parse_status
(
Thi
s
,
PARSE_ERR
);
set_parse_status
(
&
This
->
statu
s
,
PARSE_ERR
);
}
check_shift_dstmod
(
This
,
instr
->
shift
);
memcpy
(
&
instr
->
dst
,
dst
,
sizeof
(
*
dst
));
...
...
@@ -1131,7 +1131,7 @@ static void asmparser_predicate_supported(struct asm_parser *This,
static
void
asmparser_predicate_unsupported
(
struct
asm_parser
*
This
,
const
struct
shader_reg
*
predicate
)
{
asmparser_message
(
This
,
"Line %u: Predicate not supported in < VS 2.0 or PS 2.x
\n
"
,
This
->
line_no
);
set_parse_status
(
Thi
s
,
PARSE_ERR
);
set_parse_status
(
&
This
->
statu
s
,
PARSE_ERR
);
}
static
void
asmparser_coissue_supported
(
struct
asm_parser
*
This
)
{
...
...
@@ -1139,14 +1139,14 @@ static void asmparser_coissue_supported(struct asm_parser *This) {
if
(
!
This
->
shader
)
return
;
if
(
This
->
shader
->
num_instrs
==
0
){
asmparser_message
(
This
,
"Line %u: Coissue flag on the first shader instruction
\n
"
,
This
->
line_no
);
set_parse_status
(
Thi
s
,
PARSE_ERR
);
set_parse_status
(
&
This
->
statu
s
,
PARSE_ERR
);
}
This
->
shader
->
instr
[
This
->
shader
->
num_instrs
-
1
]
->
coissue
=
TRUE
;
}
static
void
asmparser_coissue_unsupported
(
struct
asm_parser
*
This
)
{
asmparser_message
(
This
,
"Line %u: Coissue is only supported in pixel shaders versions <= 1.4
\n
"
,
This
->
line_no
);
set_parse_status
(
Thi
s
,
PARSE_ERR
);
set_parse_status
(
&
This
->
statu
s
,
PARSE_ERR
);
}
static
const
struct
asmparser_backend
parser_vs_1
=
{
...
...
@@ -1353,7 +1353,7 @@ void create_vs10_parser(struct asm_parser *ret) {
ret
->
shader
=
asm_alloc
(
sizeof
(
*
ret
->
shader
));
if
(
!
ret
->
shader
)
{
ERR
(
"Failed to allocate memory for the shader
\n
"
);
set_parse_status
(
ret
,
PARSE_ERR
);
set_parse_status
(
&
ret
->
status
,
PARSE_ERR
);
return
;
}
...
...
@@ -1369,7 +1369,7 @@ void create_vs11_parser(struct asm_parser *ret) {
ret
->
shader
=
asm_alloc
(
sizeof
(
*
ret
->
shader
));
if
(
!
ret
->
shader
)
{
ERR
(
"Failed to allocate memory for the shader
\n
"
);
set_parse_status
(
ret
,
PARSE_ERR
);
set_parse_status
(
&
ret
->
status
,
PARSE_ERR
);
return
;
}
...
...
@@ -1385,7 +1385,7 @@ void create_vs20_parser(struct asm_parser *ret) {
ret
->
shader
=
asm_alloc
(
sizeof
(
*
ret
->
shader
));
if
(
!
ret
->
shader
)
{
ERR
(
"Failed to allocate memory for the shader
\n
"
);
set_parse_status
(
ret
,
PARSE_ERR
);
set_parse_status
(
&
ret
->
status
,
PARSE_ERR
);
return
;
}
...
...
@@ -1401,7 +1401,7 @@ void create_vs2x_parser(struct asm_parser *ret) {
ret
->
shader
=
asm_alloc
(
sizeof
(
*
ret
->
shader
));
if
(
!
ret
->
shader
)
{
ERR
(
"Failed to allocate memory for the shader
\n
"
);
set_parse_status
(
ret
,
PARSE_ERR
);
set_parse_status
(
&
ret
->
status
,
PARSE_ERR
);
return
;
}
...
...
@@ -1417,7 +1417,7 @@ void create_vs30_parser(struct asm_parser *ret) {
ret
->
shader
=
asm_alloc
(
sizeof
(
*
ret
->
shader
));
if
(
!
ret
->
shader
)
{
ERR
(
"Failed to allocate memory for the shader
\n
"
);
set_parse_status
(
ret
,
PARSE_ERR
);
set_parse_status
(
&
ret
->
status
,
PARSE_ERR
);
return
;
}
...
...
@@ -1432,7 +1432,7 @@ void create_ps10_parser(struct asm_parser *ret) {
ret
->
shader
=
asm_alloc
(
sizeof
(
*
ret
->
shader
));
if
(
!
ret
->
shader
)
{
ERR
(
"Failed to allocate memory for the shader
\n
"
);
set_parse_status
(
ret
,
PARSE_ERR
);
set_parse_status
(
&
ret
->
status
,
PARSE_ERR
);
return
;
}
...
...
@@ -1448,7 +1448,7 @@ void create_ps11_parser(struct asm_parser *ret) {
ret
->
shader
=
asm_alloc
(
sizeof
(
*
ret
->
shader
));
if
(
!
ret
->
shader
)
{
ERR
(
"Failed to allocate memory for the shader
\n
"
);
set_parse_status
(
ret
,
PARSE_ERR
);
set_parse_status
(
&
ret
->
status
,
PARSE_ERR
);
return
;
}
...
...
@@ -1464,7 +1464,7 @@ void create_ps12_parser(struct asm_parser *ret) {
ret
->
shader
=
asm_alloc
(
sizeof
(
*
ret
->
shader
));
if
(
!
ret
->
shader
)
{
ERR
(
"Failed to allocate memory for the shader
\n
"
);
set_parse_status
(
ret
,
PARSE_ERR
);
set_parse_status
(
&
ret
->
status
,
PARSE_ERR
);
return
;
}
...
...
@@ -1480,7 +1480,7 @@ void create_ps13_parser(struct asm_parser *ret) {
ret
->
shader
=
asm_alloc
(
sizeof
(
*
ret
->
shader
));
if
(
!
ret
->
shader
)
{
ERR
(
"Failed to allocate memory for the shader
\n
"
);
set_parse_status
(
ret
,
PARSE_ERR
);
set_parse_status
(
&
ret
->
status
,
PARSE_ERR
);
return
;
}
...
...
@@ -1496,7 +1496,7 @@ void create_ps14_parser(struct asm_parser *ret) {
ret
->
shader
=
asm_alloc
(
sizeof
(
*
ret
->
shader
));
if
(
!
ret
->
shader
)
{
ERR
(
"Failed to allocate memory for the shader
\n
"
);
set_parse_status
(
ret
,
PARSE_ERR
);
set_parse_status
(
&
ret
->
status
,
PARSE_ERR
);
return
;
}
...
...
@@ -1512,7 +1512,7 @@ void create_ps20_parser(struct asm_parser *ret) {
ret
->
shader
=
asm_alloc
(
sizeof
(
*
ret
->
shader
));
if
(
!
ret
->
shader
)
{
ERR
(
"Failed to allocate memory for the shader
\n
"
);
set_parse_status
(
ret
,
PARSE_ERR
);
set_parse_status
(
&
ret
->
status
,
PARSE_ERR
);
return
;
}
...
...
@@ -1528,7 +1528,7 @@ void create_ps2x_parser(struct asm_parser *ret) {
ret
->
shader
=
asm_alloc
(
sizeof
(
*
ret
->
shader
));
if
(
!
ret
->
shader
)
{
ERR
(
"Failed to allocate memory for the shader
\n
"
);
set_parse_status
(
ret
,
PARSE_ERR
);
set_parse_status
(
&
ret
->
status
,
PARSE_ERR
);
return
;
}
...
...
@@ -1544,7 +1544,7 @@ void create_ps30_parser(struct asm_parser *ret) {
ret
->
shader
=
asm_alloc
(
sizeof
(
*
ret
->
shader
));
if
(
!
ret
->
shader
)
{
ERR
(
"Failed to allocate memory for the shader
\n
"
);
set_parse_status
(
ret
,
PARSE_ERR
);
set_parse_status
(
&
ret
->
status
,
PARSE_ERR
);
return
;
}
...
...
dlls/d3dcompiler_43/asmshader.l
View file @
555f6349
...
...
@@ -480,7 +480,7 @@ false {
{ANY} {
asmparser_message(&asm_ctx, "Line %u: Unexpected input %s\n", asm_ctx.line_no, yytext);
set_parse_status(&asm_ctx, PARSE_ERR);
set_parse_status(&asm_ctx
.status
, PARSE_ERR);
}
%%
...
...
dlls/d3dcompiler_43/asmshader.y
View file @
555f6349
/*
/*
* Direct3D shader assembler
*
* Copyright 2008 Stefan Dösinger
...
...
@@ -73,7 +73,7 @@ void asmparser_message(struct asm_parser *ctx, const char *fmt, ...) {
static void asmshader_error(char const *s) {
asmparser_message(&asm_ctx, "Line %u: Error \"%s\" from bison\n", asm_ctx.line_no, s);
set_parse_status(&asm_ctx, PARSE_ERR);
set_parse_status(&asm_ctx
.status
, PARSE_ERR);
}
static void set_rel_reg(struct shader_reg *reg, struct rel_reg *rel) {
...
...
@@ -623,13 +623,13 @@ instruction: INSTR_ADD omods dreg ',' sregs
if($3.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);
set_parse_status(&asm_ctx
.status,
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);
set_parse_status(&asm_ctx
.status,
PARSE_ERR);
}
ZeroMemory(®, sizeof(reg));
reg.type = $4.type;
...
...
@@ -646,13 +646,13 @@ instruction: INSTR_ADD omods dreg ',' sregs
if($3.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);
set_parse_status(&asm_ctx
.status,
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);
set_parse_status(&asm_ctx
.status,
PARSE_ERR);
}
ZeroMemory(®, sizeof(reg));
reg.type = $4.type;
...
...
@@ -669,12 +669,12 @@ instruction: INSTR_ADD omods dreg ',' sregs
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);
set_parse_status(&asm_ctx
.status,
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);
set_parse_status(&asm_ctx
.status,
PARSE_ERR);
}
ZeroMemory(®, sizeof(reg));
reg.type = $3.type;
...
...
@@ -691,12 +691,12 @@ instruction: INSTR_ADD omods dreg ',' sregs
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);
set_parse_status(&asm_ctx
.status,
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);
set_parse_status(&asm_ctx
.status,
PARSE_ERR);
}
ZeroMemory(®, sizeof(reg));
reg.type = $3.type;
...
...
@@ -712,7 +712,7 @@ instruction: INSTR_ADD omods dreg ',' sregs
if($3.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);
set_parse_status(&asm_ctx
.status,
PARSE_ERR);
}
asm_ctx.funcs->dcl_sampler(&asm_ctx, $2, $3.mod, $4, asm_ctx.line_no);
}
...
...
@@ -722,12 +722,12 @@ instruction: INSTR_ADD omods dreg ',' sregs
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);
set_parse_status(&asm_ctx
.status,
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);
set_parse_status(&asm_ctx
.status,
PARSE_ERR);
}
asm_ctx.funcs->dcl_sampler(&asm_ctx, BWRITERSTT_UNKNOWN, $2.mod, $3, asm_ctx.line_no);
}
...
...
@@ -736,14 +736,14 @@ instruction: INSTR_ADD omods dreg ',' sregs
TRACE("Error rule: sampler decl of input reg\n");
asmparser_message(&asm_ctx, "Line %u: Sampler declarations of input regs is not valid\n",
asm_ctx.line_no);
set_parse_status(&asm_ctx
,
PARSE_WARN);
set_parse_status(&asm_ctx
.status,
PARSE_WARN);
}
| INSTR_DCL sampdcl omods REG_OUTPUT
{
TRACE("Error rule: sampler decl of output reg\n");
asmparser_message(&asm_ctx, "Line %u: Sampler declarations of output regs is not valid\n",
asm_ctx.line_no);
set_parse_status(&asm_ctx
,
PARSE_WARN);
set_parse_status(&asm_ctx
.status,
PARSE_WARN);
}
| INSTR_DEF REG_CONSTFLOAT ',' IMMVAL ',' IMMVAL ',' IMMVAL ',' IMMVAL
{
...
...
@@ -1049,19 +1049,19 @@ dreg_name: REG_TEMP
{
asmparser_message(&asm_ctx, "Line %u: Register c%u is not a valid destination register\n",
asm_ctx.line_no, $1);
set_parse_status(&asm_ctx
,
PARSE_WARN);
set_parse_status(&asm_ctx
.status,
PARSE_WARN);
}
| REG_CONSTINT
{
asmparser_message(&asm_ctx, "Line %u: Register i%u is not a valid destination register\n",
asm_ctx.line_no, $1);
set_parse_status(&asm_ctx
,
PARSE_WARN);
set_parse_status(&asm_ctx
.status,
PARSE_WARN);
}
| REG_CONSTBOOL
{
asmparser_message(&asm_ctx, "Line %u: Register b%u is not a valid destination register\n",
asm_ctx.line_no, $1);
set_parse_status(&asm_ctx
,
PARSE_WARN);
set_parse_status(&asm_ctx
.status,
PARSE_WARN);
}
| REG_TEXTURE
{
...
...
@@ -1075,7 +1075,7 @@ dreg_name: REG_TEMP
{
asmparser_message(&asm_ctx, "Line %u: Register s%u is not a valid destination register\n",
asm_ctx.line_no, $1);
set_parse_status(&asm_ctx
,
PARSE_WARN);
set_parse_status(&asm_ctx
.status,
PARSE_WARN);
}
| REG_OPOS
{
...
...
@@ -1109,13 +1109,13 @@ dreg_name: REG_TEMP
{
asmparser_message(&asm_ctx, "Line %u: Register vPos is not a valid destination register\n",
asm_ctx.line_no);
set_parse_status(&asm_ctx
,
PARSE_WARN);
set_parse_status(&asm_ctx
.status,
PARSE_WARN);
}
| REG_VFACE
{
asmparser_message(&asm_ctx, "Line %u: Register vFace is not a valid destination register\n",
asm_ctx.line_no);
set_parse_status(&asm_ctx
,
PARSE_WARN);
set_parse_status(&asm_ctx
.status,
PARSE_WARN);
}
| REG_ADDRESS
{
...
...
@@ -1126,7 +1126,7 @@ dreg_name: REG_TEMP
{
asmparser_message(&asm_ctx, "Line %u: Register aL is not a valid destination register\n",
asm_ctx.line_no);
set_parse_status(&asm_ctx
,
PARSE_WARN);
set_parse_status(&asm_ctx
.status,
PARSE_WARN);
}
writemask: '.' wm_components
...
...
@@ -1134,7 +1134,7 @@ writemask: '.' wm_components
if($2.writemask == SWIZZLE_ERR) {
asmparser_message(&asm_ctx, "Line %u: Invalid writemask specified\n",
asm_ctx.line_no);
set_parse_status(&asm_ctx
,
PARSE_ERR);
set_parse_status(&asm_ctx
.status,
PARSE_ERR);
/* Provide a correct writemask to prevent following complaints */
$$ = BWRITERSP_WRITEMASK_ALL;
}
...
...
@@ -1175,7 +1175,7 @@ swizzle: /* empty */
if($2.swizzle == SWIZZLE_ERR) {
asmparser_message(&asm_ctx, "Line %u: Invalid swizzle\n",
asm_ctx.line_no);
set_parse_status(&asm_ctx
,
PARSE_ERR);
set_parse_status(&asm_ctx
.status,
PARSE_ERR);
/* Provide a correct swizzle to prevent following complaints */
$$ = BWRITERVS_NOSWIZZLE;
}
...
...
@@ -1221,7 +1221,7 @@ omods: /* Empty */
if($1.shift && $2.shift) {
asmparser_message(&asm_ctx, "Line %u: More than one shift flag\n",
asm_ctx.line_no);
set_parse_status(&asm_ctx
,
PARSE_ERR);
set_parse_status(&asm_ctx
.status,
PARSE_ERR);
$$.shift = $1.shift;
} else {
$$.shift = $1.shift | $2.shift;
...
...
@@ -1284,7 +1284,7 @@ sregs: sreg
if($$.count == MAX_SRC_REGS){
asmparser_message(&asm_ctx, "Line %u: Too many source registers in this instruction\n",
asm_ctx.line_no);
set_parse_status(&asm_ctx
,
PARSE_ERR);
set_parse_status(&asm_ctx
.status,
PARSE_ERR);
}
else
$$.reg[$$.count++] = $3;
...
...
@@ -1327,12 +1327,12 @@ sreg: sreg_name rel_reg swizzle
case BWRITERSPSM_DZ:
asmparser_message(&asm_ctx, "Line %u: Incompatible source modifiers: NEG and DZ\n",
asm_ctx.line_no);
set_parse_status(&asm_ctx
,
PARSE_ERR);
set_parse_status(&asm_ctx
.status,
PARSE_ERR);
break;
case BWRITERSPSM_DW:
asmparser_message(&asm_ctx, "Line %u: Incompatible source modifiers: NEG and DW\n",
asm_ctx.line_no);
set_parse_status(&asm_ctx
,
PARSE_ERR);
set_parse_status(&asm_ctx
.status,
PARSE_ERR);
break;
default:
FIXME("Unhandled combination of NEGATE and %u\n", $4);
...
...
@@ -1344,7 +1344,7 @@ sreg: sreg_name rel_reg swizzle
if($1.val != 1.0 || (!$1.integer)) {
asmparser_message(&asm_ctx, "Line %u: Only \"1 - reg\" is valid for D3DSPSM_COMP, "
"%g - reg found\n", asm_ctx.line_no, $1.val);
set_parse_status(&asm_ctx
,
PARSE_ERR);
set_parse_status(&asm_ctx
.status,
PARSE_ERR);
}
/* Complement - not compatible with other source modifiers */
$$.type = $3.type;
...
...
@@ -1359,12 +1359,12 @@ sreg: sreg_name rel_reg swizzle
if($1.val != 1.0 || (!$1.integer)) {
asmparser_message(&asm_ctx, "Line %u: Only \"1 - reg\" is valid for D3DSPSM_COMP\n",
asm_ctx.line_no);
set_parse_status(&asm_ctx
,
PARSE_ERR);
set_parse_status(&asm_ctx
.status,
PARSE_ERR);
} else {
asmparser_message(&asm_ctx, "Line %u: Incompatible source modifiers: D3DSPSM_COMP and %s\n",
asm_ctx.line_no,
debug_print_srcmod($5));
set_parse_status(&asm_ctx
,
PARSE_ERR);
set_parse_status(&asm_ctx
.status,
PARSE_ERR);
}
}
| SMOD_NOT sreg_name swizzle
...
...
@@ -1424,7 +1424,7 @@ immsum: IMMVAL
if(!$1.integer) {
asmparser_message(&asm_ctx, "Line %u: Unexpected float %f\n",
asm_ctx.line_no, $1.val);
set_parse_status(&asm_ctx
,
PARSE_ERR);
set_parse_status(&asm_ctx
.status,
PARSE_ERR);
}
$$.val = $1.val;
}
...
...
@@ -1433,7 +1433,7 @@ immsum: IMMVAL
if(!$3.integer) {
asmparser_message(&asm_ctx, "Line %u: Unexpected float %f\n",
asm_ctx.line_no, $3.val);
set_parse_status(&asm_ctx
,
PARSE_ERR);
set_parse_status(&asm_ctx
.status,
PARSE_ERR);
}
$$.val = $1.val + $3.val;
}
...
...
@@ -1480,7 +1480,7 @@ sreg_name: REG_TEMP
{
asmparser_message(&asm_ctx, "Line %u: Register o%u is not a valid source register\n",
asm_ctx.line_no, $1);
set_parse_status(&asm_ctx
,
PARSE_WARN);
set_parse_status(&asm_ctx
.status,
PARSE_WARN);
}
| REG_INPUT
{
...
...
@@ -1506,7 +1506,7 @@ sreg_name: REG_TEMP
{
asmparser_message(&asm_ctx, "Line %u: Register oT%u is not a valid source register\n",
asm_ctx.line_no, $1);
set_parse_status(&asm_ctx
,
PARSE_WARN);
set_parse_status(&asm_ctx
.status,
PARSE_WARN);
}
| REG_SAMPLER
{
...
...
@@ -1516,31 +1516,31 @@ sreg_name: REG_TEMP
{
asmparser_message(&asm_ctx, "Line %u: Register oPos is not a valid source register\n",
asm_ctx.line_no);
set_parse_status(&asm_ctx
,
PARSE_WARN);
set_parse_status(&asm_ctx
.status,
PARSE_WARN);
}
| REG_OFOG
{
asmparser_message(&asm_ctx, "Line %u: Register oFog is not a valid source register\n",
asm_ctx.line_no);
set_parse_status(&asm_ctx
,
PARSE_WARN);
set_parse_status(&asm_ctx
.status,
PARSE_WARN);
}
| REG_VERTEXCOLOR
{
asmparser_message(&asm_ctx, "Line %u: Register oD%u is not a valid source register\n",
asm_ctx.line_no, $1);
set_parse_status(&asm_ctx
,
PARSE_WARN);
set_parse_status(&asm_ctx
.status,
PARSE_WARN);
}
| REG_FRAGCOLOR
{
asmparser_message(&asm_ctx, "Line %u: Register oC%u is not a valid source register\n",
asm_ctx.line_no, $1);
set_parse_status(&asm_ctx
,
PARSE_WARN);
set_parse_status(&asm_ctx
.status,
PARSE_WARN);
}
| REG_FRAGDEPTH
{
asmparser_message(&asm_ctx, "Line %u: Register oDepth is not a valid source register\n",
asm_ctx.line_no);
set_parse_status(&asm_ctx, PARSE_WARN);
set_parse_status(&asm_ctx
.status
, PARSE_WARN);
}
| REG_PREDICATE
{
...
...
@@ -1704,12 +1704,6 @@ predicate: '(' REG_PREDICATE swizzle ')'
%%
/* New status is the worst between current status and parameter value */
void set_parse_status(struct asm_parser *ctx, enum parse_status status) {
if(status == PARSE_ERR) ctx->status = PARSE_ERR;
else if(status == PARSE_WARN && ctx->status == PARSE_SUCCESS) ctx->status = PARSE_WARN;
}
struct bwriter_shader *parse_asm_shader(char **messages) {
struct bwriter_shader *ret = NULL;
...
...
dlls/d3dcompiler_43/d3dcompiler_private.h
View file @
555f6349
...
...
@@ -209,6 +209,13 @@ BOOL record_sampler(struct bwriter_shader *shader, DWORD samptype, DWORD mod, DW
#define MESSAGEBUFFER_INITIAL_SIZE 256
enum
parse_status
{
PARSE_SUCCESS
=
0
,
PARSE_WARN
=
1
,
PARSE_ERR
=
2
};
struct
asm_parser
{
/* The function table of the parser implementation */
const
struct
asmparser_backend
*
funcs
;
...
...
@@ -217,11 +224,7 @@ struct asm_parser {
struct
bwriter_shader
*
shader
;
unsigned
int
m3x3pad_count
;
enum
parse_status
{
PARSE_SUCCESS
=
0
,
PARSE_WARN
=
1
,
PARSE_ERR
=
2
}
status
;
enum
parse_status
status
;
char
*
messages
;
unsigned
int
messagesize
;
unsigned
int
messagecapacity
;
...
...
@@ -253,7 +256,13 @@ struct bwriter_shader *parse_asm_shader(char **messages) DECLSPEC_HIDDEN;
#endif
void
asmparser_message
(
struct
asm_parser
*
ctx
,
const
char
*
fmt
,
...)
PRINTF_ATTR
(
2
,
3
)
DECLSPEC_HIDDEN
;
void
set_parse_status
(
struct
asm_parser
*
ctx
,
enum
parse_status
status
)
DECLSPEC_HIDDEN
;
static
inline
void
set_parse_status
(
enum
parse_status
*
current
,
enum
parse_status
update
)
{
if
(
update
==
PARSE_ERR
)
*
current
=
PARSE_ERR
;
else
if
(
update
==
PARSE_WARN
&&
*
current
==
PARSE_SUCCESS
)
*
current
=
PARSE_WARN
;
}
/* A reasonable value as initial size */
#define BYTECODEBUFFER_INITIAL_SIZE 32
...
...
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