intel: aubinator: print field values if available
Turning this :
sampler state 0
Sampler Disable: false
Texture Border Color Mode: 0
LOD PreClamp Enable: 1
Base Mip Level: 0.000000
Mip Mode Filter: 0
Mag Mode Filter: 1
Min Mode Filter: 1
Texture LOD Bias: foo
Anisotropic Algorithm: 0
into this :
sampler state 0
Sampler Disable: false
Texture Border Color Mode: 0 (DX10/OGL)
LOD PreClamp Enable: 1 (OGL)
Base Mip Level: 0.000000
Mip Mode Filter: 0 (NONE)
Mag Mode Filter: 1 (LINEAR)
Min Mode Filter: 1 (LINEAR)
Texture LOD Bias: foo
Anisotropic Algorithm: 0 (LEGACY)
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Sirisha Gandikota<sirisha.gandikota@intel.com>
This commit is contained in:
@@ -635,6 +635,19 @@ gen_field_iterator_init(struct gen_field_iterator *iter,
|
||||
iter->print_colors = print_colors;
|
||||
}
|
||||
|
||||
static void
|
||||
gen_field_write_value(char *str, size_t max_length,
|
||||
struct gen_field *field,
|
||||
uint64_t value)
|
||||
{
|
||||
for (int i = 0; i < field->n_values; i++) {
|
||||
if (field->values[i]->value == value) {
|
||||
strncpy(str, field->values[i]->name, max_length);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool
|
||||
gen_field_iterator_next(struct gen_field_iterator *iter)
|
||||
{
|
||||
@@ -656,16 +669,26 @@ gen_field_iterator_next(struct gen_field_iterator *iter)
|
||||
else
|
||||
v.qw = iter->p[index];
|
||||
|
||||
iter->description[0] = '\0';
|
||||
|
||||
switch (f->type.kind) {
|
||||
case GEN_TYPE_UNKNOWN:
|
||||
case GEN_TYPE_INT:
|
||||
case GEN_TYPE_INT: {
|
||||
uint64_t value = field(v.qw, f->start, f->end);
|
||||
snprintf(iter->value, sizeof(iter->value),
|
||||
"%"PRId64, field(v.qw, f->start, f->end));
|
||||
"%"PRId64, value);
|
||||
gen_field_write_value(iter->description, sizeof(iter->description),
|
||||
f, value);
|
||||
break;
|
||||
case GEN_TYPE_UINT:
|
||||
}
|
||||
case GEN_TYPE_UINT: {
|
||||
uint64_t value = field(v.qw, f->start, f->end);
|
||||
snprintf(iter->value, sizeof(iter->value),
|
||||
"%"PRIu64, field(v.qw, f->start, f->end));
|
||||
"%"PRIu64, value);
|
||||
gen_field_write_value(iter->description, sizeof(iter->description),
|
||||
f, value);
|
||||
break;
|
||||
}
|
||||
case GEN_TYPE_BOOL: {
|
||||
const char *true_string =
|
||||
iter->print_colors ? "\e[0;35mtrue\e[0m" : "true";
|
||||
|
||||
Reference in New Issue
Block a user