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
b81e5605
Commit
b81e5605
authored
Jan 17, 2014
by
Stefan Dösinger
Committed by
Alexandre Julliard
Jan 17, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Migrate surfaces to the new location flags.
parent
beb64c99
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
221 additions
and
230 deletions
+221
-230
arb_program_shader.c
dlls/wined3d/arb_program_shader.c
+2
-1
context.c
dlls/wined3d/context.c
+20
-20
cs.c
dlls/wined3d/cs.c
+1
-1
device.c
dlls/wined3d/device.c
+5
-5
drawprim.c
dlls/wined3d/drawprim.c
+2
-2
surface.c
dlls/wined3d/surface.c
+156
-151
swapchain.c
dlls/wined3d/swapchain.c
+21
-19
utils.c
dlls/wined3d/utils.c
+6
-17
wined3d_private.h
dlls/wined3d/wined3d_private.h
+8
-14
No files found.
dlls/wined3d/arb_program_shader.c
View file @
b81e5605
...
...
@@ -7454,7 +7454,8 @@ HRESULT arbfp_blit_surface(struct wined3d_device *device, DWORD filter,
/* Now load the surface */
if
(
wined3d_settings
.
offscreen_rendering_mode
!=
ORM_FBO
&&
(
src_surface
->
locations
&
(
SFLAG_INTEXTURE
|
SFLAG_INDRAWABLE
))
==
SFLAG_INDRAWABLE
&&
(
src_surface
->
locations
&
(
WINED3D_LOCATION_TEXTURE_RGB
|
WINED3D_LOCATION_DRAWABLE
))
==
WINED3D_LOCATION_DRAWABLE
&&
!
surface_is_offscreen
(
src_surface
))
{
/* Without FBO blits transferring from the drawable to the texture is
...
...
dlls/wined3d/context.c
View file @
b81e5605
...
...
@@ -139,8 +139,8 @@ static void context_attach_depth_stencil_fbo(struct wined3d_context *context,
{
switch
(
location
)
{
case
SFLAG_INTEXTURE
:
case
SFLAG_INSRGBTEX
:
case
WINED3D_LOCATION_TEXTURE_RGB
:
case
WINED3D_LOCATION_TEXTURE_SRGB
:
surface_prepare_texture
(
depth_stencil
,
context
,
FALSE
);
if
(
format_flags
&
WINED3DFMT_FLAG_DEPTH
)
...
...
@@ -160,20 +160,20 @@ static void context_attach_depth_stencil_fbo(struct wined3d_context *context,
}
break
;
case
SFLAG_IN
RB_MULTISAMPLE
:
case
WINED3D_LOCATION_
RB_MULTISAMPLE
:
surface_prepare_rb
(
depth_stencil
,
gl_info
,
TRUE
);
context_attach_depth_stencil_rb
(
gl_info
,
fbo_target
,
format_flags
,
depth_stencil
->
rb_multisample
);
break
;
case
SFLAG_IN
RB_RESOLVED
:
case
WINED3D_LOCATION_
RB_RESOLVED
:
surface_prepare_rb
(
depth_stencil
,
gl_info
,
FALSE
);
context_attach_depth_stencil_rb
(
gl_info
,
fbo_target
,
format_flags
,
depth_stencil
->
rb_resolved
);
break
;
default:
ERR
(
"Unsupported location %s (%#x).
\n
"
,
debug_surf
location
(
location
),
location
);
ERR
(
"Unsupported location %s (%#x).
\n
"
,
wined3d_debug_
location
(
location
),
location
);
break
;
}
}
...
...
@@ -214,9 +214,9 @@ static void context_attach_surface_fbo(struct wined3d_context *context,
switch
(
location
)
{
case
SFLAG_INTEXTURE
:
case
SFLAG_INSRGBTEX
:
srgb
=
location
==
SFLAG_INSRGBTEX
;
case
WINED3D_LOCATION_TEXTURE_RGB
:
case
WINED3D_LOCATION_TEXTURE_SRGB
:
srgb
=
location
==
WINED3D_LOCATION_TEXTURE_SRGB
;
surface_prepare_texture
(
surface
,
context
,
srgb
);
gl_info
->
fbo_ops
.
glFramebufferTexture2D
(
fbo_target
,
GL_COLOR_ATTACHMENT0
+
idx
,
surface
->
texture_target
,
surface_get_texture_name
(
surface
,
gl_info
,
srgb
),
...
...
@@ -224,14 +224,14 @@ static void context_attach_surface_fbo(struct wined3d_context *context,
checkGLcall
(
"glFramebufferTexture2D()"
);
break
;
case
SFLAG_IN
RB_MULTISAMPLE
:
case
WINED3D_LOCATION_
RB_MULTISAMPLE
:
surface_prepare_rb
(
surface
,
gl_info
,
TRUE
);
gl_info
->
fbo_ops
.
glFramebufferRenderbuffer
(
fbo_target
,
GL_COLOR_ATTACHMENT0
+
idx
,
GL_RENDERBUFFER
,
surface
->
rb_multisample
);
checkGLcall
(
"glFramebufferRenderbuffer()"
);
break
;
case
SFLAG_IN
RB_RESOLVED
:
case
WINED3D_LOCATION_
RB_RESOLVED
:
surface_prepare_rb
(
surface
,
gl_info
,
FALSE
);
gl_info
->
fbo_ops
.
glFramebufferRenderbuffer
(
fbo_target
,
GL_COLOR_ATTACHMENT0
+
idx
,
GL_RENDERBUFFER
,
surface
->
rb_resolved
);
...
...
@@ -239,7 +239,7 @@ static void context_attach_surface_fbo(struct wined3d_context *context,
break
;
default:
ERR
(
"Unsupported location %s (%#x).
\n
"
,
debug_surf
location
(
location
),
location
);
ERR
(
"Unsupported location %s (%#x).
\n
"
,
wined3d_debug_
location
(
location
),
location
);
break
;
}
}
...
...
@@ -276,7 +276,7 @@ void context_check_fbo_status(const struct wined3d_context *context, GLenum targ
return
;
}
FIXME
(
"
\t
Location %s (%#x).
\n
"
,
debug_surf
location
(
context
->
current_fbo
->
location
),
FIXME
(
"
\t
Location %s (%#x).
\n
"
,
wined3d_debug_
location
(
context
->
current_fbo
->
location
),
context
->
current_fbo
->
location
);
/* Dump the FBO attachments */
...
...
@@ -467,7 +467,7 @@ static void context_apply_fbo_state(struct wined3d_context *context, GLenum targ
context
->
rebind_fbo
=
FALSE
;
}
if
(
location
==
SFLAG_IN
DRAWABLE
)
if
(
location
==
WINED3D_LOCATION_
DRAWABLE
)
{
context
->
current_fbo
=
NULL
;
context_bind_fbo
(
context
,
target
,
0
);
...
...
@@ -2096,7 +2096,7 @@ static void context_validate_onscreen_formats(struct wined3d_context *context,
WARN
(
"Depth stencil format is not supported by WGL, rendering the backbuffer in an FBO
\n
"
);
/* The currently active context is the necessary context to access the swapchain's onscreen buffers */
surface_load_location
(
context
->
current_rt
,
SFLAG_INTEXTURE
);
surface_load_location
(
context
->
current_rt
,
WINED3D_LOCATION_TEXTURE_RGB
);
swapchain
->
render_to_fbo
=
TRUE
;
swapchain_update_draw_bindings
(
swapchain
);
context_set_render_offscreen
(
context
,
TRUE
);
...
...
@@ -2211,11 +2211,11 @@ BOOL context_apply_clear_state(struct wined3d_context *context, const struct win
++
i
;
}
context_apply_fbo_state
(
context
,
GL_FRAMEBUFFER
,
context
->
blit_targets
,
fb
->
depth_stencil
,
rt_count
?
rts
[
0
]
->
draw_binding
:
SFLAG_INTEXTURE
);
rt_count
?
rts
[
0
]
->
draw_binding
:
WINED3D_LOCATION_TEXTURE_RGB
);
}
else
{
context_apply_fbo_state
(
context
,
GL_FRAMEBUFFER
,
NULL
,
NULL
,
SFLAG_IN
DRAWABLE
);
context_apply_fbo_state
(
context
,
GL_FRAMEBUFFER
,
NULL
,
NULL
,
WINED3D_LOCATION_
DRAWABLE
);
rt_mask
=
context_generate_rt_mask_from_surface
(
rts
[
0
]);
}
...
...
@@ -2312,7 +2312,7 @@ void context_state_fb(struct wined3d_context *context, const struct wined3d_stat
{
if
(
!
context
->
render_offscreen
)
{
context_apply_fbo_state
(
context
,
GL_FRAMEBUFFER
,
NULL
,
NULL
,
SFLAG_IN
DRAWABLE
);
context_apply_fbo_state
(
context
,
GL_FRAMEBUFFER
,
NULL
,
NULL
,
WINED3D_LOCATION_
DRAWABLE
);
}
else
{
...
...
@@ -2928,8 +2928,8 @@ static void context_setup_target(struct wined3d_context *context, struct wined3d
/* When switching away from an offscreen render target, and we're not
* using FBOs, we have to read the drawable into the texture. This is
* done via PreLoad (and
SFLAG_INDRAWABLE set on the surface). There
* are some things that need care though. PreLoad needs a GL context,
* done via PreLoad (and
WINED3D_LOCATION_DRAWABLE set on the surface).
*
There
are some things that need care though. PreLoad needs a GL context,
* and FindContext is called before the context is activated. It also
* has to be called with the old rendertarget active, otherwise a
* wrong drawable is read. */
...
...
@@ -2942,7 +2942,7 @@ static void context_setup_target(struct wined3d_context *context, struct wined3d
if
(
texture
->
texture_srgb
.
name
)
wined3d_texture_load
(
texture
,
context
,
TRUE
);
wined3d_texture_load
(
texture
,
context
,
FALSE
);
surface_invalidate_location
(
context
->
current_rt
,
SFLAG_IN
DRAWABLE
);
surface_invalidate_location
(
context
->
current_rt
,
WINED3D_LOCATION_
DRAWABLE
);
}
}
...
...
dlls/wined3d/cs.c
View file @
b81e5605
...
...
@@ -378,7 +378,7 @@ static void wined3d_cs_exec_set_depth_stencil(struct wined3d_cs *cs, const void
if
(
device
->
swapchains
[
0
]
->
desc
.
flags
&
WINED3DPRESENTFLAG_DISCARD_DEPTHSTENCIL
||
prev
->
flags
&
SFLAG_DISCARD
)
{
surface_modify_ds_location
(
prev
,
SFLAG
_DISCARDED
,
surface_modify_ds_location
(
prev
,
WINED3D_LOCATION
_DISCARDED
,
prev
->
resource
.
width
,
prev
->
resource
.
height
);
if
(
prev
==
device
->
onscreen_depth_stencil
)
{
...
...
dlls/wined3d/device.c
View file @
b81e5605
...
...
@@ -201,9 +201,9 @@ void device_switch_onscreen_ds(struct wined3d_device *device,
{
if
(
device
->
onscreen_depth_stencil
)
{
surface_load_ds_location
(
device
->
onscreen_depth_stencil
,
context
,
SFLAG_INTEXTURE
);
surface_load_ds_location
(
device
->
onscreen_depth_stencil
,
context
,
WINED3D_LOCATION_TEXTURE_RGB
);
surface_modify_ds_location
(
device
->
onscreen_depth_stencil
,
SFLAG_INTEXTURE
,
surface_modify_ds_location
(
device
->
onscreen_depth_stencil
,
WINED3D_LOCATION_TEXTURE_RGB
,
device
->
onscreen_depth_stencil
->
ds_current_size
.
cx
,
device
->
onscreen_depth_stencil
->
ds_current_size
.
cy
);
wined3d_surface_decref
(
device
->
onscreen_depth_stencil
);
...
...
@@ -234,7 +234,7 @@ static void prepare_ds_clear(struct wined3d_surface *ds, struct wined3d_context
{
RECT
current_rect
,
r
;
if
(
ds
->
locations
&
SFLAG
_DISCARDED
)
if
(
ds
->
locations
&
WINED3D_LOCATION
_DISCARDED
)
{
/* Depth buffer was discarded, make it entirely current in its new location since
* there is no other place where we would get data anyway. */
...
...
@@ -337,7 +337,7 @@ void device_clear_render_targets(struct wined3d_device *device, UINT rt_count, c
if
(
flags
&
WINED3DCLEAR_ZBUFFER
)
{
DWORD
location
=
render_offscreen
?
fb
->
depth_stencil
->
draw_binding
:
SFLAG_IN
DRAWABLE
;
DWORD
location
=
render_offscreen
?
fb
->
depth_stencil
->
draw_binding
:
WINED3D_LOCATION_
DRAWABLE
;
if
(
!
render_offscreen
&&
fb
->
depth_stencil
!=
device
->
onscreen_depth_stencil
)
device_switch_onscreen_ds
(
device
,
context
,
fb
->
depth_stencil
);
...
...
@@ -369,7 +369,7 @@ void device_clear_render_targets(struct wined3d_device *device, UINT rt_count, c
if
(
flags
&
WINED3DCLEAR_ZBUFFER
)
{
DWORD
location
=
render_offscreen
?
fb
->
depth_stencil
->
draw_binding
:
SFLAG_IN
DRAWABLE
;
DWORD
location
=
render_offscreen
?
fb
->
depth_stencil
->
draw_binding
:
WINED3D_LOCATION_
DRAWABLE
;
surface_modify_ds_location
(
fb
->
depth_stencil
,
location
,
ds_rect
.
right
,
ds_rect
.
bottom
);
...
...
dlls/wined3d/drawprim.c
View file @
b81e5605
...
...
@@ -639,7 +639,7 @@ void draw_primitive(struct wined3d_device *device, UINT start_idx, UINT index_co
* depthstencil for D3DCMP_NEVER and D3DCMP_ALWAYS as well. Also note
* that we never copy the stencil data.*/
DWORD
location
=
context
->
render_offscreen
?
device
->
fb
.
depth_stencil
->
draw_binding
:
SFLAG_IN
DRAWABLE
;
device
->
fb
.
depth_stencil
->
draw_binding
:
WINED3D_LOCATION_
DRAWABLE
;
if
(
state
->
render_states
[
WINED3D_RS_ZWRITEENABLE
]
||
state
->
render_states
[
WINED3D_RS_ZENABLE
])
{
struct
wined3d_surface
*
ds
=
device
->
fb
.
depth_stencil
;
...
...
@@ -671,7 +671,7 @@ void draw_primitive(struct wined3d_device *device, UINT start_idx, UINT index_co
if
(
device
->
fb
.
depth_stencil
&&
state
->
render_states
[
WINED3D_RS_ZWRITEENABLE
])
{
struct
wined3d_surface
*
ds
=
device
->
fb
.
depth_stencil
;
DWORD
location
=
context
->
render_offscreen
?
ds
->
draw_binding
:
SFLAG_IN
DRAWABLE
;
DWORD
location
=
context
->
render_offscreen
?
ds
->
draw_binding
:
WINED3D_LOCATION_
DRAWABLE
;
surface_modify_ds_location
(
ds
,
location
,
ds
->
ds_current_size
.
cx
,
ds
->
ds_current_size
.
cy
);
}
...
...
dlls/wined3d/surface.c
View file @
b81e5605
...
...
@@ -37,7 +37,8 @@ WINE_DECLARE_DEBUG_CHANNEL(d3d);
#define MAXLOCKCOUNT 50
/* After this amount of locks do not free the sysmem copy. */
static
const
DWORD
surface_simple_locations
=
SFLAG_INDIB
|
SFLAG_INUSERMEM
|
SFLAG_INSYSMEM
|
SFLAG_INBUFFER
;
WINED3D_LOCATION_SYSMEM
|
WINED3D_LOCATION_USER_MEMORY
|
WINED3D_LOCATION_DIB
|
WINED3D_LOCATION_BUFFER
;
static
void
surface_cleanup
(
struct
wined3d_surface
*
surface
)
{
...
...
@@ -105,11 +106,11 @@ static void surface_cleanup(struct wined3d_surface *surface)
void
surface_update_draw_binding
(
struct
wined3d_surface
*
surface
)
{
if
(
!
surface_is_offscreen
(
surface
)
||
wined3d_settings
.
offscreen_rendering_mode
!=
ORM_FBO
)
surface
->
draw_binding
=
SFLAG_IN
DRAWABLE
;
surface
->
draw_binding
=
WINED3D_LOCATION_
DRAWABLE
;
else
if
(
surface
->
resource
.
multisample_type
)
surface
->
draw_binding
=
SFLAG_IN
RB_MULTISAMPLE
;
surface
->
draw_binding
=
WINED3D_LOCATION_
RB_MULTISAMPLE
;
else
surface
->
draw_binding
=
SFLAG_INTEXTURE
;
surface
->
draw_binding
=
WINED3D_LOCATION_TEXTURE_RGB
;
}
void
surface_set_swapchain
(
struct
wined3d_surface
*
surface
,
struct
wined3d_swapchain
*
swapchain
)
...
...
@@ -508,32 +509,32 @@ static HRESULT surface_create_dib_section(struct wined3d_surface *surface)
static
void
surface_get_memory
(
const
struct
wined3d_surface
*
surface
,
struct
wined3d_bo_address
*
data
,
DWORD
location
)
{
if
(
location
&
SFLAG_IN
BUFFER
)
if
(
location
&
WINED3D_LOCATION_
BUFFER
)
{
data
->
addr
=
NULL
;
data
->
buffer_object
=
surface
->
pbo
;
return
;
}
if
(
location
&
SFLAG_INUSERMEM
)
if
(
location
&
WINED3D_LOCATION_USER_MEMORY
)
{
data
->
addr
=
surface
->
user_memory
;
data
->
buffer_object
=
0
;
return
;
}
if
(
location
&
SFLAG_IN
DIB
)
if
(
location
&
WINED3D_LOCATION_
DIB
)
{
data
->
addr
=
surface
->
dib
.
bitmap_data
;
data
->
buffer_object
=
0
;
return
;
}
if
(
location
&
SFLAG_IN
SYSMEM
)
if
(
location
&
WINED3D_LOCATION_
SYSMEM
)
{
data
->
addr
=
surface
->
resource
.
heap_memory
;
data
->
buffer_object
=
0
;
return
;
}
ERR
(
"Unexpected locations %s.
\n
"
,
debug_surf
location
(
location
));
ERR
(
"Unexpected locations %s.
\n
"
,
wined3d_debug_
location
(
location
));
data
->
addr
=
NULL
;
data
->
buffer_object
=
0
;
}
...
...
@@ -582,34 +583,34 @@ static void surface_prepare_system_memory(struct wined3d_surface *surface)
if
(
!
wined3d_resource_allocate_sysmem
(
&
surface
->
resource
))
ERR
(
"Failed to allocate system memory.
\n
"
);
if
(
surface
->
locations
&
SFLAG_IN
SYSMEM
)
ERR
(
"Surface without system memory has
SFLAG_IN
SYSMEM set.
\n
"
);
if
(
surface
->
locations
&
WINED3D_LOCATION_
SYSMEM
)
ERR
(
"Surface without system memory has
WINED3D_LOCATION_
SYSMEM set.
\n
"
);
}
void
surface_prepare_map_memory
(
struct
wined3d_surface
*
surface
)
{
switch
(
surface
->
map_binding
)
{
case
SFLAG_INUSERMEM
:
if
(
!
surface
->
user_memory
)
ERR
(
"Map binding is set to SFLAG_INUSERMEM but surface->user_memory is NULL.
\n
"
);
case
WINED3D_LOCATION_SYSMEM
:
surface_prepare_system_memory
(
surface
);
break
;
case
SFLAG_INDIB
:
if
(
!
surface
->
dib
.
bitmap_data
)
ERR
(
"Map binding is set to
SFLAG_INDIB but surface->dib.bitmap_data
is NULL.
\n
"
);
case
WINED3D_LOCATION_USER_MEMORY
:
if
(
!
surface
->
user_memory
)
ERR
(
"Map binding is set to
WINED3D_LOCATION_USER_MEMORY but surface->user_memory
is NULL.
\n
"
);
break
;
case
SFLAG_INSYSMEM
:
surface_prepare_system_memory
(
surface
);
case
WINED3D_LOCATION_DIB
:
if
(
!
surface
->
dib
.
bitmap_data
)
ERR
(
"Map binding is set to WINED3D_LOCATION_DIB but surface->dib.bitmap_data is NULL.
\n
"
);
break
;
case
SFLAG_IN
BUFFER
:
case
WINED3D_LOCATION_
BUFFER
:
surface_prepare_buffer
(
surface
);
break
;
default:
ERR
(
"Unexpected map binding %s.
\n
"
,
debug_surf
location
(
surface
->
map_binding
));
ERR
(
"Unexpected map binding %s.
\n
"
,
wined3d_debug_
location
(
surface
->
map_binding
));
}
}
...
...
@@ -619,7 +620,7 @@ static void surface_evict_sysmem(struct wined3d_surface *surface)
return
;
wined3d_resource_free_sysmem
(
&
surface
->
resource
);
surface_invalidate_location
(
surface
,
SFLAG_IN
SYSMEM
);
surface_invalidate_location
(
surface
,
WINED3D_LOCATION_
SYSMEM
);
}
static
void
surface_force_reload
(
struct
wined3d_surface
*
surface
)
...
...
@@ -647,7 +648,7 @@ static void surface_release_client_storage(struct wined3d_surface *surface)
context_release
(
context
);
surface_invalidate_location
(
surface
,
SFLAG_INTEXTURE
|
SFLAG_INSRGBTEX
);
surface_invalidate_location
(
surface
,
WINED3D_LOCATION_TEXTURE_RGB
|
WINED3D_LOCATION_TEXTURE_SRGB
);
surface_force_reload
(
surface
);
}
...
...
@@ -747,10 +748,10 @@ static HRESULT surface_private_setup(struct wined3d_surface *surface)
}
if
(
surface
->
resource
.
usage
&
WINED3DUSAGE_DEPTHSTENCIL
)
surface
->
locations
=
SFLAG
_DISCARDED
;
surface
->
locations
=
WINED3D_LOCATION
_DISCARDED
;
if
(
surface_use_pbo
(
surface
))
surface
->
map_binding
=
SFLAG_IN
BUFFER
;
surface
->
map_binding
=
WINED3D_LOCATION_
BUFFER
;
return
WINED3D_OK
;
}
...
...
@@ -770,11 +771,11 @@ static void surface_realize_palette(struct wined3d_surface *surface)
{
/* Make sure the texture is up to date. This call doesn't do
* anything if the texture is already up to date. */
surface_load_location
(
surface
,
SFLAG_INTEXTURE
);
surface_load_location
(
surface
,
WINED3D_LOCATION_TEXTURE_RGB
);
/* We want to force a palette refresh, so mark the drawable as not being up to date */
if
(
!
surface_is_offscreen
(
surface
))
surface_invalidate_location
(
surface
,
SFLAG_IN
DRAWABLE
);
surface_invalidate_location
(
surface
,
WINED3D_LOCATION_
DRAWABLE
);
}
else
{
...
...
@@ -822,12 +823,12 @@ static void surface_unmap(struct wined3d_surface *surface)
switch
(
surface
->
map_binding
)
{
case
SFLAG_INUSER
MEM
:
case
SFLAG_INDIB
:
case
SFLAG_INSYSMEM
:
case
WINED3D_LOCATION_SYS
MEM
:
case
WINED3D_LOCATION_USER_MEMORY
:
case
WINED3D_LOCATION_DIB
:
break
;
case
SFLAG_IN
BUFFER
:
case
WINED3D_LOCATION_
BUFFER
:
context
=
context_acquire
(
device
,
NULL
);
gl_info
=
context
->
gl_info
;
...
...
@@ -839,10 +840,10 @@ static void surface_unmap(struct wined3d_surface *surface)
break
;
default:
ERR
(
"Unexpected map binding %s.
\n
"
,
debug_surf
location
(
surface
->
map_binding
));
ERR
(
"Unexpected map binding %s.
\n
"
,
wined3d_debug_
location
(
surface
->
map_binding
));
}
if
(
surface
->
locations
&
(
SFLAG_INDRAWABLE
|
SFLAG_INTEXTURE
))
if
(
surface
->
locations
&
(
WINED3D_LOCATION_DRAWABLE
|
WINED3D_LOCATION_TEXTURE_RGB
))
{
TRACE
(
"Not dirtified, nothing to do.
\n
"
);
return
;
...
...
@@ -874,9 +875,9 @@ static void surface_depth_blt_fbo(const struct wined3d_device *device,
TRACE
(
"device %p
\n
"
,
device
);
TRACE
(
"src_surface %p, src_location %s, src_rect %s,
\n
"
,
src_surface
,
debug_surf
location
(
src_location
),
wine_dbgstr_rect
(
src_rect
));
src_surface
,
wined3d_debug_
location
(
src_location
),
wine_dbgstr_rect
(
src_rect
));
TRACE
(
"dst_surface %p, dst_location %s, dst_rect %s.
\n
"
,
dst_surface
,
debug_surf
location
(
dst_location
),
wine_dbgstr_rect
(
dst_rect
));
dst_surface
,
wined3d_debug_
location
(
dst_location
),
wine_dbgstr_rect
(
dst_rect
));
src_mask
=
src_surface
->
resource
.
format
->
flags
&
(
WINED3DFMT_FLAG_DEPTH
|
WINED3DFMT_FLAG_STENCIL
);
dst_mask
=
dst_surface
->
resource
.
format
->
flags
&
(
WINED3DFMT_FLAG_DEPTH
|
WINED3DFMT_FLAG_STENCIL
);
...
...
@@ -969,9 +970,9 @@ static void surface_blt_fbo(const struct wined3d_device *device, enum wined3d_te
TRACE
(
"device %p, filter %s,
\n
"
,
device
,
debug_d3dtexturefiltertype
(
filter
));
TRACE
(
"src_surface %p, src_location %s, src_rect %s,
\n
"
,
src_surface
,
debug_surf
location
(
src_location
),
wine_dbgstr_rect
(
src_rect_in
));
src_surface
,
wined3d_debug_
location
(
src_location
),
wine_dbgstr_rect
(
src_rect_in
));
TRACE
(
"dst_surface %p, dst_location %s, dst_rect %s.
\n
"
,
dst_surface
,
debug_surf
location
(
dst_location
),
wine_dbgstr_rect
(
dst_rect_in
));
dst_surface
,
wined3d_debug_
location
(
dst_location
),
wine_dbgstr_rect
(
dst_rect_in
));
src_rect
=
*
src_rect_in
;
dst_rect
=
*
dst_rect_in
;
...
...
@@ -991,11 +992,11 @@ static void surface_blt_fbo(const struct wined3d_device *device, enum wined3d_te
}
/* Resolve the source surface first if needed. */
if
(
src_location
==
SFLAG_IN
RB_MULTISAMPLE
if
(
src_location
==
WINED3D_LOCATION_
RB_MULTISAMPLE
&&
(
src_surface
->
resource
.
format
->
id
!=
dst_surface
->
resource
.
format
->
id
||
abs
(
src_rect
.
bottom
-
src_rect
.
top
)
!=
abs
(
dst_rect
.
bottom
-
dst_rect
.
top
)
||
abs
(
src_rect
.
right
-
src_rect
.
left
)
!=
abs
(
dst_rect
.
right
-
dst_rect
.
left
)))
src_location
=
SFLAG_IN
RB_RESOLVED
;
src_location
=
WINED3D_LOCATION_
RB_RESOLVED
;
/* Make sure the locations are up-to-date. Loading the destination
* surface isn't required if the entire surface is overwritten. (And is
...
...
@@ -1005,8 +1006,8 @@ static void surface_blt_fbo(const struct wined3d_device *device, enum wined3d_te
if
(
!
surface_is_full_rect
(
dst_surface
,
&
dst_rect
))
surface_load_location
(
dst_surface
,
dst_location
);
if
(
src_location
==
SFLAG_IN
DRAWABLE
)
context
=
context_acquire
(
device
,
src_surface
);
else
if
(
dst_location
==
SFLAG_IN
DRAWABLE
)
context
=
context_acquire
(
device
,
dst_surface
);
if
(
src_location
==
WINED3D_LOCATION_
DRAWABLE
)
context
=
context_acquire
(
device
,
src_surface
);
else
if
(
dst_location
==
WINED3D_LOCATION_
DRAWABLE
)
context
=
context_acquire
(
device
,
dst_surface
);
else
context
=
context_acquire
(
device
,
NULL
);
if
(
!
context
->
valid
)
...
...
@@ -1018,7 +1019,7 @@ static void surface_blt_fbo(const struct wined3d_device *device, enum wined3d_te
gl_info
=
context
->
gl_info
;
if
(
src_location
==
SFLAG_IN
DRAWABLE
)
if
(
src_location
==
WINED3D_LOCATION_
DRAWABLE
)
{
TRACE
(
"Source surface %p is onscreen.
\n
"
,
src_surface
);
buffer
=
surface_get_gl_buffer
(
src_surface
);
...
...
@@ -1035,7 +1036,7 @@ static void surface_blt_fbo(const struct wined3d_device *device, enum wined3d_te
checkGLcall
(
"glReadBuffer()"
);
context_check_fbo_status
(
context
,
GL_READ_FRAMEBUFFER
);
if
(
dst_location
==
SFLAG_IN
DRAWABLE
)
if
(
dst_location
==
WINED3D_LOCATION_
DRAWABLE
)
{
TRACE
(
"Destination surface %p is onscreen.
\n
"
,
dst_surface
);
buffer
=
surface_get_gl_buffer
(
dst_surface
);
...
...
@@ -1066,7 +1067,7 @@ static void surface_blt_fbo(const struct wined3d_device *device, enum wined3d_te
checkGLcall
(
"glBlitFramebuffer()"
);
if
(
wined3d_settings
.
strict_draw_ordering
||
(
dst_location
==
SFLAG_IN
DRAWABLE
||
(
dst_location
==
WINED3D_LOCATION_
DRAWABLE
&&
dst_surface
->
swapchain
->
front_buffer
==
dst_surface
))
gl_info
->
gl_ops
.
gl
.
p_glFlush
();
...
...
@@ -1252,7 +1253,7 @@ static void surface_remove_pbo(struct wined3d_surface *surface, const struct win
checkGLcall
(
"glDeleteBuffersARB(1, &surface->pbo)"
);
surface
->
pbo
=
0
;
surface_invalidate_location
(
surface
,
SFLAG_IN
BUFFER
);
surface_invalidate_location
(
surface
,
WINED3D_LOCATION_
BUFFER
);
}
static
void
surface_unload
(
struct
wined3d_resource
*
resource
)
...
...
@@ -1278,8 +1279,8 @@ static void surface_unload(struct wined3d_resource *resource)
* and all flags get lost */
surface_prepare_system_memory
(
surface
);
memset
(
surface
->
resource
.
heap_memory
,
0
,
surface
->
resource
.
size
);
surface_validate_location
(
surface
,
SFLAG_IN
SYSMEM
);
surface_invalidate_location
(
surface
,
~
SFLAG_IN
SYSMEM
);
surface_validate_location
(
surface
,
WINED3D_LOCATION_
SYSMEM
);
surface_invalidate_location
(
surface
,
~
WINED3D_LOCATION_
SYSMEM
);
/* We also get here when the ddraw swapchain is destroyed, for example
* for a mode switch. In this case this surface won't necessarily be
...
...
@@ -1375,7 +1376,7 @@ static HRESULT gdi_surface_private_setup(struct wined3d_surface *surface)
hr
=
surface_create_dib_section
(
surface
);
if
(
FAILED
(
hr
))
return
hr
;
surface
->
map_binding
=
SFLAG_IN
DIB
;
surface
->
map_binding
=
WINED3D_LOCATION_
DIB
;
/* We don't mind the nonpow2 stuff in GDI. */
surface
->
pow2Width
=
surface
->
resource
.
width
;
...
...
@@ -1970,7 +1971,7 @@ HRESULT surface_upload_from_surface(struct wined3d_surface *dst_surface, const P
if
(
update_w
==
dst_w
&&
update_h
==
dst_h
)
surface_prepare_texture
(
dst_surface
,
context
,
FALSE
);
else
surface_load_location
(
dst_surface
,
SFLAG_INTEXTURE
);
surface_load_location
(
dst_surface
,
WINED3D_LOCATION_TEXTURE_RGB
);
wined3d_texture_bind
(
dst_surface
->
container
,
context
,
FALSE
);
surface_get_memory
(
src_surface
,
&
data
,
src_surface
->
locations
);
...
...
@@ -1982,8 +1983,8 @@ HRESULT surface_upload_from_surface(struct wined3d_surface *dst_surface, const P
context_release
(
context
);
surface_validate_location
(
dst_surface
,
SFLAG_INTEXTURE
);
surface_invalidate_location
(
dst_surface
,
~
SFLAG_INTEXTURE
);
surface_validate_location
(
dst_surface
,
WINED3D_LOCATION_TEXTURE_RGB
);
surface_invalidate_location
(
dst_surface
,
~
WINED3D_LOCATION_TEXTURE_RGB
);
return
WINED3D_OK
;
}
...
...
@@ -2171,7 +2172,7 @@ GLenum surface_get_gl_buffer(const struct wined3d_surface *surface)
void
surface_load
(
struct
wined3d_surface
*
surface
,
BOOL
srgb
)
{
DWORD
location
=
srgb
?
SFLAG_INSRGBTEX
:
SFLAG_INTEXTURE
;
DWORD
location
=
srgb
?
WINED3D_LOCATION_TEXTURE_SRGB
:
WINED3D_LOCATION_TEXTURE_RGB
;
BOOL
ck_changed
;
TRACE
(
"surface %p, srgb %#x.
\n
"
,
surface
,
srgb
);
...
...
@@ -2655,8 +2656,8 @@ HRESULT CDECL wined3d_surface_update_desc(struct wined3d_surface *surface,
surface
->
user_memory
=
mem
;
if
(
surface
->
user_memory
)
{
surface
->
map_binding
=
SFLAG_INUSERMEM
;
valid_location
=
SFLAG_INUSERMEM
;
surface
->
map_binding
=
WINED3D_LOCATION_USER_MEMORY
;
valid_location
=
WINED3D_LOCATION_USER_MEMORY
;
}
surface
->
pitch
=
pitch
;
surface
->
resource
.
format
=
format
;
...
...
@@ -2671,8 +2672,8 @@ HRESULT CDECL wined3d_surface_update_desc(struct wined3d_surface *surface,
* If the surface didn't use PBOs previously but could now, don't
* change it - whatever made us not use PBOs might come back, e.g.
* color keys. */
if
(
surface
->
map_binding
==
SFLAG_IN
BUFFER
&&
!
surface_use_pbo
(
surface
))
surface
->
map_binding
=
create_dib
?
SFLAG_INDIB
:
SFLAG_IN
SYSMEM
;
if
(
surface
->
map_binding
==
WINED3D_LOCATION_
BUFFER
&&
!
surface_use_pbo
(
surface
))
surface
->
map_binding
=
create_dib
?
WINED3D_LOCATION_DIB
:
WINED3D_LOCATION_
SYSMEM
;
if
(
create_dib
)
{
...
...
@@ -2682,13 +2683,13 @@ HRESULT CDECL wined3d_surface_update_desc(struct wined3d_surface *surface,
return
hr
;
}
if
(
!
valid_location
)
valid_location
=
SFLAG_IN
DIB
;
valid_location
=
WINED3D_LOCATION_
DIB
;
}
if
(
!
valid_location
)
{
surface_prepare_system_memory
(
surface
);
valid_location
=
SFLAG_IN
SYSMEM
;
valid_location
=
WINED3D_LOCATION_
SYSMEM
;
}
surface_validate_location
(
surface
,
valid_location
);
...
...
@@ -3080,7 +3081,7 @@ HRESULT CDECL wined3d_surface_map(struct wined3d_surface *surface,
if
(
flags
&
WINED3D_MAP_DISCARD
)
{
TRACE
(
"WINED3D_MAP_DISCARD flag passed, marking %s as up to date.
\n
"
,
debug_surf
location
(
surface
->
map_binding
));
wined3d_debug_
location
(
surface
->
map_binding
));
surface_validate_location
(
surface
,
surface
->
map_binding
);
}
else
...
...
@@ -3096,15 +3097,19 @@ HRESULT CDECL wined3d_surface_map(struct wined3d_surface *surface,
switch
(
surface
->
map_binding
)
{
case
SFLAG_INUSERMEM
:
case
WINED3D_LOCATION_SYSMEM
:
base_memory
=
surface
->
resource
.
heap_memory
;
break
;
case
WINED3D_LOCATION_USER_MEMORY
:
base_memory
=
surface
->
user_memory
;
break
;
case
SFLAG_IN
DIB
:
case
WINED3D_LOCATION_
DIB
:
base_memory
=
surface
->
dib
.
bitmap_data
;
break
;
case
SFLAG_IN
BUFFER
:
case
WINED3D_LOCATION_
BUFFER
:
context
=
context_acquire
(
device
,
NULL
);
gl_info
=
context
->
gl_info
;
...
...
@@ -3116,12 +3121,8 @@ HRESULT CDECL wined3d_surface_map(struct wined3d_surface *surface,
context_release
(
context
);
break
;
case
SFLAG_INSYSMEM
:
base_memory
=
surface
->
resource
.
heap_memory
;
break
;
default:
ERR
(
"Unexpected map binding %s.
\n
"
,
debug_surf
location
(
surface
->
map_binding
));
ERR
(
"Unexpected map binding %s.
\n
"
,
wined3d_debug_
location
(
surface
->
map_binding
));
base_memory
=
NULL
;
}
...
...
@@ -3186,20 +3187,20 @@ HRESULT CDECL wined3d_surface_getdc(struct wined3d_surface *surface, HDC *dc)
{
if
(
surface
->
flags
&
SFLAG_CLIENT
)
{
surface_load_location
(
surface
,
SFLAG_IN
SYSMEM
);
surface_load_location
(
surface
,
WINED3D_LOCATION_
SYSMEM
);
surface_release_client_storage
(
surface
);
}
hr
=
surface_create_dib_section
(
surface
);
if
(
FAILED
(
hr
))
return
WINED3DERR_INVALIDCALL
;
if
(
!
(
surface
->
map_binding
==
SFLAG_INUSERMEM
if
(
!
(
surface
->
map_binding
==
WINED3D_LOCATION_USER_MEMORY
||
surface
->
flags
&
SFLAG_PIN_SYSMEM
||
surface
->
pbo
))
surface
->
map_binding
=
SFLAG_IN
DIB
;
surface
->
map_binding
=
WINED3D_LOCATION_
DIB
;
}
surface_load_location
(
surface
,
SFLAG_IN
DIB
);
surface_invalidate_location
(
surface
,
~
SFLAG_IN
DIB
);
surface_load_location
(
surface
,
WINED3D_LOCATION_
DIB
);
surface_invalidate_location
(
surface
,
~
WINED3D_LOCATION_
DIB
);
if
(
surface
->
resource
.
format
->
id
==
WINED3DFMT_P8_UINT
||
surface
->
resource
.
format
->
id
==
WINED3DFMT_P8_UINT_A8_UNORM
)
...
...
@@ -3264,8 +3265,8 @@ HRESULT CDECL wined3d_surface_releasedc(struct wined3d_surface *surface, HDC dc)
surface
->
resource
.
map_count
--
;
surface
->
flags
&=
~
SFLAG_DCINUSE
;
if
(
surface
->
map_binding
==
SFLAG_INUSERMEM
)
surface_load_location
(
surface
,
SFLAG_INUSERMEM
);
if
(
surface
->
map_binding
==
WINED3D_LOCATION_USER_MEMORY
)
surface_load_location
(
surface
,
WINED3D_LOCATION_USER_MEMORY
);
return
WINED3D_OK
;
}
...
...
@@ -3978,8 +3979,8 @@ static void fb_copy_to_texture_direct(struct wined3d_surface *dst_surface, struc
/* The texture is now most up to date - If the surface is a render target
* and has a drawable, this path is never entered. */
surface_validate_location
(
dst_surface
,
SFLAG_INTEXTURE
);
surface_invalidate_location
(
dst_surface
,
~
SFLAG_INTEXTURE
);
surface_validate_location
(
dst_surface
,
WINED3D_LOCATION_TEXTURE_RGB
);
surface_invalidate_location
(
dst_surface
,
~
WINED3D_LOCATION_TEXTURE_RGB
);
}
/* Uses the hardware to stretch and flip the image */
...
...
@@ -4047,7 +4048,7 @@ static void fb_copy_to_texture_hwstretch(struct wined3d_surface *dst_surface, st
checkGLcall
(
"glEnable(texture_target)"
);
/* For now invalidate the texture copy of the back buffer. Drawable and sysmem copy are untouched */
src_surface
->
locations
&=
~
SFLAG_INTEXTURE
;
src_surface
->
locations
&=
~
WINED3D_LOCATION_TEXTURE_RGB
;
}
/* Make sure that the top pixel is always above the bottom pixel, and keep a separate upside down flag
...
...
@@ -4251,8 +4252,8 @@ static void fb_copy_to_texture_hwstretch(struct wined3d_surface *dst_surface, st
/* The texture is now most up to date - If the surface is a render target
* and has a drawable, this path is never entered. */
surface_validate_location
(
dst_surface
,
SFLAG_INTEXTURE
);
surface_invalidate_location
(
dst_surface
,
~
SFLAG_INTEXTURE
);
surface_validate_location
(
dst_surface
,
WINED3D_LOCATION_TEXTURE_RGB
);
surface_invalidate_location
(
dst_surface
,
~
WINED3D_LOCATION_TEXTURE_RGB
);
}
/* Front buffer coordinates are always full screen coordinates, but our GL
...
...
@@ -4618,8 +4619,8 @@ void surface_modify_ds_location(struct wined3d_surface *surface,
{
TRACE
(
"surface %p, new location %#x, w %u, h %u.
\n
"
,
surface
,
location
,
w
,
h
);
if
(((
surface
->
locations
&
SFLAG_INTEXTURE
)
&&
!
(
location
&
SFLAG_INTEXTURE
))
||
(
!
(
surface
->
locations
&
SFLAG_INTEXTURE
)
&&
(
location
&
SFLAG_INTEXTURE
)))
if
(((
surface
->
locations
&
WINED3D_LOCATION_TEXTURE_RGB
)
&&
!
(
location
&
WINED3D_LOCATION_TEXTURE_RGB
))
||
(
!
(
surface
->
locations
&
WINED3D_LOCATION_TEXTURE_RGB
)
&&
(
location
&
WINED3D_LOCATION_TEXTURE_RGB
)))
wined3d_texture_set_dirty
(
surface
->
container
);
surface
->
ds_current_size
.
cx
=
w
;
...
...
@@ -4665,24 +4666,24 @@ void surface_load_ds_location(struct wined3d_surface *surface, struct wined3d_co
return
;
}
if
(
surface
->
locations
&
SFLAG
_DISCARDED
)
if
(
surface
->
locations
&
WINED3D_LOCATION
_DISCARDED
)
{
TRACE
(
"Surface was discarded, no need copy data.
\n
"
);
switch
(
location
)
{
case
SFLAG_INTEXTURE
:
case
WINED3D_LOCATION_TEXTURE_RGB
:
surface_prepare_texture
(
surface
,
context
,
FALSE
);
break
;
case
SFLAG_IN
RB_MULTISAMPLE
:
case
WINED3D_LOCATION_
RB_MULTISAMPLE
:
surface_prepare_rb
(
surface
,
gl_info
,
TRUE
);
break
;
case
SFLAG_IN
DRAWABLE
:
case
WINED3D_LOCATION_
DRAWABLE
:
/* Nothing to do */
break
;
default:
FIXME
(
"Unhandled location %#x
\n
"
,
location
);
}
surface
->
locations
&=
~
SFLAG
_DISCARDED
;
surface
->
locations
&=
~
WINED3D_LOCATION
_DISCARDED
;
surface
->
locations
|=
location
;
surface
->
ds_current_size
.
cx
=
surface
->
resource
.
width
;
surface
->
ds_current_size
.
cy
=
surface
->
resource
.
height
;
...
...
@@ -4698,7 +4699,7 @@ void surface_load_ds_location(struct wined3d_surface *surface, struct wined3d_co
return
;
}
if
(
location
==
SFLAG_INTEXTURE
)
if
(
location
==
WINED3D_LOCATION_TEXTURE_RGB
)
{
GLint
old_binding
=
0
;
GLenum
bind_target
;
...
...
@@ -4718,7 +4719,7 @@ void surface_load_ds_location(struct wined3d_surface *surface, struct wined3d_co
/* Note that we use depth_blt here as well, rather than glCopyTexImage2D
* directly on the FBO texture. That's because we need to flip. */
context_apply_fbo_state_blit
(
context
,
GL_FRAMEBUFFER
,
context
->
swapchain
->
front_buffer
,
NULL
,
SFLAG_IN
DRAWABLE
);
context
->
swapchain
->
front_buffer
,
NULL
,
WINED3D_LOCATION_
DRAWABLE
);
if
(
surface
->
texture_target
==
GL_TEXTURE_RECTANGLE_ARB
)
{
gl_info
->
gl_ops
.
gl
.
p_glGetIntegerv
(
GL_TEXTURE_BINDING_RECTANGLE_ARB
,
&
old_binding
);
...
...
@@ -4747,7 +4748,7 @@ void surface_load_ds_location(struct wined3d_surface *surface, struct wined3d_co
gl_info
->
gl_ops
.
gl
.
p_glBindTexture
(
bind_target
,
old_binding
);
context_apply_fbo_state_blit
(
context
,
GL_FRAMEBUFFER
,
NULL
,
surface
,
SFLAG_INTEXTURE
);
NULL
,
surface
,
WINED3D_LOCATION_TEXTURE_RGB
);
context_set_draw_buffer
(
context
,
GL_NONE
);
/* Do the actual blit */
...
...
@@ -4759,12 +4760,12 @@ void surface_load_ds_location(struct wined3d_surface *surface, struct wined3d_co
if
(
wined3d_settings
.
strict_draw_ordering
)
gl_info
->
gl_ops
.
gl
.
p_glFlush
();
/* Flush to ensure ordering across contexts. */
}
else
if
(
location
==
SFLAG_IN
DRAWABLE
)
else
if
(
location
==
WINED3D_LOCATION_
DRAWABLE
)
{
TRACE
(
"Copying depth texture to onscreen depth buffer.
\n
"
);
context_apply_fbo_state_blit
(
context
,
GL_FRAMEBUFFER
,
context
->
swapchain
->
front_buffer
,
NULL
,
SFLAG_IN
DRAWABLE
);
context
->
swapchain
->
front_buffer
,
NULL
,
WINED3D_LOCATION_
DRAWABLE
);
surface_depth_blt
(
surface
,
context
,
surface
->
container
->
texture_rgb
.
name
,
0
,
surface
->
pow2Height
-
h
,
w
,
h
,
surface
->
texture_target
);
checkGLcall
(
"depth_blt"
);
...
...
@@ -4786,16 +4787,16 @@ void surface_load_ds_location(struct wined3d_surface *surface, struct wined3d_co
void
surface_validate_location
(
struct
wined3d_surface
*
surface
,
DWORD
location
)
{
TRACE
(
"surface %p, location %s.
\n
"
,
surface
,
debug_surf
location
(
location
));
TRACE
(
"surface %p, location %s.
\n
"
,
surface
,
wined3d_debug_
location
(
location
));
surface
->
locations
|=
location
;
}
void
surface_invalidate_location
(
struct
wined3d_surface
*
surface
,
DWORD
location
)
{
TRACE
(
"surface %p, location %s.
\n
"
,
surface
,
debug_surf
location
(
location
));
TRACE
(
"surface %p, location %s.
\n
"
,
surface
,
wined3d_debug_
location
(
location
));
if
(
location
&
(
SFLAG_INTEXTURE
|
SFLAG_INSRGBTEX
))
if
(
location
&
(
WINED3D_LOCATION_TEXTURE_RGB
|
WINED3D_LOCATION_TEXTURE_SRGB
))
wined3d_texture_set_dirty
(
surface
->
container
);
surface
->
locations
&=
~
location
;
...
...
@@ -4807,17 +4808,17 @@ static DWORD resource_access_from_location(DWORD location)
{
switch
(
location
)
{
case
SFLAG_IN
SYSMEM
:
case
SFLAG_INUSERMEM
:
case
SFLAG_IN
DIB
:
case
SFLAG_IN
BUFFER
:
case
WINED3D_LOCATION_
SYSMEM
:
case
WINED3D_LOCATION_USER_MEMORY
:
case
WINED3D_LOCATION_
DIB
:
case
WINED3D_LOCATION_
BUFFER
:
return
WINED3D_RESOURCE_ACCESS_CPU
;
case
SFLAG_IN
DRAWABLE
:
case
SFLAG_INSRGBTEX
:
case
SFLAG_INTEXTURE
:
case
SFLAG_IN
RB_MULTISAMPLE
:
case
SFLAG_IN
RB_RESOLVED
:
case
WINED3D_LOCATION_
DRAWABLE
:
case
WINED3D_LOCATION_TEXTURE_SRGB
:
case
WINED3D_LOCATION_TEXTURE_RGB
:
case
WINED3D_LOCATION_
RB_MULTISAMPLE
:
case
WINED3D_LOCATION_
RB_RESOLVED
:
return
WINED3D_RESOURCE_ACCESS_GPU
;
default:
...
...
@@ -4871,11 +4872,11 @@ static void surface_load_sysmem(struct wined3d_surface *surface,
return
;
}
if
(
surface
->
locations
&
(
SFLAG_INRB_MULTISAMPLE
|
SFLAG_IN
RB_RESOLVED
))
surface_load_location
(
surface
,
SFLAG_INTEXTURE
);
if
(
surface
->
locations
&
(
WINED3D_LOCATION_RB_MULTISAMPLE
|
WINED3D_LOCATION_
RB_RESOLVED
))
surface_load_location
(
surface
,
WINED3D_LOCATION_TEXTURE_RGB
);
/* Download the surface to system memory. */
if
(
surface
->
locations
&
(
SFLAG_INTEXTURE
|
SFLAG_INSRGBTEX
))
if
(
surface
->
locations
&
(
WINED3D_LOCATION_TEXTURE_RGB
|
WINED3D_LOCATION_TEXTURE_SRGB
))
{
struct
wined3d_device
*
device
=
surface
->
resource
.
device
;
struct
wined3d_context
*
context
;
...
...
@@ -4883,7 +4884,8 @@ static void surface_load_sysmem(struct wined3d_surface *surface,
/* TODO: Use already acquired context when possible. */
context
=
context_acquire
(
device
,
NULL
);
wined3d_texture_bind_and_dirtify
(
surface
->
container
,
context
,
!
(
surface
->
locations
&
SFLAG_INTEXTURE
));
wined3d_texture_bind_and_dirtify
(
surface
->
container
,
context
,
!
(
surface
->
locations
&
WINED3D_LOCATION_TEXTURE_RGB
));
surface_download_data
(
surface
,
gl_info
,
dst_location
);
context_release
(
context
);
...
...
@@ -4891,14 +4893,14 @@ static void surface_load_sysmem(struct wined3d_surface *surface,
return
;
}
if
(
surface
->
locations
&
SFLAG_IN
DRAWABLE
)
if
(
surface
->
locations
&
WINED3D_LOCATION_
DRAWABLE
)
{
read_from_framebuffer
(
surface
,
dst_location
);
return
;
}
FIXME
(
"Can't load surface %p with location flags %s into sysmem.
\n
"
,
surface
,
debug_surf
location
(
surface
->
locations
));
surface
,
wined3d_debug_
location
(
surface
->
locations
));
}
static
HRESULT
surface_load_drawable
(
struct
wined3d_surface
*
surface
,
...
...
@@ -4908,12 +4910,12 @@ static HRESULT surface_load_drawable(struct wined3d_surface *surface,
if
(
wined3d_settings
.
offscreen_rendering_mode
==
ORM_FBO
&&
surface_is_offscreen
(
surface
))
{
ERR
(
"Trying to load offscreen surface into
SFLAG_IN
DRAWABLE.
\n
"
);
ERR
(
"Trying to load offscreen surface into
WINED3D_LOCATION_
DRAWABLE.
\n
"
);
return
WINED3DERR_INVALIDCALL
;
}
surface_get_rect
(
surface
,
NULL
,
&
r
);
surface_load_location
(
surface
,
SFLAG_INTEXTURE
);
surface_load_location
(
surface
,
WINED3D_LOCATION_TEXTURE_RGB
);
surface_blt_to_drawable
(
surface
->
resource
.
device
,
WINED3D_TEXF_POINT
,
FALSE
,
surface
,
&
r
,
surface
,
&
r
);
...
...
@@ -4935,38 +4937,38 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface,
if
(
wined3d_settings
.
offscreen_rendering_mode
!=
ORM_FBO
&&
surface_is_offscreen
(
surface
)
&&
(
surface
->
locations
&
SFLAG_IN
DRAWABLE
))
&&
(
surface
->
locations
&
WINED3D_LOCATION_
DRAWABLE
))
{
surface_load_fb_texture
(
surface
,
srgb
);
return
WINED3D_OK
;
}
if
(
surface
->
locations
&
(
SFLAG_INSRGBTEX
|
SFLAG_INTEXTURE
)
if
(
surface
->
locations
&
(
WINED3D_LOCATION_TEXTURE_SRGB
|
WINED3D_LOCATION_TEXTURE_RGB
)
&&
(
surface
->
resource
.
format
->
flags
&
WINED3DFMT_FLAG_FBO_ATTACHABLE_SRGB
)
&&
fbo_blit_supported
(
gl_info
,
WINED3D_BLIT_OP_COLOR_BLIT
,
NULL
,
surface
->
resource
.
usage
,
surface
->
resource
.
pool
,
surface
->
resource
.
format
,
NULL
,
surface
->
resource
.
usage
,
surface
->
resource
.
pool
,
surface
->
resource
.
format
))
{
if
(
srgb
)
surface_blt_fbo
(
device
,
WINED3D_TEXF_POINT
,
surface
,
SFLAG_INTEXTURE
,
&
src_rect
,
surface
,
SFLAG_INSRGBTEX
,
&
src_rect
);
surface_blt_fbo
(
device
,
WINED3D_TEXF_POINT
,
surface
,
WINED3D_LOCATION_TEXTURE_RGB
,
&
src_rect
,
surface
,
WINED3D_LOCATION_TEXTURE_SRGB
,
&
src_rect
);
else
surface_blt_fbo
(
device
,
WINED3D_TEXF_POINT
,
surface
,
SFLAG_INSRGBTEX
,
&
src_rect
,
surface
,
SFLAG_INTEXTURE
,
&
src_rect
);
surface_blt_fbo
(
device
,
WINED3D_TEXF_POINT
,
surface
,
WINED3D_LOCATION_TEXTURE_SRGB
,
&
src_rect
,
surface
,
WINED3D_LOCATION_TEXTURE_RGB
,
&
src_rect
);
return
WINED3D_OK
;
}
if
(
surface
->
locations
&
(
SFLAG_INRB_MULTISAMPLE
|
SFLAG_IN
RB_RESOLVED
)
if
(
surface
->
locations
&
(
WINED3D_LOCATION_RB_MULTISAMPLE
|
WINED3D_LOCATION_
RB_RESOLVED
)
&&
(
!
srgb
||
(
surface
->
resource
.
format
->
flags
&
WINED3DFMT_FLAG_FBO_ATTACHABLE_SRGB
))
&&
fbo_blit_supported
(
gl_info
,
WINED3D_BLIT_OP_COLOR_BLIT
,
NULL
,
surface
->
resource
.
usage
,
surface
->
resource
.
pool
,
surface
->
resource
.
format
,
NULL
,
surface
->
resource
.
usage
,
surface
->
resource
.
pool
,
surface
->
resource
.
format
))
{
DWORD
src_location
=
surface
->
locations
&
SFLAG_IN
RB_RESOLVED
?
SFLAG_INRB_RESOLVED
:
SFLAG_IN
RB_MULTISAMPLE
;
DWORD
dst_location
=
srgb
?
SFLAG_INSRGBTEX
:
SFLAG_INTEXTURE
;
DWORD
src_location
=
surface
->
locations
&
WINED3D_LOCATION_
RB_RESOLVED
?
WINED3D_LOCATION_RB_RESOLVED
:
WINED3D_LOCATION_
RB_MULTISAMPLE
;
DWORD
dst_location
=
srgb
?
WINED3D_LOCATION_TEXTURE_SRGB
:
WINED3D_LOCATION_TEXTURE_RGB
;
RECT
rect
=
{
0
,
0
,
surface
->
resource
.
width
,
surface
->
resource
.
height
};
surface_blt_fbo
(
device
,
WINED3D_TEXF_POINT
,
surface
,
src_location
,
...
...
@@ -4982,7 +4984,8 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface,
if
(
srgb
)
{
if
((
surface
->
locations
&
(
SFLAG_INTEXTURE
|
surface
->
map_binding
))
==
SFLAG_INTEXTURE
)
if
((
surface
->
locations
&
(
WINED3D_LOCATION_TEXTURE_RGB
|
surface
->
map_binding
))
==
WINED3D_LOCATION_TEXTURE_RGB
)
{
/* Performance warning... */
FIXME
(
"Downloading RGB surface %p to reload it as sRGB.
\n
"
,
surface
);
...
...
@@ -4992,7 +4995,8 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface,
}
else
{
if
((
surface
->
locations
&
(
SFLAG_INSRGBTEX
|
surface
->
map_binding
))
==
SFLAG_INSRGBTEX
)
if
((
surface
->
locations
&
(
WINED3D_LOCATION_TEXTURE_SRGB
|
surface
->
map_binding
))
==
WINED3D_LOCATION_TEXTURE_SRGB
)
{
/* Performance warning... */
FIXME
(
"Downloading sRGB surface %p to reload it as RGB.
\n
"
,
surface
);
...
...
@@ -5006,7 +5010,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface,
WARN
(
"Trying to load a texture from sysmem, but no simple location is valid.
\n
"
);
/* Lets hope we get it from somewhere... */
surface_prepare_system_memory
(
surface
);
surface_load_location
(
surface
,
SFLAG_IN
SYSMEM
);
surface_load_location
(
surface
,
WINED3D_LOCATION_
SYSMEM
);
}
/* TODO: Use already acquired context when possible. */
...
...
@@ -5033,9 +5037,9 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface,
TRACE
(
"Removing the pbo attached to surface %p.
\n
"
,
surface
);
if
(
surface
->
flags
&
SFLAG_DIBSECTION
)
surface
->
map_binding
=
SFLAG_IN
DIB
;
surface
->
map_binding
=
WINED3D_LOCATION_
DIB
;
else
surface
->
map_binding
=
SFLAG_IN
SYSMEM
;
surface
->
map_binding
=
WINED3D_LOCATION_
SYSMEM
;
surface_prepare_map_memory
(
surface
);
surface_load_location
(
surface
,
surface
->
map_binding
);
...
...
@@ -5099,11 +5103,12 @@ static void surface_multisample_resolve(struct wined3d_surface *surface)
{
RECT
rect
=
{
0
,
0
,
surface
->
resource
.
width
,
surface
->
resource
.
height
};
if
(
!
(
surface
->
locations
&
SFLAG_INRB_MULTISAMPLE
))
ERR
(
"Trying to resolve multisampled surface %p, but location SFLAG_INRB_MULTISAMPLE not current.
\n
"
,
surface
);
if
(
!
(
surface
->
locations
&
WINED3D_LOCATION_RB_MULTISAMPLE
))
ERR
(
"Trying to resolve multisampled surface %p, but location WINED3D_LOCATION_RB_MULTISAMPLE not current.
\n
"
,
surface
);
surface_blt_fbo
(
surface
->
resource
.
device
,
WINED3D_TEXF_POINT
,
surface
,
SFLAG_INRB_MULTISAMPLE
,
&
rect
,
surface
,
SFLAG_IN
RB_RESOLVED
,
&
rect
);
surface
,
WINED3D_LOCATION_RB_MULTISAMPLE
,
&
rect
,
surface
,
WINED3D_LOCATION_
RB_RESOLVED
,
&
rect
);
}
HRESULT
surface_load_location
(
struct
wined3d_surface
*
surface
,
DWORD
location
)
...
...
@@ -5112,18 +5117,18 @@ HRESULT surface_load_location(struct wined3d_surface *surface, DWORD location)
const
struct
wined3d_gl_info
*
gl_info
=
&
device
->
adapter
->
gl_info
;
HRESULT
hr
;
TRACE
(
"surface %p, location %s.
\n
"
,
surface
,
debug_surf
location
(
location
));
TRACE
(
"surface %p, location %s.
\n
"
,
surface
,
wined3d_debug_
location
(
location
));
if
(
surface
->
resource
.
usage
&
WINED3DUSAGE_DEPTHSTENCIL
)
{
if
(
location
==
SFLAG_INTEXTURE
&&
surface
->
locations
&
SFLAG_IN
DRAWABLE
)
if
(
location
==
WINED3D_LOCATION_TEXTURE_RGB
&&
surface
->
locations
&
WINED3D_LOCATION_
DRAWABLE
)
{
struct
wined3d_context
*
context
=
context_acquire
(
device
,
NULL
);
surface_load_ds_location
(
surface
,
context
,
location
);
context_release
(
context
);
return
WINED3D_OK
;
}
else
if
(
location
&
surface
->
locations
&&
surface
->
draw_binding
!=
SFLAG_IN
DRAWABLE
)
else
if
(
location
&
surface
->
locations
&&
surface
->
draw_binding
!=
WINED3D_LOCATION_
DRAWABLE
)
{
/* Already up to date, nothing to do. */
return
WINED3D_OK
;
...
...
@@ -5131,7 +5136,7 @@ HRESULT surface_load_location(struct wined3d_surface *surface, DWORD location)
else
{
FIXME
(
"Unimplemented copy from %s to %s for depth/stencil buffers.
\n
"
,
debug_surflocation
(
surface
->
locations
),
debug_surf
location
(
location
));
wined3d_debug_location
(
surface
->
locations
),
wined3d_debug_
location
(
location
));
return
WINED3DERR_INVALIDCALL
;
}
}
...
...
@@ -5159,25 +5164,25 @@ HRESULT surface_load_location(struct wined3d_surface *surface, DWORD location)
switch
(
location
)
{
case
SFLAG_IN
DIB
:
case
SFLAG_INUSERMEM
:
case
SFLAG_IN
SYSMEM
:
case
SFLAG_IN
BUFFER
:
case
WINED3D_LOCATION_
DIB
:
case
WINED3D_LOCATION_USER_MEMORY
:
case
WINED3D_LOCATION_
SYSMEM
:
case
WINED3D_LOCATION_
BUFFER
:
surface_load_sysmem
(
surface
,
gl_info
,
location
);
break
;
case
SFLAG_IN
DRAWABLE
:
case
WINED3D_LOCATION_
DRAWABLE
:
if
(
FAILED
(
hr
=
surface_load_drawable
(
surface
,
gl_info
)))
return
hr
;
break
;
case
SFLAG_IN
RB_RESOLVED
:
case
WINED3D_LOCATION_
RB_RESOLVED
:
surface_multisample_resolve
(
surface
);
break
;
case
SFLAG_INTEXTURE
:
case
SFLAG_INSRGBTEX
:
if
(
FAILED
(
hr
=
surface_load_texture
(
surface
,
gl_info
,
location
==
SFLAG_INSRGBTEX
)))
case
WINED3D_LOCATION_TEXTURE_RGB
:
case
WINED3D_LOCATION_TEXTURE_SRGB
:
if
(
FAILED
(
hr
=
surface_load_texture
(
surface
,
gl_info
,
location
==
WINED3D_LOCATION_TEXTURE_SRGB
)))
return
hr
;
break
;
...
...
@@ -5188,7 +5193,7 @@ HRESULT surface_load_location(struct wined3d_surface *surface, DWORD location)
surface_validate_location
(
surface
,
location
);
if
(
location
!=
SFLAG_INSYSMEM
&&
(
surface
->
locations
&
SFLAG_IN
SYSMEM
))
if
(
location
!=
WINED3D_LOCATION_SYSMEM
&&
(
surface
->
locations
&
WINED3D_LOCATION_
SYSMEM
))
surface_evict_sysmem
(
surface
);
return
WINED3D_OK
;
...
...
@@ -6218,8 +6223,8 @@ HRESULT CDECL wined3d_surface_blt(struct wined3d_surface *dst_surface, const REC
TRACE
(
"Color blit.
\n
"
);
/* Upload */
if
((
src_surface
->
locations
&
SFLAG_IN
SYSMEM
)
&&
!
(
dst_surface
->
locations
&
SFLAG_IN
SYSMEM
))
if
((
src_surface
->
locations
&
WINED3D_LOCATION_
SYSMEM
)
&&
!
(
dst_surface
->
locations
&
WINED3D_LOCATION_
SYSMEM
))
{
if
(
scale
)
TRACE
(
"Not doing upload because of scaling.
\n
"
);
...
...
@@ -6367,7 +6372,7 @@ static HRESULT surface_init(struct wined3d_surface *surface, struct wined3d_text
}
surface_set_container
(
surface
,
container
);
surface_validate_location
(
surface
,
SFLAG_IN
SYSMEM
);
surface_validate_location
(
surface
,
WINED3D_LOCATION_
SYSMEM
);
list_init
(
&
surface
->
renderbuffers
);
list_init
(
&
surface
->
overlays
);
...
...
@@ -6390,7 +6395,7 @@ static HRESULT surface_init(struct wined3d_surface *surface, struct wined3d_text
if
(
lockable
&&
(
desc
->
usage
&
WINED3DUSAGE_RENDERTARGET
))
surface
->
flags
|=
SFLAG_DYNLOCK
;
surface
->
map_binding
=
SFLAG_IN
SYSMEM
;
surface
->
map_binding
=
WINED3D_LOCATION_
SYSMEM
;
/* Call the private setup routine */
hr
=
surface
->
surface_ops
->
surface_private_setup
(
surface
);
...
...
@@ -6407,13 +6412,13 @@ static HRESULT surface_init(struct wined3d_surface *surface, struct wined3d_text
* after a wined3d_surface_getdc() call. */
if
((
desc
->
usage
&
WINED3DUSAGE_OWNDC
)
&&
!
surface
->
hDC
&&
SUCCEEDED
(
surface_create_dib_section
(
surface
)))
surface
->
map_binding
=
SFLAG_IN
DIB
;
surface
->
map_binding
=
WINED3D_LOCATION_
DIB
;
if
(
surface
->
map_binding
==
SFLAG_IN
DIB
)
if
(
surface
->
map_binding
==
WINED3D_LOCATION_
DIB
)
{
wined3d_resource_free_sysmem
(
&
surface
->
resource
);
surface_validate_location
(
surface
,
SFLAG_IN
DIB
);
surface_invalidate_location
(
surface
,
SFLAG_IN
SYSMEM
);
surface_validate_location
(
surface
,
WINED3D_LOCATION_
DIB
);
surface_invalidate_location
(
surface
,
WINED3D_LOCATION_
SYSMEM
);
}
return
hr
;
...
...
dlls/wined3d/swapchain.c
View file @
b81e5605
...
...
@@ -297,11 +297,11 @@ static void swapchain_blit(const struct wined3d_swapchain *swapchain,
if
(
gl_info
->
fbo_ops
.
glBlitFramebuffer
&&
is_identity_fixup
(
backbuffer
->
resource
.
format
->
color_fixup
))
{
DWORD
location
=
SFLAG_INTEXTURE
;
DWORD
location
=
WINED3D_LOCATION_TEXTURE_RGB
;
if
(
backbuffer
->
resource
.
multisample_type
)
{
location
=
SFLAG_IN
RB_RESOLVED
;
location
=
WINED3D_LOCATION_
RB_RESOLVED
;
surface_load_location
(
backbuffer
,
location
);
}
...
...
@@ -309,7 +309,8 @@ static void swapchain_blit(const struct wined3d_swapchain *swapchain,
gl_info
->
gl_ops
.
gl
.
p_glReadBuffer
(
GL_COLOR_ATTACHMENT0
);
context_check_fbo_status
(
context
,
GL_READ_FRAMEBUFFER
);
context_apply_fbo_state_blit
(
context
,
GL_DRAW_FRAMEBUFFER
,
swapchain
->
front_buffer
,
NULL
,
SFLAG_INDRAWABLE
);
context_apply_fbo_state_blit
(
context
,
GL_DRAW_FRAMEBUFFER
,
swapchain
->
front_buffer
,
NULL
,
WINED3D_LOCATION_DRAWABLE
);
context_set_draw_buffer
(
context
,
GL_BACK
);
context_invalidate_state
(
context
,
STATE_FRAMEBUFFER
);
...
...
@@ -351,7 +352,8 @@ static void swapchain_blit(const struct wined3d_swapchain *swapchain,
if
(
is_complex_fixup
(
backbuffer
->
resource
.
format
->
color_fixup
))
gl_filter
=
GL_NEAREST
;
context_apply_fbo_state_blit
(
context2
,
GL_FRAMEBUFFER
,
swapchain
->
front_buffer
,
NULL
,
SFLAG_INDRAWABLE
);
context_apply_fbo_state_blit
(
context2
,
GL_FRAMEBUFFER
,
swapchain
->
front_buffer
,
NULL
,
WINED3D_LOCATION_DRAWABLE
);
context_bind_texture
(
context2
,
backbuffer
->
texture_target
,
backbuffer
->
container
->
texture_rgb
.
name
);
/* Set up the texture. The surface is not in a wined3d_texture
...
...
@@ -498,8 +500,8 @@ static void swapchain_gl_present(struct wined3d_swapchain *swapchain, const RECT
*/
if
(
!
swapchain
->
render_to_fbo
&&
render_to_fbo
&&
wined3d_settings
.
offscreen_rendering_mode
==
ORM_FBO
)
{
surface_load_location
(
back_buffer
,
SFLAG_INTEXTURE
);
surface_invalidate_location
(
back_buffer
,
SFLAG_IN
DRAWABLE
);
surface_load_location
(
back_buffer
,
WINED3D_LOCATION_TEXTURE_RGB
);
surface_invalidate_location
(
back_buffer
,
WINED3D_LOCATION_
DRAWABLE
);
swapchain
->
render_to_fbo
=
TRUE
;
swapchain_update_draw_bindings
(
swapchain
);
}
...
...
@@ -541,8 +543,8 @@ static void swapchain_gl_present(struct wined3d_swapchain *swapchain, const RECT
}
}
if
(
!
swapchain
->
render_to_fbo
&&
((
swapchain
->
front_buffer
->
locations
&
SFLAG_IN
SYSMEM
)
||
(
back_buffer
->
locations
&
SFLAG_IN
SYSMEM
)))
if
(
!
swapchain
->
render_to_fbo
&&
((
swapchain
->
front_buffer
->
locations
&
WINED3D_LOCATION_
SYSMEM
)
||
(
back_buffer
->
locations
&
WINED3D_LOCATION_
SYSMEM
)))
{
/* Both memory copies of the surfaces are ok, flip them around too instead of dirtifying
* Doesn't work with render_to_fbo because we're not flipping
...
...
@@ -556,20 +558,20 @@ static void swapchain_gl_present(struct wined3d_swapchain *swapchain, const RECT
/* Tell the front buffer surface that is has been modified. However,
* the other locations were preserved during that, so keep the flags.
* This serves to update the emulated overlay, if any. */
surface_validate_location
(
front
,
SFLAG_IN
DRAWABLE
);
surface_validate_location
(
front
,
WINED3D_LOCATION_
DRAWABLE
);
}
else
{
surface_validate_location
(
front
,
SFLAG_IN
DRAWABLE
);
surface_invalidate_location
(
front
,
~
SFLAG_IN
DRAWABLE
);
surface_validate_location
(
back_buffer
,
SFLAG_IN
DRAWABLE
);
surface_invalidate_location
(
back_buffer
,
~
SFLAG_IN
DRAWABLE
);
surface_validate_location
(
front
,
WINED3D_LOCATION_
DRAWABLE
);
surface_invalidate_location
(
front
,
~
WINED3D_LOCATION_
DRAWABLE
);
surface_validate_location
(
back_buffer
,
WINED3D_LOCATION_
DRAWABLE
);
surface_invalidate_location
(
back_buffer
,
~
WINED3D_LOCATION_
DRAWABLE
);
}
}
else
{
surface_validate_location
(
swapchain
->
front_buffer
,
SFLAG_IN
DRAWABLE
);
surface_invalidate_location
(
swapchain
->
front_buffer
,
~
SFLAG_IN
DRAWABLE
);
surface_validate_location
(
swapchain
->
front_buffer
,
WINED3D_LOCATION_
DRAWABLE
);
surface_invalidate_location
(
swapchain
->
front_buffer
,
~
WINED3D_LOCATION_
DRAWABLE
);
/* If the swapeffect is DISCARD, the back buffer is undefined. That means the SYSMEM
* and INTEXTURE copies can keep their old content if they have any defined content.
* If the swapeffect is COPY, the content remains the same. If it is FLIP however,
...
...
@@ -587,7 +589,7 @@ static void swapchain_gl_present(struct wined3d_swapchain *swapchain, const RECT
if
(
swapchain
->
desc
.
flags
&
WINED3DPRESENTFLAG_DISCARD_DEPTHSTENCIL
||
fb
->
depth_stencil
->
flags
&
SFLAG_DISCARD
)
{
surface_modify_ds_location
(
fb
->
depth_stencil
,
SFLAG
_DISCARDED
,
surface_modify_ds_location
(
fb
->
depth_stencil
,
WINED3D_LOCATION
_DISCARDED
,
fb
->
depth_stencil
->
resource
.
width
,
fb
->
depth_stencil
->
resource
.
height
);
if
(
fb
->
depth_stencil
==
swapchain
->
device
->
onscreen_depth_stencil
)
...
...
@@ -623,7 +625,7 @@ void x11_copy_to_screen(const struct wined3d_swapchain *swapchain, const RECT *r
TRACE
(
"Copying surface %p to screen.
\n
"
,
front
);
surface_load_location
(
front
,
SFLAG_IN
DIB
);
surface_load_location
(
front
,
WINED3D_LOCATION_
DIB
);
src_dc
=
front
->
hDC
;
window
=
swapchain
->
win_handle
;
...
...
@@ -846,8 +848,8 @@ static HRESULT swapchain_init(struct wined3d_swapchain *swapchain, struct wined3
surface_set_swapchain
(
swapchain
->
front_buffer
,
swapchain
);
if
(
!
(
device
->
wined3d
->
flags
&
WINED3D_NO3D
))
{
surface_validate_location
(
swapchain
->
front_buffer
,
SFLAG_IN
DRAWABLE
);
surface_invalidate_location
(
swapchain
->
front_buffer
,
~
SFLAG_IN
DRAWABLE
);
surface_validate_location
(
swapchain
->
front_buffer
,
WINED3D_LOCATION_
DRAWABLE
);
surface_invalidate_location
(
swapchain
->
front_buffer
,
~
WINED3D_LOCATION_
DRAWABLE
);
}
/* MSDN says we're only allowed a single fullscreen swapchain per device,
...
...
dlls/wined3d/utils.c
View file @
b81e5605
...
...
@@ -2794,22 +2794,6 @@ void dump_color_fixup_desc(struct color_fixup_desc fixup)
TRACE
(
"
\t
W: %s%s
\n
"
,
debug_fixup_channel_source
(
fixup
.
w_source
),
fixup
.
w_sign_fixup
?
", SIGN_FIXUP"
:
""
);
}
const
char
*
debug_surflocation
(
DWORD
flag
)
{
char
buf
[
172
];
buf
[
0
]
=
0
;
if
(
flag
&
SFLAG_INSYSMEM
)
strcat
(
buf
,
" | SFLAG_INSYSMEM"
);
/* 17 */
if
(
flag
&
SFLAG_INDRAWABLE
)
strcat
(
buf
,
" | SFLAG_INDRAWABLE"
);
/* 19 */
if
(
flag
&
SFLAG_INTEXTURE
)
strcat
(
buf
,
" | SFLAG_INTEXTURE"
);
/* 18 */
if
(
flag
&
SFLAG_INSRGBTEX
)
strcat
(
buf
,
" | SFLAG_INSRGBTEX"
);
/* 18 */
if
(
flag
&
SFLAG_INRB_MULTISAMPLE
)
strcat
(
buf
,
" | SFLAG_INRB_MULTISAMPLE"
);
/* 25 */
if
(
flag
&
SFLAG_INRB_RESOLVED
)
strcat
(
buf
,
" | SFLAG_INRB_RESOLVED"
);
/* 22 */
if
(
flag
&
SFLAG_INUSERMEM
)
strcat
(
buf
,
" | SFLAG_INUSERMEM"
);
/* 18 */
if
(
flag
&
SFLAG_INDIB
)
strcat
(
buf
,
" | SFLAG_INDIB"
);
/* 14 */
if
(
flag
&
SFLAG_INBUFFER
)
strcat
(
buf
,
" | SFLAG_INBUFFER"
);
/* 17 */
return
wine_dbg_sprintf
(
"%s"
,
buf
[
0
]
?
buf
+
3
:
"0"
);
}
BOOL
is_invalid_op
(
const
struct
wined3d_state
*
state
,
int
stage
,
enum
wined3d_texture_op
op
,
DWORD
arg1
,
DWORD
arg2
,
DWORD
arg3
)
{
...
...
@@ -3792,15 +3776,20 @@ void wined3d_get_draw_rect(const struct wined3d_state *state, RECT *rect)
const
char
*
wined3d_debug_location
(
DWORD
location
)
{
char
buf
[
2
00
];
char
buf
[
2
94
];
buf
[
0
]
=
'\0'
;
#define LOCATION_TO_STR(u) if (location & u) { strcat(buf, " | "#u); location &= ~u; }
LOCATION_TO_STR
(
WINED3D_LOCATION_DISCARDED
);
LOCATION_TO_STR
(
WINED3D_LOCATION_SYSMEM
);
LOCATION_TO_STR
(
WINED3D_LOCATION_USER_MEMORY
);
LOCATION_TO_STR
(
WINED3D_LOCATION_DIB
);
LOCATION_TO_STR
(
WINED3D_LOCATION_BUFFER
);
LOCATION_TO_STR
(
WINED3D_LOCATION_TEXTURE_RGB
);
LOCATION_TO_STR
(
WINED3D_LOCATION_TEXTURE_SRGB
);
LOCATION_TO_STR
(
WINED3D_LOCATION_DRAWABLE
);
LOCATION_TO_STR
(
WINED3D_LOCATION_RB_MULTISAMPLE
);
LOCATION_TO_STR
(
WINED3D_LOCATION_RB_RESOLVED
);
#undef LOCATION_TO_STR
if
(
location
)
FIXME
(
"Unrecognized location flag(s) %#x.
\n
"
,
location
);
...
...
dlls/wined3d/wined3d_private.h
View file @
b81e5605
...
...
@@ -2119,9 +2119,14 @@ void wined3d_texture_set_dirty(struct wined3d_texture *texture) DECLSPEC_HIDDEN;
#define WINED3D_LOCATION_DISCARDED 0x00000001
#define WINED3D_LOCATION_SYSMEM 0x00000002
#define WINED3D_LOCATION_BUFFER 0x00000004
#define WINED3D_LOCATION_TEXTURE_RGB 0x00000008
#define WINED3D_LOCATION_TEXTURE_SRGB 0x00000010
#define WINED3D_LOCATION_USER_MEMORY 0x00000004
#define WINED3D_LOCATION_DIB 0x00000008
#define WINED3D_LOCATION_BUFFER 0x00000010
#define WINED3D_LOCATION_TEXTURE_RGB 0x00000020
#define WINED3D_LOCATION_TEXTURE_SRGB 0x00000040
#define WINED3D_LOCATION_DRAWABLE 0x00000080
#define WINED3D_LOCATION_RB_MULTISAMPLE 0x00000100
#define WINED3D_LOCATION_RB_RESOLVED 0x00000200
const
char
*
wined3d_debug_location
(
DWORD
location
)
DECLSPEC_HIDDEN
;
...
...
@@ -2295,16 +2300,6 @@ void flip_surface(struct wined3d_surface *front, struct wined3d_surface *back) D
#define SFLAG_DIBSECTION 0x00000400
/* Has a DIB section attached for GetDC. */
#define SFLAG_ALLOCATED 0x00000800
/* A GL texture is allocated for this surface. */
#define SFLAG_SRGBALLOCATED 0x00001000
/* A sRGB GL texture is allocated for this surface. */
#define SFLAG_INSYSMEM 0x00002000
/* The system memory copy is current. */
#define SFLAG_INUSERMEM 0x00004000
/* The user memory copy is current. */
#define SFLAG_INDIB 0x00008000
/* The DIB copy is current. */
#define SFLAG_INBUFFER 0x00010000
/* The PBO copy is current. */
#define SFLAG_INTEXTURE 0x00020000
/* The GL texture is current. */
#define SFLAG_INSRGBTEX 0x00040000
/* The GL sRGB texture is current. */
#define SFLAG_INDRAWABLE 0x00080000
/* The GL drawable is current. */
#define SFLAG_INRB_MULTISAMPLE 0x00100000
/* The multisample renderbuffer is current. */
#define SFLAG_INRB_RESOLVED 0x00200000
/* The resolved renderbuffer is current. */
#define SFLAG_DISCARDED 0x00400000
/* Surface was discarded, allocating new location is enough. */
/* In some conditions the surface memory must not be freed:
* SFLAG_CONVERTED: Converting the data back would take too long
...
...
@@ -2652,7 +2647,6 @@ const char *debug_fbostatus(GLenum status) DECLSPEC_HIDDEN;
const
char
*
debug_glerror
(
GLenum
error
)
DECLSPEC_HIDDEN
;
const
char
*
debug_d3dtop
(
enum
wined3d_texture_op
d3dtop
)
DECLSPEC_HIDDEN
;
void
dump_color_fixup_desc
(
struct
color_fixup_desc
fixup
)
DECLSPEC_HIDDEN
;
const
char
*
debug_surflocation
(
DWORD
flag
)
DECLSPEC_HIDDEN
;
BOOL
is_invalid_op
(
const
struct
wined3d_state
*
state
,
int
stage
,
enum
wined3d_texture_op
op
,
DWORD
arg1
,
DWORD
arg2
,
DWORD
arg3
)
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