From 325ac235a787565179eb9922d68eee8f0bdf0a61 Mon Sep 17 00:00:00 2001 From: Caio Oliveira Date: Tue, 18 May 2021 12:13:52 -0700 Subject: [PATCH] anv: Add boilerplate for VK_NV_mesh_shader MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Use minimum values for the properties. Reviewed-by: Lionel Landwerlin Reviewed-by: Marcin Ĺšlusarz Part-of: --- src/intel/vulkan/anv_device.c | 36 ++++++++++++++++++++++++++++++ src/intel/vulkan/genX_cmd_buffer.c | 33 +++++++++++++++++++++++++++ 2 files changed, 69 insertions(+) diff --git a/src/intel/vulkan/anv_device.c b/src/intel/vulkan/anv_device.c index cfe1d21ed97..b043589f626 100644 --- a/src/intel/vulkan/anv_device.c +++ b/src/intel/vulkan/anv_device.c @@ -1596,6 +1596,14 @@ void anv_GetPhysicalDeviceFeatures2( break; } + case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MESH_SHADER_FEATURES_NV: { + VkPhysicalDeviceMeshShaderFeaturesNV *features = + (VkPhysicalDeviceMeshShaderFeaturesNV *)ext; + features->taskShader = false; + features->meshShader = false; + break; + } + case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MUTABLE_DESCRIPTOR_TYPE_FEATURES_VALVE: { VkPhysicalDeviceMutableDescriptorTypeFeaturesVALVE *features = (VkPhysicalDeviceMutableDescriptorTypeFeaturesVALVE *)ext; @@ -2386,6 +2394,34 @@ void anv_GetPhysicalDeviceProperties2( break; } + case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MESH_SHADER_PROPERTIES_NV: { + VkPhysicalDeviceMeshShaderPropertiesNV *props = + (VkPhysicalDeviceMeshShaderPropertiesNV *)ext; + + props->maxDrawMeshTasksCount = UINT16_MAX; + + props->maxTaskWorkGroupInvocations = 32; + props->maxTaskWorkGroupSize[0] = 32; + props->maxTaskWorkGroupSize[1] = 1; + props->maxTaskWorkGroupSize[2] = 1; + props->maxTaskTotalMemorySize = 16 * 1024; + props->maxTaskOutputCount = UINT16_MAX; + + props->maxMeshWorkGroupInvocations = 32; + props->maxMeshWorkGroupSize[0] = 32; + props->maxMeshWorkGroupSize[1] = 1; + props->maxMeshWorkGroupSize[2] = 1; + props->maxMeshTotalMemorySize = 16 * 1024; + props->maxMeshOutputVertices = 256; + props->maxMeshOutputPrimitives = 256; + props->maxMeshMultiviewViewCount = 1; + + props->meshOutputPerVertexGranularity = 32; + props->meshOutputPerPrimitiveGranularity = 32; + + break; + } + case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PCI_BUS_INFO_PROPERTIES_EXT: { VkPhysicalDevicePCIBusInfoPropertiesEXT *properties = (VkPhysicalDevicePCIBusInfoPropertiesEXT *)ext; diff --git a/src/intel/vulkan/genX_cmd_buffer.c b/src/intel/vulkan/genX_cmd_buffer.c index f929bc084e1..f22399b625a 100644 --- a/src/intel/vulkan/genX_cmd_buffer.c +++ b/src/intel/vulkan/genX_cmd_buffer.c @@ -4838,6 +4838,39 @@ void genX(CmdEndTransformFeedbackEXT)( cmd_buffer->state.gfx.dirty |= ANV_CMD_DIRTY_XFB_ENABLE; } +void +genX(CmdDrawMeshTasksNV)( + VkCommandBuffer commandBuffer, + uint32_t taskCount, + uint32_t firstTask) +{ + unreachable("Unimplemented"); +} + +void +genX(CmdDrawMeshTasksIndirectNV)( + VkCommandBuffer commandBuffer, + VkBuffer buffer, + VkDeviceSize offset, + uint32_t drawCount, + uint32_t stride) +{ + unreachable("Unimplemented"); +} + +void +genX(CmdDrawMeshTasksIndirectCountNV)( + VkCommandBuffer commandBuffer, + VkBuffer buffer, + VkDeviceSize offset, + VkBuffer countBuffer, + VkDeviceSize countBufferOffset, + uint32_t maxDrawCount, + uint32_t stride) +{ + unreachable("Unimplemented"); +} + void genX(cmd_buffer_flush_compute_state)(struct anv_cmd_buffer *cmd_buffer) {