Eliminate custom Vulkan constants

VK_PIPELINE_BIND_POINT_RANGE_SIZE and VK_IMAGE_VIEW_TYPE_END_RANGE
were added to one of SwiftShader's own headers, when they were deleted
from the official Vulkan headers, as part of b/153337629.

A header version check was put in place to alert us to manually verify
that no new official Vulkan constants would be defined that clash with
ours. This check is annoying every time we update the Vulkan headers,
and hasn't resulted in requiring changes thus far. Also note that as
part of b/154215163 we ensured all our builds use SwiftShader's copy
of the Vulkan headers.

This change eliminates these constants entirely, so we no longer need
the header version check either. VK_PIPELINE_BIND_POINT_RANGE_SIZE only
affected our pipeline bind point array. Since we only support graphics
and compute pipelines for the foreseeable future, the array size has
been hard-coded to 2, a comment has been added to clarify the index
mapping, and the assert which bounds checks the array access is
preserved.

VK_IMAGE_VIEW_TYPE_END_RANGE was only being used to discern between
image views and buffer views, but this turns out not to be used at all
any more, as we treat them the same as 1D images. b/152224843 removed
the need to specialize for texel buffers due to them requiring support
for larger dimensions than 1D images, and b/152227757 ensured that the
generation of routines does not use more state than what's associated
with the descriptor identifiers. Hence the hacky use of a custom
constant to represent buffer views can safely be eliminated.

Bug: b/155153221
Change-Id: I4566b558d9f3f009e9a1f319c8cb1453c89d52fd
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/56608
Presubmit-Ready: Nicolas Capens <nicolascapens@google.com>
Kokoro-Result: kokoro <noreply+kokoro@google.com>
Tested-by: Nicolas Capens <nicolascapens@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
diff --git a/src/Vulkan/VkCommandBuffer.cpp b/src/Vulkan/VkCommandBuffer.cpp
index aa7f024..14bef79 100644
--- a/src/Vulkan/VkCommandBuffer.cpp
+++ b/src/Vulkan/VkCommandBuffer.cpp
@@ -990,7 +990,7 @@
 
 	void play(vk::CommandBuffer::ExecutionState &executionState) override
 	{
-		ASSERT(pipelineBindPoint < vk::VK_PIPELINE_BIND_POINT_RANGE_SIZE);
+		ASSERT((size_t)pipelineBindPoint < executionState.pipelineState.size());
 		ASSERT(firstSet + descriptorSetCount <= vk::MAX_BOUND_DESCRIPTOR_SETS);
 		ASSERT(firstDynamicOffset + dynamicOffsetCount <= vk::MAX_DESCRIPTOR_SET_COMBINED_BUFFERS_DYNAMIC);
 
diff --git a/src/Vulkan/VkCommandBuffer.hpp b/src/Vulkan/VkCommandBuffer.hpp
index 567602a..52f6091 100644
--- a/src/Vulkan/VkCommandBuffer.hpp
+++ b/src/Vulkan/VkCommandBuffer.hpp
@@ -152,7 +152,10 @@
 		sw::CountedEvent *events = nullptr;
 		RenderPass *renderPass = nullptr;
 		Framebuffer *renderPassFramebuffer = nullptr;
-		std::array<PipelineState, vk::VK_PIPELINE_BIND_POINT_RANGE_SIZE> pipelineState;
+
+		// VK_PIPELINE_BIND_POINT_GRAPHICS = 0
+		// VK_PIPELINE_BIND_POINT_COMPUTE = 1
+		std::array<PipelineState, 2> pipelineState;
 
 		vk::DynamicState dynamicState;
 
diff --git a/src/Vulkan/VkImageView.cpp b/src/Vulkan/VkImageView.cpp
index 7b962ab..35663c8 100644
--- a/src/Vulkan/VkImageView.cpp
+++ b/src/Vulkan/VkImageView.cpp
@@ -92,7 +92,6 @@
 
 Identifier::Identifier(VkFormat bufferFormat)
 {
-	static_assert(vk::VK_IMAGE_VIEW_TYPE_END_RANGE == 6, "VkImageViewType does not allow using 7 to indicate buffer view");
 	constexpr VkComponentMapping identityMapping = { VK_COMPONENT_SWIZZLE_R, VK_COMPONENT_SWIZZLE_G, VK_COMPONENT_SWIZZLE_B, VK_COMPONENT_SWIZZLE_A };
 	pack({ VK_IMAGE_VIEW_TYPE_1D, bufferFormat, ResolveComponentMapping(identityMapping, bufferFormat), true });
 }
diff --git a/src/Vulkan/VulkanPlatform.hpp b/src/Vulkan/VulkanPlatform.hpp
index 4f02c79..8e736d4 100644
--- a/src/Vulkan/VulkanPlatform.hpp
+++ b/src/Vulkan/VulkanPlatform.hpp
@@ -52,18 +52,4 @@
 #include <vulkan/vk_google_filtering_precision.h>
 #include <vulkan/vulkan_core.h>
 
-namespace vk {
-// Here we define constants that used to be in the Vulkan headers, but are not part of the spec.
-// See: https://github.com/KhronosGroup/Vulkan-Docs/issues/1230
-
-// When updating the Vulkan Headers we use, go through each constant below and make sure they are valid.
-// Once that's done, update SwiftShaderVulkanHeaderVersion.
-constexpr int SwiftShaderVulkanHeaderVersion = 178;
-static_assert(SwiftShaderVulkanHeaderVersion == VK_HEADER_VERSION, "Please validate/update constants below upon upgrading Vulkan headers");
-
-constexpr auto VK_PIPELINE_BIND_POINT_RANGE_SIZE = (VK_PIPELINE_BIND_POINT_COMPUTE - VK_PIPELINE_BIND_POINT_GRAPHICS + 1);
-constexpr auto VK_IMAGE_VIEW_TYPE_END_RANGE = VK_IMAGE_VIEW_TYPE_CUBE_ARRAY;
-
-}  // namespace vk
-
 #endif  // VULKAN_PLATFORM