vkGetRenderAreaGranularity implementation
There's no reason to have any limitation on granularity in
SwiftShader, so the granularity is always 1 pixel.
Passes all tests in:
dEQP-VK.api.granularity
Bug b/119620965
Change-Id: Ie2f09737c0054da1b6806b9572e515446a8b1263
Reviewed-on: https://swiftshader-review.googlesource.com/c/24890
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
diff --git a/src/Vulkan/VkRenderPass.cpp b/src/Vulkan/VkRenderPass.cpp
index f34b1e9..108e797 100644
--- a/src/Vulkan/VkRenderPass.cpp
+++ b/src/Vulkan/VkRenderPass.cpp
@@ -133,6 +133,12 @@
return attachmentSize + subpassesSize + dependenciesSize;
}
+void RenderPass::getRenderAreaGranularity(VkExtent2D* pGranularity) const
+{
+ pGranularity->width = 1;
+ pGranularity->height = 1;
+}
+
void RenderPass::begin()
{
currentSubpass = 0;
diff --git a/src/Vulkan/VkRenderPass.hpp b/src/Vulkan/VkRenderPass.hpp
index 2355bb6..8a8a63d 100644
--- a/src/Vulkan/VkRenderPass.hpp
+++ b/src/Vulkan/VkRenderPass.hpp
@@ -29,6 +29,8 @@
static size_t ComputeRequiredAllocationSize(const VkRenderPassCreateInfo* pCreateInfo);
+ void getRenderAreaGranularity(VkExtent2D* pGranularity) const;
+
void begin();
void nextSubpass();
void end();
diff --git a/src/Vulkan/libVulkan.cpp b/src/Vulkan/libVulkan.cpp
index dae36c4..70bc9b5 100644
--- a/src/Vulkan/libVulkan.cpp
+++ b/src/Vulkan/libVulkan.cpp
@@ -1202,8 +1202,10 @@
VKAPI_ATTR void VKAPI_CALL vkGetRenderAreaGranularity(VkDevice device, VkRenderPass renderPass, VkExtent2D* pGranularity)
{
- TRACE("()");
- UNIMPLEMENTED();
+ TRACE("(VkDevice device = 0x%X, VkRenderPass renderPass = 0x%X, VkExtent2D* pGranularity = 0x%X)",
+ device, renderPass, pGranularity);
+
+ vk::Cast(renderPass)->getRenderAreaGranularity(pGranularity);
}
VKAPI_ATTR VkResult VKAPI_CALL vkCreateCommandPool(VkDevice device, const VkCommandPoolCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkCommandPool* pCommandPool)