freedreno: Add support for EXT_multisampled_render_to_texture
authorKristian H. Kristensen <hoegsberg@chromium.org>
Tue, 6 Nov 2018 05:23:27 +0000 (21:23 -0800)
committerKristian H. Kristensen <hoegsberg@chromium.org>
Fri, 7 Dec 2018 00:56:37 +0000 (16:56 -0800)
There is not much to do in freedreno - tile layout and multisample
state for gmem renderings is programmed based on the pfb sample count,
while resolve blits take the destination sample count from the resource.

Reviewed-by: Rob Clark <robdclark@gmail.com>
Signed-off-by: Kristian H. Kristensen <hoegsberg@chromium.org>
src/gallium/drivers/freedreno/freedreno_batch_cache.c
src/gallium/drivers/freedreno/freedreno_screen.c
src/gallium/drivers/freedreno/freedreno_surface.c

index 408d48ccdb6037728f613af4b93e04a875d29207..45cd9c172d3e5522d13ae1448a9194ad13da616e 100644 (file)
@@ -81,7 +81,8 @@ struct key {
        struct {
                struct pipe_resource *texture;
                union pipe_surface_desc u;
-               uint16_t pos, format;
+               uint8_t pos, samples;
+               uint16_t format;
        } surf[0];
 };
 
@@ -401,6 +402,7 @@ key_surf(struct key *key, unsigned idx, unsigned pos, struct pipe_surface *psurf
        key->surf[idx].texture = psurf->texture;
        key->surf[idx].u = psurf->u;
        key->surf[idx].pos = pos;
+       key->surf[idx].samples = psurf->nr_samples;
        key->surf[idx].format = psurf->format;
 }
 
index ab83487aef879b86151eac3a06b7b958fbe74c8d..03b358782c15575f1e34907c26cdafedea9c83b6 100644 (file)
@@ -225,6 +225,9 @@ fd_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
        case PIPE_CAP_TEXTURE_MULTISAMPLE:
                return is_a5xx(screen) || is_a6xx(screen);
 
+       case PIPE_CAP_SURFACE_SAMPLE_COUNT:
+               return is_a6xx(screen);
+
        case PIPE_CAP_DEPTH_CLIP_DISABLE:
                return is_a3xx(screen) || is_a4xx(screen);
 
index 6f415f69993d4a11bd150013153e20aa8e65ba06..24da54798b62418fe868f3fcaf6a6be01371f3af 100644 (file)
@@ -53,6 +53,7 @@ fd_create_surface(struct pipe_context *pctx,
        psurf->format = surf_tmpl->format;
        psurf->width = u_minify(ptex->width0, level);
        psurf->height = u_minify(ptex->height0, level);
+       psurf->nr_samples = surf_tmpl->nr_samples;
 
        if (ptex->target == PIPE_BUFFER) {
                psurf->u.buf.first_element = surf_tmpl->u.buf.first_element;