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
7bf2a345
Commit
7bf2a345
authored
Mar 23, 2016
by
Henri Verbeet
Committed by
Alexandre Julliard
Mar 24, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Pass a texture instead of a surface to context_create().
Signed-off-by:
Henri Verbeet
<
hverbeet@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
72e373d2
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
9 additions
and
13 deletions
+9
-13
context.c
dlls/wined3d/context.c
+4
-4
device.c
dlls/wined3d/device.c
+2
-4
swapchain.c
dlls/wined3d/swapchain.c
+2
-4
wined3d_private.h
dlls/wined3d/wined3d_private.h
+1
-1
No files found.
dlls/wined3d/context.c
View file @
7bf2a345
...
...
@@ -1559,7 +1559,7 @@ HGLRC context_create_wgl_attribs(const struct wined3d_gl_info *gl_info, HDC hdc,
}
struct
wined3d_context
*
context_create
(
struct
wined3d_swapchain
*
swapchain
,
struct
wined3d_
surfac
e
*
target
,
const
struct
wined3d_format
*
ds_format
)
struct
wined3d_
textur
e
*
target
,
const
struct
wined3d_format
*
ds_format
)
{
struct
wined3d_device
*
device
=
swapchain
->
device
;
const
struct
wined3d_gl_info
*
gl_info
=
&
device
->
adapter
->
gl_info
;
...
...
@@ -1659,7 +1659,7 @@ struct wined3d_context *context_create(struct wined3d_swapchain *swapchain,
}
}
color_format
=
target
->
container
->
resource
.
format
;
color_format
=
target
->
resource
.
format
;
/* In case of ORM_BACKBUFFER, make sure to request an alpha component for
* X4R4G4B4/X8R8G8B8 as we might need it for the backbuffer. */
...
...
@@ -1771,10 +1771,10 @@ struct wined3d_context *context_create(struct wined3d_swapchain *swapchain,
}
ret
->
swapchain
=
swapchain
;
ret
->
current_rt
=
target
;
ret
->
current_rt
=
target
->
sub_resources
[
0
].
u
.
surface
;
ret
->
tid
=
GetCurrentThreadId
();
ret
->
render_offscreen
=
wined3d_resource_is_offscreen
(
&
target
->
container
->
resource
);
ret
->
render_offscreen
=
wined3d_resource_is_offscreen
(
&
target
->
resource
);
ret
->
draw_buffers_mask
=
context_generate_rt_mask
(
GL_BACK
);
ret
->
valid
=
1
;
...
...
dlls/wined3d/device.c
View file @
7bf2a345
...
...
@@ -4554,7 +4554,7 @@ static void delete_opengl_contexts(struct wined3d_device *device, struct wined3d
static
HRESULT
create_primary_opengl_context
(
struct
wined3d_device
*
device
,
struct
wined3d_swapchain
*
swapchain
)
{
struct
wined3d_context
*
context
;
struct
wined3d_
surfac
e
*
target
;
struct
wined3d_
textur
e
*
target
;
HRESULT
hr
;
if
(
FAILED
(
hr
=
device
->
shader_backend
->
shader_alloc_private
(
device
,
...
...
@@ -4581,9 +4581,7 @@ static HRESULT create_primary_opengl_context(struct wined3d_device *device, stru
return
E_OUTOFMEMORY
;
}
target
=
swapchain
->
back_buffers
?
surface_from_resource
(
wined3d_texture_get_sub_resource
(
swapchain
->
back_buffers
[
0
],
0
))
:
surface_from_resource
(
wined3d_texture_get_sub_resource
(
swapchain
->
front_buffer
,
0
));
target
=
swapchain
->
back_buffers
?
swapchain
->
back_buffers
[
0
]
:
swapchain
->
front_buffer
;
if
(
!
(
context
=
context_create
(
swapchain
,
target
,
swapchain
->
ds_format
)))
{
WARN
(
"Failed to create context.
\n
"
);
...
...
dlls/wined3d/swapchain.c
View file @
7bf2a345
...
...
@@ -983,7 +983,7 @@ static HRESULT swapchain_init(struct wined3d_swapchain *swapchain, struct wined3
for
(
i
=
0
;
i
<
(
sizeof
(
formats
)
/
sizeof
(
*
formats
));
i
++
)
{
swapchain
->
ds_format
=
wined3d_get_format
(
gl_info
,
formats
[
i
]);
swapchain
->
context
[
0
]
=
context_create
(
swapchain
,
front_buffer
,
swapchain
->
ds_format
);
swapchain
->
context
[
0
]
=
context_create
(
swapchain
,
swapchain
->
front_buffer
,
swapchain
->
ds_format
);
if
(
swapchain
->
context
[
0
])
break
;
TRACE
(
"Depth stencil format %s is not supported, trying next format
\n
"
,
debug_d3dformat
(
formats
[
i
]));
...
...
@@ -1145,9 +1145,7 @@ static struct wined3d_context *swapchain_create_context(struct wined3d_swapchain
TRACE
(
"Creating a new context for swapchain %p, thread %u.
\n
"
,
swapchain
,
GetCurrentThreadId
());
if
(
!
(
ctx
=
context_create
(
swapchain
,
surface_from_resource
(
wined3d_texture_get_sub_resource
(
swapchain
->
front_buffer
,
0
)),
swapchain
->
ds_format
)))
if
(
!
(
ctx
=
context_create
(
swapchain
,
swapchain
->
front_buffer
,
swapchain
->
ds_format
)))
{
ERR
(
"Failed to create a new context for the swapchain
\n
"
);
return
NULL
;
...
...
dlls/wined3d/wined3d_private.h
View file @
7bf2a345
...
...
@@ -1515,7 +1515,7 @@ void context_active_texture(struct wined3d_context *context, const struct wined3
unsigned
int
unit
)
DECLSPEC_HIDDEN
;
void
context_bind_texture
(
struct
wined3d_context
*
context
,
GLenum
target
,
GLuint
name
)
DECLSPEC_HIDDEN
;
void
context_check_fbo_status
(
const
struct
wined3d_context
*
context
,
GLenum
target
)
DECLSPEC_HIDDEN
;
struct
wined3d_context
*
context_create
(
struct
wined3d_swapchain
*
swapchain
,
struct
wined3d_
surfac
e
*
target
,
struct
wined3d_context
*
context_create
(
struct
wined3d_swapchain
*
swapchain
,
struct
wined3d_
textur
e
*
target
,
const
struct
wined3d_format
*
ds_format
)
DECLSPEC_HIDDEN
;
HGLRC
context_create_wgl_attribs
(
const
struct
wined3d_gl_info
*
gl_info
,
HDC
hdc
,
HGLRC
share_ctx
)
DECLSPEC_HIDDEN
;
void
context_destroy
(
struct
wined3d_device
*
device
,
struct
wined3d_context
*
context
)
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