projects
/
mesa.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
8985ad4
)
glsl: allow NULL to be passed to encode_type_to_blob()
author
Timothy Arceri
<tarceri@itsqueeze.com>
Fri, 11 Aug 2017 03:53:18 +0000
(13:53 +1000)
committer
Timothy Arceri
<tarceri@itsqueeze.com>
Thu, 24 Aug 2017 01:18:48 +0000
(11:18 +1000)
This will be used by the following commit.
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
src/compiler/glsl/shader_cache.cpp
patch
|
blob
|
history
diff --git
a/src/compiler/glsl/shader_cache.cpp
b/src/compiler/glsl/shader_cache.cpp
index cc4d24482d9364dbe9678e5c2702a6fc48425917..1fd49b82e98f92c65389114b732e0843a20de313 100644
(file)
--- a/
src/compiler/glsl/shader_cache.cpp
+++ b/
src/compiler/glsl/shader_cache.cpp
@@
-79,6
+79,11
@@
encode_type_to_blob(struct blob *blob, const glsl_type *type)
{
uint32_t encoding;
+ if (!type) {
+ blob_write_uint32(blob, 0);
+ return;
+ }
+
switch (type->base_type) {
case GLSL_TYPE_UINT:
case GLSL_TYPE_INT:
@@
-149,6
+154,11
@@
static const glsl_type *
decode_type_from_blob(struct blob_reader *blob)
{
uint32_t u = blob_read_uint32(blob);
+
+ if (u == 0) {
+ return NULL;
+ }
+
glsl_base_type base_type = (glsl_base_type) (u >> 24);
switch (base_type) {