summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2016-09-10 10:16:54 +0200
committerMarek Olšák <[email protected]>2016-09-13 20:38:25 +0200
commitc723acc03dc39388e75d2c5919b99cd7b4d7e7cc (patch)
treee7f13255164c71a4d63ecdbec4ff7b429b8f7387 /src
parentfdd457c89fb5d210d29f878704969d85abd91e8f (diff)
ddebug: dump shader buffers and images
this was unimplemented Reviewed-by: Nicolai Hähnle <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/gallium/auxiliary/util/u_dump.h3
-rw-r--r--src/gallium/auxiliary/util/u_dump_state.c19
-rw-r--r--src/gallium/drivers/ddebug/dd_draw.c30
3 files changed, 49 insertions, 3 deletions
diff --git a/src/gallium/auxiliary/util/u_dump.h b/src/gallium/auxiliary/util/u_dump.h
index 2598851152b..bce8517b4e6 100644
--- a/src/gallium/auxiliary/util/u_dump.h
+++ b/src/gallium/auxiliary/util/u_dump.h
@@ -159,6 +159,9 @@ void
util_dump_image_view(FILE *stream, const struct pipe_image_view *state);
void
+util_dump_shader_buffer(FILE *stream, const struct pipe_shader_buffer *state);
+
+void
util_dump_sampler_view(FILE *stream, const struct pipe_sampler_view *state);
void
diff --git a/src/gallium/auxiliary/util/u_dump_state.c b/src/gallium/auxiliary/util/u_dump_state.c
index 6aecee1e622..06d5e788fae 100644
--- a/src/gallium/auxiliary/util/u_dump_state.c
+++ b/src/gallium/auxiliary/util/u_dump_state.c
@@ -736,6 +736,25 @@ util_dump_image_view(FILE *stream, const struct pipe_image_view *state)
void
+util_dump_shader_buffer(FILE *stream, const struct pipe_shader_buffer *state)
+{
+ if (!state) {
+ util_dump_null(stream);
+ return;
+ }
+
+ util_dump_struct_begin(stream, "pipe_shader_buffer");
+
+ util_dump_member(stream, ptr, state, buffer);
+ util_dump_member(stream, uint, state, buffer_offset);
+ util_dump_member(stream, uint, state, buffer_size);
+
+ util_dump_struct_end(stream);
+
+}
+
+
+void
util_dump_sampler_view(FILE *stream, const struct pipe_sampler_view *state)
{
if (!state) {
diff --git a/src/gallium/drivers/ddebug/dd_draw.c b/src/gallium/drivers/ddebug/dd_draw.c
index 3124d0552d0..511daf429d9 100644
--- a/src/gallium/drivers/ddebug/dd_draw.c
+++ b/src/gallium/drivers/ddebug/dd_draw.c
@@ -313,8 +313,19 @@ dd_dump_draw_vbo(struct dd_draw_state *dstate, struct pipe_draw_info *info, FILE
DUMP_M(resource, dstate->sampler_views[sh][i], texture);
}
- /* TODO: print shader images */
- /* TODO: print shader buffers */
+ for (i = 0; i < PIPE_MAX_SHADER_IMAGES; i++)
+ if (dstate->shader_images[sh][i].resource) {
+ DUMP_I(image_view, &dstate->shader_images[sh][i], i);
+ if (dstate->shader_images[sh][i].resource)
+ DUMP_M(resource, &dstate->shader_images[sh][i], resource);
+ }
+
+ for (i = 0; i < PIPE_MAX_SHADER_BUFFERS; i++)
+ if (dstate->shader_buffers[sh][i].buffer) {
+ DUMP_I(shader_buffer, &dstate->shader_buffers[sh][i], i);
+ if (dstate->shader_buffers[sh][i].buffer)
+ DUMP_M(resource, &dstate->shader_buffers[sh][i], buffer);
+ }
fprintf(f, COLOR_SHADER "end shader: %s" COLOR_RESET "\n\n", shader_str[sh]);
}
@@ -804,7 +815,20 @@ dd_copy_draw_state(struct dd_draw_state *dst, struct dd_draw_state *src)
else
dst->sampler_states[i][j] = NULL;
}
- /* TODO: shader buffers & images */
+
+ for (j = 0; j < PIPE_MAX_SHADER_IMAGES; j++) {
+ pipe_resource_reference(&dst->shader_images[i][j].resource,
+ src->shader_images[i][j].resource);
+ memcpy(&dst->shader_images[i][j], &src->shader_images[i][j],
+ sizeof(src->shader_images[i][j]));
+ }
+
+ for (j = 0; j < PIPE_MAX_SHADER_BUFFERS; j++) {
+ pipe_resource_reference(&dst->shader_buffers[i][j].buffer,
+ src->shader_buffers[i][j].buffer);
+ memcpy(&dst->shader_buffers[i][j], &src->shader_buffers[i][j],
+ sizeof(src->shader_buffers[i][j]));
+ }
}
if (src->velems)