freedreno/a5xx: re-express buffer textures more logically
Instead of treating it as 2 bits to enable, make BUFFER a type (and extend the bitfield width), and then add a separate BUFFER bit (ostensibly to perform the width/height concatenation but who knows). Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13805>
This commit is contained in:
@@ -2893,6 +2893,7 @@ different border-color states per texture.. Looks something like:
|
||||
<value name="A5XX_TEX_2D" value="1"/>
|
||||
<value name="A5XX_TEX_CUBE" value="2"/>
|
||||
<value name="A5XX_TEX_3D" value="3"/>
|
||||
<value name="A5XX_TEX_BUFFER" value="4"/>
|
||||
</enum>
|
||||
<reg32 offset="0" name="0">
|
||||
<bitfield name="TILE_MODE" low="0" high="1" type="a5xx_tile_mode"/>
|
||||
@@ -2918,13 +2919,12 @@ different border-color states per texture.. Looks something like:
|
||||
b31 is probably the 'BUFFER' bit.. it is the one that changes
|
||||
behavior of texture in dEQP-GLES31.functional.texture.texture_buffer.render.as_fragment_texture.buffer_size_131071
|
||||
-->
|
||||
<bitfield name="UNK4" pos="4" type="boolean"/>
|
||||
<bitfield name="BUFFER" pos="4" type="boolean"/>
|
||||
<!-- minimum pitch (for mipmap levels): log2(pitchalign / 64) -->
|
||||
<bitfield name="PITCHALIGN" low="0" high="3" type="uint"/>
|
||||
<doc>Pitch in bytes (so actually stride)</doc>
|
||||
<bitfield name="PITCH" low="7" high="28" type="uint"/>
|
||||
<bitfield name="TYPE" low="29" high="30" type="a5xx_tex_type"/>
|
||||
<bitfield name="UNK31" pos="31" type="boolean"/>
|
||||
<bitfield name="TYPE" low="29" high="31" type="a5xx_tex_type"/>
|
||||
</reg32>
|
||||
<reg32 offset="3" name="3">
|
||||
<!--
|
||||
|
||||
@@ -154,7 +154,7 @@ emit_image_tex(struct fd_ringbuffer *ring, unsigned slot, struct fd5_image *img,
|
||||
OUT_RING(ring, A5XX_TEX_CONST_1_WIDTH(img->width) |
|
||||
A5XX_TEX_CONST_1_HEIGHT(img->height));
|
||||
OUT_RING(ring,
|
||||
COND(img->buffer, A5XX_TEX_CONST_2_UNK4 | A5XX_TEX_CONST_2_UNK31) |
|
||||
COND(img->buffer, A5XX_TEX_CONST_2_BUFFER) |
|
||||
A5XX_TEX_CONST_2_TYPE(img->type) |
|
||||
A5XX_TEX_CONST_2_PITCH(img->pitch));
|
||||
OUT_RING(ring, A5XX_TEX_CONST_3_ARRAY_PITCH(img->array_pitch));
|
||||
|
||||
@@ -176,7 +176,7 @@ fd5_sampler_view_create(struct pipe_context *pctx, struct pipe_resource *prsc,
|
||||
lvl = 0;
|
||||
so->texconst1 = A5XX_TEX_CONST_1_WIDTH(elements & MASK(15)) |
|
||||
A5XX_TEX_CONST_1_HEIGHT(elements >> 15);
|
||||
so->texconst2 = A5XX_TEX_CONST_2_UNK4 | A5XX_TEX_CONST_2_UNK31;
|
||||
so->texconst2 = A5XX_TEX_CONST_2_BUFFER;
|
||||
so->offset = cso->u.buf.offset;
|
||||
} else {
|
||||
unsigned miplevels;
|
||||
|
||||
@@ -69,6 +69,7 @@ fd5_tex_type(unsigned target)
|
||||
default:
|
||||
assert(0);
|
||||
case PIPE_BUFFER:
|
||||
return A5XX_TEX_BUFFER;
|
||||
case PIPE_TEXTURE_1D:
|
||||
case PIPE_TEXTURE_1D_ARRAY:
|
||||
return A5XX_TEX_1D;
|
||||
|
||||
Reference in New Issue
Block a user