mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-08 06:58:05 +02:00
intel/decode/gfx6: add support for gfx6 CC/VIEWPORT pointers.
These have 3 sub states encoded and valid fields on SNB. Acked-by: Jason Ekstrand <jason@jlekstrand.net> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12864>
This commit is contained in:
parent
09ef427f94
commit
929db0a818
1 changed files with 86 additions and 17 deletions
|
|
@ -851,23 +851,10 @@ str_ends_with(const char *str, const char *end)
|
|||
}
|
||||
|
||||
static void
|
||||
decode_dynamic_state_pointers(struct intel_batch_decode_ctx *ctx,
|
||||
const char *struct_type, const uint32_t *p,
|
||||
int count)
|
||||
decode_dynamic_state(struct intel_batch_decode_ctx *ctx,
|
||||
const char *struct_type, uint32_t state_offset,
|
||||
int count)
|
||||
{
|
||||
struct intel_group *inst = intel_ctx_find_instruction(ctx, p);
|
||||
|
||||
uint32_t state_offset = 0;
|
||||
|
||||
struct intel_field_iterator iter;
|
||||
intel_field_iterator_init(&iter, inst, p, 0, false);
|
||||
while (intel_field_iterator_next(&iter)) {
|
||||
if (str_ends_with(iter.name, "Pointer") || !strncmp(iter.name, "Pointer", 7)) {
|
||||
state_offset = iter.raw_value;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
uint64_t state_addr = ctx->dynamic_base + state_offset;
|
||||
struct intel_batch_decode_bo bo = ctx_get_bo(ctx, true, state_addr);
|
||||
const void *state_map = bo.map;
|
||||
|
|
@ -905,6 +892,57 @@ decode_dynamic_state_pointers(struct intel_batch_decode_ctx *ctx,
|
|||
}
|
||||
}
|
||||
|
||||
static void
|
||||
decode_dynamic_state_pointers(struct intel_batch_decode_ctx *ctx,
|
||||
const char *struct_type, const uint32_t *p,
|
||||
int count)
|
||||
{
|
||||
struct intel_group *inst = intel_ctx_find_instruction(ctx, p);
|
||||
|
||||
uint32_t state_offset = 0;
|
||||
|
||||
struct intel_field_iterator iter;
|
||||
intel_field_iterator_init(&iter, inst, p, 0, false);
|
||||
while (intel_field_iterator_next(&iter)) {
|
||||
if (str_ends_with(iter.name, "Pointer") || !strncmp(iter.name, "Pointer", 7)) {
|
||||
state_offset = iter.raw_value;
|
||||
break;
|
||||
}
|
||||
}
|
||||
decode_dynamic_state(ctx, struct_type, state_offset, count);
|
||||
}
|
||||
|
||||
static void
|
||||
decode_3dstate_viewport_state_pointers(struct intel_batch_decode_ctx *ctx,
|
||||
const uint32_t *p)
|
||||
{
|
||||
struct intel_group *inst = intel_ctx_find_instruction(ctx, p);
|
||||
uint32_t state_offset = 0;
|
||||
bool clip = false, sf = false, cc = false;
|
||||
struct intel_field_iterator iter;
|
||||
intel_field_iterator_init(&iter, inst, p, 0, false);
|
||||
while (intel_field_iterator_next(&iter)) {
|
||||
if (!strcmp(iter.name, "CLIP Viewport State Change"))
|
||||
clip = iter.raw_value;
|
||||
if (!strcmp(iter.name, "SF Viewport State Change"))
|
||||
sf = iter.raw_value;
|
||||
if (!strcmp(iter.name, "CC Viewport State Change"))
|
||||
cc = iter.raw_value;
|
||||
else if (!strcmp(iter.name, "Pointer to CLIP_VIEWPORT") && clip) {
|
||||
state_offset = iter.raw_value;
|
||||
decode_dynamic_state(ctx, "CLIP_VIEWPORT", state_offset, 1);
|
||||
}
|
||||
else if (!strcmp(iter.name, "Pointer to SF_VIEWPORT") && sf) {
|
||||
state_offset = iter.raw_value;
|
||||
decode_dynamic_state(ctx, "SF_VIEWPORT", state_offset, 1);
|
||||
}
|
||||
else if (!strcmp(iter.name, "Pointer to CC_VIEWPORT") && cc) {
|
||||
state_offset = iter.raw_value;
|
||||
decode_dynamic_state(ctx, "CC_VIEWPORT", state_offset, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
decode_3dstate_viewport_state_pointers_cc(struct intel_batch_decode_ctx *ctx,
|
||||
const uint32_t *p)
|
||||
|
|
@ -930,7 +968,37 @@ static void
|
|||
decode_3dstate_cc_state_pointers(struct intel_batch_decode_ctx *ctx,
|
||||
const uint32_t *p)
|
||||
{
|
||||
decode_dynamic_state_pointers(ctx, "COLOR_CALC_STATE", p, 1);
|
||||
if (ctx->devinfo.ver != 6) {
|
||||
decode_dynamic_state_pointers(ctx, "COLOR_CALC_STATE", p, 1);
|
||||
return;
|
||||
}
|
||||
|
||||
struct intel_group *inst = intel_ctx_find_instruction(ctx, p);
|
||||
|
||||
uint32_t state_offset = 0;
|
||||
bool blend_change = false, ds_change = false, cc_change = false;
|
||||
struct intel_field_iterator iter;
|
||||
intel_field_iterator_init(&iter, inst, p, 0, false);
|
||||
while (intel_field_iterator_next(&iter)) {
|
||||
if (!strcmp(iter.name, "BLEND_STATE Change"))
|
||||
blend_change = iter.raw_value;
|
||||
else if (!strcmp(iter.name, "DEPTH_STENCIL_STATE Change"))
|
||||
ds_change = iter.raw_value;
|
||||
else if (!strcmp(iter.name, "Color Calc State Pointer Valid"))
|
||||
cc_change = iter.raw_value;
|
||||
else if (!strcmp(iter.name, "Pointer to DEPTH_STENCIL_STATE") && ds_change) {
|
||||
state_offset = iter.raw_value;
|
||||
decode_dynamic_state(ctx, "DEPTH_STENCIL_STATE", state_offset, 1);
|
||||
}
|
||||
else if (!strcmp(iter.name, "Pointer to BLEND_STATE") && blend_change) {
|
||||
state_offset = iter.raw_value;
|
||||
decode_dynamic_state(ctx, "BLEND_STATE", state_offset, 1);
|
||||
}
|
||||
else if (!strcmp(iter.name, "Color Calc State Pointer") && cc_change) {
|
||||
state_offset = iter.raw_value;
|
||||
decode_dynamic_state(ctx, "COLOR_CALC_STATE", state_offset, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
@ -1262,6 +1330,7 @@ struct custom_decoder {
|
|||
{ "3DSTATE_SAMPLER_STATE_POINTERS_PS", decode_3dstate_sampler_state_pointers },
|
||||
{ "3DSTATE_SAMPLER_STATE_POINTERS", decode_3dstate_sampler_state_pointers_gfx6 },
|
||||
|
||||
{ "3DSTATE_VIEWPORT_STATE_POINTERS", decode_3dstate_viewport_state_pointers },
|
||||
{ "3DSTATE_VIEWPORT_STATE_POINTERS_CC", decode_3dstate_viewport_state_pointers_cc },
|
||||
{ "3DSTATE_VIEWPORT_STATE_POINTERS_SF_CLIP", decode_3dstate_viewport_state_pointers_sf_clip },
|
||||
{ "3DSTATE_BLEND_STATE_POINTERS", decode_3dstate_blend_state_pointers },
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue