diff options
Diffstat (limited to 'src/mesa/state_tracker')
-rw-r--r-- | src/mesa/state_tracker/st_context.c | 6 | ||||
-rw-r--r-- | src/mesa/state_tracker/st_shader_cache.c | 16 | ||||
-rw-r--r-- | src/mesa/state_tracker/st_shader_cache.h | 10 |
3 files changed, 30 insertions, 2 deletions
diff --git a/src/mesa/state_tracker/st_context.c b/src/mesa/state_tracker/st_context.c index 488202bbc59..b7330acfcca 100644 --- a/src/mesa/state_tracker/st_context.c +++ b/src/mesa/state_tracker/st_context.c @@ -760,12 +760,14 @@ st_init_driver_functions(struct pipe_screen *screen, PIPE_SHADER_CAP_PREFERRED_IR); if (preferred_ir == PIPE_SHADER_IR_NIR) { functions->ShaderCacheSerializeDriverBlob = st_serialise_nir_program; - functions->ProgramBinarySerializeDriverBlob = st_serialise_nir_program; + functions->ProgramBinarySerializeDriverBlob = + st_serialise_nir_program_binary; functions->ProgramBinaryDeserializeDriverBlob = st_deserialise_nir_program; } else { functions->ShaderCacheSerializeDriverBlob = st_serialise_tgsi_program; - functions->ProgramBinarySerializeDriverBlob = st_serialise_tgsi_program; + functions->ProgramBinarySerializeDriverBlob = + st_serialise_tgsi_program_binary; functions->ProgramBinaryDeserializeDriverBlob = st_deserialise_tgsi_program; } diff --git a/src/mesa/state_tracker/st_shader_cache.c b/src/mesa/state_tracker/st_shader_cache.c index 3f8d2d110ce..c82ce3eaa2d 100644 --- a/src/mesa/state_tracker/st_shader_cache.c +++ b/src/mesa/state_tracker/st_shader_cache.c @@ -415,6 +415,14 @@ st_serialise_tgsi_program(struct gl_context *ctx, struct gl_program *prog) } void +st_serialise_tgsi_program_binary(struct gl_context *ctx, + struct gl_shader_program *shProg, + struct gl_program *prog) +{ + st_serialise_ir_program(ctx, prog, false); +} + +void st_deserialise_tgsi_program(struct gl_context *ctx, struct gl_shader_program *shProg, struct gl_program *prog) @@ -429,6 +437,14 @@ st_serialise_nir_program(struct gl_context *ctx, struct gl_program *prog) } void +st_serialise_nir_program_binary(struct gl_context *ctx, + struct gl_shader_program *shProg, + struct gl_program *prog) +{ + st_serialise_ir_program(ctx, prog, true); +} + +void st_deserialise_nir_program(struct gl_context *ctx, struct gl_shader_program *shProg, struct gl_program *prog) diff --git a/src/mesa/state_tracker/st_shader_cache.h b/src/mesa/state_tracker/st_shader_cache.h index 132dac00c01..5b0bff7b2f8 100644 --- a/src/mesa/state_tracker/st_shader_cache.h +++ b/src/mesa/state_tracker/st_shader_cache.h @@ -39,6 +39,11 @@ void st_serialise_tgsi_program(struct gl_context *ctx, struct gl_program *prog); void +st_serialise_tgsi_program_binary(struct gl_context *ctx, + struct gl_shader_program *shProg, + struct gl_program *prog); + +void st_deserialise_tgsi_program(struct gl_context *ctx, struct gl_shader_program *shProg, struct gl_program *prog); @@ -47,6 +52,11 @@ void st_serialise_nir_program(struct gl_context *ctx, struct gl_program *prog); void +st_serialise_nir_program_binary(struct gl_context *ctx, + struct gl_shader_program *shProg, + struct gl_program *prog); + +void st_deserialise_nir_program(struct gl_context *ctx, struct gl_shader_program *shProg, struct gl_program *prog); |