From 17c7f8e3c3e4e6ebe4b8b0b73e91c98f279491b9 Mon Sep 17 00:00:00 2001 From: Henri Verbeet Date: Tue, 20 Mar 2018 15:11:57 +0330 Subject: [PATCH] wined3d: Allow wined3d_texture_upload_data() to upload to WINED3D_LOCATION_TEXTURE_SRGB. Signed-off-by: Henri Verbeet Signed-off-by: Alexandre Julliard --- dlls/wined3d/cs.c | 6 +++--- dlls/wined3d/texture.c | 24 ++++++++++++------------ dlls/wined3d/wined3d_private.h | 4 ++-- 3 files changed, 17 insertions(+), 17 deletions(-) diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c index b08e91b1496..f7ae3be184f 100644 --- a/dlls/wined3d/cs.c +++ b/dlls/wined3d/cs.c @@ -2121,7 +2121,7 @@ static void wined3d_cs_exec_blt_sub_resource(struct wined3d_cs *cs, const void * wined3d_texture_bind_and_dirtify(dst_texture, context, FALSE); wined3d_texture_upload_data(dst_texture, op->dst_sub_resource_idx, context, dst_texture->resource.format, &op->src_box, wined3d_const_bo_address(&addr), - row_pitch, slice_pitch, op->dst_box.left, op->dst_box.top, op->dst_box.front); + row_pitch, slice_pitch, op->dst_box.left, op->dst_box.top, op->dst_box.front, FALSE); wined3d_texture_validate_location(dst_texture, op->dst_sub_resource_idx, WINED3D_LOCATION_TEXTURE_RGB); wined3d_texture_invalidate_location(dst_texture, op->dst_sub_resource_idx, ~WINED3D_LOCATION_TEXTURE_RGB); @@ -2216,8 +2216,8 @@ static void wined3d_cs_exec_update_sub_resource(struct wined3d_cs *cs, const voi wined3d_texture_bind_and_dirtify(texture, context, FALSE); wined3d_box_set(&src_box, 0, 0, box->right - box->left, box->bottom - box->top, 0, box->back - box->front); - wined3d_texture_upload_data(texture, op->sub_resource_idx, context, texture->resource.format, - &src_box, &addr, op->data.row_pitch, op->data.slice_pitch, box->left, box->top, box->front); + wined3d_texture_upload_data(texture, op->sub_resource_idx, context, texture->resource.format, &src_box, + &addr, op->data.row_pitch, op->data.slice_pitch, box->left, box->top, box->front, FALSE); wined3d_texture_validate_location(texture, op->sub_resource_idx, WINED3D_LOCATION_TEXTURE_RGB); wined3d_texture_invalidate_location(texture, op->sub_resource_idx, ~WINED3D_LOCATION_TEXTURE_RGB); diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c index 551d9fdfd3c..29bcfb1e4df 100644 --- a/dlls/wined3d/texture.c +++ b/dlls/wined3d/texture.c @@ -1747,19 +1747,19 @@ HRESULT CDECL wined3d_texture_add_dirty_region(struct wined3d_texture *texture, void wined3d_texture_upload_data(struct wined3d_texture *texture, unsigned int sub_resource_idx, const struct wined3d_context *context, const struct wined3d_format *format, const struct wined3d_box *src_box, const struct wined3d_const_bo_address *data, unsigned int row_pitch, unsigned int slice_pitch, - unsigned int dst_x, unsigned int dst_y, unsigned int dst_z) + unsigned int dst_x, unsigned int dst_y, unsigned int dst_z, BOOL srgb) { texture->texture_ops->texture_upload_data(texture, sub_resource_idx, context, - format, src_box, data, row_pitch, slice_pitch, dst_x, dst_y, dst_z); + format, src_box, data, row_pitch, slice_pitch, dst_x, dst_y, dst_z, srgb); } static void texture2d_upload_data(struct wined3d_texture *texture, unsigned int sub_resource_idx, const struct wined3d_context *context, const struct wined3d_format *format, const struct wined3d_box *src_box, const struct wined3d_const_bo_address *data, unsigned int row_pitch, unsigned int slice_pitch, - unsigned int dst_x, unsigned int dst_y, unsigned int dst_z) + unsigned int dst_x, unsigned int dst_y, unsigned int dst_z, BOOL srgb) { wined3d_surface_upload_data(texture, sub_resource_idx, context->gl_info, - format, src_box, row_pitch, dst_x, dst_y, FALSE, data); + format, src_box, row_pitch, dst_x, dst_y, srgb, data); } /* Context activation is done by the caller. Context may be NULL in ddraw-only mode. */ @@ -2392,7 +2392,7 @@ static HRESULT wined3d_texture_init(struct wined3d_texture *texture, const struc static void texture3d_upload_data(struct wined3d_texture *texture, unsigned int sub_resource_idx, const struct wined3d_context *context, const struct wined3d_format *format, const struct wined3d_box *src_box, const struct wined3d_const_bo_address *data, unsigned int row_pitch, unsigned int slice_pitch, - unsigned int dst_x, unsigned int dst_y, unsigned int dst_z) + unsigned int dst_x, unsigned int dst_y, unsigned int dst_z, BOOL srgb) { unsigned int level = sub_resource_idx % texture->level_count; const struct wined3d_gl_info *gl_info = context->gl_info; @@ -2402,9 +2402,9 @@ static void texture3d_upload_data(struct wined3d_texture *texture, unsigned int void *converted_mem = NULL; TRACE("texture %p, sub_resource_idx %u, context %p, format %s, src_box %s, data {%#x:%p}, " - "row_pitch %#x, slice_pitch %#x, dst_x %u, dst_y %u, dst_z %u.\n", + "row_pitch %#x, slice_pitch %#x, dst_x %u, dst_y %u, dst_z %u, srgb %#x.\n", texture, sub_resource_idx, context, debug_d3dformat(format->id), debug_box(src_box), - data->buffer_object, data->addr, row_pitch, slice_pitch, dst_x, dst_y, dst_z); + data->buffer_object, data->addr, row_pitch, slice_pitch, dst_x, dst_y, dst_z, srgb); if (src_box) { @@ -2520,7 +2520,7 @@ static void texture3d_srgb_transfer(struct wined3d_texture *texture, unsigned in texture3d_download_data(texture, sub_resource_idx, context, &data); wined3d_texture_bind_and_dirtify(texture, context, dest_is_srgb); texture3d_upload_data(texture, sub_resource_idx, context, texture->resource.format, - NULL, wined3d_const_bo_address(&data), row_pitch, slice_pitch, 0, 0, 0); + NULL, wined3d_const_bo_address(&data), row_pitch, slice_pitch, 0, 0, 0, FALSE); heap_free(data.addr); } @@ -2546,8 +2546,8 @@ static BOOL texture3d_load_location(struct wined3d_texture *texture, unsigned in wined3d_texture_bind_and_dirtify(texture, context, location == WINED3D_LOCATION_TEXTURE_SRGB); wined3d_texture_get_pitch(texture, sub_resource_idx, &row_pitch, &slice_pitch); - texture3d_upload_data(texture, sub_resource_idx, context, - texture->resource.format, NULL, &data, row_pitch, slice_pitch, 0, 0, 0); + texture3d_upload_data(texture, sub_resource_idx, context, texture->resource.format, + NULL, &data, row_pitch, slice_pitch, 0, 0, 0, FALSE); } else if (sub_resource->locations & WINED3D_LOCATION_BUFFER) { @@ -2555,8 +2555,8 @@ static BOOL texture3d_load_location(struct wined3d_texture *texture, unsigned in wined3d_texture_bind_and_dirtify(texture, context, location == WINED3D_LOCATION_TEXTURE_SRGB); wined3d_texture_get_pitch(texture, sub_resource_idx, &row_pitch, &slice_pitch); - texture3d_upload_data(texture, sub_resource_idx, context, - texture->resource.format, NULL, &data, row_pitch, slice_pitch, 0, 0, 0); + texture3d_upload_data(texture, sub_resource_idx, context, texture->resource.format, + NULL, &data, row_pitch, slice_pitch, 0, 0, 0, FALSE); } else if (sub_resource->locations & WINED3D_LOCATION_TEXTURE_RGB) { diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index e48f82ac70d..580f35a924b 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -3086,7 +3086,7 @@ struct wined3d_texture_ops void (*texture_upload_data)(struct wined3d_texture *texture, unsigned int sub_resource_idx, const struct wined3d_context *context, const struct wined3d_format *format, const struct wined3d_box *src_box, const struct wined3d_const_bo_address *data, unsigned int row_pitch, - unsigned int slice_pitch, unsigned int dst_x, unsigned int dst_y, unsigned int dst_z); + unsigned int slice_pitch, unsigned int dst_x, unsigned int dst_y, unsigned int dst_z, BOOL srgb); BOOL (*texture_load_location)(struct wined3d_texture *texture, unsigned int sub_resource_idx, struct wined3d_context *context, DWORD location); }; @@ -3287,7 +3287,7 @@ void wined3d_texture_translate_drawable_coords(const struct wined3d_texture *tex void wined3d_texture_upload_data(struct wined3d_texture *texture, unsigned int sub_resource_idx, const struct wined3d_context *context, const struct wined3d_format *format, const struct wined3d_box *src_box, const struct wined3d_const_bo_address *data, unsigned int row_pitch, unsigned int slice_pitch, - unsigned int dst_x, unsigned int dst_y, unsigned int dst_z) DECLSPEC_HIDDEN; + unsigned int dst_x, unsigned int dst_y, unsigned int dst_z, BOOL srgb) DECLSPEC_HIDDEN; void wined3d_texture_validate_location(struct wined3d_texture *texture, unsigned int sub_resource_idx, DWORD location) DECLSPEC_HIDDEN; -- 2.11.4.GIT