st/nir: Rework fixup_varying_slots
[mesa.git] / src / mesa / main / program_binary.c
index 427a79dc94dfde8bb230135b8d21d23c54a2d96a..8c2db255246ee2d05ba84cab55b5f43bcbc54dab 100644 (file)
  */
 
 
-#include "compiler/blob.h"
 #include "compiler/glsl/serialize.h"
 #include "main/errors.h"
 #include "main/mtypes.h"
 #include "main/shaderapi.h"
 #include "util/bitscan.h"
+#include "util/blob.h"
 #include "util/crc32.h"
 #include "program_binary.h"
 #include "program/prog_parameter.h"
@@ -174,9 +174,12 @@ write_program_payload(struct gl_context *ctx, struct blob *blob,
    for (unsigned stage = 0; stage < MESA_SHADER_STAGES; stage++) {
       struct gl_linked_shader *shader = sh_prog->_LinkedShaders[stage];
       if (shader)
-         ctx->Driver.ProgramBinarySerializeDriverBlob(ctx, shader->Program);
+         ctx->Driver.ProgramBinarySerializeDriverBlob(ctx, sh_prog,
+                                                      shader->Program);
    }
 
+   blob_write_uint32(blob, sh_prog->SeparateShader);
+
    serialize_glsl_program(blob, ctx, sh_prog);
 
    for (unsigned stage = 0; stage < MESA_SHADER_STAGES; stage++) {
@@ -194,6 +197,8 @@ static bool
 read_program_payload(struct gl_context *ctx, struct blob_reader *blob,
                      GLenum binary_format, struct gl_shader_program *sh_prog)
 {
+   sh_prog->SeparateShader = blob_read_uint32(blob);
+
    if (!deserialize_glsl_program(blob, ctx, sh_prog))
       return false;