wined3d: Use wined3d_texture_load_location() in context_validate_onscreen_formats().
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
cad279449c
commit
3160eabf24
|
@ -2455,7 +2455,6 @@ static void context_validate_onscreen_formats(struct wined3d_context *context,
|
||||||
{
|
{
|
||||||
/* Onscreen surfaces are always in a swapchain */
|
/* Onscreen surfaces are always in a swapchain */
|
||||||
struct wined3d_swapchain *swapchain = context->current_rt.texture->swapchain;
|
struct wined3d_swapchain *swapchain = context->current_rt.texture->swapchain;
|
||||||
struct wined3d_surface *surface;
|
|
||||||
|
|
||||||
if (context->render_offscreen || !depth_stencil) return;
|
if (context->render_offscreen || !depth_stencil) return;
|
||||||
if (match_depth_stencil_format(swapchain->ds_format, depth_stencil->format)) return;
|
if (match_depth_stencil_format(swapchain->ds_format, depth_stencil->format)) return;
|
||||||
|
@ -2466,8 +2465,9 @@ 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");
|
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 */
|
/* The currently active context is the necessary context to access the swapchain's onscreen buffers */
|
||||||
surface = context->current_rt.texture->sub_resources[context->current_rt.sub_resource_idx].u.surface;
|
if (!(wined3d_texture_load_location(context->current_rt.texture, context->current_rt.sub_resource_idx,
|
||||||
surface_load_location(surface, context, WINED3D_LOCATION_TEXTURE_RGB);
|
context, WINED3D_LOCATION_TEXTURE_RGB)))
|
||||||
|
ERR("Failed to load location.\n");
|
||||||
swapchain->render_to_fbo = TRUE;
|
swapchain->render_to_fbo = TRUE;
|
||||||
swapchain_update_draw_bindings(swapchain);
|
swapchain_update_draw_bindings(swapchain);
|
||||||
context_set_render_offscreen(context, TRUE);
|
context_set_render_offscreen(context, TRUE);
|
||||||
|
|
|
@ -176,7 +176,7 @@ void wined3d_texture_invalidate_location(struct wined3d_texture *texture,
|
||||||
|
|
||||||
/* Context activation is done by the caller. Context may be NULL in
|
/* Context activation is done by the caller. Context may be NULL in
|
||||||
* WINED3D_NO3D mode. */
|
* WINED3D_NO3D mode. */
|
||||||
static BOOL wined3d_texture_load_location(struct wined3d_texture *texture,
|
BOOL wined3d_texture_load_location(struct wined3d_texture *texture,
|
||||||
unsigned int sub_resource_idx, struct wined3d_context *context, DWORD location)
|
unsigned int sub_resource_idx, struct wined3d_context *context, DWORD location)
|
||||||
{
|
{
|
||||||
return texture->texture_ops->texture_load_location(texture, sub_resource_idx, context, location);
|
return texture->texture_ops->texture_load_location(texture, sub_resource_idx, context, location);
|
||||||
|
|
|
@ -2760,6 +2760,8 @@ void wined3d_texture_invalidate_location(struct wined3d_texture *texture,
|
||||||
unsigned int sub_resource_idx, DWORD location) DECLSPEC_HIDDEN;
|
unsigned int sub_resource_idx, DWORD location) DECLSPEC_HIDDEN;
|
||||||
void wined3d_texture_load(struct wined3d_texture *texture,
|
void wined3d_texture_load(struct wined3d_texture *texture,
|
||||||
struct wined3d_context *context, BOOL srgb) DECLSPEC_HIDDEN;
|
struct wined3d_context *context, BOOL srgb) DECLSPEC_HIDDEN;
|
||||||
|
BOOL wined3d_texture_load_location(struct wined3d_texture *texture,
|
||||||
|
unsigned int sub_resource_idx, struct wined3d_context *context, DWORD location) DECLSPEC_HIDDEN;
|
||||||
void *wined3d_texture_map_bo_address(const struct wined3d_bo_address *data, size_t size,
|
void *wined3d_texture_map_bo_address(const struct wined3d_bo_address *data, size_t size,
|
||||||
const struct wined3d_gl_info *gl_info, GLenum binding, DWORD flags) DECLSPEC_HIDDEN;
|
const struct wined3d_gl_info *gl_info, GLenum binding, DWORD flags) DECLSPEC_HIDDEN;
|
||||||
BOOL wined3d_texture_prepare_location(struct wined3d_texture *texture, unsigned int sub_resource_idx,
|
BOOL wined3d_texture_prepare_location(struct wined3d_texture *texture, unsigned int sub_resource_idx,
|
||||||
|
|
Loading…
Reference in New Issue