mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-29 05:50:11 +01:00
radeonsi: compute blake3 hashes of internal shaders if they are not set
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37566>
This commit is contained in:
parent
e018b916d1
commit
a441a30921
1 changed files with 12 additions and 0 deletions
|
|
@ -12,9 +12,21 @@
|
|||
#include "aco_interface.h"
|
||||
#include "nir_format_convert.h"
|
||||
#include "ac_nir_helpers.h"
|
||||
#include "nir/nir_serialize.h"
|
||||
|
||||
void *si_create_shader_state(struct si_context *sctx, nir_shader *nir)
|
||||
{
|
||||
static blake3_hash zeros;
|
||||
|
||||
if (!memcmp(nir->info.source_blake3, zeros, sizeof(blake3_hash))) {
|
||||
struct blob blob = {};
|
||||
|
||||
blob_init(&blob);
|
||||
nir_serialize(&blob, nir, false);
|
||||
_mesa_blake3_compute(blob.data, blob.size, nir->info.source_blake3);
|
||||
blob_finish(&blob);
|
||||
}
|
||||
|
||||
sctx->b.screen->finalize_nir(sctx->b.screen, nir);
|
||||
return pipe_shader_from_nir(&sctx->b, nir);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue