diff options
author | Jason Ekstrand <[email protected]> | 2016-06-02 14:34:15 -0700 |
---|---|---|
committer | Jason Ekstrand <[email protected]> | 2016-06-03 19:29:28 -0700 |
commit | 62c6e94bd69a1287ebb4908f4ee67b8f730466cc (patch) | |
tree | 382b558385d97f9a78006aea6a4e7ef0cd3b62c1 /src/compiler/spirv/vtn_variables.c | |
parent | ed14d21d04bf5d58cfadac525b8fd17552378507 (diff) |
nir/spirv: Make unhandled decorations and capabilities non-fatal
glslang frequently throw bogus decorations into shaders. While we are free
to assert-fail, it's a bit nicer to the application to just warn.
Signed-off-by: Jason Ekstrand <[email protected]>
Cc: "12.0" <[email protected]>
Diffstat (limited to 'src/compiler/spirv/vtn_variables.c')
-rw-r--r-- | src/compiler/spirv/vtn_variables.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/src/compiler/spirv/vtn_variables.c b/src/compiler/spirv/vtn_variables.c index 812ac62b39a..61fc184a692 100644 --- a/src/compiler/spirv/vtn_variables.c +++ b/src/compiler/spirv/vtn_variables.c @@ -26,6 +26,7 @@ */ #include "vtn_private.h" +#include "spirv_info.h" static struct vtn_access_chain * vtn_access_chain_extend(struct vtn_builder *b, struct vtn_access_chain *old, @@ -1040,7 +1041,8 @@ var_decoration_cb(struct vtn_builder *b, struct vtn_value *val, int member, break; /* Do nothing with these here */ case SpvDecorationPatch: - unreachable("Tessellation not yet supported"); + vtn_warn("Tessellation not yet supported"); + break; case SpvDecorationLocation: unreachable("Handled above"); @@ -1056,11 +1058,15 @@ var_decoration_cb(struct vtn_builder *b, struct vtn_value *val, int member, case SpvDecorationDescriptorSet: case SpvDecorationNoContraction: case SpvDecorationInputAttachmentIndex: - unreachable("Decoration not allowed for variable or structure member"); + vtn_warn("Decoration not allowed for variable or structure member: %s", + spirv_decoration_to_string(dec->decoration)); + break; case SpvDecorationXfbBuffer: case SpvDecorationXfbStride: - unreachable("Vulkan does not have transform feedback"); + vtn_warn("Vulkan does not have transform feedback: %s", + spirv_decoration_to_string(dec->decoration)); + break; case SpvDecorationCPacked: case SpvDecorationSaturatedConversion: @@ -1068,7 +1074,9 @@ var_decoration_cb(struct vtn_builder *b, struct vtn_value *val, int member, case SpvDecorationFPRoundingMode: case SpvDecorationFPFastMathMode: case SpvDecorationAlignment: - unreachable("Decoraiton only allowed for CL-style kernels"); + vtn_warn("Decoraiton only allowed for CL-style kernels: %s", + spirv_decoration_to_string(dec->decoration)); + break; } } |