{
switch (w) {
case PIPE_TEX_WRAP_REPEAT:
- return MALI_WRAP_REPEAT;
+ return MALI_WRAP_MODE_REPEAT;
case PIPE_TEX_WRAP_CLAMP:
- return MALI_WRAP_CLAMP;
+ return MALI_WRAP_MODE_CLAMP;
case PIPE_TEX_WRAP_CLAMP_TO_EDGE:
- return MALI_WRAP_CLAMP_TO_EDGE;
+ return MALI_WRAP_MODE_CLAMP_TO_EDGE;
case PIPE_TEX_WRAP_CLAMP_TO_BORDER:
- return MALI_WRAP_CLAMP_TO_BORDER;
+ return MALI_WRAP_MODE_CLAMP_TO_BORDER;
case PIPE_TEX_WRAP_MIRROR_REPEAT:
- return MALI_WRAP_MIRRORED_REPEAT;
+ return MALI_WRAP_MODE_MIRRORED_REPEAT;
case PIPE_TEX_WRAP_MIRROR_CLAMP:
- return MALI_WRAP_MIRRORED_CLAMP;
+ return MALI_WRAP_MODE_MIRRORED_CLAMP;
case PIPE_TEX_WRAP_MIRROR_CLAMP_TO_EDGE:
- return MALI_WRAP_MIRRORED_CLAMP_TO_EDGE;
+ return MALI_WRAP_MODE_MIRRORED_CLAMP_TO_EDGE;
case PIPE_TEX_WRAP_MIRROR_CLAMP_TO_BORDER:
- return MALI_WRAP_MIRRORED_CLAMP_TO_BORDER;
+ return MALI_WRAP_MODE_MIRRORED_CLAMP_TO_BORDER;
default:
unreachable("Invalid wrap");
#define MALI_POSITIVE(dim) (dim - 1)
-/* Used with wrapping. Unclear what top bit conveys */
-
-enum mali_wrap_mode {
- MALI_WRAP_REPEAT = 0x8 | 0x0,
- MALI_WRAP_CLAMP_TO_EDGE = 0x8 | 0x1,
- MALI_WRAP_CLAMP = 0x8 | 0x2,
- MALI_WRAP_CLAMP_TO_BORDER = 0x8 | 0x3,
- MALI_WRAP_MIRRORED_REPEAT = 0x8 | 0x4 | 0x0,
- MALI_WRAP_MIRRORED_CLAMP_TO_EDGE = 0x8 | 0x4 | 0x1,
- MALI_WRAP_MIRRORED_CLAMP = 0x8 | 0x4 | 0x2,
- MALI_WRAP_MIRRORED_CLAMP_TO_BORDER = 0x8 | 0x4 | 0x3,
-};
-
/* Shared across both command stream and Midgard, and even with Bifrost */
enum mali_texture_type {
}
}
-#define DEFINE_CASE(name) case MALI_WRAP_## name: return "MALI_WRAP_" #name
-static char *
-pandecode_wrap_mode(enum mali_wrap_mode op)
-{
- switch (op) {
- DEFINE_CASE(REPEAT);
- DEFINE_CASE(CLAMP_TO_EDGE);
- DEFINE_CASE(CLAMP);
- DEFINE_CASE(CLAMP_TO_BORDER);
- DEFINE_CASE(MIRRORED_REPEAT);
- DEFINE_CASE(MIRRORED_CLAMP_TO_EDGE);
- DEFINE_CASE(MIRRORED_CLAMP);
- DEFINE_CASE(MIRRORED_CLAMP_TO_BORDER);
-
- default:
- pandecode_msg("XXX: invalid wrap mode %X\n", op);
- return "";
- }
-}
-#undef DEFINE_CASE
-
#define DEFINE_CASE(name) case MALI_BLOCK_## name: return "MALI_BLOCK_" #name
static char *
pandecode_block_format(enum mali_block_format fmt)
pandecode_prop("unk1 = 0x%x", s->unk1);
}
- pandecode_prop("wrap_s = %s", pandecode_wrap_mode(s->wrap_s));
- pandecode_prop("wrap_t = %s", pandecode_wrap_mode(s->wrap_t));
- pandecode_prop("wrap_r = %s", pandecode_wrap_mode(s->wrap_r));
+ pandecode_prop("wrap_s = %s", mali_wrap_mode_as_str(s->wrap_s));
+ pandecode_prop("wrap_t = %s", mali_wrap_mode_as_str(s->wrap_t));
+ pandecode_prop("wrap_r = %s", mali_wrap_mode_as_str(s->wrap_r));
if (s->unk8 != 0x8) {
pandecode_msg("XXX: unk8 tripped\n");
if (s->lod_bias)
pandecode_prop("lod_bias = FIXED_16(%f)", DECODE_FIXED_16(s->lod_bias));
- pandecode_prop("wrap_s = %s", pandecode_wrap_mode(s->wrap_s));
- pandecode_prop("wrap_t = %s", pandecode_wrap_mode(s->wrap_t));
- pandecode_prop("wrap_r = %s", pandecode_wrap_mode(s->wrap_r));
+ pandecode_prop("wrap_s = %s", mali_wrap_mode_as_str(s->wrap_s));
+ pandecode_prop("wrap_t = %s", mali_wrap_mode_as_str(s->wrap_t));
+ pandecode_prop("wrap_r = %s", mali_wrap_mode_as_str(s->wrap_r));
pandecode_prop("compare_func = %s", mali_func_as_str(s->compare_func));
<value name="Decr Sat" value="7"/>
</enum>
+ <enum name="Wrap Mode">
+ <value name="Repeat" value="8"/>
+ <value name="Clamp to Edge" value="9"/>
+ <value name="Clamp" value="10"/>
+ <value name="Clamp to Border" value="11"/>
+ <value name="Mirrored Repeat" value="12"/>
+ <value name="Mirrored Clamp to Edge" value="13"/>
+ <value name="Mirrored Clamp" value="14"/>
+ <value name="Mirrored Clamp to Border" value="15"/>
+ </enum>
+
</panxml>
struct mali_sampler_descriptor sampler = {
.filter_mode = MALI_SAMP_MAG_NEAREST | MALI_SAMP_MIN_NEAREST,
- .wrap_s = MALI_WRAP_CLAMP_TO_EDGE,
- .wrap_t = MALI_WRAP_CLAMP_TO_EDGE,
- .wrap_r = MALI_WRAP_CLAMP_TO_EDGE,
+ .wrap_s = MALI_WRAP_MODE_CLAMP_TO_EDGE,
+ .wrap_t = MALI_WRAP_MODE_CLAMP_TO_EDGE,
+ .wrap_r = MALI_WRAP_MODE_CLAMP_TO_EDGE,
};
struct panfrost_transfer shader_meta_t = panfrost_pool_alloc(pool, sizeof(shader_meta) + 8 * sizeof(struct midgard_blend_rt));