Commit c390f415 authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

wined3d: Introduce debug helpers for wined3d_bo_address structures.

parent 718f7fd4
......@@ -3670,7 +3670,7 @@ static void context_update_stream_info(struct wined3d_context *context, const st
if (buffer->fence)
context->buffer_fences[context->buffer_fence_count++] = buffer->fence;
TRACE("Load array %u {%#x:%p}.\n", i, element->data.buffer_object, element->data.addr);
TRACE("Load array %u %s.\n", i, debug_bo_address(&element->data));
}
if (prev_all_vbo != stream_info->all_vbo)
......@@ -5068,8 +5068,8 @@ void context_load_tex_coords(const struct wined3d_context *context, const struct
{
const struct wined3d_stream_info_element *e = &si->elements[WINED3D_FFP_TEXCOORD0 + coord_idx];
TRACE("Setting up texture %u, idx %d, coord_idx %u, data {%#x:%p}.\n",
texture_idx, mapped_stage, coord_idx, e->data.buffer_object, e->data.addr);
TRACE("Setting up texture %u, idx %u, coord_idx %u, data %s.\n",
texture_idx, mapped_stage, coord_idx, debug_bo_address(&e->data));
if (*current_bo != e->data.buffer_object)
{
......@@ -5386,7 +5386,7 @@ static void context_load_numbered_arrays(struct wined3d_context *context,
continue;
}
TRACE("Loading array %u [VBO=%u].\n", i, element->data.buffer_object);
TRACE("Loading array %u %s.\n", i, debug_bo_address(&element->data));
if (element->stride)
{
......
......@@ -1927,10 +1927,10 @@ void wined3d_texture_upload_data(struct wined3d_texture *texture, unsigned int s
BOOL decompress;
GLenum target;
TRACE("texture %p, sub_resource_idx %u, context %p, format %s, src_box %s, data {%#x:%p}, "
TRACE("texture %p, sub_resource_idx %u, context %p, format %s, src_box %s, data %s, "
"src_row_pitch %#x, src_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, src_row_pitch, src_slice_pitch, dst_x, dst_y, dst_z, srgb);
debug_const_bo_address(data), src_row_pitch, src_slice_pitch, dst_x, dst_y, dst_z, srgb);
if (texture->sub_resources[sub_resource_idx].map_count)
{
......
......@@ -4208,6 +4208,18 @@ const char *debug_vec4(const struct wined3d_vec4 *v)
v->x, v->y, v->z, v->w);
}
const char *debug_const_bo_address(const struct wined3d_const_bo_address *address)
{
if (!address)
return "(null)";
return wine_dbg_sprintf("{%#x:%p}", address->buffer_object, address->addr);
}
const char *debug_bo_address(const struct wined3d_bo_address *address)
{
return debug_const_bo_address((const struct wined3d_const_bo_address *)address);
}
const char *debug_d3dformat(enum wined3d_format_id format_id)
{
switch (format_id)
......
......@@ -3915,8 +3915,10 @@ void swapchain_set_max_frame_latency(struct wined3d_swapchain *swapchain,
*/
/* Trace routines */
const char *debug_bo_address(const struct wined3d_bo_address *address) DECLSPEC_HIDDEN;
const char *debug_box(const struct wined3d_box *box) DECLSPEC_HIDDEN;
const char *debug_color(const struct wined3d_color *color) DECLSPEC_HIDDEN;
const char *debug_const_bo_address(const struct wined3d_const_bo_address *address) DECLSPEC_HIDDEN;
const char *debug_d3dshaderinstructionhandler(enum WINED3D_SHADER_INSTRUCTION_HANDLER handler_idx) DECLSPEC_HIDDEN;
const char *debug_d3dformat(enum wined3d_format_id format_id) DECLSPEC_HIDDEN;
const char *debug_d3ddevicetype(enum wined3d_device_type device_type) DECLSPEC_HIDDEN;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment