Signed-off-by: Zebediah Figura zfigura@codeweavers.com --- dlls/wined3d/adapter_vk.c | 16 +++++++++------- dlls/wined3d/buffer.c | 8 ++++---- dlls/wined3d/context_gl.c | 13 +++++++------ dlls/wined3d/cs.c | 2 +- dlls/wined3d/directx.c | 8 ++++---- dlls/wined3d/surface.c | 4 ++-- dlls/wined3d/texture.c | 22 +++++++++++----------- dlls/wined3d/view.c | 6 +++--- dlls/wined3d/wined3d_private.h | 7 ++++--- 9 files changed, 45 insertions(+), 41 deletions(-)
diff --git a/dlls/wined3d/adapter_vk.c b/dlls/wined3d/adapter_vk.c index e83f0a012d6..12811fd1482 100644 --- a/dlls/wined3d/adapter_vk.c +++ b/dlls/wined3d/adapter_vk.c @@ -960,8 +960,9 @@ static void *adapter_vk_map_bo_address(struct wined3d_context *context, VkMappedMemoryRange range; void *map_ptr;
- if (!(bo = (struct wined3d_bo_vk *)data->buffer_object)) + if (!data->buffer_object) return data->addr; + bo = wined3d_bo_vk(data->buffer_object);
vk_info = context_vk->vk_info; device_vk = wined3d_device_vk(context->device); @@ -1065,8 +1066,9 @@ static void adapter_vk_unmap_bo_address(struct wined3d_context *context, struct wined3d_bo_vk *bo; unsigned int i;
- if (!(bo = (struct wined3d_bo_vk *)data->buffer_object)) + if (!data->buffer_object) return; + bo = wined3d_bo_vk(data->buffer_object);
if (!bo->b.coherent) { @@ -1092,8 +1094,8 @@ void adapter_vk_copy_bo_address(struct wined3d_context *context, void *dst_ptr, *src_ptr; VkBufferCopy region;
- src_bo = (struct wined3d_bo_vk *)src->buffer_object; - dst_bo = (struct wined3d_bo_vk *)dst->buffer_object; + src_bo = src->buffer_object ? wined3d_bo_vk(src->buffer_object) : NULL; + dst_bo = dst->buffer_object ? wined3d_bo_vk(dst->buffer_object) : NULL;
if (dst_bo && !dst->addr && size == dst_bo->size) map_flags |= WINED3D_MAP_DISCARD; @@ -1164,7 +1166,7 @@ void adapter_vk_copy_bo_address(struct wined3d_context *context, return; }
- staging.buffer_object = (uintptr_t)&staging_bo; + staging.buffer_object = &staging_bo.b; staging.addr = NULL; adapter_vk_copy_bo_address(context, &staging, src, size); adapter_vk_copy_bo_address(context, dst, &staging, size); @@ -1184,7 +1186,7 @@ void adapter_vk_copy_bo_address(struct wined3d_context *context, return; }
- staging.buffer_object = (uintptr_t)&staging_bo; + staging.buffer_object = &staging_bo.b; staging.addr = NULL; adapter_vk_copy_bo_address(context, &staging, src, size); adapter_vk_copy_bo_address(context, dst, &staging, size); @@ -1251,7 +1253,7 @@ static bool adapter_vk_alloc_bo(struct wined3d_device *device, struct wined3d_re ERR("Failed to map bo.\n"); }
- addr->buffer_object = (uintptr_t)bo_vk; + addr->buffer_object = &bo_vk->b; addr->addr = NULL; return true; } diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c index d5840a488b5..b07f1510b74 100644 --- a/dlls/wined3d/buffer.c +++ b/dlls/wined3d/buffer.c @@ -665,7 +665,7 @@ DWORD wined3d_buffer_get_memory(struct wined3d_buffer *buffer, struct wined3d_co } if (locations & WINED3D_LOCATION_BUFFER) { - data->buffer_object = (uintptr_t)buffer->buffer_object; + data->buffer_object = buffer->buffer_object; data->addr = NULL; return WINED3D_LOCATION_BUFFER; } @@ -977,7 +977,7 @@ static HRESULT buffer_resource_sub_resource_map(struct wined3d_resource *resourc
if (count == 1) { - addr.buffer_object = (uintptr_t)buffer->buffer_object; + addr.buffer_object = buffer->buffer_object; addr.addr = 0; buffer->map_ptr = wined3d_context_map_bo_address(context, &addr, resource->size, flags); /* We are accessing buffer->resource.client from the CS thread, @@ -1057,7 +1057,7 @@ static HRESULT buffer_resource_sub_resource_unmap(struct wined3d_resource *resou
context = context_acquire(device, NULL, 0);
- addr.buffer_object = (uintptr_t)buffer->buffer_object; + addr.buffer_object = buffer->buffer_object; addr.addr = 0; wined3d_context_unmap_bo_address(context, &addr, range_count, buffer->maps);
@@ -1587,7 +1587,7 @@ static void wined3d_buffer_vk_upload_ranges(struct wined3d_buffer *buffer, struc if (!range_count) return;
- dst.buffer_object = (uintptr_t)buffer->buffer_object; + dst.buffer_object = buffer->buffer_object; dst.addr = NULL;
flags = WINED3D_MAP_WRITE; diff --git a/dlls/wined3d/context_gl.c b/dlls/wined3d/context_gl.c index 210d8e0b925..e91bff9328b 100644 --- a/dlls/wined3d/context_gl.c +++ b/dlls/wined3d/context_gl.c @@ -2729,13 +2729,13 @@ map: void *wined3d_context_gl_map_bo_address(struct wined3d_context_gl *context_gl, const struct wined3d_bo_address *data, size_t size, uint32_t flags) { - struct wined3d_bo_gl *bo; + struct wined3d_bo *bo; void *map_ptr;
- if (!(bo = (struct wined3d_bo_gl *)data->buffer_object)) + if (!(bo = data->buffer_object)) return data->addr;
- if (!(map_ptr = wined3d_bo_gl_map(bo, context_gl, (uintptr_t)data->addr, size, flags))) + if (!(map_ptr = wined3d_bo_gl_map(wined3d_bo_gl(bo), context_gl, (uintptr_t)data->addr, size, flags))) ERR("Failed to map bo.\n");
return map_ptr; @@ -2782,8 +2782,9 @@ void wined3d_context_gl_unmap_bo_address(struct wined3d_context_gl *context_gl, const struct wined3d_gl_info *gl_info; struct wined3d_bo_gl *bo;
- if (!(bo = (struct wined3d_bo_gl *)data->buffer_object)) + if (!data->buffer_object) return; + bo = wined3d_bo_gl(data->buffer_object);
flush_bo_ranges(context_gl, wined3d_const_bo_address(data), range_count, ranges);
@@ -2816,8 +2817,8 @@ void wined3d_context_gl_copy_bo_address(struct wined3d_context_gl *context_gl, BYTE *dst_ptr, *src_ptr;
gl_info = context_gl->gl_info; - src_bo = (struct wined3d_bo_gl *)src->buffer_object; - dst_bo = (struct wined3d_bo_gl *)dst->buffer_object; + src_bo = src->buffer_object ? wined3d_bo_gl(src->buffer_object) : NULL; + dst_bo = dst->buffer_object ? wined3d_bo_gl(dst->buffer_object) : NULL;
if (dst_bo && src_bo) { diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c index 262123b5d90..1a6ca2b8c7a 100644 --- a/dlls/wined3d/cs.c +++ b/dlls/wined3d/cs.c @@ -3130,7 +3130,7 @@ static bool wined3d_cs_map_upload_bo(struct wined3d_device_context *context, str return false; }
- bo = (const struct wined3d_bo *)client->addr.buffer_object; + bo = client->addr.buffer_object; map_ptr = bo ? bo->map_ptr : NULL; map_ptr += (uintptr_t)client->addr.addr;
diff --git a/dlls/wined3d/directx.c b/dlls/wined3d/directx.c index 06387452b89..40567cf1a2c 100644 --- a/dlls/wined3d/directx.c +++ b/dlls/wined3d/directx.c @@ -2774,7 +2774,7 @@ static void *adapter_no3d_map_bo_address(struct wined3d_context *context, { if (data->buffer_object) { - ERR("Unsupported buffer object %#lx.\n", data->buffer_object); + ERR("Unsupported buffer object %p.\n", data->buffer_object); return NULL; }
@@ -2785,16 +2785,16 @@ static void adapter_no3d_unmap_bo_address(struct wined3d_context *context, const struct wined3d_bo_address *data, unsigned int range_count, const struct wined3d_range *ranges) { if (data->buffer_object) - ERR("Unsupported buffer object %#lx.\n", data->buffer_object); + ERR("Unsupported buffer object %p.\n", data->buffer_object); }
static void adapter_no3d_copy_bo_address(struct wined3d_context *context, const struct wined3d_bo_address *dst, const struct wined3d_bo_address *src, size_t size) { if (dst->buffer_object) - ERR("Unsupported dst buffer object %#lx.\n", dst->buffer_object); + ERR("Unsupported dst buffer object %p.\n", dst->buffer_object); if (src->buffer_object) - ERR("Unsupported src buffer object %#lx.\n", src->buffer_object); + ERR("Unsupported src buffer object %p.\n", src->buffer_object); if (dst->buffer_object || src->buffer_object) return; memcpy(dst->addr, src->addr, size); diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c index 8a4ca4f5781..79dc0bd06b6 100644 --- a/dlls/wined3d/surface.c +++ b/dlls/wined3d/surface.c @@ -469,7 +469,7 @@ void texture2d_read_from_framebuffer(struct wined3d_texture *texture, unsigned i
if (data.buffer_object) { - GL_EXTCALL(glBindBuffer(GL_PIXEL_PACK_BUFFER, ((struct wined3d_bo_gl *)data.buffer_object)->id)); + GL_EXTCALL(glBindBuffer(GL_PIXEL_PACK_BUFFER, wined3d_bo_gl(data.buffer_object)->id)); checkGLcall("glBindBuffer"); }
@@ -527,7 +527,7 @@ error: if (data.buffer_object) { GL_EXTCALL(glBindBuffer(GL_PIXEL_PACK_BUFFER, 0)); - wined3d_context_gl_reference_bo(context_gl, (struct wined3d_bo_gl *)data.buffer_object); + wined3d_context_gl_reference_bo(context_gl, wined3d_bo_gl(data.buffer_object)); checkGLcall("glBindBuffer"); }
diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c index df42f2d766b..370eaaf08e5 100644 --- a/dlls/wined3d/texture.c +++ b/dlls/wined3d/texture.c @@ -830,7 +830,7 @@ void wined3d_texture_get_memory(struct wined3d_texture *texture, unsigned int su if (locations & WINED3D_LOCATION_BUFFER) { data->addr = NULL; - data->buffer_object = (uintptr_t)&sub_resource->bo; + data->buffer_object = &sub_resource->bo.b; return; }
@@ -2476,7 +2476,7 @@ static void wined3d_texture_gl_upload_data(struct wined3d_context *context, return; }
- bo.buffer_object = src_bo_addr->buffer_object; + bo.buffer_object = (struct wined3d_bo *)src_bo_addr->buffer_object; bo.addr = (BYTE *)src_bo_addr->addr + src_box->front * src_slice_pitch; if (dst_texture->resource.format_flags & WINED3DFMT_FLAG_BLOCKS) { @@ -2555,7 +2555,7 @@ static void wined3d_texture_gl_upload_data(struct wined3d_context *context, { if (bo.buffer_object) { - GL_EXTCALL(glBindBuffer(GL_PIXEL_UNPACK_BUFFER, ((struct wined3d_bo_gl *)bo.buffer_object)->id)); + GL_EXTCALL(glBindBuffer(GL_PIXEL_UNPACK_BUFFER, wined3d_bo_gl(bo.buffer_object)->id)); checkGLcall("glBindBuffer"); }
@@ -2565,7 +2565,7 @@ static void wined3d_texture_gl_upload_data(struct wined3d_context *context, if (bo.buffer_object) { GL_EXTCALL(glBindBuffer(GL_PIXEL_UNPACK_BUFFER, 0)); - wined3d_context_gl_reference_bo(context_gl, (struct wined3d_bo_gl *)bo.buffer_object); + wined3d_context_gl_reference_bo(context_gl, wined3d_bo_gl(bo.buffer_object)); checkGLcall("glBindBuffer"); } } @@ -2585,7 +2585,7 @@ static void wined3d_texture_gl_upload_data(struct wined3d_context *context, static void wined3d_texture_gl_download_data_slow_path(struct wined3d_texture_gl *texture_gl, unsigned int sub_resource_idx, struct wined3d_context_gl *context_gl, const struct wined3d_bo_address *data) { - struct wined3d_bo_gl *bo = (struct wined3d_bo_gl *)data->buffer_object; + struct wined3d_bo_gl *bo = wined3d_bo_gl(data->buffer_object); const struct wined3d_gl_info *gl_info = context_gl->gl_info; struct wined3d_texture_sub_resource *sub_resource; unsigned int dst_row_pitch, dst_slice_pitch; @@ -2824,7 +2824,7 @@ static void wined3d_texture_gl_download_data(struct wined3d_context *context, unsigned int src_level, src_width, src_height, src_depth; unsigned int src_row_pitch, src_slice_pitch; const struct wined3d_format_gl *format_gl; - struct wined3d_bo_gl *dst_bo; + struct wined3d_bo *dst_bo; BOOL srgb = FALSE; GLenum target;
@@ -2899,9 +2899,9 @@ static void wined3d_texture_gl_download_data(struct wined3d_context *context, return; }
- if ((dst_bo = (struct wined3d_bo_gl *)dst_bo_addr->buffer_object)) + if ((dst_bo = dst_bo_addr->buffer_object)) { - GL_EXTCALL(glBindBuffer(GL_PIXEL_PACK_BUFFER, dst_bo->id)); + GL_EXTCALL(glBindBuffer(GL_PIXEL_PACK_BUFFER, wined3d_bo_gl(dst_bo)->id)); checkGLcall("glBindBuffer"); }
@@ -2925,7 +2925,7 @@ static void wined3d_texture_gl_download_data(struct wined3d_context *context, if (dst_bo) { GL_EXTCALL(glBindBuffer(GL_PIXEL_PACK_BUFFER, 0)); - wined3d_context_gl_reference_bo(context_gl, dst_bo); + wined3d_context_gl_reference_bo(context_gl, wined3d_bo_gl(dst_bo)); checkGLcall("glBindBuffer"); } } @@ -4729,7 +4729,7 @@ static void wined3d_texture_vk_upload_data(struct wined3d_context *context, return; }
- staging_bo_addr.buffer_object = (uintptr_t)&staging_bo; + staging_bo_addr.buffer_object = &staging_bo.b; staging_bo_addr.addr = NULL; if (!(map_ptr = wined3d_context_map_bo_address(context, &staging_bo_addr, sub_resource->size, WINED3D_MAP_DISCARD | WINED3D_MAP_WRITE))) @@ -4992,7 +4992,7 @@ static void wined3d_texture_vk_download_data(struct wined3d_context *context, wined3d_context_vk_submit_command_buffer(context_vk, 0, NULL, NULL, 0, NULL); wined3d_context_vk_wait_command_buffer(context_vk, src_texture_vk->image.command_buffer_id);
- staging_bo_addr.buffer_object = (uintptr_t)&staging_bo; + staging_bo_addr.buffer_object = &staging_bo.b; staging_bo_addr.addr = NULL; if (!(map_ptr = wined3d_context_map_bo_address(context, &staging_bo_addr, sub_resource->size, WINED3D_MAP_READ))) diff --git a/dlls/wined3d/view.c b/dlls/wined3d/view.c index cbcfed4a21e..0d8001f5cbe 100644 --- a/dlls/wined3d/view.c +++ b/dlls/wined3d/view.c @@ -1616,7 +1616,7 @@ void wined3d_unordered_access_view_set_counter(struct wined3d_unordered_access_v src.buffer_object = 0; src.addr = (void *)&value;
- dst.buffer_object = view->counter_bo; + dst.buffer_object = (struct wined3d_bo *)view->counter_bo; dst.addr = NULL;
wined3d_context_copy_bo_address(context, &dst, &src, sizeof(uint32_t)); @@ -2092,9 +2092,9 @@ void wined3d_unordered_access_view_vk_clear(struct wined3d_unordered_access_view goto out; }
- cb_source_address.buffer_object = 0; + cb_source_address.buffer_object = NULL; cb_source_address.addr = (BYTE *)&constants; - cb_destination_address.buffer_object = (UINT_PTR)&constants_bo; + cb_destination_address.buffer_object = &constants_bo.b; cb_destination_address.addr = 0;
adapter_vk_copy_bo_address(&context_vk->c, &cb_destination_address, &cb_source_address, sizeof(constants)); diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index dc5bfb28328..1eaf480dcd4 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -1619,9 +1619,9 @@ static inline struct wined3d_bo_gl *wined3d_bo_gl(struct wined3d_bo *bo) return CONTAINING_RECORD(bo, struct wined3d_bo_gl, b); }
-static inline GLuint wined3d_bo_gl_id(uintptr_t bo) +static inline GLuint wined3d_bo_gl_id(struct wined3d_bo *bo) { - return bo ? ((struct wined3d_bo_gl *)bo)->id : 0; + return bo ? wined3d_bo_gl(bo)->id : 0; }
struct wined3d_bo_user @@ -1679,7 +1679,7 @@ void wined3d_bo_slab_vk_unmap(struct wined3d_bo_slab_vk *slab_vk,
struct wined3d_bo_address { - UINT_PTR buffer_object; + struct wined3d_bo *buffer_object; BYTE *addr; };
@@ -4409,6 +4409,7 @@ struct wined3d_texture DWORD locations; union { + struct wined3d_bo b; struct wined3d_bo_gl gl; struct wined3d_bo_vk vk; } bo;
Signed-off-by: Zebediah Figura zfigura@codeweavers.com --- dlls/wined3d/adapter_vk.c | 6 +++--- dlls/wined3d/buffer.c | 4 ++-- dlls/wined3d/context_gl.c | 3 ++- dlls/wined3d/texture.c | 10 +++++++--- dlls/wined3d/utils.c | 2 +- dlls/wined3d/view.c | 2 +- dlls/wined3d/wined3d_private.h | 2 +- 7 files changed, 17 insertions(+), 12 deletions(-)
diff --git a/dlls/wined3d/adapter_vk.c b/dlls/wined3d/adapter_vk.c index 12811fd1482..e6f5bf108c7 100644 --- a/dlls/wined3d/adapter_vk.c +++ b/dlls/wined3d/adapter_vk.c @@ -1211,12 +1211,12 @@ static void adapter_vk_flush_bo_address(struct wined3d_context *context, const struct wined3d_const_bo_address *data, size_t size) { struct wined3d_context_vk *context_vk = wined3d_context_vk(context); - struct wined3d_bo_vk *bo; + struct wined3d_bo *bo;
- if (!(bo = (struct wined3d_bo_vk *)data->buffer_object)) + if (!(bo = data->buffer_object)) return;
- flush_bo_range(context_vk, bo, (uintptr_t)data->addr, size); + flush_bo_range(context_vk, wined3d_bo_vk(bo), (uintptr_t)data->addr, size); }
static bool adapter_vk_alloc_bo(struct wined3d_device *device, struct wined3d_resource *resource, diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c index b07f1510b74..315ea05260e 100644 --- a/dlls/wined3d/buffer.c +++ b/dlls/wined3d/buffer.c @@ -1132,12 +1132,12 @@ void wined3d_buffer_update_sub_resource(struct wined3d_buffer *buffer, struct wi { if (upload_bo->flags & UPLOAD_BO_RENAME_ON_UNMAP) { - wined3d_buffer_set_bo(buffer, context, (struct wined3d_bo *)upload_bo->addr.buffer_object); + wined3d_buffer_set_bo(buffer, context, upload_bo->addr.buffer_object); wined3d_buffer_validate_location(buffer, WINED3D_LOCATION_BUFFER); wined3d_buffer_invalidate_location(buffer, ~WINED3D_LOCATION_BUFFER); }
- if (upload_bo->addr.buffer_object && upload_bo->addr.buffer_object == (uintptr_t)buffer->buffer_object) + if (upload_bo->addr.buffer_object && upload_bo->addr.buffer_object == buffer->buffer_object) wined3d_context_flush_bo_address(context, &upload_bo->addr, size); else wined3d_buffer_copy_bo_address(buffer, context, offset, &upload_bo->addr, size); diff --git a/dlls/wined3d/context_gl.c b/dlls/wined3d/context_gl.c index e91bff9328b..f7d4d9e8cb3 100644 --- a/dlls/wined3d/context_gl.c +++ b/dlls/wined3d/context_gl.c @@ -2748,8 +2748,9 @@ static void flush_bo_ranges(struct wined3d_context_gl *context_gl, const struct struct wined3d_bo_gl *bo; unsigned int i;
- if (!(bo = (struct wined3d_bo_gl *)data->buffer_object) || bo->b.coherent) + if (!data->buffer_object || data->buffer_object->coherent) return; + bo = wined3d_bo_gl(data->buffer_object);
gl_info = context_gl->gl_info; wined3d_context_gl_bind_bo(context_gl, bo->binding, bo->id); diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c index 370eaaf08e5..7e2da350f5a 100644 --- a/dlls/wined3d/texture.c +++ b/dlls/wined3d/texture.c @@ -2476,7 +2476,7 @@ static void wined3d_texture_gl_upload_data(struct wined3d_context *context, return; }
- bo.buffer_object = (struct wined3d_bo *)src_bo_addr->buffer_object; + bo.buffer_object = src_bo_addr->buffer_object; bo.addr = (BYTE *)src_bo_addr->addr + src_box->front * src_slice_pitch; if (dst_texture->resource.format_flags & WINED3DFMT_FLAG_BLOCKS) { @@ -4720,7 +4720,7 @@ static void wined3d_texture_vk_upload_data(struct wined3d_context *context, /* We need to be outside of a render pass for vkCmdPipelineBarrier() and vkCmdCopyBufferToImage() calls below. */ wined3d_context_vk_end_current_render_pass(context_vk);
- if (!(src_bo = (struct wined3d_bo_vk *)src_bo_addr->buffer_object)) + if (!src_bo_addr->buffer_object) { if (!wined3d_context_vk_create_bo(context_vk, sub_resource->size, VK_BUFFER_USAGE_TRANSFER_SRC_BIT, VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT, &staging_bo)) @@ -4755,6 +4755,8 @@ static void wined3d_texture_vk_upload_data(struct wined3d_context *context, } else { + src_bo = wined3d_bo_vk(src_bo_addr->buffer_object); + vk_barrier.sType = VK_STRUCTURE_TYPE_BUFFER_MEMORY_BARRIER; vk_barrier.pNext = NULL; vk_barrier.srcAccessMask = vk_access_mask_from_buffer_usage(src_bo->usage) & ~WINED3D_READ_ONLY_ACCESS_FLAGS; @@ -4917,7 +4919,7 @@ static void wined3d_texture_vk_download_data(struct wined3d_context *context, /* We need to be outside of a render pass for vkCmdPipelineBarrier() and vkCmdCopyBufferToImage() calls below. */ wined3d_context_vk_end_current_render_pass(context_vk);
- if (!(dst_bo = (struct wined3d_bo_vk *)dst_bo_addr->buffer_object)) + if (!dst_bo_addr->buffer_object) { if (!wined3d_context_vk_create_bo(context_vk, sub_resource->size, VK_BUFFER_USAGE_TRANSFER_DST_BIT, VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT, &staging_bo)) @@ -4930,6 +4932,8 @@ static void wined3d_texture_vk_download_data(struct wined3d_context *context, } else { + dst_bo = wined3d_bo_vk(dst_bo_addr->buffer_object); + vk_barrier.sType = VK_STRUCTURE_TYPE_BUFFER_MEMORY_BARRIER; vk_barrier.pNext = NULL; vk_barrier.srcAccessMask = vk_access_mask_from_buffer_usage(dst_bo->usage); diff --git a/dlls/wined3d/utils.c b/dlls/wined3d/utils.c index 26001775300..098b07ae35b 100644 --- a/dlls/wined3d/utils.c +++ b/dlls/wined3d/utils.c @@ -4613,7 +4613,7 @@ const char *debug_const_bo_address(const struct wined3d_const_bo_address *addres { if (!address) return "(null)"; - return wine_dbg_sprintf("{%#lx:%p}", address->buffer_object, address->addr); + return wine_dbg_sprintf("{%p:%p}", address->buffer_object, address->addr); }
const char *debug_bo_address(const struct wined3d_bo_address *address) diff --git a/dlls/wined3d/view.c b/dlls/wined3d/view.c index 0d8001f5cbe..79dbc847249 100644 --- a/dlls/wined3d/view.c +++ b/dlls/wined3d/view.c @@ -1632,7 +1632,7 @@ void wined3d_unordered_access_view_copy_counter(struct wined3d_unordered_access_ if (!view->counter_bo) return;
- src.buffer_object = view->counter_bo; + src.buffer_object = (struct wined3d_bo *)view->counter_bo; src.addr = NULL;
wined3d_buffer_copy_bo_address(buffer, context, offset, &src, sizeof(uint32_t)); diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index 1eaf480dcd4..86497e7da87 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -1685,7 +1685,7 @@ struct wined3d_bo_address
struct wined3d_const_bo_address { - UINT_PTR buffer_object; + struct wined3d_bo *buffer_object; const BYTE *addr; };
Signed-off-by: Henri Verbeet hverbeet@codeweavers.com
Signed-off-by: Zebediah Figura zfigura@codeweavers.com --- dlls/wined3d/view.c | 8 ++++---- dlls/wined3d/wined3d_private.h | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/dlls/wined3d/view.c b/dlls/wined3d/view.c index 79dbc847249..b902812aded 100644 --- a/dlls/wined3d/view.c +++ b/dlls/wined3d/view.c @@ -1616,7 +1616,7 @@ void wined3d_unordered_access_view_set_counter(struct wined3d_unordered_access_v src.buffer_object = 0; src.addr = (void *)&value;
- dst.buffer_object = (struct wined3d_bo *)view->counter_bo; + dst.buffer_object = view->counter_bo; dst.addr = NULL;
wined3d_context_copy_bo_address(context, &dst, &src, sizeof(uint32_t)); @@ -1632,7 +1632,7 @@ void wined3d_unordered_access_view_copy_counter(struct wined3d_unordered_access_ if (!view->counter_bo) return;
- src.buffer_object = (struct wined3d_bo *)view->counter_bo; + src.buffer_object = view->counter_bo; src.addr = NULL;
wined3d_buffer_copy_bo_address(buffer, context, offset, &src, sizeof(uint32_t)); @@ -1670,7 +1670,7 @@ static void wined3d_unordered_access_view_gl_cs_init(void *object) { struct wined3d_bo_gl *bo = &view_gl->counter_bo;
- view_gl->v.counter_bo = (uintptr_t)bo; + view_gl->v.counter_bo = &bo->b; wined3d_context_gl_create_bo(context_gl, sizeof(uint32_t), GL_ATOMIC_COUNTER_BUFFER, GL_STATIC_DRAW, true, GL_MAP_READ_BIT | GL_MAP_WRITE_BIT | GL_CLIENT_STORAGE_BIT, bo); wined3d_unordered_access_view_set_counter(&view_gl->v, 0); @@ -2253,7 +2253,7 @@ static void wined3d_unordered_access_view_vk_cs_init(void *object) { TRACE("Created counter buffer view 0x%s.\n", wine_dbgstr_longlong(uav_vk->vk_counter_view));
- uav_vk->v.counter_bo = (uintptr_t)&uav_vk->counter_bo; + uav_vk->v.counter_bo = &uav_vk->counter_bo.b; } }
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index 86497e7da87..1157eedfe69 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -5312,7 +5312,7 @@ struct wined3d_unordered_access_view const struct wined3d_format *format;
struct wined3d_view_desc desc; - uintptr_t counter_bo; + struct wined3d_bo *counter_bo; };
void wined3d_unordered_access_view_cleanup(struct wined3d_unordered_access_view *view) DECLSPEC_HIDDEN;
Signed-off-by: Henri Verbeet hverbeet@codeweavers.com