mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-03 05:00:09 +01:00
This keeps the directory structure a bit more organized: - brw specific code - elk specific code - common NIR passes that could be used in both places It also means that you can now 'git grep' in the brw directory without finding a bunch of elk code, or having to "grep thing b*". Reviewed-by: Dylan Baker <dylan.c.baker@intel.com> Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37755>
51 lines
1.8 KiB
C
51 lines
1.8 KiB
C
/*
|
|
* Copyright © 2017 Intel Corporation
|
|
* SPDX-License-Identifier: MIT
|
|
*/
|
|
|
|
#include "intel_decoder.h"
|
|
#include "intel_decoder_private.h"
|
|
|
|
#include "compiler/brw/brw_disasm.h"
|
|
|
|
static void
|
|
ctx_disassemble_program_brw(struct intel_batch_decode_ctx *ctx,
|
|
uint32_t ksp,
|
|
const char *short_name,
|
|
const char *name)
|
|
{
|
|
uint64_t addr = ctx->instruction_base + ksp;
|
|
struct intel_batch_decode_bo bo = ctx_get_bo(ctx, true, addr);
|
|
if (!bo.map)
|
|
return;
|
|
|
|
fprintf(ctx->fp, "\nReferenced %s:\n", name);
|
|
brw_disassemble_with_errors(ctx->brw, bo.map, 0, NULL, ctx->fp);
|
|
|
|
if (ctx->shader_binary) {
|
|
int size = brw_disassemble_find_end(ctx->brw, bo.map, 0);
|
|
|
|
ctx->shader_binary(ctx->user_data, short_name, addr,
|
|
bo.map, size);
|
|
}
|
|
}
|
|
|
|
void
|
|
intel_batch_decode_ctx_init_brw(struct intel_batch_decode_ctx *ctx,
|
|
const struct brw_isa_info *isa,
|
|
const struct intel_device_info *devinfo,
|
|
FILE *fp, enum intel_batch_decode_flags flags,
|
|
const char *xml_path,
|
|
struct intel_batch_decode_bo (*get_bo)(void *,
|
|
bool,
|
|
uint64_t),
|
|
unsigned (*get_state_size)(void *, uint64_t,
|
|
uint64_t),
|
|
void *user_data)
|
|
{
|
|
intel_batch_decode_ctx_init(ctx, devinfo, fp, flags, xml_path,
|
|
get_bo, get_state_size, user_data);
|
|
ctx->brw = isa;
|
|
ctx->disassemble_program = ctx_disassemble_program_brw;
|
|
}
|
|
|