struct trace_resource *tr_tex = trace_resource(_resource);
struct pipe_context *pipe = tr_ctx->pipe;
struct pipe_resource *texture = tr_tex->resource;
- struct trace_sampler_view *result = CALLOC_STRUCT(trace_sampler_view);
+ struct pipe_sampler_view *result;
+ struct trace_sampler_view *tr_view;
trace_dump_call_begin("pipe_context", "create_sampler_view");
trace_dump_arg(ptr, pipe);
trace_dump_arg(ptr, texture);
- trace_dump_arg(ptr, templ);
-
- result->sampler_view = pipe->create_sampler_view(pipe, texture, templ);
+ trace_dump_arg(sampler_view_template, templ);
- result->base = *templ;
- result->base.reference.count = 1;
- result->base.texture = NULL;
- pipe_resource_reference(&result->base.texture, _resource);
- result->base.context = _pipe;
+ result = pipe->create_sampler_view(pipe, texture, templ);
trace_dump_ret(ptr, result);
trace_dump_call_end();
- return &result->base;
+ /*
+ * Wrap pipe_sampler_view
+ */
+ tr_view = CALLOC_STRUCT(trace_sampler_view);
+ tr_view->base = *templ;
+ tr_view->base.reference.count = 1;
+ tr_view->base.texture = NULL;
+ pipe_resource_reference(&tr_view->base.texture, _resource);
+ tr_view->base.context = _pipe;
+ tr_view->sampler_view = result;
+ result = &tr_view->base;
+
+ return result;
}
assert(texture->screen == context->screen);
- trace_dump_call_begin("pipe_context", "get_transfer");
-
- trace_dump_arg(ptr, context);
- trace_dump_arg(ptr, texture);
- trace_dump_arg(uint, sr.face);
- trace_dump_arg(uint, sr.level);
- trace_dump_arg(uint, usage);
- trace_dump_arg(uint, box->x);
- trace_dump_arg(uint, box->y);
- trace_dump_arg(uint, box->z);
- trace_dump_arg(uint, box->width);
- trace_dump_arg(uint, box->height);
- trace_dump_arg(uint, box->depth);
+ /*
+ * Map and transfers can't be serialized so we convert all write transfers
+ * to transfer_inline_write and ignore read transfers.
+ */
result = context->get_transfer(context, texture, sr, usage, box);
- trace_dump_ret(ptr, result);
-
- trace_dump_call_end();
-
if (result)
result = trace_transfer_create(tr_context, tr_tex, result);
{
struct trace_context *tr_context = trace_context(_context);
struct trace_transfer *tr_trans = trace_transfer(_transfer);
- struct pipe_context *context = tr_context->pipe;
- struct pipe_transfer *transfer = tr_trans->transfer;
-
- trace_dump_call_begin("pipe_context", "transfer_destroy");
-
- trace_dump_arg(ptr, context);
- trace_dump_arg(ptr, transfer);
-
- trace_dump_call_end();
trace_transfer_destroy(tr_context, tr_trans);
}
trace_dump_arg(ptr, context);
trace_dump_arg(ptr, transfer);
- trace_dump_arg(uint, box->x);
- trace_dump_arg(uint, box->y);
- trace_dump_arg(uint, box->z);
- trace_dump_arg(uint, box->width);
- trace_dump_arg(uint, box->height);
- trace_dump_arg(uint, box->depth);
+ trace_dump_arg(box, box);
trace_dump_call_end();
context->transfer_flush_region(context,
struct pipe_transfer *transfer = tr_trans->transfer;
if(tr_trans->map) {
- trace_dump_call_begin("pipe_context", "transfer_write");
+ /*
+ * Fake a transfer_inline_write
+ */
- trace_dump_arg(ptr, context);
+ struct pipe_resource *resource = transfer->resource;
+ struct pipe_subresource sr = transfer->sr;
+ unsigned usage = transfer->usage;
+ const struct pipe_box *box = &transfer->box;
+ unsigned stride = transfer->stride;
+ unsigned slice_stride = transfer->slice_stride;
- trace_dump_arg(ptr, transfer);
+ trace_dump_call_begin("pipe_context", "transfer_inline_write");
- trace_dump_arg_begin("stride");
- trace_dump_uint(transfer->stride);
- trace_dump_arg_end();
+ trace_dump_arg(ptr, context);
+ trace_dump_arg(ptr, resource);
+ trace_dump_arg_struct(subresource, sr);
+ trace_dump_arg(uint, usage);
+ trace_dump_arg(box, box);
trace_dump_arg_begin("data");
trace_dump_box_bytes(tr_trans->map,
- transfer->resource->format,
- &transfer->box,
- transfer->stride,
- transfer->slice_stride);
+ resource->format,
+ box,
+ stride,
+ slice_stride);
trace_dump_arg_end();
-// trace_dump_arg_begin("size");
-// trace_dump_uint(size);
-// trace_dump_arg_end();
+ trace_dump_arg(uint, stride);
+ trace_dump_arg(uint, slice_stride);
trace_dump_call_end();
trace_dump_arg(ptr, context);
trace_dump_arg(ptr, resource);
- trace_dump_arg(uint, sr.face);
- trace_dump_arg(uint, sr.level);
+ trace_dump_arg_struct(subresource, sr);
trace_dump_arg(uint, usage);
- trace_dump_arg(uint, box->x);
- trace_dump_arg(uint, box->y);
- trace_dump_arg(uint, box->z);
- trace_dump_arg(uint, box->width);
- trace_dump_arg(uint, box->height);
- trace_dump_arg(uint, box->depth);
- trace_dump_arg(uint, stride);
- trace_dump_arg(uint, slice_stride);
+ trace_dump_arg(box, box);
trace_dump_arg_begin("data");
trace_dump_box_bytes(data,
- resource->format,
- box,
- stride,
- slice_stride);
+ resource->format,
+ box,
+ stride,
+ slice_stride);
trace_dump_arg_end();
+ trace_dump_arg(uint, stride);
+ trace_dump_arg(uint, slice_stride);
+
trace_dump_call_end();
context->transfer_inline_write(context, resource,
}
-void trace_dump_template(const struct pipe_resource *templat)
+void trace_dump_resource_template(const struct pipe_resource *templat)
{
if (!trace_dumping_enabled_locked())
return;
}
+void trace_dump_subresource(const struct pipe_subresource *subresource)
+{
+ if (!trace_dumping_enabled_locked())
+ return;
+
+ if(!subresource) {
+ trace_dump_null();
+ return;
+ }
+
+ trace_dump_struct_begin("pipe_subresource");
+
+ trace_dump_member(uint, subresource, face);
+ trace_dump_member(uint, subresource, level);
+
+ trace_dump_struct_end();
+}
+
+
+void trace_dump_box(const struct pipe_box *box)
+{
+ if (!trace_dumping_enabled_locked())
+ return;
+
+ if(!box) {
+ trace_dump_null();
+ return;
+ }
+
+ trace_dump_struct_begin("pipe_box");
+
+ trace_dump_member(uint, box, x);
+ trace_dump_member(uint, box, y);
+ trace_dump_member(uint, box, z);
+ trace_dump_member(uint, box, width);
+ trace_dump_member(uint, box, height);
+ trace_dump_member(uint, box, depth);
+
+ trace_dump_struct_end();
+}
+
+
void trace_dump_rasterizer_state(const struct pipe_rasterizer_state *state)
{
if (!trace_dumping_enabled_locked())
}
+void trace_dump_sampler_view_template(const struct pipe_sampler_view *state)
+{
+ if (!trace_dumping_enabled_locked())
+ return;
+
+ if(!state) {
+ trace_dump_null();
+ return;
+ }
+
+ trace_dump_struct_begin("pipe_sampler_view");
+
+ trace_dump_member(format, state, format);
+ trace_dump_member(uint, state, first_level);
+ trace_dump_member(uint, state, last_level);
+ trace_dump_member(uint, state, swizzle_r);
+ trace_dump_member(uint, state, swizzle_g);
+ trace_dump_member(uint, state, swizzle_b);
+ trace_dump_member(uint, state, swizzle_a);
+
+ trace_dump_struct_end();
+}
+
+
void trace_dump_surface(const struct pipe_surface *state)
{
if (!trace_dumping_enabled_locked())