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
20872abc
Commit
20872abc
authored
Sep 26, 2007
by
Stefan Dösinger
Committed by
Alexandre Julliard
Sep 27, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Add sincos support to arb shaders.
parent
daf2290e
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
29 additions
and
4 deletions
+29
-4
arb_program_shader.c
dlls/wined3d/arb_program_shader.c
+24
-0
pixelshader.c
dlls/wined3d/pixelshader.c
+2
-2
vertexshader.c
dlls/wined3d/vertexshader.c
+2
-2
wined3d_private.h
dlls/wined3d/wined3d_private.h
+1
-0
No files found.
dlls/wined3d/arb_program_shader.c
View file @
20872abc
...
...
@@ -1499,6 +1499,30 @@ void shader_hw_nrm(SHADER_OPCODE_ARG* arg) {
pshader_gen_output_modifier_line
(
buffer
,
FALSE
,
dst_wmask
,
shift
,
dst_name
);
}
void
shader_hw_sincos
(
SHADER_OPCODE_ARG
*
arg
)
{
/* This instruction exists in ARB, but the d3d instruction takes two extra parameters which
* must contain fixed constants. So we need a separate functin to filter those constants and
* can't use map2gl
*/
SHADER_BUFFER
*
buffer
=
arg
->
buffer
;
char
dst_name
[
50
];
char
src_name
[
50
];
char
dst_wmask
[
20
];
DWORD
shift
=
(
arg
->
dst
&
WINED3DSP_DSTSHIFT_MASK
)
>>
WINED3DSP_DSTSHIFT_SHIFT
;
BOOL
sat
=
(
arg
->
dst
&
WINED3DSP_DSTMOD_MASK
)
&
WINED3DSPDM_SATURATE
;
pshader_get_register_name
(
arg
->
dst
,
dst_name
);
shader_arb_get_write_mask
(
arg
,
arg
->
dst
,
dst_wmask
);
pshader_gen_input_modifier_line
(
buffer
,
arg
->
src
[
0
],
0
,
src_name
);
shader_addline
(
buffer
,
"SCS%s %s%s, %s;
\n
"
,
sat
?
"_SAT"
:
""
,
dst_name
,
dst_wmask
,
src_name
);
if
(
shift
!=
0
)
pshader_gen_output_modifier_line
(
buffer
,
FALSE
,
dst_wmask
,
shift
,
dst_name
);
}
/* TODO: merge with pixel shader */
/* Map the opcode 1-to-1 to the GL code */
void
vshader_hw_map2gl
(
SHADER_OPCODE_ARG
*
arg
)
{
...
...
dlls/wined3d/pixelshader.c
View file @
20872abc
...
...
@@ -178,8 +178,8 @@ CONST SHADER_OPCODE IWineD3DPixelShaderImpl_shader_ins[] = {
{
WINED3DSIO_POW
,
"pow"
,
"POW"
,
1
,
3
,
pshader_hw_map2gl
,
shader_glsl_pow
,
0
,
0
},
{
WINED3DSIO_CRS
,
"crs"
,
"XPD"
,
1
,
3
,
pshader_hw_map2gl
,
shader_glsl_cross
,
0
,
0
},
{
WINED3DSIO_NRM
,
"nrm"
,
NULL
,
1
,
2
,
shader_hw_nrm
,
shader_glsl_map2gl
,
0
,
0
},
{
WINED3DSIO_SINCOS
,
"sincos"
,
NULL
,
1
,
4
,
NULL
,
shader_glsl_sincos
,
WINED3DPS_VERSION
(
2
,
0
),
WINED3DPS_VERSION
(
2
,
1
)},
{
WINED3DSIO_SINCOS
,
"sincos"
,
NULL
,
1
,
2
,
NULL
,
shader_glsl_sincos
,
WINED3DPS_VERSION
(
3
,
0
),
-
1
},
{
WINED3DSIO_SINCOS
,
"sincos"
,
NULL
,
1
,
4
,
shader_hw_sincos
,
shader_glsl_sincos
,
WINED3DPS_VERSION
(
2
,
0
),
WINED3DPS_VERSION
(
2
,
1
)},
{
WINED3DSIO_SINCOS
,
"sincos"
,
"SCS"
,
1
,
2
,
shader_hw_sincos
,
shader_glsl_sincos
,
WINED3DPS_VERSION
(
3
,
0
),
-
1
},
{
WINED3DSIO_DP2ADD
,
"dp2add"
,
NULL
,
1
,
4
,
pshader_hw_dp2add
,
pshader_glsl_dp2add
,
WINED3DPS_VERSION
(
2
,
0
),
-
1
},
/* Matrix */
{
WINED3DSIO_M4x4
,
"m4x4"
,
"undefined"
,
1
,
3
,
NULL
,
shader_glsl_mnxn
,
0
,
0
},
...
...
dlls/wined3d/vertexshader.c
View file @
20872abc
...
...
@@ -115,8 +115,8 @@ CONST SHADER_OPCODE IWineD3DVertexShaderImpl_shader_ins[] = {
MUL out, tmp, vec*/
{
WINED3DSIO_SGN
,
"sgn"
,
NULL
,
1
,
2
,
NULL
,
shader_glsl_map2gl
,
0
,
0
},
{
WINED3DSIO_NRM
,
"nrm"
,
NULL
,
1
,
2
,
shader_hw_nrm
,
shader_glsl_map2gl
,
0
,
0
},
{
WINED3DSIO_SINCOS
,
"sincos"
,
NULL
,
1
,
4
,
NULL
,
shader_glsl_sincos
,
WINED3DVS_VERSION
(
2
,
0
),
WINED3DVS_VERSION
(
2
,
1
)},
{
WINED3DSIO_SINCOS
,
"sincos"
,
NULL
,
1
,
2
,
NULL
,
shader_glsl_sincos
,
WINED3DVS_VERSION
(
3
,
0
),
-
1
},
{
WINED3DSIO_SINCOS
,
"sincos"
,
NULL
,
1
,
4
,
shader_hw_sincos
,
shader_glsl_sincos
,
WINED3DVS_VERSION
(
2
,
0
),
WINED3DVS_VERSION
(
2
,
1
)},
{
WINED3DSIO_SINCOS
,
"sincos"
,
"SCS"
,
1
,
2
,
shader_hw_sincos
,
shader_glsl_sincos
,
WINED3DVS_VERSION
(
3
,
0
),
-
1
},
/* Matrix */
{
WINED3DSIO_M4x4
,
"m4x4"
,
"undefined"
,
1
,
3
,
vshader_hw_mnxn
,
shader_glsl_mnxn
,
0
,
0
},
{
WINED3DSIO_M4x3
,
"m4x3"
,
"undefined"
,
1
,
3
,
vshader_hw_mnxn
,
shader_glsl_mnxn
,
0
,
0
},
...
...
dlls/wined3d/wined3d_private.h
View file @
20872abc
...
...
@@ -1791,6 +1791,7 @@ extern void pshader_hw_dp2add(SHADER_OPCODE_ARG* arg);
/* ARB vertex / pixel shader common prototypes */
extern
void
shader_hw_nrm
(
SHADER_OPCODE_ARG
*
arg
);
extern
void
shader_hw_sincos
(
SHADER_OPCODE_ARG
*
arg
);
/* ARB vertex shader prototypes */
extern
void
vshader_hw_map2gl
(
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