aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Forbes <chrisforbes@google.com>2016-01-13 09:29:31 +1300
committerMark Lobodzinski <mark@lunarg.com>2016-01-12 14:28:38 -0700
commit28c4bb3ac4938458b83a4a7226fdc42d6ace952a (patch)
tree87fb0e3d94c723dde1f912a8844198c607445528
parente772023dd3def090870af070cf48879ad8eddeca (diff)
downloadusermoji-28c4bb3ac4938458b83a4a7226fdc42d6ace952a.tar.xz
layers: MR128, Don't complain about declarations without Builtin or Location
This is a stopgap until we have proper interface block analysis landed. For now, this just suppresses the false positives. A correct SPIRV module will not hit this path for anything other than interface blocks. Conflicts: layers/draw_state.cpp
-rw-r--r--layers/draw_state.cpp21
1 files changed, 10 insertions, 11 deletions
diff --git a/layers/draw_state.cpp b/layers/draw_state.cpp
index 48fd4ccf..eabec543 100644
--- a/layers/draw_state.cpp
+++ b/layers/draw_state.cpp
@@ -588,16 +588,15 @@ collect_interface_by_location(layer_data *my_data, VkDevice dev,
int location = value_or_default(var_locations, code[word+2], -1);
int builtin = value_or_default(var_builtins, code[word+2], -1);
- if (location == -1 && builtin == -1) {
- /* No location defined, and not bound to an API builtin.
- * The spec says nothing about how this case works (or doesn't)
- * for interface matching.
- */
- log_msg(my_data->report_data, VK_DEBUG_REPORT_WARN_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_EXT, /*dev*/0, __LINE__, SHADER_CHECKER_INCONSISTENT_SPIRV, "SC",
- "var %d (type %d) in %s interface has no Location or Builtin decoration",
- code[word+2], code[word+1], storage_class_name(sinterface));
- }
- else if (location != -1) {
+ /* All variables and interface block members in the Input or Output storage classes
+ * must be decorated with either a builtin or an explicit location.
+ *
+ * TODO: integrate the interface block support here. For now, don't complain --
+ * a valid SPIRV module will only hit this path for the interface block case, as the
+ * individual members of the type are decorated, rather than variable declarations.
+ */
+
+ if (location != -1) {
/* A user-defined interface variable, with a location. Where a variable
* occupied multiple locations, emit one result for each. */
unsigned num_locations = get_locations_consumed_by_type(src, type,
@@ -610,7 +609,7 @@ collect_interface_by_location(layer_data *my_data, VkDevice dev,
out[location + offset] = v;
}
}
- else {
+ else if (builtin != -1) {
/* A builtin interface variable */
/* Note that since builtin interface variables do not consume numbered
* locations, there is no larger-than-vec4 consideration as above