v3d: Add support for GL_ARB_framebuffer_no_attachments.
authorEric Anholt <eric@anholt.net>
Fri, 28 Dec 2018 03:57:03 +0000 (19:57 -0800)
committerEric Anholt <eric@anholt.net>
Mon, 14 Jan 2019 21:18:02 +0000 (13:18 -0800)
Fixes
dEQP-GLES31.functional.state_query.integer.max_framebuffer_height_getboolean
when GLES3 is enabled.

src/gallium/drivers/v3d/v3d_job.c
src/gallium/drivers/v3d/v3d_screen.c
src/gallium/drivers/v3d/v3dx_rcl.c

index f92aac1a51ab256942a4f7d6c9b0481df7f94fcc..5928e98a71cf9ebebd4645e793df817acb548659 100644 (file)
@@ -267,8 +267,6 @@ v3d_get_job(struct v3d_context *v3d,
                         job->msaa = true;
         }
 
-        v3d_job_set_tile_buffer_size(job);
-
         for (int i = 0; i < VC5_MAX_DRAW_BUFFERS; i++) {
                 if (cbufs[i])
                         _mesa_hash_table_insert(v3d->write_jobs,
@@ -303,6 +301,11 @@ v3d_get_job_for_fbo(struct v3d_context *v3d)
         struct pipe_surface *zsbuf = v3d->framebuffer.zsbuf;
         struct v3d_job *job = v3d_get_job(v3d, cbufs, zsbuf);
 
+        if (v3d->framebuffer.samples >= 1)
+                job->msaa = true;
+
+        v3d_job_set_tile_buffer_size(job);
+
         /* The dirty flags are tracking what's been updated while v3d->job has
          * been bound, so set them all to ~0 when switching between jobs.  We
          * also need to reset all state at the start of rendering.
index 5fd29b7878592ce10e1e506486207d53a079d413..a1ff75435f0dcceef038d6beb60bc306a94a7168 100644 (file)
@@ -128,6 +128,7 @@ v3d_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
         case PIPE_CAP_TGSI_CAN_READ_OUTPUTS:
         case PIPE_CAP_TGSI_PACK_HALF_FLOAT:
         case PIPE_CAP_TEXTURE_HALF_FLOAT_LINEAR:
+        case PIPE_CAP_FRAMEBUFFER_NO_ATTACHMENT:
                 return 1;
 
         case PIPE_CAP_GENERATE_MIPMAP:
@@ -396,7 +397,11 @@ v3d_screen_is_format_supported(struct pipe_screen *pscreen,
                 }
         }
 
+        /* FORMAT_NONE gets allowed for ARB_framebuffer_no_attachments's probe
+         * of FRAMEBUFFER_MAX_SAMPLES
+         */
         if ((usage & PIPE_BIND_RENDER_TARGET) &&
+            format != PIPE_FORMAT_NONE &&
             !v3d_rt_format_supported(&screen->devinfo, format)) {
                 return FALSE;
         }
index 45115c0b0ccc904b3db2dca3969f2410637050da..17750cc75f4d6664f9a93e93686ed970e2141d95 100644 (file)
@@ -374,6 +374,15 @@ v3d_rcl_emit_stores(struct v3d_job *job, struct v3d_cl *cl)
                 }
         }
 #else /* V3D_VERSION >= 40 */
+        /* If we're emitting an RCL with GL_ARB_framebuffer_no_attachments,
+         * we still need to emit some sort of store.
+         */
+        if (!job->store) {
+                cl_emit(cl, STORE_TILE_BUFFER_GENERAL, store) {
+                        store.buffer_to_store = NONE;
+                }
+        }
+
         assert(!stores_pending);
 
         /* GFXH-1461/GFXH-1689: The per-buffer store command's clear