mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-01 05:58:05 +02:00
pan/bi: Fix empty shader handling
Fixes INSTR_INVALID_ENC fault on dEQP-GLES31.functional.compute.basic.empty
Fixes: bfcdc8f174 ("pan/bi: Add some zero bytes after shaders on Bifrost")
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9011>
This commit is contained in:
parent
a805d999c0
commit
9bf8bfe3c8
1 changed files with 7 additions and 3 deletions
|
|
@ -2577,11 +2577,15 @@ bifrost_compile_shader_nir(void *mem_ctx, nir_shader *nir,
|
|||
bifrost_debug & BIFROST_DBG_VERBOSE);
|
||||
}
|
||||
|
||||
/* Pad the shader with enough zero bytes to trick the prefetcher */
|
||||
/* Pad the shader with enough zero bytes to trick the prefetcher,
|
||||
* unless we're compiling an empty shader (in which case we don't pad
|
||||
* so the size remains 0) */
|
||||
unsigned prefetch_size = BIFROST_SHADER_PREFETCH - final_clause;
|
||||
|
||||
memset(util_dynarray_grow(&program->compiled, uint8_t, prefetch_size),
|
||||
0, prefetch_size);
|
||||
if (program->compiled.size) {
|
||||
memset(util_dynarray_grow(&program->compiled, uint8_t, prefetch_size),
|
||||
0, prefetch_size);
|
||||
}
|
||||
|
||||
program->tls_size = ctx->tls_size;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue