aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/panfrost
diff options
context:
space:
mode:
authorAlyssa Rosenzweig <[email protected]>2019-07-15 07:08:15 -0700
committerAlyssa Rosenzweig <[email protected]>2019-07-15 08:03:35 -0700
commitf8e2219b08949e90b34d67c7c9e7369446f16428 (patch)
treeb22a8bef38a598717f8eecdf4b356c8e85b3e2aa /src/gallium/drivers/panfrost
parent318d641cd9f51f0058d973caf907d68f88566ac2 (diff)
panfrost: Fix blend_cso if nr_cbufs == 0
Fixes: 46396af1ec4b69ca4a ("panfrost: Refactor blend infrastructure") Signed-off-by: Alyssa Rosenzweig <[email protected]>
Diffstat (limited to 'src/gallium/drivers/panfrost')
-rw-r--r--src/gallium/drivers/panfrost/pan_blend_cso.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/gallium/drivers/panfrost/pan_blend_cso.c b/src/gallium/drivers/panfrost/pan_blend_cso.c
index fa5f954c3a8..cf26d7366ee 100644
--- a/src/gallium/drivers/panfrost/pan_blend_cso.c
+++ b/src/gallium/drivers/panfrost/pan_blend_cso.c
@@ -206,10 +206,13 @@ panfrost_blend_constant(float *out, float *in, unsigned mask)
struct panfrost_blend_final
panfrost_get_blend_for_context(struct panfrost_context *ctx, unsigned rti)
{
- /* Grab the format */
+ /* Grab the format, falling back gracefully if called invalidly (which
+ * has to happen for no-color-attachment FBOs, for instance) */
struct pipe_framebuffer_state *fb = &ctx->pipe_framebuffer;
- assert(fb->nr_cbufs > rti);
- enum pipe_format fmt = fb->cbufs[rti]->format;
+ enum pipe_format fmt = PIPE_FORMAT_R8G8B8A8_UNORM;
+
+ if (fb->nr_cbufs > rti)
+ fmt = fb->cbufs[rti]->format;
/* Grab the blend state */
struct panfrost_blend_state *blend = ctx->blend;