Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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-winehq
Commits
7252b4d3
Commit
7252b4d3
authored
Jan 15, 2007
by
H. Verbeet
Committed by
Alexandre Julliard
Jan 16, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Give WINED3DSIO_CRS its own function, properly take the write mask into account.
parent
b557a802
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
18 additions
and
3 deletions
+18
-3
glsl_shader.c
dlls/wined3d/glsl_shader.c
+15
-1
pixelshader.c
dlls/wined3d/pixelshader.c
+1
-1
vertexshader.c
dlls/wined3d/vertexshader.c
+1
-1
wined3d_private.h
dlls/wined3d/wined3d_private.h
+1
-0
No files found.
dlls/wined3d/glsl_shader.c
View file @
7252b4d3
...
...
@@ -1003,6 +1003,21 @@ void shader_glsl_dot(SHADER_OPCODE_ARG* arg) {
tmpDest
,
cast
,
src0_str
,
cast
,
src1_str
,
dst_mask
);
}
/* Note that this instruction has some restrictions. The destination write mask
* can't contain the w component, and the source swizzles have to be .xyzw */
void
shader_glsl_cross
(
SHADER_OPCODE_ARG
*
arg
)
{
char
src0_reg
[
50
],
src0_mask
[
6
],
src0_str
[
100
];
char
src1_reg
[
50
],
src1_mask
[
6
],
src1_str
[
100
];
DWORD
src_mask
=
WINED3DSP_WRITEMASK_0
|
WINED3DSP_WRITEMASK_1
|
WINED3DSP_WRITEMASK_2
;
char
dst_mask
[
6
];
shader_glsl_get_write_mask
(
arg
->
dst
,
dst_mask
);
shader_glsl_append_dst
(
arg
->
buffer
,
arg
);
shader_glsl_add_src_param
(
arg
,
arg
->
src
[
0
],
arg
->
src_addr
[
0
],
src_mask
,
src0_reg
,
src0_mask
,
src0_str
);
shader_glsl_add_src_param
(
arg
,
arg
->
src
[
1
],
arg
->
src_addr
[
1
],
src_mask
,
src1_reg
,
src1_mask
,
src1_str
);
shader_addline
(
arg
->
buffer
,
"cross(%s, %s).%s);
\n
"
,
src0_str
,
src1_str
,
dst_mask
);
}
/* Map the opcode 1-to-1 to the GL code (arg->dst = instruction(src0, src1, ...) */
void
shader_glsl_map2gl
(
SHADER_OPCODE_ARG
*
arg
)
{
...
...
@@ -1027,7 +1042,6 @@ void shader_glsl_map2gl(SHADER_OPCODE_ARG* arg) {
case
WINED3DSIO_ABS
:
strcat
(
tmpLine
,
"abs"
);
break
;
case
WINED3DSIO_FRC
:
strcat
(
tmpLine
,
"fract"
);
break
;
case
WINED3DSIO_POW
:
strcat
(
tmpLine
,
"pow"
);
break
;
case
WINED3DSIO_CRS
:
strcat
(
tmpLine
,
"cross"
);
break
;
case
WINED3DSIO_NRM
:
strcat
(
tmpLine
,
"normalize"
);
break
;
case
WINED3DSIO_LOGP
:
case
WINED3DSIO_LOG
:
strcat
(
tmpLine
,
"log2"
);
break
;
...
...
dlls/wined3d/pixelshader.c
View file @
7252b4d3
...
...
@@ -646,7 +646,7 @@ CONST SHADER_OPCODE IWineD3DPixelShaderImpl_shader_ins[] = {
{
WINED3DSIO_CND
,
"cnd"
,
NULL
,
1
,
4
,
pshader_cnd
,
pshader_hw_cnd
,
shader_glsl_cnd
,
WINED3DPS_VERSION
(
1
,
1
),
WINED3DPS_VERSION
(
1
,
4
)},
{
WINED3DSIO_CMP
,
"cmp"
,
NULL
,
1
,
4
,
pshader_cmp
,
pshader_hw_cmp
,
shader_glsl_cmp
,
WINED3DPS_VERSION
(
1
,
2
),
WINED3DPS_VERSION
(
3
,
0
)},
{
WINED3DSIO_POW
,
"pow"
,
"POW"
,
1
,
3
,
pshader_pow
,
NULL
,
shader_glsl_map2gl
,
0
,
0
},
{
WINED3DSIO_CRS
,
"crs"
,
"XPS"
,
1
,
3
,
pshader_crs
,
NULL
,
shader_glsl_
map2gl
,
0
,
0
},
{
WINED3DSIO_CRS
,
"crs"
,
"XPS"
,
1
,
3
,
pshader_crs
,
NULL
,
shader_glsl_
cross
,
0
,
0
},
/* TODO: xyz normalise can be performed as VS_ARB using one temporary register,
DP3 tmp , vec, vec;
RSQ tmp, tmp.x;
...
...
dlls/wined3d/vertexshader.c
View file @
7252b4d3
...
...
@@ -501,7 +501,7 @@ CONST SHADER_OPCODE IWineD3DVertexShaderImpl_shader_ins[] = {
{
WINED3DSIO_LRP
,
"lrp"
,
"LRP"
,
1
,
4
,
vshader_lrp
,
NULL
,
shader_glsl_lrp
,
0
,
0
},
{
WINED3DSIO_FRC
,
"frc"
,
"FRC"
,
1
,
2
,
vshader_frc
,
vshader_hw_map2gl
,
shader_glsl_map2gl
,
0
,
0
},
{
WINED3DSIO_POW
,
"pow"
,
"POW"
,
1
,
3
,
vshader_pow
,
NULL
,
shader_glsl_map2gl
,
0
,
0
},
{
WINED3DSIO_CRS
,
"crs"
,
"XPS"
,
1
,
3
,
vshader_crs
,
NULL
,
shader_glsl_
map2gl
,
0
,
0
},
{
WINED3DSIO_CRS
,
"crs"
,
"XPS"
,
1
,
3
,
vshader_crs
,
NULL
,
shader_glsl_
cross
,
0
,
0
},
/* TODO: sng can possibly be performed a s
RCP tmp, vec
MUL out, tmp, vec*/
...
...
dlls/wined3d/wined3d_private.h
View file @
7252b4d3
...
...
@@ -1616,6 +1616,7 @@ extern void shader_glsl_load_constants(
char
useVertexShader
);
/** The following translate DirectX pixel/vertex shader opcodes to GLSL lines */
extern
void
shader_glsl_cross
(
SHADER_OPCODE_ARG
*
arg
);
extern
void
shader_glsl_map2gl
(
SHADER_OPCODE_ARG
*
arg
);
extern
void
shader_glsl_arith
(
SHADER_OPCODE_ARG
*
arg
);
extern
void
shader_glsl_mov
(
SHADER_OPCODE_ARG
*
arg
);
...
...
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