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
06a4f978
Commit
06a4f978
authored
Mar 23, 2018
by
Henri Verbeet
Committed by
Alexandre Julliard
Mar 23, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Use upper-case enum elements in the projection_types enum.
Signed-off-by:
Henri Verbeet
<
hverbeet@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
9cdc8876
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
56 additions
and
42 deletions
+56
-42
arb_program_shader.c
dlls/wined3d/arb_program_shader.c
+33
-15
ati_fragment_shader.c
dlls/wined3d/ati_fragment_shader.c
+7
-11
glsl_shader.c
dlls/wined3d/glsl_shader.c
+7
-7
utils.c
dlls/wined3d/utils.c
+5
-5
wined3d_private.h
dlls/wined3d/wined3d_private.h
+4
-4
No files found.
dlls/wined3d/arb_program_shader.c
View file @
06a4f978
...
...
@@ -6379,12 +6379,17 @@ static GLuint gen_arbfp_ffp_shader(const struct ffp_frag_settings *settings, con
textype
=
arbfp_texture_target
(
settings
->
op
[
stage
].
tex_type
);
if
(
settings
->
op
[
stage
].
projected
==
proj_none
)
{
if
(
settings
->
op
[
stage
].
projected
==
WINED3D_PROJECTION_NONE
)
{
instr
=
"TEX"
;
}
else
if
(
settings
->
op
[
stage
].
projected
==
proj_count4
||
settings
->
op
[
stage
].
projected
==
proj_count3
)
{
}
else
if
(
settings
->
op
[
stage
].
projected
==
WINED3D_PROJECTION_COUNT4
||
settings
->
op
[
stage
].
projected
==
WINED3D_PROJECTION_COUNT3
)
{
instr
=
"TXP"
;
}
else
{
}
else
{
FIXME
(
"Unexpected projection mode %d
\n
"
,
settings
->
op
[
stage
].
projected
);
instr
=
"TXP"
;
}
...
...
@@ -6398,18 +6403,27 @@ static GLuint gen_arbfp_ffp_shader(const struct ffp_frag_settings *settings, con
shader_addline
(
&
buffer
,
"SWZ arg1, bumpmat%u, y, w, 0, 0;
\n
"
,
stage
-
1
);
shader_addline
(
&
buffer
,
"DP3 ret.y, arg1, tex%u;
\n
"
,
stage
-
1
);
/* with projective textures, texbem only divides the static texture coord, not the displacement,
* so multiply the displacement with the dividing parameter before passing it to TXP
*/
if
(
settings
->
op
[
stage
].
projected
!=
proj_none
)
{
if
(
settings
->
op
[
stage
].
projected
==
proj_count4
)
{
/* With projective textures, texbem only divides the static
* texture coordinate, not the displacement, so multiply the
* displacement with the dividing parameter before passing it to
* TXP. */
if
(
settings
->
op
[
stage
].
projected
!=
WINED3D_PROJECTION_NONE
)
{
if
(
settings
->
op
[
stage
].
projected
==
WINED3D_PROJECTION_COUNT4
)
{
shader_addline
(
&
buffer
,
"MOV ret.w, fragment.texcoord[%u].w;
\n
"
,
stage
);
shader_addline
(
&
buffer
,
"MUL ret.xyz, ret, fragment.texcoord[%u].w, fragment.texcoord[%u];
\n
"
,
stage
,
stage
);
}
else
{
shader_addline
(
&
buffer
,
"MUL ret.xyz, ret, fragment.texcoord[%u].w, fragment.texcoord[%u];
\n
"
,
stage
,
stage
);
}
else
{
shader_addline
(
&
buffer
,
"MOV ret.w, fragment.texcoord[%u].z;
\n
"
,
stage
);
shader_addline
(
&
buffer
,
"MAD ret.xyz, ret, fragment.texcoord[%u].z, fragment.texcoord[%u];
\n
"
,
stage
,
stage
);
shader_addline
(
&
buffer
,
"MAD ret.xyz, ret, fragment.texcoord[%u].z, fragment.texcoord[%u];
\n
"
,
stage
,
stage
);
}
}
else
{
}
else
{
shader_addline
(
&
buffer
,
"ADD ret, ret, fragment.texcoord[%u];
\n
"
,
stage
);
}
...
...
@@ -6421,12 +6435,16 @@ static GLuint gen_arbfp_ffp_shader(const struct ffp_frag_settings *settings, con
stage
-
1
,
stage
-
1
,
stage
-
1
);
shader_addline
(
&
buffer
,
"MUL tex%u, tex%u, ret.x;
\n
"
,
stage
,
stage
);
}
}
else
if
(
settings
->
op
[
stage
].
projected
==
proj_count3
)
{
}
else
if
(
settings
->
op
[
stage
].
projected
==
WINED3D_PROJECTION_COUNT3
)
{
shader_addline
(
&
buffer
,
"MOV ret, fragment.texcoord[%u];
\n
"
,
stage
);
shader_addline
(
&
buffer
,
"MOV ret.w, ret.z;
\n
"
);
shader_addline
(
&
buffer
,
"%s tex%u, ret, texture[%u], %s;
\n
"
,
instr
,
stage
,
stage
,
textype
);
}
else
{
}
else
{
shader_addline
(
&
buffer
,
"%s tex%u, fragment.texcoord[%u], texture[%u], %s;
\n
"
,
instr
,
stage
,
stage
,
stage
,
textype
);
}
...
...
dlls/wined3d/ati_fragment_shader.c
View file @
06a4f978
...
...
@@ -505,16 +505,13 @@ static GLuint gen_ati_shader(const struct texture_stage_op op[MAX_TEXTURES],
TRACE
(
"glSampleMapATI(GL_REG_%d_ATI, GL_TEXTURE_%d_ARB, GL_SWIZZLE_STR_ATI)
\n
"
,
stage
,
stage
);
GL_EXTCALL
(
glSampleMapATI
(
GL_REG_0_ATI
+
stage
,
GL_TEXTURE0_ARB
+
stage
,
GL_SWIZZLE_STR_ATI
));
if
(
op
[
stage
+
1
].
projected
==
proj_none
)
{
GL_EXTCALL
(
glSampleMapATI
(
GL_REG_0_ATI
+
stage
,
GL_TEXTURE0_ARB
+
stage
,
GL_SWIZZLE_STR_ATI
));
if
(
op
[
stage
+
1
].
projected
==
WINED3D_PROJECTION_NONE
)
swizzle
=
GL_SWIZZLE_STR_ATI
;
}
else
if
(
op
[
stage
+
1
].
projected
==
proj_count4
)
{
else
if
(
op
[
stage
+
1
].
projected
==
WINED3D_PROJECTION_COUNT4
)
swizzle
=
GL_SWIZZLE_STQ_DQ_ATI
;
}
else
{
else
swizzle
=
GL_SWIZZLE_STR_DR_ATI
;
}
TRACE
(
"glPassTexCoordATI(GL_REG_%d_ATI, GL_TEXTURE_%d_ARB, %s)
\n
"
,
stage
+
1
,
stage
+
1
,
debug_swizzle
(
swizzle
));
GL_EXTCALL
(
glPassTexCoordATI
(
GL_REG_0_ATI
+
stage
+
1
,
...
...
@@ -579,13 +576,12 @@ static GLuint gen_ati_shader(const struct texture_stage_op op[MAX_TEXTURES],
if
(
op
[
stage
].
cop
==
WINED3D_TOP_DISABLE
)
break
;
if
(
op
[
stage
].
projected
==
proj_none
)
{
if
(
op
[
stage
].
projected
==
WINED3D_PROJECTION_NONE
)
swizzle
=
GL_SWIZZLE_STR_ATI
;
}
else
if
(
op
[
stage
].
projected
==
proj_count3
)
{
else
if
(
op
[
stage
].
projected
==
WINED3D_PROJECTION_COUNT3
)
swizzle
=
GL_SWIZZLE_STR_DR_ATI
;
}
else
{
else
swizzle
=
GL_SWIZZLE_STQ_DQ_ATI
;
}
if
(
op_reads_texture
(
&
op
[
stage
]))
{
...
...
dlls/wined3d/glsl_shader.c
View file @
06a4f978
...
...
@@ -9495,12 +9495,12 @@ static GLuint shader_glsl_generate_ffp_fragment_shader(struct shader_glsl_priv *
if
(
!
(
tex_map
&
(
1u
<<
stage
)))
continue
;
if
(
settings
->
op
[
stage
].
projected
==
proj_none
)
if
(
settings
->
op
[
stage
].
projected
==
WINED3D_PROJECTION_NONE
)
{
proj
=
FALSE
;
}
else
if
(
settings
->
op
[
stage
].
projected
==
proj_count
4
||
settings
->
op
[
stage
].
projected
==
proj_count
3
)
else
if
(
settings
->
op
[
stage
].
projected
==
WINED3D_PROJECTION_COUNT
4
||
settings
->
op
[
stage
].
projected
==
WINED3D_PROJECTION_COUNT
3
)
{
proj
=
TRUE
;
}
...
...
@@ -9583,12 +9583,12 @@ static GLuint shader_glsl_generate_ffp_fragment_shader(struct shader_glsl_priv *
shader_addline
(
buffer
,
"ret.xy = bumpenv_mat%u * tex%u.xy;
\n
"
,
stage
-
1
,
stage
-
1
);
/* With projective textures, texbem only divides the static
* texture coord, not the displacement, so multiply the
* texture coord
inate
, not the displacement, so multiply the
* displacement with the dividing parameter before passing it to
* TXP. */
if
(
settings
->
op
[
stage
].
projected
!=
proj_none
)
if
(
settings
->
op
[
stage
].
projected
!=
WINED3D_PROJECTION_NONE
)
{
if
(
settings
->
op
[
stage
].
projected
==
proj_count
4
)
if
(
settings
->
op
[
stage
].
projected
==
WINED3D_PROJECTION_COUNT
4
)
{
shader_addline
(
buffer
,
"ret.xy = (ret.xy * ffp_texcoord[%u].w) + ffp_texcoord[%u].xy;
\n
"
,
stage
,
stage
);
...
...
@@ -9613,7 +9613,7 @@ static GLuint shader_glsl_generate_ffp_fragment_shader(struct shader_glsl_priv *
shader_addline
(
buffer
,
"tex%u *= clamp(tex%u.z * bumpenv_lum_scale%u + bumpenv_lum_offset%u, 0.0, 1.0);
\n
"
,
stage
,
stage
-
1
,
stage
-
1
,
stage
-
1
);
}
else
if
(
settings
->
op
[
stage
].
projected
==
proj_count
3
)
else
if
(
settings
->
op
[
stage
].
projected
==
WINED3D_PROJECTION_COUNT
3
)
{
shader_addline
(
buffer
,
"tex%u = %s(ps_sampler%u, ffp_texcoord[%u].xyz);
\n
"
,
stage
,
texture_function
,
stage
,
stage
);
...
...
dlls/wined3d/utils.c
View file @
06a4f978
...
...
@@ -5495,7 +5495,7 @@ void gen_ffp_frag_op(const struct wined3d_context *context, const struct wined3d
settings
->
op
[
i
].
color_fixup
=
COLOR_FIXUP_IDENTITY
;
settings
->
op
[
i
].
dst
=
resultreg
;
settings
->
op
[
i
].
tex_type
=
WINED3D_GL_RES_TYPE_TEX_1D
;
settings
->
op
[
i
].
projected
=
proj_none
;
settings
->
op
[
i
].
projected
=
WINED3D_PROJECTION_NONE
;
i
++
;
break
;
}
...
...
@@ -5619,15 +5619,15 @@ void gen_ffp_frag_op(const struct wined3d_context *context, const struct wined3d
{
ttff
=
state
->
texture_states
[
i
][
WINED3D_TSS_TEXTURE_TRANSFORM_FLAGS
];
if
(
ttff
==
(
WINED3D_TTFF_PROJECTED
|
WINED3D_TTFF_COUNT3
))
settings
->
op
[
i
].
projected
=
proj_count
3
;
settings
->
op
[
i
].
projected
=
WINED3D_PROJECTION_COUNT
3
;
else
if
(
ttff
&
WINED3D_TTFF_PROJECTED
)
settings
->
op
[
i
].
projected
=
proj_count
4
;
settings
->
op
[
i
].
projected
=
WINED3D_PROJECTION_COUNT
4
;
else
settings
->
op
[
i
].
projected
=
proj_none
;
settings
->
op
[
i
].
projected
=
WINED3D_PROJECTION_NONE
;
}
else
{
settings
->
op
[
i
].
projected
=
proj_none
;
settings
->
op
[
i
].
projected
=
WINED3D_PROJECTION_NONE
;
}
settings
->
op
[
i
].
cop
=
cop
;
...
...
dlls/wined3d/wined3d_private.h
View file @
06a4f978
...
...
@@ -2634,11 +2634,11 @@ BOOL wined3d_caps_gl_ctx_test_viewport_subpixel_bits(struct wined3d_caps_gl_ctx
void
install_gl_compat_wrapper
(
struct
wined3d_gl_info
*
gl_info
,
enum
wined3d_gl_extension
ext
)
DECLSPEC_HIDDEN
;
enum
projection_types
enum
wined3d_projection_type
{
proj_none
=
0
,
proj_count
3
=
1
,
proj_count
4
=
2
WINED3D_PROJECTION_NONE
=
0
,
WINED3D_PROJECTION_COUNT
3
=
1
,
WINED3D_PROJECTION_COUNT
4
=
2
};
enum
dst_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