MALI_FUNC_ALWAYS = 7
};
-/* Same OpenGL, but mixed up. Why? Because forget me, that's why! */
-
-enum mali_alt_func {
- MALI_ALT_FUNC_NEVER = 0,
- MALI_ALT_FUNC_GREATER = 1,
- MALI_ALT_FUNC_EQUAL = 2,
- MALI_ALT_FUNC_GEQUAL = 3,
- MALI_ALT_FUNC_LESS = 4,
- MALI_ALT_FUNC_NOTEQUAL = 5,
- MALI_ALT_FUNC_LEQUAL = 6,
- MALI_ALT_FUNC_ALWAYS = 7
-};
-
/* Flags apply to unknown2_3? */
#define MALI_HAS_MSAA (1 << 0)
#define MALI_POSITIVE(dim) (dim - 1)
-/* Used with wrapping. Incomplete (this is a 4-bit field...) */
+/* Used with wrapping. Unclear what top bit conveys */
enum mali_wrap_mode {
- MALI_WRAP_REPEAT = 0x8,
- MALI_WRAP_CLAMP_TO_EDGE = 0x9,
- MALI_WRAP_CLAMP_TO_BORDER = 0xB,
- MALI_WRAP_MIRRORED_REPEAT = 0xC
+ 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 */
uint16_t min_lod;
uint16_t max_lod;
- /* All one word in reality, but packed a bit */
+ /* All one word in reality, but packed a bit. Comparisons are flipped
+ * from OpenGL. */
enum mali_wrap_mode wrap_s : 4;
enum mali_wrap_mode wrap_t : 4;
enum mali_wrap_mode wrap_r : 4;
- enum mali_alt_func compare_func : 3;
+ enum mali_func compare_func : 3;
/* No effect on 2D textures. For cubemaps, set for ES3 and clear for
* ES2, controlling seamless cubemapping */