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
baf2f94b
Commit
baf2f94b
authored
Apr 22, 2009
by
Henri Verbeet
Committed by
Alexandre Julliard
Apr 22, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Get rid of the WINED3DVS_* swizzle constants.
They're redundant.
parent
629801bc
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
37 deletions
+14
-37
baseshader.c
dlls/wined3d/baseshader.c
+2
-1
glsl_shader.c
dlls/wined3d/glsl_shader.c
+12
-12
wined3d_private_types.h
dlls/wined3d/wined3d_private_types.h
+0
-24
No files found.
dlls/wined3d/baseshader.c
View file @
baf2f94b
...
...
@@ -789,7 +789,8 @@ static void shader_dump_param(const DWORD param, const DWORD addr_token, int inp
* swizzle bits fields:
* RRGGBBAA
*/
if
((
WINED3DVS_NOSWIZZLE
>>
WINED3DVS_SWIZZLE_SHIFT
)
!=
swizzle
)
{
if
((
WINED3DSP_NOSWIZZLE
>>
WINED3DSP_SWIZZLE_SHIFT
)
!=
swizzle
)
{
if
(
swizzle_x
==
swizzle_y
&&
swizzle_x
==
swizzle_z
&&
swizzle_x
==
swizzle_w
)
{
...
...
dlls/wined3d/glsl_shader.c
View file @
baf2f94b
...
...
@@ -2472,7 +2472,7 @@ static void pshader_glsl_tex(const struct wined3d_shader_instruction *ins)
shader_glsl_get_sample_function
(
sampler_type
,
sample_flags
,
&
sample_function
);
mask
|=
sample_function
.
coord_mask
;
if
(
shader_version
<
WINED3DPS_VERSION
(
2
,
0
))
swizzle
=
WINED3D
VS
_NOSWIZZLE
;
if
(
shader_version
<
WINED3DPS_VERSION
(
2
,
0
))
swizzle
=
WINED3D
SP
_NOSWIZZLE
;
else
swizzle
=
ins
->
src
[
1
].
swizzle
;
/* 1.0-1.3: Use destination register as coordinate source.
...
...
@@ -2602,17 +2602,17 @@ static void pshader_glsl_texdp3tex(const struct wined3d_shader_instruction *ins)
switch
(
mask_size
)
{
case
1
:
shader_glsl_gen_sample_code
(
ins
,
sampler_idx
,
&
sample_function
,
WINED3D
VS
_NOSWIZZLE
,
NULL
,
shader_glsl_gen_sample_code
(
ins
,
sampler_idx
,
&
sample_function
,
WINED3D
SP
_NOSWIZZLE
,
NULL
,
"dot(gl_TexCoord[%u].xyz, %s)"
,
sampler_idx
,
src0_param
.
param_str
);
break
;
case
2
:
shader_glsl_gen_sample_code
(
ins
,
sampler_idx
,
&
sample_function
,
WINED3D
VS
_NOSWIZZLE
,
NULL
,
shader_glsl_gen_sample_code
(
ins
,
sampler_idx
,
&
sample_function
,
WINED3D
SP
_NOSWIZZLE
,
NULL
,
"vec2(dot(gl_TexCoord[%u].xyz, %s), 0.0)"
,
sampler_idx
,
src0_param
.
param_str
);
break
;
case
3
:
shader_glsl_gen_sample_code
(
ins
,
sampler_idx
,
&
sample_function
,
WINED3D
VS
_NOSWIZZLE
,
NULL
,
shader_glsl_gen_sample_code
(
ins
,
sampler_idx
,
&
sample_function
,
WINED3D
SP
_NOSWIZZLE
,
NULL
,
"vec3(dot(gl_TexCoord[%u].xyz, %s), 0.0, 0.0)"
,
sampler_idx
,
src0_param
.
param_str
);
break
;
...
...
@@ -2722,7 +2722,7 @@ static void pshader_glsl_texm3x2tex(const struct wined3d_shader_instruction *ins
shader_glsl_get_sample_function
(
sampler_type
,
0
,
&
sample_function
);
/* Sample the texture using the calculated coordinates */
shader_glsl_gen_sample_code
(
ins
,
reg
,
&
sample_function
,
WINED3D
VS
_NOSWIZZLE
,
NULL
,
"tmp0.xy"
);
shader_glsl_gen_sample_code
(
ins
,
reg
,
&
sample_function
,
WINED3D
SP
_NOSWIZZLE
,
NULL
,
"tmp0.xy"
);
}
/** Process the WINED3DSIO_TEXM3X3TEX instruction in GLSL
...
...
@@ -2744,7 +2744,7 @@ static void pshader_glsl_texm3x3tex(const struct wined3d_shader_instruction *ins
shader_glsl_get_sample_function
(
sampler_type
,
0
,
&
sample_function
);
/* Sample the texture using the calculated coordinates */
shader_glsl_gen_sample_code
(
ins
,
reg
,
&
sample_function
,
WINED3D
VS
_NOSWIZZLE
,
NULL
,
"tmp0.xyz"
);
shader_glsl_gen_sample_code
(
ins
,
reg
,
&
sample_function
,
WINED3D
SP
_NOSWIZZLE
,
NULL
,
"tmp0.xyz"
);
current_state
->
current_row
=
0
;
}
...
...
@@ -2795,7 +2795,7 @@ static void pshader_glsl_texm3x3spec(const struct wined3d_shader_instruction *in
shader_glsl_get_sample_function
(
stype
,
0
,
&
sample_function
);
/* Sample the texture */
shader_glsl_gen_sample_code
(
ins
,
reg
,
&
sample_function
,
WINED3D
VS
_NOSWIZZLE
,
NULL
,
"tmp0.xyz"
);
shader_glsl_gen_sample_code
(
ins
,
reg
,
&
sample_function
,
WINED3D
SP
_NOSWIZZLE
,
NULL
,
"tmp0.xyz"
);
current_state
->
current_row
=
0
;
}
...
...
@@ -2827,7 +2827,7 @@ static void pshader_glsl_texm3x3vspec(const struct wined3d_shader_instruction *i
shader_glsl_get_sample_function
(
sampler_type
,
0
,
&
sample_function
);
/* Sample the texture using the calculated coordinates */
shader_glsl_gen_sample_code
(
ins
,
reg
,
&
sample_function
,
WINED3D
VS
_NOSWIZZLE
,
NULL
,
"tmp0.xyz"
);
shader_glsl_gen_sample_code
(
ins
,
reg
,
&
sample_function
,
WINED3D
SP
_NOSWIZZLE
,
NULL
,
"tmp0.xyz"
);
current_state
->
current_row
=
0
;
}
...
...
@@ -2877,7 +2877,7 @@ static void pshader_glsl_texbem(const struct wined3d_shader_instruction *ins)
shader_glsl_add_src_param
(
ins
,
&
ins
->
src
[
0
],
WINED3DSP_WRITEMASK_0
|
WINED3DSP_WRITEMASK_1
,
&
coord_param
);
shader_glsl_gen_sample_code
(
ins
,
sampler_idx
,
&
sample_function
,
WINED3D
VS
_NOSWIZZLE
,
NULL
,
shader_glsl_gen_sample_code
(
ins
,
sampler_idx
,
&
sample_function
,
WINED3D
SP
_NOSWIZZLE
,
NULL
,
"T%u%s + vec4(bumpenvmat%d * %s, 0.0, 0.0)%s"
,
sampler_idx
,
coord_mask
,
sampler_idx
,
coord_param
.
param_str
,
coord_mask
);
...
...
@@ -2920,7 +2920,7 @@ static void pshader_glsl_texreg2ar(const struct wined3d_shader_instruction *ins)
shader_glsl_add_src_param
(
ins
,
&
ins
->
src
[
0
],
WINED3DSP_WRITEMASK_ALL
,
&
src0_param
);
shader_glsl_get_sample_function
(
sampler_type
,
0
,
&
sample_function
);
shader_glsl_gen_sample_code
(
ins
,
sampler_idx
,
&
sample_function
,
WINED3D
VS
_NOSWIZZLE
,
NULL
,
shader_glsl_gen_sample_code
(
ins
,
sampler_idx
,
&
sample_function
,
WINED3D
SP
_NOSWIZZLE
,
NULL
,
"%s.wx"
,
src0_param
.
reg_name
);
}
...
...
@@ -2936,7 +2936,7 @@ static void pshader_glsl_texreg2gb(const struct wined3d_shader_instruction *ins)
shader_glsl_add_src_param
(
ins
,
&
ins
->
src
[
0
],
WINED3DSP_WRITEMASK_ALL
,
&
src0_param
);
shader_glsl_get_sample_function
(
sampler_type
,
0
,
&
sample_function
);
shader_glsl_gen_sample_code
(
ins
,
sampler_idx
,
&
sample_function
,
WINED3D
VS
_NOSWIZZLE
,
NULL
,
shader_glsl_gen_sample_code
(
ins
,
sampler_idx
,
&
sample_function
,
WINED3D
SP
_NOSWIZZLE
,
NULL
,
"%s.yz"
,
src0_param
.
reg_name
);
}
...
...
@@ -2953,7 +2953,7 @@ static void pshader_glsl_texreg2rgb(const struct wined3d_shader_instruction *ins
shader_glsl_get_sample_function
(
sampler_type
,
0
,
&
sample_function
);
shader_glsl_add_src_param
(
ins
,
&
ins
->
src
[
0
],
sample_function
.
coord_mask
,
&
src0_param
);
shader_glsl_gen_sample_code
(
ins
,
sampler_idx
,
&
sample_function
,
WINED3D
VS
_NOSWIZZLE
,
NULL
,
shader_glsl_gen_sample_code
(
ins
,
sampler_idx
,
&
sample_function
,
WINED3D
SP
_NOSWIZZLE
,
NULL
,
"%s"
,
src0_param
.
param_str
);
}
...
...
dlls/wined3d/wined3d_private_types.h
View file @
baf2f94b
...
...
@@ -98,33 +98,9 @@ typedef enum _WINED3DVS_RASTOUT_OFFSETS {
}
WINED3DVS_RASTOUT_OFFSETS
;
/** Source register modifiers **/
#define WINED3DVS_SWIZZLE_SHIFT 16
#define WINED3DVS_SWIZZLE_MASK (0xFF << WINED3DVS_SWIZZLE_SHIFT)
#define WINED3DSP_SWIZZLE_SHIFT 16
#define WINED3DSP_SWIZZLE_MASK (0xFF << WINED3DSP_SWIZZLE_SHIFT)
#define WINED3DVS_X_X (0 << WINED3DVS_SWIZZLE_SHIFT)
#define WINED3DVS_X_Y (1 << WINED3DVS_SWIZZLE_SHIFT)
#define WINED3DVS_X_Z (2 << WINED3DVS_SWIZZLE_SHIFT)
#define WINED3DVS_X_W (3 << WINED3DVS_SWIZZLE_SHIFT)
#define WINED3DVS_Y_X (0 << (WINED3DVS_SWIZZLE_SHIFT + 2))
#define WINED3DVS_Y_Y (1 << (WINED3DVS_SWIZZLE_SHIFT + 2))
#define WINED3DVS_Y_Z (2 << (WINED3DVS_SWIZZLE_SHIFT + 2))
#define WINED3DVS_Y_W (3 << (WINED3DVS_SWIZZLE_SHIFT + 2))
#define WINED3DVS_Z_X (0 << (WINED3DVS_SWIZZLE_SHIFT + 4))
#define WINED3DVS_Z_Y (1 << (WINED3DVS_SWIZZLE_SHIFT + 4))
#define WINED3DVS_Z_Z (2 << (WINED3DVS_SWIZZLE_SHIFT + 4))
#define WINED3DVS_Z_W (3 << (WINED3DVS_SWIZZLE_SHIFT + 4))
#define WINED3DVS_W_X (0 << (WINED3DVS_SWIZZLE_SHIFT + 6))
#define WINED3DVS_W_Y (1 << (WINED3DVS_SWIZZLE_SHIFT + 6))
#define WINED3DVS_W_Z (2 << (WINED3DVS_SWIZZLE_SHIFT + 6))
#define WINED3DVS_W_W (3 << (WINED3DVS_SWIZZLE_SHIFT + 6))
#define WINED3DVS_NOSWIZZLE (WINED3DVS_X_X | WINED3DVS_Y_Y | WINED3DVS_Z_Z | WINED3DVS_W_W)
#define WINED3DSP_NOSWIZZLE \
((0 << (WINED3DSP_SWIZZLE_SHIFT + 0)) | (1 << (WINED3DSP_SWIZZLE_SHIFT + 2)) | \
(2 << (WINED3DSP_SWIZZLE_SHIFT + 4)) | (3 << (WINED3DSP_SWIZZLE_SHIFT + 6)))
...
...
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