diff options
author | Tomeu Vizoso <[email protected]> | 2020-05-07 14:56:17 +0200 |
---|---|---|
committer | Marge Bot <[email protected]> | 2020-05-07 17:16:53 +0000 |
commit | 9c3e82296c8bfc96ac956918a69f917a954c1f12 (patch) | |
tree | 77384ea93cac857f58b035d8cdfdf8677d421654 /src/gallium | |
parent | 7e53cce3ba4bdbddcad5f740a915f126f2388dd6 (diff) |
panfrost: Don't trample on top of Bifrost-specific unions
Signed-off-by: Tomeu Vizoso <[email protected]>
Reviewed-by: Alyssa Rosenzweig <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4944>
Diffstat (limited to 'src/gallium')
-rw-r--r-- | src/gallium/drivers/panfrost/pan_cmdstream.c | 46 |
1 files changed, 26 insertions, 20 deletions
diff --git a/src/gallium/drivers/panfrost/pan_cmdstream.c b/src/gallium/drivers/panfrost/pan_cmdstream.c index c99469a82d9..34c2c7a2af0 100644 --- a/src/gallium/drivers/panfrost/pan_cmdstream.c +++ b/src/gallium/drivers/panfrost/pan_cmdstream.c @@ -644,9 +644,11 @@ panfrost_frag_meta_blend_update(struct panfrost_context *ctx, /* If there is a blend shader, work registers are shared. XXX: opt */ - for (unsigned c = 0; c < rt_count; ++c) { - if (blend[c].is_shader) - fragmeta->midgard1.work_count = 16; + if (!(dev->quirks & IS_BIFROST)) { + for (unsigned c = 0; c < rt_count; ++c) { + if (blend[c].is_shader) + fragmeta->midgard1.work_count = 16; + } } /* Even on MFBD, the shader descriptor gets blend shaders. It's *also* @@ -763,29 +765,33 @@ panfrost_frag_shader_meta_init(struct panfrost_context *ctx, SET_BIT(fragmeta->unknown2_4, 0x10, dev->quirks & MIDGARD_SFBD); - /* Depending on whether it's legal to in the given shader, we try to - * enable early-z testing (or forward-pixel kill?) */ + if (dev->quirks & IS_BIFROST) { + /* TODO */ + } else { + /* Depending on whether it's legal to in the given shader, we try to + * enable early-z testing (or forward-pixel kill?) */ - SET_BIT(fragmeta->midgard1.flags_lo, MALI_EARLY_Z, - !fs->can_discard && !fs->writes_depth); + SET_BIT(fragmeta->midgard1.flags_lo, MALI_EARLY_Z, + !fs->can_discard && !fs->writes_depth); - /* Add the writes Z/S flags if needed. */ - SET_BIT(fragmeta->midgard1.flags_lo, MALI_WRITES_Z, fs->writes_depth); - SET_BIT(fragmeta->midgard1.flags_hi, MALI_WRITES_S, fs->writes_stencil); + /* Add the writes Z/S flags if needed. */ + SET_BIT(fragmeta->midgard1.flags_lo, MALI_WRITES_Z, fs->writes_depth); + SET_BIT(fragmeta->midgard1.flags_hi, MALI_WRITES_S, fs->writes_stencil); - /* Any time texturing is used, derivatives are implicitly calculated, - * so we need to enable helper invocations */ + /* Any time texturing is used, derivatives are implicitly calculated, + * so we need to enable helper invocations */ - SET_BIT(fragmeta->midgard1.flags_lo, MALI_HELPER_INVOCATIONS, - fs->helper_invocations); + SET_BIT(fragmeta->midgard1.flags_lo, MALI_HELPER_INVOCATIONS, + fs->helper_invocations); - /* CAN_DISCARD should be set if the fragment shader possibly contains a - * 'discard' instruction. It is likely this is related to optimizations - * related to forward-pixel kill, as per "Mali Performance 3: Is - * EGL_BUFFER_PRESERVED a good thing?" by Peter Harris */ + /* CAN_DISCARD should be set if the fragment shader possibly contains a + * 'discard' instruction. It is likely this is related to optimizations + * related to forward-pixel kill, as per "Mali Performance 3: Is + * EGL_BUFFER_PRESERVED a good thing?" by Peter Harris */ - SET_BIT(fragmeta->unknown2_3, MALI_CAN_DISCARD, fs->can_discard); - SET_BIT(fragmeta->midgard1.flags_lo, 0x400, fs->can_discard); + SET_BIT(fragmeta->unknown2_3, MALI_CAN_DISCARD, fs->can_discard); + SET_BIT(fragmeta->midgard1.flags_lo, 0x400, fs->can_discard); + } panfrost_frag_meta_rasterizer_update(ctx, fragmeta); panfrost_frag_meta_zsa_update(ctx, fragmeta); |