summaryrefslogtreecommitdiffstats
path: root/tools/gfx/vulkan
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2024-02-02 22:04:40 -0800
committerGitHub <noreply@github.com>2024-02-02 22:04:40 -0800
commitc15e7ade4e27e1649d5b98f5854e9e52bb9e60ae (patch)
tree22082fda85b2b25eec36da8c4505de7b6cb987fc /tools/gfx/vulkan
parenta67cb0609587c230746b52567ff5775cab215220 (diff)
Atomics+Wave ops intrinsics fixes. (#3542)
* Fix atomics intrinsics, increase kMaxDescriptorSets. * Add SPIRVASM to known non-differentiable insts. * Support fp16 wave ops when targeting glsl. * Fixes. * Fix vk validation errors. * Fix. * Add to allowed failures.
Diffstat (limited to 'tools/gfx/vulkan')
-rw-r--r--tools/gfx/vulkan/vk-api.h8
-rw-r--r--tools/gfx/vulkan/vk-descriptor-allocator.cpp4
-rw-r--r--tools/gfx/vulkan/vk-device.cpp24
-rw-r--r--tools/gfx/vulkan/vk-shader-object-layout.h2
4 files changed, 37 insertions, 1 deletions
diff --git a/tools/gfx/vulkan/vk-api.h b/tools/gfx/vulkan/vk-api.h
index 213921406..3d3303efa 100644
--- a/tools/gfx/vulkan/vk-api.h
+++ b/tools/gfx/vulkan/vk-api.h
@@ -278,6 +278,14 @@ struct VulkanExtendedFeatureProperties
VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MESH_SHADER_FEATURES_EXT
};
+ // Multiview features
+ VkPhysicalDeviceMultiviewFeaturesKHR multiviewFeatures = {
+ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_FEATURES_KHR };
+
+ // Fragment shading rate features
+ VkPhysicalDeviceFragmentShadingRateFeaturesKHR fragmentShadingRateFeatures = {
+ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADING_RATE_FEATURES_KHR };
+
// Vulkan 1.2 features.
VkPhysicalDeviceVulkan12Features vulkan12Features = {
VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_2_FEATURES};
diff --git a/tools/gfx/vulkan/vk-descriptor-allocator.cpp b/tools/gfx/vulkan/vk-descriptor-allocator.cpp
index d5e9b5863..49199091d 100644
--- a/tools/gfx/vulkan/vk-descriptor-allocator.cpp
+++ b/tools/gfx/vulkan/vk-descriptor-allocator.cpp
@@ -31,6 +31,10 @@ VkDescriptorPool DescriptorSetAllocator::newPool()
descriptorPoolInfo.pPoolSizes = poolSizes.getBuffer();
descriptorPoolInfo.flags = VK_DESCRIPTOR_POOL_CREATE_FREE_DESCRIPTOR_SET_BIT;
+ VkDescriptorPoolInlineUniformBlockCreateInfo inlineUniformBlockInfo = { VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_INLINE_UNIFORM_BLOCK_CREATE_INFO };
+ inlineUniformBlockInfo.maxInlineUniformBlockBindings = 16;
+ descriptorPoolInfo.pNext = &inlineUniformBlockInfo;
+
VkDescriptorPool descriptorPool = VK_NULL_HANDLE;
SLANG_VK_CHECK(m_api->vkCreateDescriptorPool(
m_api->m_device, &descriptorPoolInfo, nullptr, &descriptorPool));
diff --git a/tools/gfx/vulkan/vk-device.cpp b/tools/gfx/vulkan/vk-device.cpp
index 55c1a88ec..4f2899f1b 100644
--- a/tools/gfx/vulkan/vk-device.cpp
+++ b/tools/gfx/vulkan/vk-device.cpp
@@ -487,6 +487,14 @@ Result DeviceImpl::initVulkanInstanceAndDevice(
extendedFeatures.meshShaderFeatures.pNext = deviceFeatures2.pNext;
deviceFeatures2.pNext = &extendedFeatures.meshShaderFeatures;
+ // multiview features
+ extendedFeatures.multiviewFeatures.pNext = deviceFeatures2.pNext;
+ deviceFeatures2.pNext = &extendedFeatures.multiviewFeatures;
+
+ // fragment shading rate features
+ extendedFeatures.fragmentShadingRateFeatures.pNext = deviceFeatures2.pNext;
+ deviceFeatures2.pNext = &extendedFeatures.fragmentShadingRateFeatures;
+
if (VK_MAKE_VERSION(majorVersion, minorVersion, 0) >= VK_API_VERSION_1_2)
{
extendedFeatures.vulkan12Features.pNext = deviceFeatures2.pNext;
@@ -625,6 +633,20 @@ Result DeviceImpl::initVulkanInstanceAndDevice(
);
SIMPLE_EXTENSION_FEATURE(
+ extendedFeatures.multiviewFeatures,
+ multiview,
+ VK_KHR_MULTIVIEW_EXTENSION_NAME,
+ "multiview"
+ );
+
+ SIMPLE_EXTENSION_FEATURE(
+ extendedFeatures.fragmentShadingRateFeatures,
+ primitiveFragmentShadingRate,
+ VK_KHR_FRAGMENT_SHADING_RATE_EXTENSION_NAME,
+ "fragment-shading-rate"
+ );
+
+ SIMPLE_EXTENSION_FEATURE(
extendedFeatures.rayTracingInvocationReorderFeatures,
rayTracingInvocationReorder,
VK_NV_RAY_TRACING_INVOCATION_REORDER_EXTENSION_NAME,
@@ -659,10 +681,12 @@ Result DeviceImpl::initVulkanInstanceAndDevice(
VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_PIPELINE_PROPERTIES_KHR };
VkPhysicalDeviceSubgroupProperties subgroupProps = {
VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_PROPERTIES };
+
rtProps.pNext = extendedProps.pNext;
extendedProps.pNext = &rtProps;
subgroupProps.pNext = extendedProps.pNext;
extendedProps.pNext = &subgroupProps;
+
m_api.vkGetPhysicalDeviceProperties2(m_api.m_physicalDevice, &extendedProps);
m_api.m_rtProperties = rtProps;
diff --git a/tools/gfx/vulkan/vk-shader-object-layout.h b/tools/gfx/vulkan/vk-shader-object-layout.h
index e1a01dcf3..1d2b08b6c 100644
--- a/tools/gfx/vulkan/vk-shader-object-layout.h
+++ b/tools/gfx/vulkan/vk-shader-object-layout.h
@@ -15,7 +15,7 @@ namespace vk
enum
{
- kMaxDescriptorSets = 8,
+ kMaxDescriptorSets = 32,
};
class ShaderObjectLayoutImpl : public ShaderObjectLayoutBase