diff --git a/src/nouveau/vulkan/nvk_nir_lower_descriptors.c b/src/nouveau/vulkan/nvk_nir_lower_descriptors.c index 874a8495522..75a79864bf0 100644 --- a/src/nouveau/vulkan/nvk_nir_lower_descriptors.c +++ b/src/nouveau/vulkan/nvk_nir_lower_descriptors.c @@ -5,6 +5,7 @@ #include "nvk_pipeline_layout.h" #include "nir_builder.h" +#include "nir_deref.h" struct lower_descriptors_ctx { const struct nvk_pipeline_layout *layout; @@ -55,6 +56,22 @@ load_descriptor(nir_builder *b, unsigned num_components, unsigned bit_size, .align_mul = 16, .align_offset = 0, .range = ~0); } + case VK_DESCRIPTOR_TYPE_INLINE_UNIFORM_BLOCK: { + nir_ssa_def *base_addr = + nir_iadd_imm(b, load_descriptor_set_addr(b, set, ctx), + binding_layout->offset); + + assert(binding_layout->stride == 1); + const uint32_t binding_size = binding_layout->array_size; + + /* Convert it to nir_address_format_64bit_bounded_global */ + assert(num_components == 4 && bit_size == 32); + return nir_vec4(b, nir_unpack_64_2x32_split_x(b, base_addr), + nir_unpack_64_2x32_split_y(b, base_addr), + nir_imm_int(b, binding_size), + nir_imm_int(b, 0)); + } + default: { assert(binding_layout->stride > 0); nir_ssa_def *desc_ubo_offset = diff --git a/src/nouveau/vulkan/nvk_physical_device.c b/src/nouveau/vulkan/nvk_physical_device.c index 093de134652..8c74f1b5ea4 100644 --- a/src/nouveau/vulkan/nvk_physical_device.c +++ b/src/nouveau/vulkan/nvk_physical_device.c @@ -56,6 +56,7 @@ nvk_GetPhysicalDeviceFeatures2(VkPhysicalDevice physicalDevice, VkPhysicalDeviceVulkan13Features core_1_3 = { .sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_3_FEATURES, /* Vulkan 1.3 features */ + .inlineUniformBlock = true, }; vk_foreach_struct(ext, pFeatures->pNext) @@ -140,6 +141,8 @@ nvk_GetPhysicalDeviceProperties2(VkPhysicalDevice physicalDevice, VkPhysicalDeviceVulkan13Properties core_1_3 = { .sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_3_PROPERTIES, /* Vulkan 1.3 properties */ + .maxInlineUniformBlockSize = 1 << 16, + .maxPerStageDescriptorInlineUniformBlocks = 32, }; vk_foreach_struct(ext, pProperties->pNext) @@ -181,6 +184,7 @@ nvk_get_device_extensions(const struct nvk_physical_device *device, #endif .KHR_variable_pointers = true, .EXT_custom_border_color = true, + .EXT_inline_uniform_block = true, }; }