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
fcf4303e
Commit
fcf4303e
authored
Jul 14, 2011
by
Henri Verbeet
Committed by
Alexandre Julliard
Jul 14, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Store a pointer to the framebuffer state in struct wined3d_state.
parent
eeb3625d
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
25 additions
and
18 deletions
+25
-18
arb_program_shader.c
dlls/wined3d/arb_program_shader.c
+9
-9
context.c
dlls/wined3d/context.c
+10
-7
shader.c
dlls/wined3d/shader.c
+1
-1
state.c
dlls/wined3d/state.c
+0
-0
stateblock.c
dlls/wined3d/stateblock.c
+2
-0
utils.c
dlls/wined3d/utils.c
+1
-1
wined3d_private.h
dlls/wined3d/wined3d_private.h
+2
-0
No files found.
dlls/wined3d/arb_program_shader.c
View file @
fcf4303e
...
...
@@ -629,31 +629,31 @@ static void shader_arb_vs_local_constants(const struct arb_vs_compiled_shader *g
static
void
shader_arb_load_constants
(
const
struct
wined3d_context
*
context
,
char
usePixelShader
,
char
useVertexShader
)
{
struct
wined3d_device
*
device
=
context
->
swapchain
->
device
;
struct
wined3d_stateblock
*
stateBlock
=
device
->
stateBlock
;
const
struct
wined3d_state
*
state
=
&
device
->
stateBlock
->
state
;
const
struct
wined3d_gl_info
*
gl_info
=
context
->
gl_info
;
struct
shader_arb_priv
*
priv
=
device
->
shader_priv
;
if
(
useVertexShader
)
{
struct
wined3d_shader
*
vshader
=
state
Block
->
state
.
vertex_shader
;
struct
wined3d_shader
*
vshader
=
state
->
vertex_shader
;
const
struct
arb_vs_compiled_shader
*
gl_shader
=
priv
->
compiled_vprog
;
/* Load DirectX 9 float constants for vertex shader */
device
->
highest_dirty_vs_const
=
shader_arb_load_constantsF
(
vshader
,
gl_info
,
GL_VERTEX_PROGRAM_ARB
,
device
->
highest_dirty_vs_const
,
state
Block
->
state
.
vs_consts_f
,
context
->
vshader_const_dirty
);
shader_arb_vs_local_constants
(
gl_shader
,
context
,
&
stateBlock
->
state
);
device
->
highest_dirty_vs_const
,
state
->
vs_consts_f
,
context
->
vshader_const_dirty
);
shader_arb_vs_local_constants
(
gl_shader
,
context
,
state
);
}
if
(
usePixelShader
)
{
struct
wined3d_shader
*
pshader
=
state
Block
->
state
.
pixel_shader
;
struct
wined3d_shader
*
pshader
=
state
->
pixel_shader
;
const
struct
arb_ps_compiled_shader
*
gl_shader
=
priv
->
compiled_fprog
;
UINT
rt_height
=
device
->
fb
.
render_targets
[
0
]
->
resource
.
height
;
UINT
rt_height
=
state
->
fb
->
render_targets
[
0
]
->
resource
.
height
;
/* Load DirectX 9 float constants for pixel shader */
device
->
highest_dirty_ps_const
=
shader_arb_load_constantsF
(
pshader
,
gl_info
,
GL_FRAGMENT_PROGRAM_ARB
,
device
->
highest_dirty_ps_const
,
state
Block
->
state
.
ps_consts_f
,
context
->
pshader_const_dirty
);
shader_arb_ps_local_constants
(
gl_shader
,
context
,
&
stateBlock
->
state
,
rt_height
);
device
->
highest_dirty_ps_const
,
state
->
ps_consts_f
,
context
->
pshader_const_dirty
);
shader_arb_ps_local_constants
(
gl_shader
,
context
,
state
,
rt_height
);
}
}
...
...
@@ -4612,7 +4612,7 @@ static void shader_arb_select(const struct wined3d_context *context, BOOL usePS,
}
else
{
UINT
rt_height
=
device
->
fb
.
render_targets
[
0
]
->
resource
.
height
;
UINT
rt_height
=
state
->
fb
->
render_targets
[
0
]
->
resource
.
height
;
shader_arb_ps_local_constants
(
compiled
,
context
,
state
,
rt_height
);
}
...
...
dlls/wined3d/context.c
View file @
fcf4303e
...
...
@@ -2149,10 +2149,11 @@ BOOL context_apply_clear_state(struct wined3d_context *context, struct wined3d_d
return
TRUE
;
}
static
inline
DWORD
find_draw_buffers_mask
(
struct
wined3d_context
*
context
,
struct
wined3d_device
*
device
)
static
DWORD
find_draw_buffers_mask
(
struct
wined3d_context
*
context
,
struct
wined3d_device
*
device
)
{
struct
wined3d_shader
*
ps
=
device
->
stateBlock
->
state
.
pixel_shader
;
struct
wined3d_surface
**
rts
=
device
->
fb
.
render_targets
;
const
struct
wined3d_state
*
state
=
&
device
->
stateBlock
->
state
;
struct
wined3d_surface
**
rts
=
state
->
fb
->
render_targets
;
struct
wined3d_shader
*
ps
=
state
->
pixel_shader
;
DWORD
rt_mask
,
rt_mask_bits
;
unsigned
int
i
;
...
...
@@ -2176,10 +2177,11 @@ static inline DWORD find_draw_buffers_mask(struct wined3d_context *context, stru
}
/* GL locking and context activation are done by the caller */
void
context_state_fb
(
DWORD
state
,
struct
wined3d_stateblock
*
stateblock
,
struct
wined3d_context
*
context
)
void
context_state_fb
(
DWORD
state
_id
,
struct
wined3d_stateblock
*
stateblock
,
struct
wined3d_context
*
context
)
{
const
struct
wined3d_state
*
state
=
&
stateblock
->
state
;
struct
wined3d_device
*
device
=
stateblock
->
device
;
const
struct
wined3d_fb_state
*
fb
=
&
devic
e
->
fb
;
const
struct
wined3d_fb_state
*
fb
=
stat
e
->
fb
;
DWORD
rt_mask
=
find_draw_buffers_mask
(
context
,
device
);
if
(
wined3d_settings
.
offscreen_rendering_mode
==
ORM_FBO
)
...
...
@@ -2222,8 +2224,9 @@ void context_state_drawbuf(DWORD state, struct wined3d_stateblock *stateblock, s
/* Context activation is done by the caller. */
BOOL
context_apply_draw_state
(
struct
wined3d_context
*
context
,
struct
wined3d_device
*
device
)
{
struct
wined3d_stateblock
*
stateblock
=
device
->
stateBlock
;
const
struct
StateEntry
*
state_table
=
device
->
StateTable
;
const
struct
wined3d_fb_state
*
fb
=
&
device
->
fb
;
const
struct
wined3d_fb_state
*
fb
=
stateblock
->
state
.
fb
;
unsigned
int
i
;
if
(
!
context_validate_rt_config
(
context
->
gl_info
->
limits
.
buffers
,
...
...
@@ -2250,7 +2253,7 @@ BOOL context_apply_draw_state(struct wined3d_context *context, struct wined3d_de
DWORD
idx
=
rep
/
(
sizeof
(
*
context
->
isStateDirty
)
*
CHAR_BIT
);
BYTE
shift
=
rep
&
((
sizeof
(
*
context
->
isStateDirty
)
*
CHAR_BIT
)
-
1
);
context
->
isStateDirty
[
idx
]
&=
~
(
1
<<
shift
);
state_table
[
rep
].
apply
(
rep
,
device
->
stateB
lock
,
context
);
state_table
[
rep
].
apply
(
rep
,
stateb
lock
,
context
);
}
if
(
wined3d_settings
.
offscreen_rendering_mode
==
ORM_FBO
)
...
...
dlls/wined3d/shader.c
View file @
fcf4303e
...
...
@@ -1879,7 +1879,7 @@ void find_ps_compile_args(const struct wined3d_state *state,
memset
(
args
,
0
,
sizeof
(
*
args
));
/* FIXME: Make sure all bits are set. */
if
(
state
->
render_states
[
WINED3DRS_SRGBWRITEENABLE
])
{
struct
wined3d_surface
*
rt
=
device
->
fb
.
render_targets
[
0
];
const
struct
wined3d_surface
*
rt
=
state
->
fb
->
render_targets
[
0
];
if
(
rt
->
resource
.
format
->
flags
&
WINED3DFMT_FLAG_SRGB_WRITE
)
args
->
srgb_correction
=
1
;
}
...
...
dlls/wined3d/state.c
View file @
fcf4303e
This diff is collapsed.
Click to expand it.
dlls/wined3d/stateblock.c
View file @
fcf4303e
...
...
@@ -1099,6 +1099,8 @@ void stateblock_init_default_state(struct wined3d_stateblock *stateblock)
memcpy
(
&
state
->
transforms
[
WINED3DTS_WORLDMATRIX
(
i
)],
identity
,
sizeof
(
identity
));
}
state
->
fb
=
&
device
->
fb
;
TRACE
(
"Render states
\n
"
);
/* Render states: */
if
(
device
->
auto_depth_stencil
)
...
...
dlls/wined3d/utils.c
View file @
fcf4303e
...
...
@@ -2787,7 +2787,7 @@ void gen_ffp_frag_op(const struct wined3d_device *device, const struct wined3d_s
unsigned
int
i
;
DWORD
ttff
;
DWORD
cop
,
aop
,
carg0
,
carg1
,
carg2
,
aarg0
,
aarg1
,
aarg2
;
const
struct
wined3d_surface
*
rt
=
device
->
fb
.
render_targets
[
0
];
const
struct
wined3d_surface
*
rt
=
state
->
fb
->
render_targets
[
0
];
const
struct
wined3d_gl_info
*
gl_info
=
&
device
->
adapter
->
gl_info
;
for
(
i
=
0
;
i
<
gl_info
->
limits
.
texture_stages
;
++
i
)
...
...
dlls/wined3d/wined3d_private.h
View file @
fcf4303e
...
...
@@ -2238,6 +2238,8 @@ struct wined3d_stream_state
struct
wined3d_state
{
const
struct
wined3d_fb_state
*
fb
;
struct
wined3d_vertex_declaration
*
vertex_declaration
;
struct
wined3d_stream_state
streams
[
MAX_STREAMS
+
1
/* tesselated pseudo-stream */
];
BOOL
user_stream
;
...
...
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