mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-22 15:40:11 +01:00
pan/bi: Add some zero bytes after shaders on Bifrost
Bifrost will prefetch bytes after the end of shaders, so make sure these bytes are allocated and zeroed. Fixes GPU faults in Xonotic. Suggested-by: Boris Brezillon <boris.brezillon@collabora.com> Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8428>
This commit is contained in:
parent
e74b2edcef
commit
bfcdc8f174
1 changed files with 4 additions and 0 deletions
|
|
@ -2236,6 +2236,10 @@ 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 */
|
||||
memset(util_dynarray_grow(&program->compiled, uint8_t, BIFROST_SHADER_PREFETCH),
|
||||
0, BIFROST_SHADER_PREFETCH);
|
||||
|
||||
program->tls_size = ctx->tls_size;
|
||||
|
||||
if ((bifrost_debug & BIFROST_DBG_SHADERDB || inputs->shaderdb) &&
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue