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
382fa588
Commit
382fa588
authored
Apr 14, 2015
by
Stefan Dösinger
Committed by
Alexandre Julliard
Apr 15, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Handle color key dirtification in wined3d_cs_exec_set_texture.
parent
2b650fa6
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
34 additions
and
22 deletions
+34
-22
arb_program_shader.c
dlls/wined3d/arb_program_shader.c
+1
-0
ati_fragment_shader.c
dlls/wined3d/ati_fragment_shader.c
+1
-0
cs.c
dlls/wined3d/cs.c
+13
-0
glsl_shader.c
dlls/wined3d/glsl_shader.c
+7
-0
nvidia_texture_shader.c
dlls/wined3d/nvidia_texture_shader.c
+1
-0
state.c
dlls/wined3d/state.c
+3
-21
utils.c
dlls/wined3d/utils.c
+2
-0
wined3d_private.h
dlls/wined3d/wined3d_private.h
+6
-1
No files found.
dlls/wined3d/arb_program_shader.c
View file @
382fa588
...
...
@@ -6784,6 +6784,7 @@ static const struct StateEntryTemplate arbfp_fragmentstate_template[] =
{
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_COLOR_KEY
,
{
STATE_COLOR_KEY
,
state_nop
},
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 @
382fa588
...
...
@@ -1113,6 +1113,7 @@ static const struct StateEntryTemplate atifs_fragmentstate_template[] = {
{
STATE_RENDER
(
WINED3D_RS_FOGSTART
),
{
STATE_RENDER
(
WINED3D_RS_FOGSTART
),
state_fogstartend
},
WINED3D_GL_EXT_NONE
},
{
STATE_RENDER
(
WINED3D_RS_FOGEND
),
{
STATE_RENDER
(
WINED3D_RS_FOGSTART
),
NULL
},
WINED3D_GL_EXT_NONE
},
{
STATE_RENDER
(
WINED3D_RS_SRGBWRITEENABLE
),
{
STATE_RENDER
(
WINED3D_RS_SRGBWRITEENABLE
),
atifs_srgbwriteenable
},
WINED3D_GL_EXT_NONE
},
{
STATE_COLOR_KEY
,
{
STATE_COLOR_KEY
,
state_nop
},
WINED3D_GL_EXT_NONE
},
{
STATE_TEXTURESTAGE
(
0
,
WINED3D_TSS_COLOR_OP
),
{
STATE_SHADER
(
WINED3D_SHADER_TYPE_PIXEL
),
NULL
},
WINED3D_GL_EXT_NONE
},
{
STATE_TEXTURESTAGE
(
0
,
WINED3D_TSS_COLOR_ARG1
),
{
STATE_SHADER
(
WINED3D_SHADER_TYPE_PIXEL
),
NULL
},
WINED3D_GL_EXT_NONE
},
{
STATE_TEXTURESTAGE
(
0
,
WINED3D_TSS_COLOR_ARG2
),
{
STATE_SHADER
(
WINED3D_SHADER_TYPE_PIXEL
),
NULL
},
WINED3D_GL_EXT_NONE
},
...
...
dlls/wined3d/cs.c
View file @
382fa588
...
...
@@ -640,6 +640,7 @@ static void wined3d_cs_exec_set_texture(struct wined3d_cs *cs, const void *data)
const
struct
wined3d_d3d_info
*
d3d_info
=
&
cs
->
device
->
adapter
->
d3d_info
;
const
struct
wined3d_cs_set_texture
*
op
=
data
;
struct
wined3d_texture
*
prev
;
BOOL
old_use_color_key
=
FALSE
,
new_use_color_key
=
FALSE
;
prev
=
cs
->
state
.
textures
[
op
->
stage
];
cs
->
state
.
textures
[
op
->
stage
]
=
op
->
texture
;
...
...
@@ -665,6 +666,9 @@ static void wined3d_cs_exec_set_texture(struct wined3d_cs *cs, const void *data)
device_invalidate_state
(
cs
->
device
,
STATE_TEXTURESTAGE
(
op
->
stage
,
WINED3D_TSS_COLOR_OP
));
device_invalidate_state
(
cs
->
device
,
STATE_TEXTURESTAGE
(
op
->
stage
,
WINED3D_TSS_ALPHA_OP
));
}
if
(
!
op
->
stage
&&
op
->
texture
->
async
.
color_key_flags
&
WINED3D_CKEY_SRC_BLT
)
new_use_color_key
=
TRUE
;
}
if
(
prev
)
...
...
@@ -692,9 +696,18 @@ static void wined3d_cs_exec_set_texture(struct wined3d_cs *cs, const void *data)
device_invalidate_state
(
cs
->
device
,
STATE_TEXTURESTAGE
(
op
->
stage
,
WINED3D_TSS_COLOR_OP
));
device_invalidate_state
(
cs
->
device
,
STATE_TEXTURESTAGE
(
op
->
stage
,
WINED3D_TSS_ALPHA_OP
));
}
if
(
!
op
->
stage
&&
prev
->
async
.
color_key_flags
&
WINED3D_CKEY_SRC_BLT
)
old_use_color_key
=
TRUE
;
}
device_invalidate_state
(
cs
->
device
,
STATE_SAMPLER
(
op
->
stage
));
if
(
new_use_color_key
!=
old_use_color_key
)
device_invalidate_state
(
cs
->
device
,
STATE_RENDER
(
WINED3D_RS_COLORKEYENABLE
));
if
(
new_use_color_key
)
device_invalidate_state
(
cs
->
device
,
STATE_COLOR_KEY
);
}
void
wined3d_cs_emit_set_texture
(
struct
wined3d_cs
*
cs
,
UINT
stage
,
struct
wined3d_texture
*
texture
)
...
...
dlls/wined3d/glsl_shader.c
View file @
382fa588
...
...
@@ -7610,6 +7610,12 @@ static void glsl_fragment_pipe_alpha_test(struct wined3d_context *context,
}
}
static
void
glsl_fragment_pipe_color_key
(
struct
wined3d_context
*
context
,
const
struct
wined3d_state
*
state
,
DWORD
state_id
)
{
context
->
constant_update_mask
|=
WINED3D_SHADER_CONST_FFP_COLOR_KEY
;
}
static
const
struct
StateEntryTemplate
glsl_fragment_pipe_state_template
[]
=
{
{
STATE_VDECL
,
{
STATE_VDECL
,
glsl_fragment_pipe_vdecl
},
WINED3D_GL_EXT_NONE
},
...
...
@@ -7691,6 +7697,7 @@ static const struct StateEntryTemplate glsl_fragment_pipe_state_template[] =
{
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
),
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_COLOR_KEY
,
{
STATE_COLOR_KEY
,
glsl_fragment_pipe_color_key
},
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 @
382fa588
...
...
@@ -884,6 +884,7 @@ static const struct StateEntryTemplate nvrc_fragmentstate_template[] =
{
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_COLOR_KEY
,
{
STATE_COLOR_KEY
,
state_nop
},
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 @
382fa588
...
...
@@ -45,7 +45,7 @@ static void state_undefined(struct wined3d_context *context, const struct wined3
ERR
(
"Undefined state.
\n
"
);
}
static
void
state_nop
(
struct
wined3d_context
*
context
,
const
struct
wined3d_state
*
state
,
DWORD
state_id
)
void
state_nop
(
struct
wined3d_context
*
context
,
const
struct
wined3d_state
*
state
,
DWORD
state_id
)
{
TRACE
(
"%s: nop in current pipe config.
\n
"
,
debug_d3dstate
(
state_id
));
}
...
...
@@ -3741,32 +3741,12 @@ static void sampler(struct wined3d_context *context, const struct wined3d_state
gl_tex
->
base_level
=
base_level
;
}
if
(
!
use_ps
(
state
)
&&
sampler_idx
<
context
->
lowest_disabled_stage
)
{
if
(
state
->
render_states
[
WINED3D_RS_COLORKEYENABLE
]
&&
!
sampler_idx
)
{
/* If color keying is enabled update the alpha test, it
* depends on the existence of a color key in stage 0. */
context_apply_state
(
context
,
state
,
WINED3D_RS_COLORKEYENABLE
);
}
}
/* Trigger shader constant reloading (for NP2 texcoord fixup) */
if
(
!
(
texture
->
flags
&
WINED3D_TEXTURE_POW2_MAT_IDENT
))
context
->
constant_update_mask
|=
WINED3D_SHADER_CONST_PS_NP2_FIXUP
;
}
else
{
if
(
sampler_idx
<
context
->
lowest_disabled_stage
)
{
/* TODO: What should I do with pixel shaders here ??? */
if
(
state
->
render_states
[
WINED3D_RS_COLORKEYENABLE
]
&&
!
sampler_idx
)
{
/* If color keying is enabled update the alpha test, it
* depends on the existence of a color key in stage 0. */
context_apply_state
(
context
,
state
,
WINED3D_RS_COLORKEYENABLE
);
}
}
/* Otherwise tex_colorop disables the stage */
context_bind_texture
(
context
,
GL_NONE
,
0
);
}
}
...
...
@@ -5674,6 +5654,7 @@ static const struct StateEntryTemplate ffp_fragmentstate_template[] = {
{
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_COLOR_KEY
,
{
STATE_COLOR_KEY
,
state_nop
},
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
},
...
...
@@ -5951,6 +5932,7 @@ static void validate_state_table(struct StateEntry *state_table)
STATE_BASEVERTEXINDEX
,
STATE_FRAMEBUFFER
,
STATE_POINT_SIZE_ENABLE
,
STATE_COLOR_KEY
,
};
unsigned
int
i
,
current
;
...
...
dlls/wined3d/utils.c
View file @
382fa588
...
...
@@ -3001,6 +3001,8 @@ const char *debug_d3dstate(DWORD state)
return
"STATE_FRAMEBUFFER"
;
if
(
STATE_IS_POINT_SIZE_ENABLE
(
state
))
return
"STATE_POINT_SIZE_ENABLE"
;
if
(
STATE_IS_COLOR_KEY
(
state
))
return
"STATE_COLOR_KEY"
;
return
wine_dbg_sprintf
(
"UNKNOWN_STATE(%#x)"
,
state
);
}
...
...
dlls/wined3d/wined3d_private.h
View file @
382fa588
...
...
@@ -1068,7 +1068,10 @@ DWORD get_flexible_vertex_size(DWORD d3dvtVertexType) DECLSPEC_HIDDEN;
#define STATE_POINT_SIZE_ENABLE (STATE_FRAMEBUFFER + 1)
#define STATE_IS_POINT_SIZE_ENABLE(a) ((a) == STATE_POINT_SIZE_ENABLE)
#define STATE_HIGHEST (STATE_POINT_SIZE_ENABLE)
#define STATE_COLOR_KEY (STATE_POINT_SIZE_ENABLE + 1)
#define STATE_IS_COLOR_KEY(a) ((a) == STATE_COLOR_KEY)
#define STATE_HIGHEST (STATE_COLOR_KEY)
enum
fogsource
{
FOGSOURCE_FFP
,
...
...
@@ -2826,6 +2829,8 @@ void state_fogstartend(struct wined3d_context *context,
const
struct
wined3d_state
*
state
,
DWORD
state_id
)
DECLSPEC_HIDDEN
;
void
state_fog_fragpart
(
struct
wined3d_context
*
context
,
const
struct
wined3d_state
*
state
,
DWORD
state_id
)
DECLSPEC_HIDDEN
;
void
state_nop
(
struct
wined3d_context
*
context
,
const
struct
wined3d_state
*
state
,
DWORD
state_id
)
DECLSPEC_HIDDEN
;
void
state_srgbwrite
(
struct
wined3d_context
*
context
,
const
struct
wined3d_state
*
state
,
DWORD
state_id
)
DECLSPEC_HIDDEN
;
...
...
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