r600,radeonsi: GL_ARB_conditional_render_inverted
authorEdward O'Callaghan <eocallaghan@alterapraxis.com>
Mon, 27 Jul 2015 01:01:47 +0000 (11:01 +1000)
committerMarek Olšák <marek.olsak@amd.com>
Tue, 28 Jul 2015 22:10:27 +0000 (00:10 +0200)
By using 'Tobias Klausmann' piglit test-suite patch. We obtain
a full 12/12 passes using this patch. By 'faking' to claim
support for this extension we obtain 7 fails and 5 passes.

Signed-off-by: Edward O'Callaghan <eocallaghan@alterapraxis.com>
Tested-by: Furkan Alaca <falaca@gmail.com>
Signed-off-by: Marek Olšák <marek.olsak@amd.com>
docs/GL3.txt
docs/relnotes/10.7.0.html
src/gallium/drivers/r600/r600_pipe.c
src/gallium/drivers/radeon/r600_query.c
src/gallium/drivers/radeonsi/si_pipe.c

index 258a6fb94e2d41fd4505fba47fa43f207078dc74..d438403b54aa2727b0f9624961547092f05f417c 100644 (file)
@@ -189,7 +189,7 @@ GL 4.5, GLSL 4.50:
 
   GL_ARB_ES3_1_compatibility                           not started
   GL_ARB_clip_control                                  DONE (i965, nv50, nvc0, r600, radeonsi, llvmpipe, softpipe)
-  GL_ARB_conditional_render_inverted                   DONE (i965, nv50, nvc0, llvmpipe, softpipe)
+  GL_ARB_conditional_render_inverted                   DONE (i965, nv50, nvc0, r600, radeonsi, llvmpipe, softpipe)
   GL_ARB_cull_distance                                 in progress (Tobias)
   GL_ARB_derivative_control                            DONE (i965, nv50, nvc0, r600, radeonsi)
   GL_ARB_direct_state_access                           DONE (all drivers)
index afef5256b754954ece2ab14262aeebb80e916248..2df18c0532d4913e8f3552c36e016dac623d1c70 100644 (file)
@@ -45,6 +45,7 @@ Note: some of the new features are only available with certain drivers.
 
 <ul>
 <li>GL_AMD_vertex_shader_viewport_index on radeonsi</li>
+<li>GL_ARB_conditional_render_inverted on r600, radeonsi</li>
 <li>GL_ARB_derivative_control on radeonsi</li>
 <li>GL_ARB_fragment_layer_viewport on radeonsi</li>
 <li>GL_ARB_framebuffer_no_attachments on i965</li>
index e8459288106c34145af1604ea8e663f4d61058df..e755784209a524f2c98318a5a26f602b12737af9 100644 (file)
@@ -268,6 +268,7 @@ static int r600_get_param(struct pipe_screen* pscreen, enum pipe_cap param)
        case PIPE_CAP_SAMPLE_SHADING:
        case PIPE_CAP_CLIP_HALFZ:
        case PIPE_CAP_POLYGON_OFFSET_CLAMP:
+       case PIPE_CAP_CONDITIONAL_RENDER_INVERTED:
                return 1;
 
        case PIPE_CAP_DEVICE_RESET_STATUS_QUERY:
@@ -332,7 +333,6 @@ static int r600_get_param(struct pipe_screen* pscreen, enum pipe_cap param)
        case PIPE_CAP_VERTEX_COLOR_CLAMPED:
        case PIPE_CAP_USER_VERTEX_BUFFERS:
        case PIPE_CAP_TEXTURE_GATHER_OFFSETS:
-       case PIPE_CAP_CONDITIONAL_RENDER_INVERTED:
        case PIPE_CAP_SAMPLER_VIEW_TARGET:
        case PIPE_CAP_VERTEXID_NOBASE:
        case PIPE_CAP_MAX_SHADER_PATCH_VARYINGS:
