Commit 7591c8b6 authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

wined3d: Trace command stream opcodes.

parent 43fc25b1
......@@ -443,6 +443,65 @@ struct wined3d_cs_stop
enum wined3d_cs_op opcode;
};
static const char *debug_cs_op(enum wined3d_cs_op op)
{
switch (op)
{
#define WINED3D_TO_STR(type) case type: return #type
WINED3D_TO_STR(WINED3D_CS_OP_NOP);
WINED3D_TO_STR(WINED3D_CS_OP_PRESENT);
WINED3D_TO_STR(WINED3D_CS_OP_CLEAR);
WINED3D_TO_STR(WINED3D_CS_OP_DISPATCH);
WINED3D_TO_STR(WINED3D_CS_OP_DRAW);
WINED3D_TO_STR(WINED3D_CS_OP_FLUSH);
WINED3D_TO_STR(WINED3D_CS_OP_SET_PREDICATION);
WINED3D_TO_STR(WINED3D_CS_OP_SET_VIEWPORTS);
WINED3D_TO_STR(WINED3D_CS_OP_SET_SCISSOR_RECTS);
WINED3D_TO_STR(WINED3D_CS_OP_SET_RENDERTARGET_VIEW);
WINED3D_TO_STR(WINED3D_CS_OP_SET_DEPTH_STENCIL_VIEW);
WINED3D_TO_STR(WINED3D_CS_OP_SET_VERTEX_DECLARATION);
WINED3D_TO_STR(WINED3D_CS_OP_SET_STREAM_SOURCE);
WINED3D_TO_STR(WINED3D_CS_OP_SET_STREAM_SOURCE_FREQ);
WINED3D_TO_STR(WINED3D_CS_OP_SET_STREAM_OUTPUT);
WINED3D_TO_STR(WINED3D_CS_OP_SET_INDEX_BUFFER);
WINED3D_TO_STR(WINED3D_CS_OP_SET_CONSTANT_BUFFER);
WINED3D_TO_STR(WINED3D_CS_OP_SET_TEXTURE);
WINED3D_TO_STR(WINED3D_CS_OP_SET_SHADER_RESOURCE_VIEW);
WINED3D_TO_STR(WINED3D_CS_OP_SET_UNORDERED_ACCESS_VIEW);
WINED3D_TO_STR(WINED3D_CS_OP_SET_SAMPLER);
WINED3D_TO_STR(WINED3D_CS_OP_SET_SHADER);
WINED3D_TO_STR(WINED3D_CS_OP_SET_BLEND_STATE);
WINED3D_TO_STR(WINED3D_CS_OP_SET_RASTERIZER_STATE);
WINED3D_TO_STR(WINED3D_CS_OP_SET_RENDER_STATE);
WINED3D_TO_STR(WINED3D_CS_OP_SET_TEXTURE_STATE);
WINED3D_TO_STR(WINED3D_CS_OP_SET_SAMPLER_STATE);
WINED3D_TO_STR(WINED3D_CS_OP_SET_TRANSFORM);
WINED3D_TO_STR(WINED3D_CS_OP_SET_CLIP_PLANE);
WINED3D_TO_STR(WINED3D_CS_OP_SET_COLOR_KEY);
WINED3D_TO_STR(WINED3D_CS_OP_SET_MATERIAL);
WINED3D_TO_STR(WINED3D_CS_OP_SET_LIGHT);
WINED3D_TO_STR(WINED3D_CS_OP_SET_LIGHT_ENABLE);
WINED3D_TO_STR(WINED3D_CS_OP_PUSH_CONSTANTS);
WINED3D_TO_STR(WINED3D_CS_OP_RESET_STATE);
WINED3D_TO_STR(WINED3D_CS_OP_CALLBACK);
WINED3D_TO_STR(WINED3D_CS_OP_QUERY_ISSUE);
WINED3D_TO_STR(WINED3D_CS_OP_PRELOAD_RESOURCE);
WINED3D_TO_STR(WINED3D_CS_OP_UNLOAD_RESOURCE);
WINED3D_TO_STR(WINED3D_CS_OP_MAP);
WINED3D_TO_STR(WINED3D_CS_OP_UNMAP);
WINED3D_TO_STR(WINED3D_CS_OP_BLT_SUB_RESOURCE);
WINED3D_TO_STR(WINED3D_CS_OP_UPDATE_SUB_RESOURCE);
WINED3D_TO_STR(WINED3D_CS_OP_ADD_DIRTY_TEXTURE_REGION);
WINED3D_TO_STR(WINED3D_CS_OP_CLEAR_UNORDERED_ACCESS_VIEW);
WINED3D_TO_STR(WINED3D_CS_OP_COPY_UAV_COUNTER);
WINED3D_TO_STR(WINED3D_CS_OP_GENERATE_MIPMAPS);
WINED3D_TO_STR(WINED3D_CS_OP_STOP);
#undef WINED3D_TO_STR
default:
return wine_dbg_sprintf("UNKNOWN_OP(%#x)", op);
}
}
static void wined3d_cs_exec_nop(struct wined3d_cs *cs, const void *data)
{
}
......@@ -2711,6 +2770,7 @@ static DWORD WINAPI wined3d_cs_run(void *ctx)
{
opcode = *(const enum wined3d_cs_op *)packet->data;
TRACE("Executing %s.\n", debug_cs_op(opcode));
if (opcode >= WINED3D_CS_OP_STOP)
{
if (opcode > WINED3D_CS_OP_STOP)
......@@ -2719,6 +2779,7 @@ static DWORD WINAPI wined3d_cs_run(void *ctx)
}
wined3d_cs_op_handlers[opcode](cs, packet->data);
TRACE("%s executed.\n", debug_cs_op(opcode));
}
tail += FIELD_OFFSET(struct wined3d_cs_packet, data[packet->size]);
......
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