diff options
Diffstat (limited to 'tools/gfx/vulkan')
| -rw-r--r-- | tools/gfx/vulkan/render-vk.cpp | 14 | ||||
| -rw-r--r-- | tools/gfx/vulkan/vk-api.h | 1 |
2 files changed, 11 insertions, 4 deletions
diff --git a/tools/gfx/vulkan/render-vk.cpp b/tools/gfx/vulkan/render-vk.cpp index a363fb4a1..654911d4d 100644 --- a/tools/gfx/vulkan/render-vk.cpp +++ b/tools/gfx/vulkan/render-vk.cpp @@ -4138,10 +4138,16 @@ public: uint32_t pixelCount, const SamplePosition* samplePositions) override { - SLANG_UNUSED(samplesPerPixel); - SLANG_UNUSED(pixelCount); - SLANG_UNUSED(samplePositions); - SLANG_UNIMPLEMENTED_X("setSamplePositions"); + if (m_api->vkCmdSetSampleLocationsEXT) + { + VkSampleLocationsInfoEXT sampleLocInfo = {}; + sampleLocInfo.sType = VK_STRUCTURE_TYPE_SAMPLE_LOCATIONS_INFO_EXT; + sampleLocInfo.sampleLocationsCount = samplesPerPixel * pixelCount; + sampleLocInfo.sampleLocationsPerPixel = (VkSampleCountFlagBits)samplesPerPixel; + m_api->vkCmdSetSampleLocationsEXT(m_vkCommandBuffer, &sampleLocInfo); + return SLANG_OK; + } + return SLANG_E_NOT_AVAILABLE; } virtual SLANG_NO_THROW void SLANG_MCALL drawInstanced( diff --git a/tools/gfx/vulkan/vk-api.h b/tools/gfx/vulkan/vk-api.h index 9cbff8ee4..bf0a99504 100644 --- a/tools/gfx/vulkan/vk-api.h +++ b/tools/gfx/vulkan/vk-api.h @@ -190,6 +190,7 @@ namespace gfx { x(vkSignalSemaphoreKHR) \ x(vkWaitSemaphores) \ x(vkWaitSemaphoresKHR) \ + x(vkCmdSetSampleLocationsEXT) \ /* */ #define VK_API_ALL_GLOBAL_PROCS(x) \ |