index a1d8241c513b4ddf72723ecd759706d892baf4e1..6bf0271e14fee19d22ae6ce25cde41922b76f469 100644 (file)
@@ -290,6 +290,13 @@ static void r600_emit_query_predication(struct r600_common_context *ctx, struct
                                        int operation, bool flag_wait)
 {
        struct radeon_winsys_cs *cs = ctx->rings.gfx.cs;
+       uint32_t op = PRED_OP(operation);
+
+       /* if true then invert, see GL_ARB_conditional_render_inverted */
+       if (ctx->current_render_cond_cond)
+               op |= PREDICATION_DRAW_NOT_VISIBLE; /* Draw if not visable/overflow */
+       else
+               op |= PREDICATION_DRAW_VISIBLE; /* Draw if visable/overflow */
 
        if (operation == PREDICATION_OP_CLEAR) {
                ctx->need_gfx_cs_space(&ctx->b, 3, FALSE);
@@ -300,24 +307,21 @@ static void r600_emit_query_predication(struct r600_common_context *ctx, struct
        } else {
                struct r600_query_buffer *qbuf;
                unsigned count;
-               uint32_t op;
-
                /* Find how many results there are. */
                count = 0;
                for (qbuf = &query->buffer; qbuf; qbuf = qbuf->previous) {
                        count += qbuf->results_end / query->result_size;
                }
-
+       
                ctx->need_gfx_cs_space(&ctx->b, 5 * count, TRUE);
-
-               op = PRED_OP(operation) | PREDICATION_DRAW_VISIBLE |
-                               (flag_wait ? PREDICATION_HINT_WAIT : PREDICATION_HINT_NOWAIT_DRAW);
-
+       
+               op |= flag_wait ? PREDICATION_HINT_WAIT : PREDICATION_HINT_NOWAIT_DRAW;
+       
                /* emit predicate packets for all data blocks */
                for (qbuf = &query->buffer; qbuf; qbuf = qbuf->previous) {
                        unsigned results_base = 0;
                        uint64_t va = qbuf->buf->gpu_address;
-
+       
                        while (results_base < qbuf->results_end) {
                                radeon_emit(cs, PKT3(PKT3_SET_PREDICATION, 1, 0));
                                radeon_emit(cs, (va + results_base) & 0xFFFFFFFFUL);
@@ -325,7 +329,7 @@ static void r600_emit_query_predication(struct r600_common_context *ctx, struct
                                r600_emit_reloc(ctx, &ctx->rings.gfx, qbuf->buf, RADEON_USAGE_READ,
                                                RADEON_PRIO_MIN);
                                results_base += query->result_size;
-
+       
                                /* set CONTINUE bit for all packets except the first */
                                op |= PREDICATION_CONTINUE;
                        }
index ebe1f5a68f11ddf684a3b2f2881968bf5ec907ab..808b9bcdc842c76d51fb4e206c1dcb2cfccccf5c 100644 (file)
@@ -250,6 +250,7 @@ static int si_get_param(struct pipe_screen* pscreen, enum pipe_cap param)
        case PIPE_CAP_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION:
        case PIPE_CAP_TGSI_TEXCOORD:
        case PIPE_CAP_TGSI_FS_FINE_DERIVATIVE:
+       case PIPE_CAP_CONDITIONAL_RENDER_INVERTED:
                return 1;
 
        case PIPE_CAP_RESOURCE_FROM_USER_MEMORY:
@@ -290,7 +291,6 @@ static int si_get_param(struct pipe_screen* pscreen, enum pipe_cap param)
        case PIPE_CAP_USER_VERTEX_BUFFERS:
        case PIPE_CAP_FAKE_SW_MSAA:
        case PIPE_CAP_TEXTURE_GATHER_OFFSETS:
-       case PIPE_CAP_CONDITIONAL_RENDER_INVERTED:
        case PIPE_CAP_SAMPLER_VIEW_TARGET:
        case PIPE_CAP_VERTEXID_NOBASE:
                return 0;