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
4c5954ea
Commit
4c5954ea
authored
Jul 20, 2010
by
Matteo Bruni
Committed by
Alexandre Julliard
Jul 20, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3dx9: Add ps_1_x source register modifiers to the shader assembler.
parent
a46f80ac
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
127 additions
and
1 deletion
+127
-1
asmshader.l
dlls/d3dx9_36/asmshader.l
+6
-0
asmshader.y
dlls/d3dx9_36/asmshader.y
+67
-1
asmutils.c
dlls/d3dx9_36/asmutils.c
+54
-0
No files found.
dlls/d3dx9_36/asmshader.l
View file @
4c5954ea
...
...
@@ -275,6 +275,7 @@ ps_3_0 {return VER_PS30; }
}
/* Output modifiers */
\_x2 {return SHIFT_X2; }
\_sat {return MOD_SAT; }
\_pp {return MOD_PP; }
\_centroid {return MOD_CENTROID; }
...
...
@@ -309,6 +310,11 @@ false {
/* for relative addressing */
\[|\]|\+ {return yytext[0]; }
\_bias {return SMOD_BIAS; }
/* No _x2 here; it is identical to MOD_X2 */
\_bx2 {return SMOD_SCALEBIAS; }
\_dz {return SMOD_DZ; }
\_dw {return SMOD_DW; }
\_abs {return SMOD_ABS; }
! {return SMOD_NOT; }
...
...
dlls/d3dx9_36/asmshader.y
View file @
4c5954ea
...
...
@@ -198,6 +198,7 @@ void set_rel_reg(struct shader_reg *reg, struct rel_reg *rel) {
%token VER_PS30
/* Output modifiers */
%token SHIFT_X2
%token MOD_SAT
%token MOD_PP
%token MOD_CENTROID
...
...
@@ -211,6 +212,10 @@ void set_rel_reg(struct shader_reg *reg, struct rel_reg *rel) {
%token COMP_NE
/* Source register modifiers */
%token SMOD_BIAS
%token SMOD_SCALEBIAS
%token SMOD_DZ
%token SMOD_DW
%token SMOD_ABS
%token SMOD_NOT
...
...
@@ -1102,12 +1107,53 @@ sreg: sreg_name rel_reg swizzle
$$.regnum = $2.regnum;
set_rel_reg(&$$, &$3);
switch($4) {
case BWRITERSPSM_BIAS: $$.srcmod = BWRITERSPSM_BIASNEG; break;
case BWRITERSPSM_X2: $$.srcmod = BWRITERSPSM_X2NEG; break;
case BWRITERSPSM_SIGN: $$.srcmod = BWRITERSPSM_SIGNNEG; break;
case BWRITERSPSM_ABS: $$.srcmod = BWRITERSPSM_ABSNEG; break;
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);
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);
break;
default:
FIXME("Unhandled combination of NEGATE and %u\n", $4);
}
$$.swizzle = $5;
}
| IMMVAL '-' 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);
}
/* Complement - not compatible with other source modifiers */
$$.type = $3.type;
$$.regnum = $3.regnum;
$$.srcmod = BWRITERSPSM_COMP;
set_rel_reg(&$$, &$4);
$$.swizzle = $5;
}
| IMMVAL '-' sreg_name rel_reg smod swizzle
{
/* For nicer error reporting */
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);
} 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);
}
}
| SMOD_NOT sreg_name swizzle
{
$$.type = $2.type;
...
...
@@ -1179,7 +1225,27 @@ immsum: IMMVAL
$$.val = $1.val + $3.val;
}
smod: SMOD_ABS
smod: SMOD_BIAS
{
$$ = BWRITERSPSM_BIAS;
}
| SHIFT_X2
{
$$ = BWRITERSPSM_X2;
}
| SMOD_SCALEBIAS
{
$$ = BWRITERSPSM_SIGN;
}
| SMOD_DZ
{
$$ = BWRITERSPSM_DZ;
}
| SMOD_DW
{
$$ = BWRITERSPSM_DW;
}
| SMOD_ABS
{
$$ = BWRITERSPSM_ABS;
}
...
...
dlls/d3dx9_36/asmutils.c
View file @
4c5954ea
...
...
@@ -72,6 +72,15 @@ DWORD d3d9_srcmod(DWORD bwriter_srcmod) {
switch
(
bwriter_srcmod
)
{
case
BWRITERSPSM_NONE
:
return
D3DSPSM_NONE
;
case
BWRITERSPSM_NEG
:
return
D3DSPSM_NEG
;
case
BWRITERSPSM_BIAS
:
return
D3DSPSM_BIAS
;
case
BWRITERSPSM_BIASNEG
:
return
D3DSPSM_BIASNEG
;
case
BWRITERSPSM_SIGN
:
return
D3DSPSM_SIGN
;
case
BWRITERSPSM_SIGNNEG
:
return
D3DSPSM_SIGNNEG
;
case
BWRITERSPSM_COMP
:
return
D3DSPSM_COMP
;
case
BWRITERSPSM_X2
:
return
D3DSPSM_X2
;
case
BWRITERSPSM_X2NEG
:
return
D3DSPSM_X2NEG
;
case
BWRITERSPSM_DZ
:
return
D3DSPSM_DZ
;
case
BWRITERSPSM_DW
:
return
D3DSPSM_DW
;
case
BWRITERSPSM_ABS
:
return
D3DSPSM_ABS
;
case
BWRITERSPSM_ABSNEG
:
return
D3DSPSM_ABSNEG
;
case
BWRITERSPSM_NOT
:
return
D3DSPSM_NOT
;
...
...
@@ -222,6 +231,15 @@ DWORD d3d9_opcode(DWORD bwriter_opcode) {
const
char
*
debug_print_srcmod
(
DWORD
mod
)
{
switch
(
mod
)
{
case
BWRITERSPSM_NEG
:
return
"D3DSPSM_NEG"
;
case
BWRITERSPSM_BIAS
:
return
"D3DSPSM_BIAS"
;
case
BWRITERSPSM_BIASNEG
:
return
"D3DSPSM_BIASNEG"
;
case
BWRITERSPSM_SIGN
:
return
"D3DSPSM_SIGN"
;
case
BWRITERSPSM_SIGNNEG
:
return
"D3DSPSM_SIGNNEG"
;
case
BWRITERSPSM_COMP
:
return
"D3DSPSM_COMP"
;
case
BWRITERSPSM_X2
:
return
"D3DSPSM_X2"
;
case
BWRITERSPSM_X2NEG
:
return
"D3DSPSM_X2NEG"
;
case
BWRITERSPSM_DZ
:
return
"D3DSPSM_DZ"
;
case
BWRITERSPSM_DW
:
return
"D3DSPSM_DW"
;
case
BWRITERSPSM_ABS
:
return
"D3DSPSM_ABS"
;
case
BWRITERSPSM_ABSNEG
:
return
"D3DSPSM_ABSNEG"
;
case
BWRITERSPSM_NOT
:
return
"D3DSPSM_NOT"
;
...
...
@@ -389,6 +407,42 @@ const char *debug_print_srcreg(const struct shader_reg *reg) {
return
wine_dbg_sprintf
(
"-%s%s%s"
,
get_regname
(
reg
),
debug_print_relarg
(
reg
),
debug_print_swizzle
(
reg
->
swizzle
));
case
BWRITERSPSM_BIAS
:
return
wine_dbg_sprintf
(
"%s%s_bias%s"
,
get_regname
(
reg
),
debug_print_relarg
(
reg
),
debug_print_swizzle
(
reg
->
swizzle
));
case
BWRITERSPSM_BIASNEG
:
return
wine_dbg_sprintf
(
"-%s%s_bias%s"
,
get_regname
(
reg
),
debug_print_relarg
(
reg
),
debug_print_swizzle
(
reg
->
swizzle
));
case
BWRITERSPSM_SIGN
:
return
wine_dbg_sprintf
(
"%s%s_bx2%s"
,
get_regname
(
reg
),
debug_print_relarg
(
reg
),
debug_print_swizzle
(
reg
->
swizzle
));
case
BWRITERSPSM_SIGNNEG
:
return
wine_dbg_sprintf
(
"-%s%s_bx2%s"
,
get_regname
(
reg
),
debug_print_relarg
(
reg
),
debug_print_swizzle
(
reg
->
swizzle
));
case
BWRITERSPSM_COMP
:
return
wine_dbg_sprintf
(
"1 - %s%s%s"
,
get_regname
(
reg
),
debug_print_relarg
(
reg
),
debug_print_swizzle
(
reg
->
swizzle
));
case
BWRITERSPSM_X2
:
return
wine_dbg_sprintf
(
"%s%s_x2%s"
,
get_regname
(
reg
),
debug_print_relarg
(
reg
),
debug_print_swizzle
(
reg
->
swizzle
));
case
BWRITERSPSM_X2NEG
:
return
wine_dbg_sprintf
(
"-%s%s_x2%s"
,
get_regname
(
reg
),
debug_print_relarg
(
reg
),
debug_print_swizzle
(
reg
->
swizzle
));
case
BWRITERSPSM_DZ
:
return
wine_dbg_sprintf
(
"%s%s_dz%s"
,
get_regname
(
reg
),
debug_print_relarg
(
reg
),
debug_print_swizzle
(
reg
->
swizzle
));
case
BWRITERSPSM_DW
:
return
wine_dbg_sprintf
(
"%s%s_dw%s"
,
get_regname
(
reg
),
debug_print_relarg
(
reg
),
debug_print_swizzle
(
reg
->
swizzle
));
case
BWRITERSPSM_ABS
:
return
wine_dbg_sprintf
(
"%s%s_abs%s"
,
get_regname
(
reg
),
debug_print_relarg
(
reg
),
...
...
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