mesa: Add gl_shader_program param to ProgramBinarySerializeDriverBlob
This might be required because some stages might generate different programs depending on the other stages in the program. For example, the i965 driver's tessellation control stage depends on the tessellation evaluation shader. Signed-off-by: Jordan Justen <jordan.l.justen@intel.com> Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
This commit is contained in:
parent
36dd15f8b3
commit
48ce7745dc
|
@ -340,7 +340,7 @@ brw_init_driver_functions(struct brw_context *brw,
|
||||||
/* GL_ARB_get_program_binary */
|
/* GL_ARB_get_program_binary */
|
||||||
brw_program_binary_init(brw->screen->deviceID);
|
brw_program_binary_init(brw->screen->deviceID);
|
||||||
functions->GetProgramBinaryDriverSHA1 = brw_get_program_binary_driver_sha1;
|
functions->GetProgramBinaryDriverSHA1 = brw_get_program_binary_driver_sha1;
|
||||||
functions->ProgramBinarySerializeDriverBlob = brw_program_serialize_nir;
|
functions->ProgramBinarySerializeDriverBlob = brw_serialize_program_binary;
|
||||||
functions->ProgramBinaryDeserializeDriverBlob =
|
functions->ProgramBinaryDeserializeDriverBlob =
|
||||||
brw_deserialize_program_binary;
|
brw_deserialize_program_binary;
|
||||||
|
|
||||||
|
|
|
@ -1637,6 +1637,9 @@ extern void
|
||||||
brw_program_binary_init(unsigned device_id);
|
brw_program_binary_init(unsigned device_id);
|
||||||
extern void
|
extern void
|
||||||
brw_get_program_binary_driver_sha1(struct gl_context *ctx, uint8_t *sha1);
|
brw_get_program_binary_driver_sha1(struct gl_context *ctx, uint8_t *sha1);
|
||||||
|
void brw_serialize_program_binary(struct gl_context *ctx,
|
||||||
|
struct gl_shader_program *sh_prog,
|
||||||
|
struct gl_program *prog);
|
||||||
extern void
|
extern void
|
||||||
brw_deserialize_program_binary(struct gl_context *ctx,
|
brw_deserialize_program_binary(struct gl_context *ctx,
|
||||||
struct gl_shader_program *shProg,
|
struct gl_shader_program *shProg,
|
||||||
|
|
|
@ -237,6 +237,14 @@ brw_deserialize_program_binary(struct gl_context *ctx,
|
||||||
brw_program_deserialize_driver_blob(ctx, prog, prog->info.stage);
|
brw_program_deserialize_driver_blob(ctx, prog, prog->info.stage);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
brw_serialize_program_binary(struct gl_context *ctx,
|
||||||
|
struct gl_shader_program *sh_prog,
|
||||||
|
struct gl_program *prog)
|
||||||
|
{
|
||||||
|
brw_program_serialize_nir(ctx, prog);
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
brw_write_blob_program_data(struct blob *binary, gl_shader_stage stage,
|
brw_write_blob_program_data(struct blob *binary, gl_shader_stage stage,
|
||||||
const void *program,
|
const void *program,
|
||||||
|
|
|
@ -1218,6 +1218,7 @@ struct dd_function_table {
|
||||||
void (*GetProgramBinaryDriverSHA1)(struct gl_context *ctx, uint8_t *sha1);
|
void (*GetProgramBinaryDriverSHA1)(struct gl_context *ctx, uint8_t *sha1);
|
||||||
|
|
||||||
void (*ProgramBinarySerializeDriverBlob)(struct gl_context *ctx,
|
void (*ProgramBinarySerializeDriverBlob)(struct gl_context *ctx,
|
||||||
|
struct gl_shader_program *shProg,
|
||||||
struct gl_program *prog);
|
struct gl_program *prog);
|
||||||
|
|
||||||
void (*ProgramBinaryDeserializeDriverBlob)(struct gl_context *ctx,
|
void (*ProgramBinaryDeserializeDriverBlob)(struct gl_context *ctx,
|
||||||
|
|
|
@ -174,7 +174,8 @@ write_program_payload(struct gl_context *ctx, struct blob *blob,
|
||||||
for (unsigned stage = 0; stage < MESA_SHADER_STAGES; stage++) {
|
for (unsigned stage = 0; stage < MESA_SHADER_STAGES; stage++) {
|
||||||
struct gl_linked_shader *shader = sh_prog->_LinkedShaders[stage];
|
struct gl_linked_shader *shader = sh_prog->_LinkedShaders[stage];
|
||||||
if (shader)
|
if (shader)
|
||||||
ctx->Driver.ProgramBinarySerializeDriverBlob(ctx, shader->Program);
|
ctx->Driver.ProgramBinarySerializeDriverBlob(ctx, sh_prog,
|
||||||
|
shader->Program);
|
||||||
}
|
}
|
||||||
|
|
||||||
serialize_glsl_program(blob, ctx, sh_prog);
|
serialize_glsl_program(blob, ctx, sh_prog);
|
||||||
|
|
|
@ -760,12 +760,14 @@ st_init_driver_functions(struct pipe_screen *screen,
|
||||||
PIPE_SHADER_CAP_PREFERRED_IR);
|
PIPE_SHADER_CAP_PREFERRED_IR);
|
||||||
if (preferred_ir == PIPE_SHADER_IR_NIR) {
|
if (preferred_ir == PIPE_SHADER_IR_NIR) {
|
||||||
functions->ShaderCacheSerializeDriverBlob = st_serialise_nir_program;
|
functions->ShaderCacheSerializeDriverBlob = st_serialise_nir_program;
|
||||||
functions->ProgramBinarySerializeDriverBlob = st_serialise_nir_program;
|
functions->ProgramBinarySerializeDriverBlob =
|
||||||
|
st_serialise_nir_program_binary;
|
||||||
functions->ProgramBinaryDeserializeDriverBlob =
|
functions->ProgramBinaryDeserializeDriverBlob =
|
||||||
st_deserialise_nir_program;
|
st_deserialise_nir_program;
|
||||||
} else {
|
} else {
|
||||||
functions->ShaderCacheSerializeDriverBlob = st_serialise_tgsi_program;
|
functions->ShaderCacheSerializeDriverBlob = st_serialise_tgsi_program;
|
||||||
functions->ProgramBinarySerializeDriverBlob = st_serialise_tgsi_program;
|
functions->ProgramBinarySerializeDriverBlob =
|
||||||
|
st_serialise_tgsi_program_binary;
|
||||||
functions->ProgramBinaryDeserializeDriverBlob =
|
functions->ProgramBinaryDeserializeDriverBlob =
|
||||||
st_deserialise_tgsi_program;
|
st_deserialise_tgsi_program;
|
||||||
}
|
}
|
||||||
|
|
|
@ -414,6 +414,14 @@ st_serialise_tgsi_program(struct gl_context *ctx, struct gl_program *prog)
|
||||||
st_serialise_ir_program(ctx, prog, false);
|
st_serialise_ir_program(ctx, prog, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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
|
void
|
||||||
st_deserialise_tgsi_program(struct gl_context *ctx,
|
st_deserialise_tgsi_program(struct gl_context *ctx,
|
||||||
struct gl_shader_program *shProg,
|
struct gl_shader_program *shProg,
|
||||||
|
@ -428,6 +436,14 @@ st_serialise_nir_program(struct gl_context *ctx, struct gl_program *prog)
|
||||||
st_serialise_ir_program(ctx, prog, true);
|
st_serialise_ir_program(ctx, prog, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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
|
void
|
||||||
st_deserialise_nir_program(struct gl_context *ctx,
|
st_deserialise_nir_program(struct gl_context *ctx,
|
||||||
struct gl_shader_program *shProg,
|
struct gl_shader_program *shProg,
|
||||||
|
|
|
@ -38,6 +38,11 @@ st_get_program_binary_driver_sha1(struct gl_context *ctx, uint8_t *sha1);
|
||||||
void
|
void
|
||||||
st_serialise_tgsi_program(struct gl_context *ctx, struct gl_program *prog);
|
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
|
void
|
||||||
st_deserialise_tgsi_program(struct gl_context *ctx,
|
st_deserialise_tgsi_program(struct gl_context *ctx,
|
||||||
struct gl_shader_program *shProg,
|
struct gl_shader_program *shProg,
|
||||||
|
@ -46,6 +51,11 @@ st_deserialise_tgsi_program(struct gl_context *ctx,
|
||||||
void
|
void
|
||||||
st_serialise_nir_program(struct gl_context *ctx, struct gl_program *prog);
|
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
|
void
|
||||||
st_deserialise_nir_program(struct gl_context *ctx,
|
st_deserialise_nir_program(struct gl_context *ctx,
|
||||||
struct gl_shader_program *shProg,
|
struct gl_shader_program *shProg,
|
||||||
|
|
Loading…
Reference in New Issue