[Mesa-dev] [PATCH 09/11] radeonsi: dump compute shader as part of debug dump
Nicolai Hähnle
nhaehnle at gmail.com
Mon May 8 15:35:59 UTC 2017
From: Nicolai Hähnle <nicolai.haehnle at amd.com>
---
src/gallium/drivers/radeonsi/si_debug.c | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/src/gallium/drivers/radeonsi/si_debug.c b/src/gallium/drivers/radeonsi/si_debug.c
index 2e727f6..6e310bb 100644
--- a/src/gallium/drivers/radeonsi/si_debug.c
+++ b/src/gallium/drivers/radeonsi/si_debug.c
@@ -18,20 +18,21 @@
* THE AUTHOR(S) AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM,
* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
* USE OR OTHER DEALINGS IN THE SOFTWARE.
*
* Authors:
* Marek Olšák <maraeo at gmail.com>
*/
#include "si_pipe.h"
+#include "si_compute.h"
#include "sid.h"
#include "gfx9d.h"
#include "sid_tables.h"
#include "ddebug/dd_util.h"
#include "util/u_memory.h"
#include "ac_debug.h"
DEBUG_GET_ONCE_OPTION(replace_shaders, "RADEON_REPLACE_SHADERS", NULL)
static void si_dump_shader(struct si_screen *sscreen,
@@ -48,20 +49,29 @@ static void si_dump_gfx_shader(struct si_screen *sscreen,
const struct si_shader_ctx_state *state, FILE *f)
{
const struct si_shader *current = state->current;
if (!state->cso || !current)
return;
si_dump_shader(sscreen, state->cso->info.processor, current, f);
}
+static void si_dump_compute_shader(struct si_screen *sscreen,
+ const struct si_cs_shader_state *state, FILE *f)
+{
+ if (!state->program || state->program != state->emitted_program)
+ return;
+
+ si_dump_shader(sscreen, PIPE_SHADER_COMPUTE, &state->program->shader, f);
+}
+
/**
* Shader compiles can be overridden with arbitrary ELF objects by setting
* the environment variable RADEON_REPLACE_SHADERS=num1:filename1[;num2:filename2]
*/
bool si_replace_shader(unsigned num, struct ac_shader_binary *binary)
{
const char *p = debug_get_option_replace_shaders();
const char *semicolon;
char *copy = NULL;
FILE *f;
@@ -762,20 +772,21 @@ static void si_dump_debug_state(struct pipe_context *ctx, FILE *f,
if (flags & PIPE_DUMP_CURRENT_STATES)
si_dump_framebuffer(sctx, f);
if (flags & PIPE_DUMP_CURRENT_SHADERS) {
si_dump_gfx_shader(sctx->screen, &sctx->vs_shader, f);
si_dump_gfx_shader(sctx->screen, &sctx->tcs_shader, f);
si_dump_gfx_shader(sctx->screen, &sctx->tes_shader, f);
si_dump_gfx_shader(sctx->screen, &sctx->gs_shader, f);
si_dump_gfx_shader(sctx->screen, &sctx->ps_shader, f);
+ si_dump_compute_shader(sctx->screen, &sctx->cs_shader_state, f);
if (flags & PIPE_DUMP_DEVICE_STATUS_REGISTERS) {
si_dump_annotated_shaders(sctx, f);
si_dump_command("Active waves (raw data)", "umr -wa | column -t", f);
si_dump_command("Wave information", "umr -O bits -wa", f);
}
si_dump_descriptor_list(&sctx->descriptors[SI_DESCS_RW_BUFFERS],
"", "RW buffers", SI_NUM_RW_BUFFERS, f);
si_dump_gfx_descriptors(sctx, &sctx->vs_shader, f);
--
2.9.3
More information about the mesa-dev
mailing list