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
21257be2
Commit
21257be2
authored
Mar 12, 2018
by
Henri Verbeet
Committed by
Alexandre Julliard
Mar 12, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Pass a texture and sub-resource index to context_restore().
Signed-off-by:
Henri Verbeet
<
hverbeet@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
7cc82c1e
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
15 deletions
+16
-15
context.c
dlls/wined3d/context.c
+3
-5
surface.c
dlls/wined3d/surface.c
+11
-9
wined3d_private.h
dlls/wined3d/wined3d_private.h
+2
-1
No files found.
dlls/wined3d/context.c
View file @
21257be2
...
...
@@ -1585,14 +1585,12 @@ void context_release(struct wined3d_context *context)
/* This is used when a context for render target A is active, but a separate context is
* needed to access the WGL framebuffer for render target B. Re-acquire a context for rt
* A to avoid breaking caller code. */
void
context_restore
(
struct
wined3d_context
*
context
,
struct
wined3d_
surface
*
restore
)
void
context_restore
(
struct
wined3d_context
*
context
,
struct
wined3d_
texture
*
texture
,
unsigned
int
sub_resource_idx
)
{
if
(
context
->
current_rt
.
texture
!=
restore
->
container
||
context
->
current_rt
.
sub_resource_idx
!=
surface_get_sub_resource_idx
(
restore
))
if
(
context
->
current_rt
.
texture
!=
texture
||
context
->
current_rt
.
sub_resource_idx
!=
sub_resource_idx
)
{
context_release
(
context
);
context
=
context_acquire
(
restore
->
container
->
resource
.
device
,
restore
->
container
,
surface_get_sub_resource_idx
(
restore
));
context
=
context_acquire
(
texture
->
resource
.
device
,
texture
,
sub_resource_idx
);
}
context_release
(
context
);
...
...
dlls/wined3d/surface.c
View file @
21257be2
...
...
@@ -507,7 +507,7 @@ static void texture2d_blt_fbo(const struct wined3d_device *device, struct wined3
gl_info
->
gl_ops
.
gl
.
p_glFlush
();
if
(
restore_texture
)
context_restore
(
context
,
restore_texture
->
sub_resources
[
restore_idx
].
u
.
surface
);
context_restore
(
context
,
restore_texture
,
restore_idx
);
}
static
BOOL
fbo_blitter_supported
(
enum
wined3d_blit_op
blit_op
,
const
struct
wined3d_gl_info
*
gl_info
,
...
...
@@ -1471,7 +1471,7 @@ error:
}
if
(
restore_texture
)
context_restore
(
context
,
restore_texture
->
sub_resources
[
restore_idx
].
u
.
surface
);
context_restore
(
context
,
restore_texture
,
restore_idx
);
}
/* Read the framebuffer contents into a texture. Note that this function
...
...
@@ -1518,7 +1518,7 @@ void texture2d_load_fb_texture(struct wined3d_texture *texture,
checkGLcall
(
"glCopyTexSubImage2D"
);
if
(
restore_texture
)
context_restore
(
context
,
restore_texture
->
sub_resources
[
restore_idx
].
u
.
surface
);
context_restore
(
context
,
restore_texture
,
restore_idx
);
}
/* Does a direct frame buffer -> texture copy. Stretching is done with single
...
...
@@ -2106,9 +2106,10 @@ BOOL texture2d_load_sysmem(struct wined3d_texture *texture, unsigned int sub_res
BOOL
texture2d_load_drawable
(
struct
wined3d_texture
*
texture
,
unsigned
int
sub_resource_idx
,
struct
wined3d_context
*
context
)
{
struct
wined3d_
surface
*
restore_rt
=
NULL
;
struct
wined3d_
texture
*
restore_texture
;
struct
wined3d_surface
*
surface
;
struct
wined3d_device
*
device
;
unsigned
int
restore_idx
;
unsigned
int
level
;
RECT
r
;
...
...
@@ -2129,11 +2130,12 @@ BOOL texture2d_load_drawable(struct wined3d_texture *texture,
device
=
texture
->
resource
.
device
;
surface
=
texture
->
sub_resources
[
sub_resource_idx
].
u
.
surface
;
restore_rt
=
context_get_rt_surface
(
context
);
if
(
restore_rt
!=
surface
)
restore_texture
=
context
->
current_rt
.
texture
;
restore_idx
=
context
->
current_rt
.
sub_resource_idx
;
if
(
restore_texture
!=
texture
||
restore_idx
!=
sub_resource_idx
)
context
=
context_acquire
(
device
,
texture
,
sub_resource_idx
);
else
restore_
rt
=
NULL
;
restore_
texture
=
NULL
;
level
=
sub_resource_idx
%
texture
->
level_count
;
SetRect
(
&
r
,
0
,
0
,
wined3d_texture_get_level_width
(
texture
,
level
),
...
...
@@ -2144,8 +2146,8 @@ BOOL texture2d_load_drawable(struct wined3d_texture *texture,
surface
,
WINED3D_LOCATION_DRAWABLE
,
&
r
,
NULL
,
WINED3D_TEXF_POINT
);
if
(
restore_
rt
)
context_restore
(
context
,
restore_
rt
);
if
(
restore_
texture
)
context_restore
(
context
,
restore_
texture
,
restore_idx
);
return
TRUE
;
}
...
...
dlls/wined3d/wined3d_private.h
View file @
21257be2
...
...
@@ -2170,7 +2170,8 @@ struct wined3d_context *context_reacquire(const struct wined3d_device *device,
void
context_release
(
struct
wined3d_context
*
context
)
DECLSPEC_HIDDEN
;
void
context_resource_released
(
const
struct
wined3d_device
*
device
,
struct
wined3d_resource
*
resource
,
enum
wined3d_resource_type
type
)
DECLSPEC_HIDDEN
;
void
context_restore
(
struct
wined3d_context
*
context
,
struct
wined3d_surface
*
restore
)
DECLSPEC_HIDDEN
;
void
context_restore
(
struct
wined3d_context
*
context
,
struct
wined3d_texture
*
texture
,
unsigned
int
sub_resource_idx
)
DECLSPEC_HIDDEN
;
BOOL
context_set_current
(
struct
wined3d_context
*
ctx
)
DECLSPEC_HIDDEN
;
void
context_set_draw_buffer
(
struct
wined3d_context
*
context
,
GLenum
buffer
)
DECLSPEC_HIDDEN
;
void
context_set_tls_idx
(
DWORD
idx
)
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