Lines Matching +full:buffer +full:- +full:crc32
2 * Mesa 3-D graphics library
38 #include "util/crc32.h"
64 uint32_t crc32; member
86 /* binary_size is the size of the buffer provided by the application. in write_program_binary()
87 * Make sure our program (payload) will fit in the buffer. in write_program_binary()
89 if (payload_size > binary_size - sizeof(*hdr)) in write_program_binary()
92 hdr->internal_format = 0; in write_program_binary()
93 memcpy(hdr->sha1, sha1, sizeof(hdr->sha1)); in write_program_binary()
95 hdr->size = payload_size; in write_program_binary()
97 hdr->crc32 = util_hash_crc32(hdr + 1, payload_size); in write_program_binary()
109 if (hdr->internal_format != 0) in simple_header_checks()
118 uint32_t crc32; in check_crc32() local
121 crc32_len = hdr->size; in check_crc32()
122 if (crc32_len > length - sizeof(*hdr)) in check_crc32()
125 crc32 = util_hash_crc32(hdr + 1, crc32_len); in check_crc32()
126 if (hdr->crc32 != crc32) in check_crc32()
143 if (memcmp(hdr->sha1, sha1, sizeof(hdr->sha1)) != 0) in is_program_binary_valid()
155 * If NULL is returned, then the binary not supported. If non-NULL is
157 * buffer.
177 struct gl_linked_shader *shader = sh_prog->_LinkedShaders[stage]; in write_program_payload()
179 ctx->Driver.ProgramBinarySerializeDriverBlob(ctx, sh_prog, in write_program_payload()
180 shader->Program); in write_program_payload()
183 blob_write_uint32(blob, sh_prog->SeparateShader); in write_program_payload()
188 struct gl_linked_shader *shader = sh_prog->_LinkedShaders[stage]; in write_program_payload()
190 struct gl_program *prog = sh_prog->_LinkedShaders[stage]->Program; in write_program_payload()
191 ralloc_free(prog->driver_cache_blob); in write_program_payload()
192 prog->driver_cache_blob = NULL; in write_program_payload()
193 prog->driver_cache_blob_size = 0; in write_program_payload()
202 sh_prog->SeparateShader = blob_read_uint32(blob); in read_program_payload()
208 for (stage = 0; stage < ARRAY_SIZE(sh_prog->_LinkedShaders); stage++) { in read_program_payload()
209 struct gl_linked_shader *shader = sh_prog->_LinkedShaders[stage]; in read_program_payload()
213 ctx->Driver.ProgramBinaryDeserializeDriverBlob(ctx, sh_prog, in read_program_payload()
214 shader->Program); in read_program_payload()
266 "glGetProgramBinary(buffer too small)"); in _mesa_get_program_binary()
285 sh_prog->data->LinkStatus = LINKING_FAILURE; in _mesa_program_binary()
290 blob_reader_init(&blob, payload, length - header_size); in _mesa_program_binary()
293 if (ctx->_Shader) in _mesa_program_binary()
295 if (ctx->_Shader->CurrentProgram[stage] && in _mesa_program_binary()
296 ctx->_Shader->CurrentProgram[stage]->Id == sh_prog->Name) { in _mesa_program_binary()
302 sh_prog->data->LinkStatus = LINKING_FAILURE; in _mesa_program_binary()
310 * "If LinkProgram or ProgramBinary successfully re-links a program in _mesa_program_binary()
322 if (sh_prog->_LinkedShaders[stage]) in _mesa_program_binary()
323 prog = sh_prog->_LinkedShaders[stage]->Program; in _mesa_program_binary()
325 _mesa_use_program(ctx, stage, sh_prog, prog, ctx->_Shader); in _mesa_program_binary()
328 sh_prog->data->LinkStatus = LINKING_SKIPPED; in _mesa_program_binary()