Support sample image instruction operand

- Added support for the sample operand in SamplerCore, which simply
  involves offsetting the buffer by the the sampleId * samplePitch.
- Also added a check so that sampleId is within the expected range
  and doesn't cause reading memory out of bounds.

Bug: b/135265531
Change-Id: Ie828d07db41d36befb34037156736a6576af0676
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/38728
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Chris Forbes <chrisforbes@google.com>
Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>
diff --git a/src/Vulkan/VkImageView.hpp b/src/Vulkan/VkImageView.hpp
index aefce8b..8563520 100644
--- a/src/Vulkan/VkImageView.hpp
+++ b/src/Vulkan/VkImageView.hpp
@@ -51,6 +51,7 @@
 	Format getFormat(VkImageAspectFlagBits aspect) const { return image->getFormat(aspect); }
 	int rowPitchBytes(VkImageAspectFlagBits aspect, uint32_t mipLevel, Usage usage = RAW) const;
 	int slicePitchBytes(VkImageAspectFlagBits aspect, uint32_t mipLevel, Usage usage = RAW) const;
+	int getMipLevelSize(VkImageAspectFlagBits aspect, uint32_t mipLevel, Usage usage = RAW) const;
 	int layerPitchBytes(VkImageAspectFlagBits aspect, Usage usage = RAW) const;
 	VkExtent3D getMipLevelExtent(uint32_t mipLevel) const;