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
a3f59cf6
Commit
a3f59cf6
authored
Jun 03, 2013
by
Henri Verbeet
Committed by
Alexandre Julliard
Jun 03, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Allow textures as swapchain surfaces.
parent
48d470f6
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
22 additions
and
48 deletions
+22
-48
arb_program_shader.c
dlls/wined3d/arb_program_shader.c
+3
-4
context.c
dlls/wined3d/context.c
+5
-6
device.c
dlls/wined3d/device.c
+1
-2
surface.c
dlls/wined3d/surface.c
+0
-0
swapchain.c
dlls/wined3d/swapchain.c
+6
-12
texture.c
dlls/wined3d/texture.c
+3
-3
wined3d_private.h
dlls/wined3d/wined3d_private.h
+4
-21
No files found.
dlls/wined3d/arb_program_shader.c
View file @
a3f59cf6
...
...
@@ -7245,8 +7245,8 @@ static HRESULT arbfp_blit_set(void *blit_priv, struct wined3d_context *context,
const
struct
wined3d_gl_info
*
gl_info
=
context
->
gl_info
;
GLenum
textype
;
if
(
surface
->
container
.
type
==
WINED3D_CONTAINER_TEXTURE
)
textype
=
surface
->
container
.
u
.
texture
->
target
;
if
(
surface
->
container
)
textype
=
surface
->
container
->
target
;
else
textype
=
surface
->
texture_target
;
...
...
@@ -7429,8 +7429,7 @@ HRESULT arbfp_blit_surface(struct wined3d_device *device, DWORD filter,
arbfp_blit_unset
(
context
->
gl_info
);
if
(
wined3d_settings
.
strict_draw_ordering
||
(
dst_surface
->
container
.
type
==
WINED3D_CONTAINER_SWAPCHAIN
&&
(
dst_surface
->
container
.
u
.
swapchain
->
front_buffer
==
dst_surface
)))
||
(
dst_surface
->
swapchain
&&
(
dst_surface
->
swapchain
->
front_buffer
==
dst_surface
)))
context
->
gl_info
->
gl_ops
.
gl
.
p_glFlush
();
/* Flush to ensure ordering across contexts. */
context_release
(
context
);
...
...
dlls/wined3d/context.c
View file @
a3f59cf6
...
...
@@ -1705,8 +1705,7 @@ static void context_get_rt_size(const struct wined3d_context *context, SIZE *siz
{
const
struct
wined3d_surface
*
rt
=
context
->
current_rt
;
if
(
rt
->
container
.
type
==
WINED3D_CONTAINER_SWAPCHAIN
&&
rt
->
container
.
u
.
swapchain
->
front_buffer
==
rt
)
if
(
rt
->
swapchain
&&
rt
->
swapchain
->
front_buffer
==
rt
)
{
RECT
window_size
;
...
...
@@ -2086,7 +2085,7 @@ 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
;
struct
wined3d_swapchain
*
swapchain
=
context
->
current_rt
->
swapchain
;
if
(
context
->
render_offscreen
||
!
depth_stencil
)
return
;
if
(
match_depth_stencil_format
(
swapchain
->
ds_format
,
depth_stencil
->
resource
.
format
))
return
;
...
...
@@ -2107,7 +2106,7 @@ static DWORD context_generate_rt_mask_no_fbo(const struct wined3d_device *device
{
if
(
!
rt
||
rt
->
resource
.
format
->
id
==
WINED3DFMT_NULL
)
return
0
;
else
if
(
rt
->
container
.
type
==
WINED3D_CONTAINER_SWAPCHAIN
)
else
if
(
rt
->
swapchain
)
return
context_generate_rt_mask_from_surface
(
rt
);
else
return
context_generate_rt_mask
(
device
->
offscreenBuffer
);
...
...
@@ -2497,11 +2496,11 @@ struct wined3d_context *context_acquire(const struct wined3d_device *device, str
{
context
=
current_context
;
}
else
if
(
target
->
container
.
type
==
WINED3D_CONTAINER_SWAPCHAIN
)
else
if
(
target
->
swapchain
)
{
TRACE
(
"Rendering onscreen.
\n
"
);
context
=
swapchain_get_context
(
target
->
container
.
u
.
swapchain
);
context
=
swapchain_get_context
(
target
->
swapchain
);
}
else
{
...
...
dlls/wined3d/device.c
View file @
a3f59cf6
...
...
@@ -715,8 +715,7 @@ void device_clear_render_targets(struct wined3d_device *device, UINT rt_count, c
}
if
(
wined3d_settings
.
strict_draw_ordering
||
(
flags
&
WINED3DCLEAR_TARGET
&&
target
->
container
.
type
==
WINED3D_CONTAINER_SWAPCHAIN
&&
target
->
container
.
u
.
swapchain
->
front_buffer
==
target
))
&&
target
->
swapchain
&&
target
->
swapchain
->
front_buffer
==
target
))
gl_info
->
gl_ops
.
gl
.
p_glFlush
();
/* Flush to ensure ordering across contexts. */
context_release
(
context
);
...
...
dlls/wined3d/surface.c
View file @
a3f59cf6
This diff is collapsed.
Click to expand it.
dlls/wined3d/swapchain.c
View file @
a3f59cf6
...
...
@@ -42,8 +42,7 @@ static void swapchain_cleanup(struct wined3d_swapchain *swapchain)
* is the last buffer to be destroyed, FindContext() depends on that. */
if
(
swapchain
->
front_buffer
)
{
if
(
swapchain
->
front_buffer
->
container
.
type
==
WINED3D_CONTAINER_SWAPCHAIN
)
surface_set_container
(
swapchain
->
front_buffer
,
WINED3D_CONTAINER_NONE
,
NULL
);
surface_set_swapchain
(
swapchain
->
front_buffer
,
NULL
);
if
(
wined3d_surface_decref
(
swapchain
->
front_buffer
))
WARN
(
"Something's still holding the front buffer (%p).
\n
"
,
swapchain
->
front_buffer
);
swapchain
->
front_buffer
=
NULL
;
...
...
@@ -55,8 +54,7 @@ static void swapchain_cleanup(struct wined3d_swapchain *swapchain)
while
(
i
--
)
{
if
(
swapchain
->
back_buffers
[
i
]
->
container
.
type
==
WINED3D_CONTAINER_SWAPCHAIN
)
surface_set_container
(
swapchain
->
back_buffers
[
i
],
WINED3D_CONTAINER_NONE
,
NULL
);
surface_set_swapchain
(
swapchain
->
back_buffers
[
i
],
NULL
);
if
(
wined3d_surface_decref
(
swapchain
->
back_buffers
[
i
]))
WARN
(
"Something's still holding back buffer %u (%p).
\n
"
,
i
,
swapchain
->
back_buffers
[
i
]);
}
...
...
@@ -898,8 +896,7 @@ static HRESULT swapchain_init(struct wined3d_swapchain *swapchain, struct wined3
goto
err
;
}
if
(
swapchain
->
front_buffer
->
container
.
type
==
WINED3D_CONTAINER_NONE
)
surface_set_container
(
swapchain
->
front_buffer
,
WINED3D_CONTAINER_SWAPCHAIN
,
swapchain
);
surface_set_swapchain
(
swapchain
->
front_buffer
,
swapchain
);
if
(
!
(
device
->
wined3d
->
flags
&
WINED3D_NO3D
))
surface_modify_location
(
swapchain
->
front_buffer
,
SFLAG_INDRAWABLE
,
TRUE
);
...
...
@@ -1007,8 +1004,7 @@ static HRESULT swapchain_init(struct wined3d_swapchain *swapchain, struct wined3
WARN
(
"Failed to create back buffer %u, hr %#x.
\n
"
,
i
,
hr
);
goto
err
;
}
if
(
swapchain
->
back_buffers
[
i
]
->
container
.
type
==
WINED3D_CONTAINER_NONE
)
surface_set_container
(
swapchain
->
back_buffers
[
i
],
WINED3D_CONTAINER_SWAPCHAIN
,
swapchain
);
surface_set_swapchain
(
swapchain
->
back_buffers
[
i
],
swapchain
);
}
}
...
...
@@ -1027,8 +1023,6 @@ static HRESULT swapchain_init(struct wined3d_swapchain *swapchain, struct wined3
WARN
(
"Failed to create the auto depth stencil, hr %#x.
\n
"
,
hr
);
goto
err
;
}
surface_set_container
(
device
->
auto_depth_stencil
,
WINED3D_CONTAINER_NONE
,
NULL
);
}
}
...
...
@@ -1059,7 +1053,7 @@ err:
{
if
(
swapchain
->
back_buffers
[
i
])
{
surface_set_
container
(
swapchain
->
back_buffers
[
i
],
WINED3D_CONTAINER_NONE
,
NULL
);
surface_set_
swapchain
(
swapchain
->
back_buffers
[
i
]
,
NULL
);
wined3d_surface_decref
(
swapchain
->
back_buffers
[
i
]);
}
}
...
...
@@ -1079,7 +1073,7 @@ err:
if
(
swapchain
->
front_buffer
)
{
surface_set_
container
(
swapchain
->
front_buffer
,
WINED3D_CONTAINER_NONE
,
NULL
);
surface_set_
swapchain
(
swapchain
->
front_buffer
,
NULL
);
wined3d_surface_decref
(
swapchain
->
front_buffer
);
}
...
...
dlls/wined3d/texture.c
View file @
a3f59cf6
...
...
@@ -715,7 +715,7 @@ static void texture2d_sub_resource_cleanup(struct wined3d_resource *sub_resource
surface_set_texture_name
(
surface
,
0
,
TRUE
);
surface_set_texture_name
(
surface
,
0
,
FALSE
);
surface_set_texture_target
(
surface
,
0
,
0
);
surface_set_container
(
surface
,
WINED3D_CONTAINER_NONE
,
NULL
);
surface_set_container
(
surface
,
NULL
);
wined3d_surface_decref
(
surface
);
}
...
...
@@ -864,7 +864,7 @@ static HRESULT cubetexture_init(struct wined3d_texture *texture, UINT edge_lengt
return
hr
;
}
surface_set_container
(
surface
,
WINED3D_CONTAINER_TEXTURE
,
texture
);
surface_set_container
(
surface
,
texture
);
surface_set_texture_target
(
surface
,
cube_targets
[
j
],
i
);
texture
->
sub_resources
[
idx
]
=
&
surface
->
resource
;
TRACE
(
"Created surface level %u @ %p.
\n
"
,
i
,
surface
);
...
...
@@ -1024,7 +1024,7 @@ static HRESULT texture_init(struct wined3d_texture *texture, UINT width, UINT he
return
hr
;
}
surface_set_container
(
surface
,
WINED3D_CONTAINER_TEXTURE
,
texture
);
surface_set_container
(
surface
,
texture
);
surface_set_texture_target
(
surface
,
texture
->
target
,
i
);
texture
->
sub_resources
[
i
]
=
&
surface
->
resource
;
TRACE
(
"Created surface level %u @ %p.
\n
"
,
i
,
surface
);
...
...
dlls/wined3d/wined3d_private.h
View file @
a3f59cf6
...
...
@@ -2076,24 +2076,6 @@ struct fbo_entry
GLuint
id
;
};
enum
wined3d_container_type
{
WINED3D_CONTAINER_NONE
=
0
,
WINED3D_CONTAINER_SWAPCHAIN
,
WINED3D_CONTAINER_TEXTURE
,
};
struct
wined3d_subresource_container
{
enum
wined3d_container_type
type
;
union
{
struct
wined3d_swapchain
*
swapchain
;
struct
wined3d_texture
*
texture
;
void
*
base
;
}
u
;
};
struct
wined3d_surface_ops
{
HRESULT
(
*
surface_private_setup
)(
struct
wined3d_surface
*
surface
);
...
...
@@ -2106,7 +2088,8 @@ struct wined3d_surface
{
struct
wined3d_resource
resource
;
const
struct
wined3d_surface_ops
*
surface_ops
;
struct
wined3d_subresource_container
container
;
struct
wined3d_texture
*
container
;
struct
wined3d_swapchain
*
swapchain
;
struct
wined3d_palette
*
palette
;
/* D3D7 style palette handling */
DWORD
draw_binding
;
...
...
@@ -2188,8 +2171,8 @@ void surface_prepare_texture(struct wined3d_surface *surface,
struct
wined3d_context
*
context
,
BOOL
srgb
)
DECLSPEC_HIDDEN
;
void
surface_set_compatible_renderbuffer
(
struct
wined3d_surface
*
surface
,
const
struct
wined3d_surface
*
rt
)
DECLSPEC_HIDDEN
;
void
surface_set_container
(
struct
wined3d_surface
*
surface
,
enum
wined3d_container_type
type
,
void
*
container
)
DECLSPEC_HIDDEN
;
void
surface_set_container
(
struct
wined3d_surface
*
surface
,
struct
wined3d_texture
*
container
)
DECLSPEC_HIDDEN
;
void
surface_set_swapchain
(
struct
wined3d_surface
*
surface
,
struct
wined3d_swapchain
*
swapchain
)
DECLSPEC_HIDDEN
;
void
surface_set_texture_name
(
struct
wined3d_surface
*
surface
,
GLuint
name
,
BOOL
srgb_name
)
DECLSPEC_HIDDEN
;
void
surface_set_texture_target
(
struct
wined3d_surface
*
surface
,
GLenum
target
,
GLint
level
)
DECLSPEC_HIDDEN
;
void
surface_translate_drawable_coords
(
const
struct
wined3d_surface
*
surface
,
HWND
window
,
RECT
*
rect
)
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