From 619a28b845118707a4968ab1e3d8eb67da7a44cb Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Thu, 27 Dec 2018 19:57:03 -0800 Subject: v3d: Add support for GL_ARB_framebuffer_no_attachments. Fixes dEQP-GLES31.functional.state_query.integer.max_framebuffer_height_getboolean when GLES3 is enabled. --- src/gallium/drivers/v3d/v3d_job.c | 7 +++++-- src/gallium/drivers/v3d/v3d_screen.c | 5 +++++ src/gallium/drivers/v3d/v3dx_rcl.c | 9 +++++++++ 3 files changed, 19 insertions(+), 2 deletions(-) (limited to 'src/gallium/drivers/v3d') diff --git a/src/gallium/drivers/v3d/v3d_job.c b/src/gallium/drivers/v3d/v3d_job.c index f92aac1a51a..5928e98a71c 100644 --- a/src/gallium/drivers/v3d/v3d_job.c +++ b/src/gallium/drivers/v3d/v3d_job.c @@ -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. diff --git a/src/gallium/drivers/v3d/v3d_screen.c b/src/gallium/drivers/v3d/v3d_screen.c index 5fd29b78785..a1ff75435f0 100644 --- a/src/gallium/drivers/v3d/v3d_screen.c +++ b/src/gallium/drivers/v3d/v3d_screen.c @@ -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; } diff --git a/src/gallium/drivers/v3d/v3dx_rcl.c b/src/gallium/drivers/v3d/v3dx_rcl.c index 45115c0b0cc..17750cc75f4 100644 --- a/src/gallium/drivers/v3d/v3dx_rcl.c +++ b/src/gallium/drivers/v3d/v3dx_rcl.c @@ -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 -- cgit v1.2.3