ir3: use OPC_GETBUF to get size of sampler buffers

The maximum value which OPC_GETSIZE could return for one dimension
is 0x007ff0, however sampler buffer could be much bigger.
Blob uses OPC_GETBUF for them.

Fixes tests:
 dEQP-VK.memory.pipeline_barrier.transfer_dst_uniform_texel_buffer.1048576

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9391>
This commit is contained in:
Danylo Piliaiev 2021-03-03 18:26:56 +02:00 committed by Marge Bot
parent 8e6ed9948e
commit 2764cf8d32
2 changed files with 13 additions and 1 deletions

View file

@ -2568,7 +2568,17 @@ emit_tex_txs(struct ir3_context *ctx, nir_tex_instr *tex)
lod = ir3_get_src(ctx, &tex->src[lod_idx].src)[0];
sam = emit_sam(ctx, OPC_GETSIZE, info, dst_type, 0b1111, lod, NULL);
if (tex->sampler_dim != GLSL_SAMPLER_DIM_BUF) {
sam = emit_sam(ctx, OPC_GETSIZE, info, dst_type, 0b1111, lod, NULL);
} else {
/*
* The maximum value which OPC_GETSIZE could return for one dimension
* is 0x007ff0, however sampler buffer could be much bigger.
* Blob uses OPC_GETBUF for them.
*/
sam = emit_sam(ctx, OPC_GETBUF, info, dst_type, 0b1111, NULL, NULL);
}
ir3_split_dest(b, dst, sam, 0, 4);
/* Array size actually ends up in .w rather than .z. This doesn't

View file

@ -134,6 +134,8 @@ static const struct test {
INSTR_6XX(a0c00f00_04400002, "sam (f16)(xyzw)hr0.x, hr0.y, s#2, t#2"),
INSTR_6XX(a6c02f00_00000000, "rgetinfo (u16)(xyzw)hr0.x"),
INSTR_6XX(a3482f08_c0000000, "getinfo.base0 (u16)(xyzw)hr2.x, t#0"),
/* dEQP-GLES31.functional.texture.texture_buffer.render.as_fragment_texture.buffer_size_65536 */
INSTR_5XX(a2c03102_00000000, "getbuf (u32)(x)r0.z, t#0"),
/* cat6 */