return shader_ptr;
}
-static bool
-all_zero(unsigned *buffer, unsigned count)
-{
- for (unsigned i = 0; i < count; ++i) {
- if (buffer[i])
- return false;
- }
-
- return true;
-}
-
static void
pandecode_stencil(const char *name, const struct mali_stencil_test *stencil)
{
- if (all_zero((unsigned *) stencil, sizeof(stencil) / sizeof(unsigned)))
+ unsigned any_nonzero =
+ stencil->ref | stencil->mask | stencil->func |
+ stencil->sfail | stencil->dpfail | stencil->dppass;
+
+ if (any_nonzero == 0)
return;
const char *func = pandecode_func(stencil->func);
static mali_ptr
pandecode_midgard_blend(union midgard_blend *blend, bool is_shader)
{
- if (all_zero((unsigned *) blend, sizeof(blend) / sizeof(unsigned)))
+ /* constant/equation is in a union */
+ if (!blend->shader)
return 0;
pandecode_log(".blend = {\n");