Module: Mesa
Branch: master
Commit: 0ea243dcd502e18fde160179faf90639fb012288
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=0ea243dcd502e18fde160179faf90639fb012288

Author: Rob Clark <[email protected]>
Date:   Mon Jul 30 10:36:23 2018 -0400

freedreno/a5xx: fix txf_ms

Somehow this got lost from the initial MSAA patch.

Signed-off-by: Rob Clark <[email protected]>

---

 src/gallium/drivers/freedreno/a5xx/fd5_draw.c     | 2 ++
 src/gallium/drivers/freedreno/freedreno_context.h | 2 ++
 src/gallium/drivers/freedreno/freedreno_texture.c | 8 ++++++++
 3 files changed, 12 insertions(+)

diff --git a/src/gallium/drivers/freedreno/a5xx/fd5_draw.c 
b/src/gallium/drivers/freedreno/a5xx/fd5_draw.c
index 9fae44a874..aa06b3c714 100644
--- a/src/gallium/drivers/freedreno/a5xx/fd5_draw.c
+++ b/src/gallium/drivers/freedreno/a5xx/fd5_draw.c
@@ -117,6 +117,8 @@ fd5_draw_vbo(struct fd_context *ctx, const struct 
pipe_draw_info *info,
                        .fsaturate_r = fd5_ctx->fsaturate_r,
                        .vastc_srgb = fd5_ctx->vastc_srgb,
                        .fastc_srgb = fd5_ctx->fastc_srgb,
+                       .vsamples = ctx->tex[PIPE_SHADER_VERTEX].samples,
+                       .fsamples = ctx->tex[PIPE_SHADER_FRAGMENT].samples,
                },
                .rasterflat = ctx->rasterizer->flatshade,
                .sprite_coord_enable = ctx->rasterizer->sprite_coord_enable,
diff --git a/src/gallium/drivers/freedreno/freedreno_context.h 
b/src/gallium/drivers/freedreno/freedreno_context.h
index bc7ff6193f..a93561ef03 100644
--- a/src/gallium/drivers/freedreno/freedreno_context.h
+++ b/src/gallium/drivers/freedreno/freedreno_context.h
@@ -52,6 +52,8 @@ struct fd_texture_stateobj {
        struct pipe_sampler_state *samplers[PIPE_MAX_SAMPLERS];
        unsigned num_samplers;
        unsigned valid_samplers;
+       /* number of samples per sampler, 2 bits per sampler: */
+       uint32_t samples;
 };
 
 struct fd_program_stateobj {
diff --git a/src/gallium/drivers/freedreno/freedreno_texture.c 
b/src/gallium/drivers/freedreno/freedreno_texture.c
index 1487f7441c..5ba851fa10 100644
--- a/src/gallium/drivers/freedreno/freedreno_texture.c
+++ b/src/gallium/drivers/freedreno/freedreno_texture.c
@@ -70,6 +70,7 @@ static void set_sampler_views(struct fd_texture_stateobj *tex,
                unsigned start, unsigned nr, struct pipe_sampler_view **views)
 {
        unsigned i;
+       unsigned samplers = 0;
 
        for (i = 0; i < nr; i++) {
                struct pipe_sampler_view *view = views ? views[i] : NULL;
@@ -82,6 +83,13 @@ static void set_sampler_views(struct fd_texture_stateobj 
*tex,
        }
 
        tex->num_textures = util_last_bit(tex->valid_textures);
+
+       for (i = 0; i < tex->num_textures; i++) {
+               uint nr_samples = tex->textures[i]->texture->nr_samples;
+               samplers |= (nr_samples >> 1) << (i * 2);
+       }
+
+       tex->samples = samplers;
 }
 
 void

_______________________________________________
mesa-commit mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to