freedreno/layout: layout simplifications and pitch from level 0 pitch
[mesa.git] / src / gallium / drivers / freedreno / a3xx / fd3_texture.c
index de1ab392bf52e0a21870c1fba1bbc49c2355847d..bea94bf00081c6c0eeb804cbd46468aaeee3fc41 100644 (file)
@@ -247,7 +247,6 @@ fd3_sampler_view_create(struct pipe_context *pctx, struct pipe_resource *prsc,
        if (prsc->target == PIPE_BUFFER) {
                lvl = 0;
                so->texconst1 =
-                       A3XX_TEX_CONST_1_FETCHSIZE(fd3_pipe2fetchsize(cso->format)) |
                        A3XX_TEX_CONST_1_WIDTH(cso->u.buf.size / util_format_get_blocksize(cso->format)) |
                        A3XX_TEX_CONST_1_HEIGHT(1);
        } else {
@@ -258,7 +257,7 @@ fd3_sampler_view_create(struct pipe_context *pctx, struct pipe_resource *prsc,
 
                so->texconst0 |= A3XX_TEX_CONST_0_MIPLVLS(miplevels);
                so->texconst1 =
-                       A3XX_TEX_CONST_1_FETCHSIZE(fd3_pipe2fetchsize(cso->format)) |
+                       A3XX_TEX_CONST_1_PITCHALIGN(rsc->layout.pitchalign - 4) |
                        A3XX_TEX_CONST_1_WIDTH(u_minify(prsc->width0, lvl)) |
                        A3XX_TEX_CONST_1_HEIGHT(u_minify(prsc->height0, lvl));
        }