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
b09b7e32
Commit
b09b7e32
authored
Jul 24, 2011
by
Henri Verbeet
Committed by
Alexandre Julliard
Jul 25, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Store a pointer to the state table in the context.
parent
68b90713
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
25 additions
and
22 deletions
+25
-22
arb_program_shader.c
dlls/wined3d/arb_program_shader.c
+3
-2
ati_fragment_shader.c
dlls/wined3d/ati_fragment_shader.c
+1
-1
context.c
dlls/wined3d/context.c
+15
-14
state.c
dlls/wined3d/state.c
+2
-2
wined3d_private.h
dlls/wined3d/wined3d_private.h
+4
-3
No files found.
dlls/wined3d/arb_program_shader.c
View file @
b09b7e32
...
...
@@ -6250,7 +6250,7 @@ static void fragment_prog_arbfp(struct wined3d_context *context, const struct wi
state_texfactor_arbfp
(
context
,
state
,
STATE_RENDER
(
WINED3DRS_TEXTUREFACTOR
));
state_arb_specularenable
(
context
,
state
,
STATE_RENDER
(
WINED3DRS_SPECULARENABLE
));
}
else
if
(
use_pshader
&&
!
isStateDirty
(
context
,
device
->
StateT
able
[
STATE_VSHADER
].
representative
))
else
if
(
use_pshader
&&
!
isStateDirty
(
context
,
context
->
state_t
able
[
STATE_VSHADER
].
representative
))
{
device
->
shader_backend
->
shader_select
(
context
,
use_pshader
,
use_vshader
);
}
...
...
@@ -6317,7 +6317,8 @@ static void fragment_prog_arbfp(struct wined3d_context *context, const struct wi
* Don't call shader_select if the vertex shader is dirty, because it will be called later on by the vertex
* shader handler
*/
if
(
!
isStateDirty
(
context
,
device
->
StateTable
[
STATE_VSHADER
].
representative
))
{
if
(
!
isStateDirty
(
context
,
context
->
state_table
[
STATE_VSHADER
].
representative
))
{
device
->
shader_backend
->
shader_select
(
context
,
use_pshader
,
use_vshader
);
if
(
!
isStateDirty
(
context
,
STATE_VERTEXSHADERCONSTANT
)
&&
(
use_vshader
||
use_pshader
))
...
...
dlls/wined3d/ati_fragment_shader.c
View file @
b09b7e32
...
...
@@ -906,7 +906,7 @@ static void atifs_apply_pixelshader(struct wined3d_context *context, const struc
* startup, and blitting disables all shaders and dirtifies all shader
* states. If atifs can deal with this it keeps the rest of the code
* simpler. */
if
(
!
isStateDirty
(
context
,
device
->
StateT
able
[
STATE_VSHADER
].
representative
))
if
(
!
isStateDirty
(
context
,
context
->
state_t
able
[
STATE_VSHADER
].
representative
))
{
device
->
shader_backend
->
shader_select
(
context
,
FALSE
,
use_vshader
);
...
...
dlls/wined3d/context.c
View file @
b09b7e32
...
...
@@ -1348,13 +1348,14 @@ struct wined3d_context *context_create(struct wined3d_swapchain *swapchain,
}
ret
->
gl_info
=
gl_info
;
ret
->
state_table
=
device
->
StateTable
;
/* Mark all states dirty to force a proper initialization of the states
* on the first use of the context. */
for
(
state
=
0
;
state
<=
STATE_HIGHEST
;
++
state
)
{
if
(
device
->
StateT
able
[
state
].
representative
)
context_invalidate_state
(
ret
,
state
,
device
->
StateT
able
);
if
(
ret
->
state_t
able
[
state
].
representative
)
context_invalidate_state
(
ret
,
state
,
ret
->
state_t
able
);
}
ret
->
swapchain
=
swapchain
;
...
...
@@ -1620,7 +1621,7 @@ static inline void set_blit_dimension(UINT width, UINT height) {
static
void
SetupForBlit
(
struct
wined3d_device
*
device
,
struct
wined3d_context
*
context
)
{
int
i
;
const
struct
StateEntry
*
StateTable
=
device
->
StateT
able
;
const
struct
StateEntry
*
StateTable
=
context
->
state_t
able
;
const
struct
wined3d_gl_info
*
gl_info
=
context
->
gl_info
;
UINT
width
=
context
->
current_rt
->
resource
.
width
;
UINT
height
=
context
->
current_rt
->
resource
.
height
;
...
...
@@ -1966,8 +1967,8 @@ static BOOL match_depth_stencil_format(const struct wined3d_format *existing,
}
/* The caller provides a context */
static
void
context_validate_onscreen_formats
(
struct
wined3d_
device
*
device
,
struct
wined3d_context
*
context
,
const
struct
wined3d_surface
*
depth_stencil
)
static
void
context_validate_onscreen_formats
(
struct
wined3d_
context
*
context
,
const
struct
wined3d_surface
*
depth_stencil
)
{
/* Onscreen surfaces are always in a swapchain */
struct
wined3d_swapchain
*
swapchain
=
context
->
current_rt
->
container
.
u
.
swapchain
;
...
...
@@ -1983,7 +1984,7 @@ static void context_validate_onscreen_formats(struct wined3d_device *device,
/* The currently active context is the necessary context to access the swapchain's onscreen buffers */
surface_load_location
(
context
->
current_rt
,
SFLAG_INTEXTURE
,
NULL
);
swapchain
->
render_to_fbo
=
TRUE
;
context_set_render_offscreen
(
context
,
device
->
StateT
able
,
TRUE
);
context_set_render_offscreen
(
context
,
context
->
state_t
able
,
TRUE
);
}
static
DWORD
context_generate_rt_mask_no_fbo
(
const
struct
wined3d_device
*
device
,
const
struct
wined3d_surface
*
rt
)
...
...
@@ -2003,7 +2004,7 @@ void context_apply_blit_state(struct wined3d_context *context, struct wined3d_de
if
(
wined3d_settings
.
offscreen_rendering_mode
==
ORM_FBO
)
{
context_validate_onscreen_formats
(
device
,
context
,
NULL
);
context_validate_onscreen_formats
(
context
,
NULL
);
if
(
context
->
render_offscreen
)
{
...
...
@@ -2044,7 +2045,7 @@ void context_apply_blit_state(struct wined3d_context *context, struct wined3d_de
LEAVE_GL
();
SetupForBlit
(
device
,
context
);
context_invalidate_state
(
context
,
STATE_FRAMEBUFFER
,
device
->
StateT
able
);
context_invalidate_state
(
context
,
STATE_FRAMEBUFFER
,
context
->
state_t
able
);
}
static
BOOL
context_validate_rt_config
(
UINT
rt_count
,
...
...
@@ -2068,7 +2069,7 @@ static BOOL context_validate_rt_config(UINT rt_count,
BOOL
context_apply_clear_state
(
struct
wined3d_context
*
context
,
struct
wined3d_device
*
device
,
UINT
rt_count
,
const
struct
wined3d_fb_state
*
fb
)
{
const
struct
StateEntry
*
state_table
=
device
->
StateT
able
;
const
struct
StateEntry
*
state_table
=
context
->
state_t
able
;
DWORD
rt_mask
=
0
;
UINT
i
;
struct
wined3d_surface
**
rts
=
fb
->
render_targets
;
...
...
@@ -2081,7 +2082,7 @@ BOOL context_apply_clear_state(struct wined3d_context *context, struct wined3d_d
if
(
wined3d_settings
.
offscreen_rendering_mode
==
ORM_FBO
)
{
context_validate_onscreen_formats
(
device
,
context
,
fb
->
depth_stencil
);
context_validate_onscreen_formats
(
context
,
fb
->
depth_stencil
);
ENTER_GL
();
...
...
@@ -2113,7 +2114,7 @@ BOOL context_apply_clear_state(struct wined3d_context *context, struct wined3d_d
/* If the framebuffer is not the device's fb the device's fb has to be reapplied
* next draw. Otherwise we could mark the framebuffer state clean here, once the
* state management allows this */
context_invalidate_state
(
context
,
STATE_FRAMEBUFFER
,
device
->
StateT
able
);
context_invalidate_state
(
context
,
STATE_FRAMEBUFFER
,
state_t
able
);
}
else
{
...
...
@@ -2138,7 +2139,7 @@ BOOL context_apply_clear_state(struct wined3d_context *context, struct wined3d_d
{
context_apply_draw_buffers
(
context
,
rt_mask
);
context
->
draw_buffers_mask
=
rt_mask
;
context_invalidate_state
(
context
,
STATE_FRAMEBUFFER
,
device
->
StateT
able
);
context_invalidate_state
(
context
,
STATE_FRAMEBUFFER
,
state_t
able
);
}
if
(
wined3d_settings
.
offscreen_rendering_mode
==
ORM_FBO
)
...
...
@@ -2242,7 +2243,7 @@ void context_state_drawbuf(struct wined3d_context *context, const struct wined3d
BOOL
context_apply_draw_state
(
struct
wined3d_context
*
context
,
struct
wined3d_device
*
device
)
{
const
struct
wined3d_state
*
state
=
&
device
->
stateBlock
->
state
;
const
struct
StateEntry
*
state_table
=
device
->
StateT
able
;
const
struct
StateEntry
*
state_table
=
context
->
state_t
able
;
const
struct
wined3d_fb_state
*
fb
=
state
->
fb
;
unsigned
int
i
;
...
...
@@ -2289,7 +2290,7 @@ static void context_setup_target(struct wined3d_device *device,
struct
wined3d_context
*
context
,
struct
wined3d_surface
*
target
)
{
BOOL
old_render_offscreen
=
context
->
render_offscreen
,
render_offscreen
;
const
struct
StateEntry
*
StateTable
=
device
->
StateT
able
;
const
struct
StateEntry
*
StateTable
=
context
->
state_t
able
;
if
(
!
target
)
return
;
render_offscreen
=
surface_is_offscreen
(
target
);
...
...
dlls/wined3d/state.c
View file @
b09b7e32
...
...
@@ -579,7 +579,7 @@ static void state_clipping(struct wined3d_context *context, const struct wined3d
/* glEnable(GL_CLIP_PLANEx) doesn't apply to vertex shaders. The enabled / disabled planes are
* hardcoded into the shader. Update the shader to update the enabled clipplanes */
if
(
!
isStateDirty
(
context
,
device
->
StateT
able
[
STATE_VSHADER
].
representative
))
if
(
!
isStateDirty
(
context
,
context
->
state_t
able
[
STATE_VSHADER
].
representative
))
{
device
->
shader_backend
->
shader_select
(
context
,
use_ps
(
state
),
TRUE
);
if
(
!
isStateDirty
(
context
,
STATE_VERTEXSHADERCONSTANT
))
...
...
@@ -3642,7 +3642,7 @@ void apply_pixelshader(struct wined3d_context *context, const struct wined3d_sta
context
->
last_was_pshader
=
FALSE
;
}
if
(
!
isStateDirty
(
context
,
device
->
StateT
able
[
STATE_VSHADER
].
representative
))
if
(
!
isStateDirty
(
context
,
context
->
state_t
able
[
STATE_VSHADER
].
representative
))
{
device
->
shader_backend
->
shader_select
(
context
,
use_pshader
,
use_vshader
);
...
...
dlls/wined3d/wined3d_private.h
View file @
b09b7e32
...
...
@@ -1049,6 +1049,7 @@ BOOL wined3d_event_query_supported(const struct wined3d_gl_info *gl_info) DECLSP
struct
wined3d_context
{
const
struct
wined3d_gl_info
*
gl_info
;
const
struct
StateEntry
*
state_table
;
/* State dirtification
* dirtyArray is an array that contains markers for dirty states. numDirtyEntries states are dirty, their numbers are in indices
* 0...numDirtyEntries - 1. isStateDirty is a redundant copy of the dirtyArray. Technically only one of them would be needed,
...
...
@@ -2828,9 +2829,9 @@ static inline BOOL use_ps(const struct wined3d_state *state)
static
inline
void
context_apply_state
(
struct
wined3d_context
*
context
,
const
struct
wined3d_state
*
state
,
DWORD
state_id
)
{
const
struct
StateEntry
*
state
table
=
context
->
swapchain
->
device
->
StateT
able
;
DWORD
rep
=
statetable
[
state_id
].
representative
;
statetable
[
rep
].
apply
(
context
,
state
,
rep
);
const
struct
StateEntry
*
state
_table
=
context
->
state_t
able
;
DWORD
rep
=
state
_
table
[
state_id
].
representative
;
state
_
table
[
rep
].
apply
(
context
,
state
,
rep
);
}
/* The WNDCLASS-Name for the fake window which we use to retrieve the GL capabilities */
...
...
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