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
c3c57247
Commit
c3c57247
authored
May 11, 2007
by
H. Verbeet
Committed by
Alexandre Julliard
May 11, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: WINED3DSIO_POW should use the absolute value of the first source register.
parent
d74e643f
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
26 additions
and
3 deletions
+26
-3
glsl_shader.c
dlls/wined3d/glsl_shader.c
+23
-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 @
c3c57247
...
...
@@ -987,6 +987,29 @@ void shader_glsl_cross(SHADER_OPCODE_ARG *arg) {
shader_addline
(
arg
->
buffer
,
"cross(%s, %s).%s);
\n
"
,
src0_param
.
param_str
,
src1_param
.
param_str
,
dst_mask
);
}
/* Process the WINED3DSIO_POW instruction in GLSL (dst = |src0|^src1)
* Src0 and src1 are scalars. Note that D3D uses the absolute of src0, while
* GLSL uses the value as-is. */
void
shader_glsl_pow
(
SHADER_OPCODE_ARG
*
arg
)
{
SHADER_BUFFER
*
buffer
=
arg
->
buffer
;
glsl_src_param_t
src0_param
;
glsl_src_param_t
src1_param
;
DWORD
dst_write_mask
;
size_t
dst_size
;
dst_write_mask
=
shader_glsl_append_dst
(
buffer
,
arg
);
dst_size
=
shader_glsl_get_write_mask_size
(
dst_write_mask
);
shader_glsl_add_src_param
(
arg
,
arg
->
src
[
0
],
arg
->
src_addr
[
0
],
WINED3DSP_WRITEMASK_0
,
&
src0_param
);
shader_glsl_add_src_param
(
arg
,
arg
->
src
[
1
],
arg
->
src_addr
[
1
],
WINED3DSP_WRITEMASK_0
,
&
src1_param
);
if
(
dst_size
>
1
)
{
shader_addline
(
buffer
,
"vec%d(pow(abs(%s), %s)));
\n
"
,
dst_size
,
src0_param
.
param_str
,
src1_param
.
param_str
);
}
else
{
shader_addline
(
buffer
,
"pow(abs(%s), %s));
\n
"
,
src0_param
.
param_str
,
src1_param
.
param_str
);
}
}
/* Map the opcode 1-to-1 to the GL code (arg->dst = instruction(src0, src1, ...) */
void
shader_glsl_map2gl
(
SHADER_OPCODE_ARG
*
arg
)
{
CONST
SHADER_OPCODE
*
curOpcode
=
arg
->
opcode
;
...
...
@@ -1005,7 +1028,6 @@ void shader_glsl_map2gl(SHADER_OPCODE_ARG* arg) {
case
WINED3DSIO_RSQ
:
instruction
=
"inversesqrt"
;
break
;
case
WINED3DSIO_ABS
:
instruction
=
"abs"
;
break
;
case
WINED3DSIO_FRC
:
instruction
=
"fract"
;
break
;
case
WINED3DSIO_POW
:
instruction
=
"pow"
;
break
;
case
WINED3DSIO_NRM
:
instruction
=
"normalize"
;
break
;
case
WINED3DSIO_LOGP
:
case
WINED3DSIO_LOG
:
instruction
=
"log2"
;
break
;
...
...
dlls/wined3d/pixelshader.c
View file @
c3c57247
...
...
@@ -183,7 +183,7 @@ CONST SHADER_OPCODE IWineD3DPixelShaderImpl_shader_ins[] = {
{
WINED3DSIO_FRC
,
"frc"
,
"FRC"
,
1
,
2
,
pshader_hw_map2gl
,
shader_glsl_map2gl
,
0
,
0
},
{
WINED3DSIO_CND
,
"cnd"
,
NULL
,
1
,
4
,
pshader_hw_cnd
,
shader_glsl_cnd
,
WINED3DPS_VERSION
(
1
,
1
),
WINED3DPS_VERSION
(
1
,
4
)},
{
WINED3DSIO_CMP
,
"cmp"
,
NULL
,
1
,
4
,
pshader_hw_cmp
,
shader_glsl_cmp
,
WINED3DPS_VERSION
(
1
,
2
),
WINED3DPS_VERSION
(
3
,
0
)},
{
WINED3DSIO_POW
,
"pow"
,
"POW"
,
1
,
3
,
NULL
,
shader_glsl_
map2gl
,
0
,
0
},
{
WINED3DSIO_POW
,
"pow"
,
"POW"
,
1
,
3
,
NULL
,
shader_glsl_
pow
,
0
,
0
},
{
WINED3DSIO_CRS
,
"crs"
,
"XPS"
,
1
,
3
,
NULL
,
shader_glsl_cross
,
0
,
0
},
/* TODO: xyz normalise can be performed as VS_ARB using one temporary register,
DP3 tmp , vec, vec;
...
...
dlls/wined3d/vertexshader.c
View file @
c3c57247
...
...
@@ -108,7 +108,7 @@ CONST SHADER_OPCODE IWineD3DVertexShaderImpl_shader_ins[] = {
{
WINED3DSIO_DST
,
"dst"
,
"DST"
,
1
,
3
,
vshader_hw_map2gl
,
shader_glsl_dst
,
0
,
0
},
{
WINED3DSIO_LRP
,
"lrp"
,
"LRP"
,
1
,
4
,
NULL
,
shader_glsl_lrp
,
0
,
0
},
{
WINED3DSIO_FRC
,
"frc"
,
"FRC"
,
1
,
2
,
vshader_hw_map2gl
,
shader_glsl_map2gl
,
0
,
0
},
{
WINED3DSIO_POW
,
"pow"
,
"POW"
,
1
,
3
,
NULL
,
shader_glsl_
map2gl
,
0
,
0
},
{
WINED3DSIO_POW
,
"pow"
,
"POW"
,
1
,
3
,
NULL
,
shader_glsl_
pow
,
0
,
0
},
{
WINED3DSIO_CRS
,
"crs"
,
"XPS"
,
1
,
3
,
NULL
,
shader_glsl_cross
,
0
,
0
},
/* TODO: sng can possibly be performed a s
RCP tmp, vec
...
...
dlls/wined3d/wined3d_private.h
View file @
c3c57247
...
...
@@ -1725,6 +1725,7 @@ extern void shader_glsl_rep(SHADER_OPCODE_ARG* arg);
extern
void
shader_glsl_call
(
SHADER_OPCODE_ARG
*
arg
);
extern
void
shader_glsl_callnz
(
SHADER_OPCODE_ARG
*
arg
);
extern
void
shader_glsl_label
(
SHADER_OPCODE_ARG
*
arg
);
extern
void
shader_glsl_pow
(
SHADER_OPCODE_ARG
*
arg
);
/** GLSL Pixel Shader Prototypes */
extern
void
pshader_glsl_tex
(
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