Commit 3badd43c authored by Alyssa Rosenzweig's avatar Alyssa Rosenzweig 💜

Decode sampler filter mode

parent 5ed97ad0
......@@ -170,6 +170,7 @@ enum mali_tex_format {
MALI_RGB24 = 0xA,
};
struct mali_texture_descriptor {
uint32_t unknown0;
uint32_t unknown1;
......@@ -194,6 +195,21 @@ struct mali_texture_descriptor {
mali_ptr swizzled_bitmap_1;
} __attribute__((packed));
/* Used as part of filter_mode */
#define MALI_GL_LINEAR 0
#define MALI_GL_NEAREST 1
/* Used to construct low bits of filter_mode */
#define MALI_GL_TEX_MAG(mode) (((mode) & 1) << 0)
#define MALI_GL_TEX_MIN(mode) (((mode) & 1) << 1)
#define MALI_GL_TEX_MAG_MASK (1)
#define MALI_GL_TEX_MIN_MASK (2)
#define MALI_FILTER_NAME(filter) (filter ? "MALI_GL_NEAREST" : "MALI_GL_LINEAR")
struct mali_sampler_descriptor {
uint32_t filter_mode;
......
......@@ -517,8 +517,11 @@ void panwrap_replay_vertex_or_tiler_job(const struct mali_job_descriptor_header
panwrap_log("struct mali_sampler_descriptor sampler_descriptor_%d = {\n", job_no);
panwrap_indent++;
/* TODO: Decode filter mode (but I have bits of it understood in my notes) */
panwrap_prop("filter_mode = 0x%" PRIx32, s->filter_mode);
/* Only the lower two bits are understood right now; the rest we display as hex */
panwrap_log(".filter_mode = MALI_GL_TEXTURE_MIN(%s) | MALI_GL_TEXTURE_MAG(%s) | 0x%" PRIx32",\n",
MALI_FILTER_NAME(s->filter_mode & MALI_GL_TEX_MIN_MASK),
MALI_FILTER_NAME(s->filter_mode & MALI_GL_TEX_MAG_MASK),
s->filter_mode & ~3);
panwrap_prop("unknown1 = 0x%" PRIx32, s->unknown1);
panwrap_prop("unknown2 = 0x%" PRIx32, s->unknown2);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment