Merge changes I6664b301,Iccccf7fd,I44bfc249,Ibd600b7e
* changes:
Update SPIR-V Tools to 43c99b5ee 47f2465ee 1d31a1004
Squashed 'third_party/SPIRV-Tools/' changes from 7b8f00f00a..43c99b5ee0
Update SPIR-V Headers to 70ff9d939
Squashed 'third_party/SPIRV-Headers/' changes from 1d31a10040..70ff9d939c
diff --git a/src/Device/Context.cpp b/src/Device/Context.cpp
index 0d88fce..cb8131f 100644
--- a/src/Device/Context.cpp
+++ b/src/Device/Context.cpp
@@ -350,7 +350,6 @@
}
}
-// TODO(b/137740918): Optimize instancing to use a single draw call.
void Inputs::advanceInstanceAttributes(bool dynamicInstanceStride)
{
for(uint32_t i = 0; i < vk::MAX_VERTEX_INPUT_BINDINGS; i++)
diff --git a/src/System/Debug.hpp b/src/System/Debug.hpp
index 10457b3..f3d3932 100644
--- a/src/System/Debug.hpp
+++ b/src/System/Debug.hpp
@@ -159,4 +159,14 @@
} while(0)
#endif
+// A macro to indicate unoptimized code paths.
+#define UNOPTIMIZED(message, ...) \
+ do \
+ { \
+ if(false) \
+ { \
+ sw::warn("%s:%d UNOPTIMIZED: " message "\n", __FILE__, __LINE__, ##__VA_ARGS__); \
+ } \
+ } while(0)
+
#endif // Debug_hpp
diff --git a/src/Vulkan/VkCommandBuffer.cpp b/src/Vulkan/VkCommandBuffer.cpp
index f333d1f..3bfe933 100644
--- a/src/Vulkan/VkCommandBuffer.cpp
+++ b/src/Vulkan/VkCommandBuffer.cpp
@@ -957,7 +957,11 @@
}
}
- inputs.advanceInstanceAttributes(hasDynamicVertexStride);
+ if(instanceCount > 1)
+ {
+ UNOPTIMIZED("Optimize instancing to use a single draw call."); // TODO(b/137740918)
+ inputs.advanceInstanceAttributes(hasDynamicVertexStride);
+ }
}
}
};
diff --git a/tests/presubmit.sh b/tests/presubmit.sh
index 10ccf53..38af885 100755
--- a/tests/presubmit.sh
+++ b/tests/presubmit.sh
@@ -8,6 +8,8 @@
CLANG_FORMAT=${CLANG_FORMAT:-clang-format}
GOFMT=${GOFMT:-gofmt}
+git config --global --add safe.directory '*'
+
if test -t 1; then
ncolors=$(tput colors)
if test -n "$ncolors" && test $ncolors -ge 8; then