aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/ddebug
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/gallium/drivers/ddebug
parentfdd457c89fb5d210d29f878704969d85abd91e8f (diff)
ddebug: dump shader buffers and images
this was unimplemented Reviewed-by: Nicolai Hähnle <[email protected]>
Diffstat (limited to 'src/gallium/drivers/ddebug')
-rw-r--r--src/gallium/drivers/ddebug/dd_draw.c30
1 files changed, 27 insertions, 3 deletions
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)