Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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-winehq
Commits
5c7707dc
Commit
5c7707dc
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: Move alpha test states to the fragment pipeline.
This will allow some color keying cleanups. For Core Contexts we'll have to emulate alpha testing in shaders anyway.
parent
f4b68744
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
25 additions
and
7 deletions
+25
-7
arb_program_shader.c
dlls/wined3d/arb_program_shader.c
+4
-0
ati_fragment_shader.c
dlls/wined3d/ati_fragment_shader.c
+4
-0
glsl_shader.c
dlls/wined3d/glsl_shader.c
+4
-0
nvidia_texture_shader.c
dlls/wined3d/nvidia_texture_shader.c
+4
-0
state.c
dlls/wined3d/state.c
+7
-7
wined3d_private.h
dlls/wined3d/wined3d_private.h
+2
-0
No files found.
dlls/wined3d/arb_program_shader.c
View file @
5c7707dc
...
...
@@ -6780,6 +6780,10 @@ static const struct StateEntryTemplate arbfp_fragmentstate_template[] =
{
STATE_TEXTURESTAGE
(
7
,
WINED3D_TSS_BUMPENV_LSCALE
),
{
STATE_TEXTURESTAGE
(
7
,
WINED3D_TSS_BUMPENV_LSCALE
),
tex_bumpenvlum_arbfp
},
WINED3D_GL_EXT_NONE
},
{
STATE_TEXTURESTAGE
(
7
,
WINED3D_TSS_BUMPENV_LOFFSET
),
{
STATE_TEXTURESTAGE
(
7
,
WINED3D_TSS_BUMPENV_LSCALE
),
NULL
},
WINED3D_GL_EXT_NONE
},
{
STATE_SHADER
(
WINED3D_SHADER_TYPE_PIXEL
),
{
STATE_SHADER
(
WINED3D_SHADER_TYPE_PIXEL
),
fragment_prog_arbfp
},
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_FOGENABLE
),
{
STATE_RENDER
(
WINED3D_RS_FOGENABLE
),
state_arbfp_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/ati_fragment_shader.c
View file @
5c7707dc
...
...
@@ -1101,6 +1101,10 @@ static void atifs_srgbwriteenable(struct wined3d_context *context, const struct
static
const
struct
StateEntryTemplate
atifs_fragmentstate_template
[]
=
{
{
STATE_RENDER
(
WINED3D_RS_TEXTUREFACTOR
),
{
STATE_RENDER
(
WINED3D_RS_TEXTUREFACTOR
),
atifs_tfactor
},
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_FOGCOLOR
),
{
STATE_RENDER
(
WINED3D_RS_FOGCOLOR
),
state_fogcolor
},
WINED3D_GL_EXT_NONE
},
{
STATE_RENDER
(
WINED3D_RS_FOGDENSITY
),
{
STATE_RENDER
(
WINED3D_RS_FOGDENSITY
),
state_fogdensity
},
WINED3D_GL_EXT_NONE
},
{
STATE_RENDER
(
WINED3D_RS_FOGENABLE
),
{
STATE_RENDER
(
WINED3D_RS_FOGENABLE
),
state_fog_fragpart
},
WINED3D_GL_EXT_NONE
},
...
...
dlls/wined3d/glsl_shader.c
View file @
5c7707dc
...
...
@@ -7649,6 +7649,10 @@ static const struct StateEntryTemplate glsl_fragment_pipe_state_template[] =
{
STATE_TEXTURESTAGE
(
7
,
WINED3D_TSS_ALPHA_ARG0
),
{
STATE_SHADER
(
WINED3D_SHADER_TYPE_PIXEL
),
NULL
},
WINED3D_GL_EXT_NONE
},
{
STATE_TEXTURESTAGE
(
7
,
WINED3D_TSS_RESULT_ARG
),
{
STATE_SHADER
(
WINED3D_SHADER_TYPE_PIXEL
),
NULL
},
WINED3D_GL_EXT_NONE
},
{
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_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/nvidia_texture_shader.c
View file @
5c7707dc
...
...
@@ -880,6 +880,10 @@ static const struct StateEntryTemplate nvrc_fragmentstate_template[] =
{
STATE_SHADER
(
WINED3D_SHADER_TYPE_PIXEL
),
{
STATE_SHADER
(
WINED3D_SHADER_TYPE_PIXEL
),
apply_pixelshader
},
WINED3D_GL_EXT_NONE
},
{
STATE_RENDER
(
WINED3D_RS_SRGBWRITEENABLE
),
{
STATE_SHADER
(
WINED3D_SHADER_TYPE_PIXEL
),
NULL
},
WINED3D_GL_EXT_NONE
},
{
STATE_RENDER
(
WINED3D_RS_TEXTUREFACTOR
),
{
STATE_RENDER
(
WINED3D_RS_TEXTUREFACTOR
),
nvrc_texfactor
},
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_FOGCOLOR
),
{
STATE_RENDER
(
WINED3D_RS_FOGCOLOR
),
state_fogcolor
},
WINED3D_GL_EXT_NONE
},
{
STATE_RENDER
(
WINED3D_RS_FOGDENSITY
),
{
STATE_RENDER
(
WINED3D_RS_FOGDENSITY
),
state_fogdensity
},
WINED3D_GL_EXT_NONE
},
{
STATE_RENDER
(
WINED3D_RS_FOGENABLE
),
{
STATE_RENDER
(
WINED3D_RS_FOGENABLE
),
state_fog_fragpart
},
WINED3D_GL_EXT_NONE
},
...
...
dlls/wined3d/state.c
View file @
5c7707dc
...
...
@@ -505,7 +505,7 @@ static void state_blendfactor(struct wined3d_context *context, const struct wine
checkGLcall
(
"glBlendColor"
);
}
static
void
state_alpha
(
struct
wined3d_context
*
context
,
const
struct
wined3d_state
*
state
,
DWORD
state_id
)
void
state_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
=
0
;
...
...
@@ -3750,7 +3750,7 @@ static void sampler(struct wined3d_context *context, const struct wined3d_state
{
/* If color keying is enabled update the alpha test, it
* depends on the existence of a color key in stage 0. */
state_alpha
(
context
,
state
,
WINED3D_RS_COLORKEYENABLE
);
context_apply_state
(
context
,
state
,
WINED3D_RS_COLORKEYENABLE
);
}
}
...
...
@@ -3767,7 +3767,7 @@ static void sampler(struct wined3d_context *context, const struct wined3d_state
{
/* If color keying is enabled update the alpha test, it
* depends on the existence of a color key in stage 0. */
state_alpha
(
context
,
state
,
WINED3D_RS_COLORKEYENABLE
);
context_apply_state
(
context
,
state
,
WINED3D_RS_COLORKEYENABLE
);
}
}
/* Otherwise tex_colorop disables the stage */
context_bind_texture
(
context
,
GL_NONE
,
0
);
...
...
@@ -5085,10 +5085,6 @@ const struct StateEntryTemplate misc_state_template[] =
{
STATE_RENDER
(
WINED3D_RS_ROP2
),
{
STATE_RENDER
(
WINED3D_RS_ROP2
),
state_rop2
},
WINED3D_GL_EXT_NONE
},
{
STATE_RENDER
(
WINED3D_RS_PLANEMASK
),
{
STATE_RENDER
(
WINED3D_RS_PLANEMASK
),
state_planemask
},
WINED3D_GL_EXT_NONE
},
{
STATE_RENDER
(
WINED3D_RS_ZWRITEENABLE
),
{
STATE_RENDER
(
WINED3D_RS_ZWRITEENABLE
),
state_zwritenable
},
WINED3D_GL_EXT_NONE
},
{
STATE_RENDER
(
WINED3D_RS_ALPHATESTENABLE
),
{
STATE_RENDER
(
WINED3D_RS_ALPHATESTENABLE
),
state_alpha
},
WINED3D_GL_EXT_NONE
},
{
STATE_RENDER
(
WINED3D_RS_ALPHAREF
),
{
STATE_RENDER
(
WINED3D_RS_ALPHATESTENABLE
),
NULL
},
WINED3D_GL_EXT_NONE
},
{
STATE_RENDER
(
WINED3D_RS_ALPHAFUNC
),
{
STATE_RENDER
(
WINED3D_RS_ALPHATESTENABLE
),
NULL
},
WINED3D_GL_EXT_NONE
},
{
STATE_RENDER
(
WINED3D_RS_COLORKEYENABLE
),
{
STATE_RENDER
(
WINED3D_RS_ALPHATESTENABLE
),
NULL
},
WINED3D_GL_EXT_NONE
},
{
STATE_RENDER
(
WINED3D_RS_LASTPIXEL
),
{
STATE_RENDER
(
WINED3D_RS_LASTPIXEL
),
state_lastpixel
},
WINED3D_GL_EXT_NONE
},
{
STATE_RENDER
(
WINED3D_RS_CULLMODE
),
{
STATE_RENDER
(
WINED3D_RS_CULLMODE
),
state_cullmode
},
WINED3D_GL_EXT_NONE
},
{
STATE_RENDER
(
WINED3D_RS_ZFUNC
),
{
STATE_RENDER
(
WINED3D_RS_ZFUNC
),
state_zfunc
},
WINED3D_GL_EXT_NONE
},
...
...
@@ -5677,6 +5673,10 @@ static const struct StateEntryTemplate ffp_fragmentstate_template[] = {
{
STATE_TEXTURESTAGE
(
7
,
WINED3D_TSS_RESULT_ARG
),
{
STATE_TEXTURESTAGE
(
7
,
WINED3D_TSS_COLOR_OP
),
NULL
},
WINED3D_GL_EXT_NONE
},
{
STATE_TEXTURESTAGE
(
7
,
WINED3D_TSS_CONSTANT
),
{
0
/* As long as we don't support D3DTA_CONSTANT */
,
NULL
},
WINED3D_GL_EXT_NONE
},
{
STATE_SHADER
(
WINED3D_SHADER_TYPE_PIXEL
),
{
STATE_SHADER
(
WINED3D_SHADER_TYPE_PIXEL
),
apply_pixelshader
},
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_SRGBWRITEENABLE
),
{
STATE_SHADER
(
WINED3D_SHADER_TYPE_PIXEL
),
NULL
},
WINED3D_GL_EXT_NONE
},
{
STATE_RENDER
(
WINED3D_RS_TEXTUREFACTOR
),
{
STATE_RENDER
(
WINED3D_RS_TEXTUREFACTOR
),
state_texfactor
},
WINED3D_GL_EXT_NONE
},
{
STATE_RENDER
(
WINED3D_RS_FOGCOLOR
),
{
STATE_RENDER
(
WINED3D_RS_FOGCOLOR
),
state_fogcolor
},
WINED3D_GL_EXT_NONE
},
...
...
dlls/wined3d/wined3d_private.h
View file @
5c7707dc
...
...
@@ -2816,6 +2816,8 @@ void tex_alphaop(struct wined3d_context *context,
const
struct
wined3d_state
*
state
,
DWORD
state_id
)
DECLSPEC_HIDDEN
;
void
apply_pixelshader
(
struct
wined3d_context
*
context
,
const
struct
wined3d_state
*
state
,
DWORD
state_id
)
DECLSPEC_HIDDEN
;
void
state_alpha_test
(
struct
wined3d_context
*
context
,
const
struct
wined3d_state
*
state
,
DWORD
state_id
)
DECLSPEC_HIDDEN
;
void
state_fogcolor
(
struct
wined3d_context
*
context
,
const
struct
wined3d_state
*
state
,
DWORD
state_id
)
DECLSPEC_HIDDEN
;
void
state_fogdensity
(
struct
wined3d_context
*
context
,
...
...
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