From 642812239ea06c6d119a2e5a76e426cd0540ad62 Mon Sep 17 00:00:00 2001 From: Iago Toral Quiroga Date: Thu, 1 Jul 2021 09:42:24 +0200 Subject: [PATCH] v3dv: expose geometry shaders MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit A run of dEQP-VK.*geom* has 6328 test passes and 16 failures. 14 of these failures are related to a CTS bug affecting atomic operations for which I submitted a CL to Khronos. Another fail looks like it might be a case of the error threshold in CTS being slightly low. There is only one test fail in that list that looks like it might be an actual driver bug, but it is a variable pointers test, so it might be unrelated to geometry shaders in the end. Reviewed-by: Alejandro PiƱeiro Part-of: --- src/broadcom/vulkan/v3dv_device.c | 14 +++++++------- src/broadcom/vulkan/v3dv_uniforms.c | 7 +++---- 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/src/broadcom/vulkan/v3dv_device.c b/src/broadcom/vulkan/v3dv_device.c index 091193fd2db..3062bdd8de8 100644 --- a/src/broadcom/vulkan/v3dv_device.c +++ b/src/broadcom/vulkan/v3dv_device.c @@ -947,7 +947,7 @@ v3dv_GetPhysicalDeviceFeatures(VkPhysicalDevice physicalDevice, .fullDrawIndexUint32 = false, /* Only available since V3D 4.4.9.1 */ .imageCubeArray = true, .independentBlend = true, - .geometryShader = false, + .geometryShader = true, .tessellationShader = false, .sampleRateShading = true, .dualSrcBlend = false, @@ -974,7 +974,7 @@ v3dv_GetPhysicalDeviceFeatures(VkPhysicalDevice physicalDevice, .pipelineStatisticsQuery = false, .vertexPipelineStoresAndAtomics = true, .fragmentStoresAndAtomics = true, - .shaderTessellationAndGeometryPointSize = false, + .shaderTessellationAndGeometryPointSize = true, .shaderImageGatherExtended = false, .shaderStorageImageExtendedFormats = true, .shaderStorageImageMultisample = false, @@ -1243,11 +1243,11 @@ v3dv_GetPhysicalDeviceProperties(VkPhysicalDevice physicalDevice, .maxTessellationEvaluationOutputComponents = 0, /* Geometry limits */ - .maxGeometryShaderInvocations = 0, - .maxGeometryInputComponents = 0, - .maxGeometryOutputComponents = 0, - .maxGeometryOutputVertices = 0, - .maxGeometryTotalOutputComponents = 0, + .maxGeometryShaderInvocations = 32, + .maxGeometryInputComponents = 64, + .maxGeometryOutputComponents = 64, + .maxGeometryOutputVertices = 256, + .maxGeometryTotalOutputComponents = 1024, /* Fragment limits */ .maxFragmentInputComponents = max_varying_components, diff --git a/src/broadcom/vulkan/v3dv_uniforms.c b/src/broadcom/vulkan/v3dv_uniforms.c index db575426a68..7b1f3ed01c2 100644 --- a/src/broadcom/vulkan/v3dv_uniforms.c +++ b/src/broadcom/vulkan/v3dv_uniforms.c @@ -39,17 +39,16 @@ /* Our Vulkan resource indices represent indices in descriptor maps which * include all shader stages, so we need to size the arrays below - * accordingly. For now we only support a maximum of 2 stages for VS and - * FS. + * accordingly. For now we only support a maximum of 3 stages: VS, GS, FS. */ -#define MAX_STAGES 2 +#define MAX_STAGES 3 #define MAX_TOTAL_TEXTURE_SAMPLERS (V3D_MAX_TEXTURE_SAMPLERS * MAX_STAGES) struct texture_bo_list { struct v3dv_bo *tex[MAX_TOTAL_TEXTURE_SAMPLERS]; }; -/* This tracks state BOs forboth textures and samplers, so we +/* This tracks state BOs for both textures and samplers, so we * multiply by 2. */ #define MAX_TOTAL_STATES (2 * V3D_MAX_TEXTURE_SAMPLERS * MAX_STAGES)