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
c5c71372
Commit
c5c71372
authored
Apr 09, 2015
by
Stefan Dösinger
Committed by
Alexandre Julliard
Apr 10, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Simplify alpha test and color keying in GLSL.
parent
5c7707dc
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
33 additions
and
5 deletions
+33
-5
glsl_shader.c
dlls/wined3d/glsl_shader.c
+33
-2
state.c
dlls/wined3d/state.c
+0
-3
No files found.
dlls/wined3d/glsl_shader.c
View file @
c5c71372
...
...
@@ -7572,6 +7572,37 @@ static void glsl_fragment_pipe_invalidate_constants(struct wined3d_context *cont
context
->
constant_update_mask
|=
WINED3D_SHADER_CONST_FFP_PS
;
}
static
void
glsl_fragment_pipe_alpha_test
(
struct
wined3d_context
*
context
,
const
struct
wined3d_state
*
state
,
DWORD
state_id
)
{
const
struct
wined3d_gl_info
*
gl_info
=
context
->
gl_info
;
int
glParm
;
float
ref
;
TRACE
(
"context %p, state %p, state_id %#x.
\n
"
,
context
,
state
,
state_id
);
if
(
state
->
render_states
[
WINED3D_RS_ALPHATESTENABLE
])
{
gl_info
->
gl_ops
.
gl
.
p_glEnable
(
GL_ALPHA_TEST
);
checkGLcall
(
"glEnable GL_ALPHA_TEST"
);
}
else
{
gl_info
->
gl_ops
.
gl
.
p_glDisable
(
GL_ALPHA_TEST
);
checkGLcall
(
"glDisable GL_ALPHA_TEST"
);
return
;
}
ref
=
((
float
)
state
->
render_states
[
WINED3D_RS_ALPHAREF
])
/
255
.
0
f
;
glParm
=
wined3d_gl_compare_func
(
state
->
render_states
[
WINED3D_RS_ALPHAFUNC
]);
if
(
glParm
)
{
gl_info
->
gl_ops
.
gl
.
p_glAlphaFunc
(
glParm
,
ref
);
checkGLcall
(
"glAlphaFunc"
);
}
}
static
const
struct
StateEntryTemplate
glsl_fragment_pipe_state_template
[]
=
{
{
STATE_VDECL
,
{
STATE_VDECL
,
glsl_fragment_pipe_vdecl
},
WINED3D_GL_EXT_NONE
},
...
...
@@ -7651,8 +7682,8 @@ static const struct StateEntryTemplate glsl_fragment_pipe_state_template[] =
{
STATE_SHADER
(
WINED3D_SHADER_TYPE_PIXEL
),
{
STATE_SHADER
(
WINED3D_SHADER_TYPE_PIXEL
),
glsl_fragment_pipe_shader
},
WINED3D_GL_EXT_NONE
},
{
STATE_RENDER
(
WINED3D_RS_ALPHAFUNC
),
{
STATE_RENDER
(
WINED3D_RS_ALPHATESTENABLE
),
NULL
},
WINED3D_GL_EXT_NONE
},
{
STATE_RENDER
(
WINED3D_RS_ALPHAREF
),
{
STATE_RENDER
(
WINED3D_RS_ALPHATESTENABLE
),
NULL
},
WINED3D_GL_EXT_NONE
},
{
STATE_RENDER
(
WINED3D_RS_ALPHATESTENABLE
),
{
STATE_RENDER
(
WINED3D_RS_ALPHATESTENABLE
),
state_alpha_test
},
WINED3D_GL_EXT_NONE
},
{
STATE_RENDER
(
WINED3D_RS_COLORKEYENABLE
),
{
STATE_
RENDER
(
WINED3D_RS_ALPHATESTENABLE
),
NULL
},
WINED3D_GL_EXT_NONE
},
{
STATE_RENDER
(
WINED3D_RS_ALPHATESTENABLE
),
{
STATE_RENDER
(
WINED3D_RS_ALPHATESTENABLE
),
glsl_fragment_pipe_alpha_test
},
WINED3D_GL_EXT_NONE
},
{
STATE_RENDER
(
WINED3D_RS_COLORKEYENABLE
),
{
STATE_
SHADER
(
WINED3D_SHADER_TYPE_PIXEL
),
NULL
},
WINED3D_GL_EXT_NONE
},
{
STATE_RENDER
(
WINED3D_RS_FOGENABLE
),
{
STATE_RENDER
(
WINED3D_RS_FOGENABLE
),
glsl_fragment_pipe_fog
},
WINED3D_GL_EXT_NONE
},
{
STATE_RENDER
(
WINED3D_RS_FOGTABLEMODE
),
{
STATE_RENDER
(
WINED3D_RS_FOGENABLE
),
NULL
},
WINED3D_GL_EXT_NONE
},
{
STATE_RENDER
(
WINED3D_RS_FOGVERTEXMODE
),
{
STATE_RENDER
(
WINED3D_RS_FOGENABLE
),
NULL
},
WINED3D_GL_EXT_NONE
},
...
...
dlls/wined3d/state.c
View file @
c5c71372
...
...
@@ -528,9 +528,6 @@ void state_alpha_test(struct wined3d_context *context, const struct wined3d_stat
context_apply_state
(
context
,
state
,
STATE_TEXTURESTAGE
(
0
,
WINED3D_TSS_ALPHA_OP
));
context
->
last_was_ckey
=
enable_ckey
;
if
(
context
->
d3d_info
->
shader_color_key
)
enable_ckey
=
FALSE
;
if
(
state
->
render_states
[
WINED3D_RS_ALPHATESTENABLE
]
||
(
state
->
render_states
[
WINED3D_RS_COLORKEYENABLE
]
&&
enable_ckey
))
{
...
...
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