lavapipe: check all vertex-stages

We should really check for the minimum of all supported vertex-stages
here, not just the vertex-shader.

This shouldn't make any real-world difference, because we really only
support LLVMpipe here, and that driver has the same limits for all
stages. But it seems better to actually check all stages instead of just
assuming.

Fixes: b38879f8c5 ("vallium: initial import of the vulkan frontend")
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10189>
This commit is contained in:
Erik Faye-Lund 2021-04-12 17:16:12 +02:00 committed by Marge Bot
parent 83de54f6a6
commit d91a549b67

View file

@ -378,6 +378,21 @@ VKAPI_ATTR VkResult VKAPI_CALL lvp_EnumeratePhysicalDeviceGroups(
return vk_outarray_status(&out);
}
static int
min_vertex_pipeline_param(struct pipe_screen *pscreen, enum pipe_shader_cap param)
{
int val = INT_MAX;
for (int i = 0; i < PIPE_SHADER_COMPUTE; ++i) {
if (i == PIPE_SHADER_FRAGMENT ||
!pscreen->get_shader_param(pscreen, i,
PIPE_SHADER_CAP_MAX_INSTRUCTIONS))
continue;
val = MAX2(val, pscreen->get_shader_param(pscreen, i, param));
}
return val;
}
VKAPI_ATTR void VKAPI_CALL lvp_GetPhysicalDeviceFeatures(
VkPhysicalDevice physicalDevice,
VkPhysicalDeviceFeatures* pFeatures)
@ -411,7 +426,7 @@ VKAPI_ATTR void VKAPI_CALL lvp_GetPhysicalDeviceFeatures(
.textureCompressionBC = true,
.occlusionQueryPrecise = true,
.pipelineStatisticsQuery = true,
.vertexPipelineStoresAndAtomics = (pdevice->pscreen->get_shader_param(pdevice->pscreen, PIPE_SHADER_VERTEX, PIPE_SHADER_CAP_MAX_SHADER_BUFFERS) != 0),
.vertexPipelineStoresAndAtomics = (min_vertex_pipeline_param(pdevice->pscreen, PIPE_SHADER_CAP_MAX_SHADER_BUFFERS) != 0),
.fragmentStoresAndAtomics = (pdevice->pscreen->get_shader_param(pdevice->pscreen, PIPE_SHADER_FRAGMENT, PIPE_SHADER_CAP_MAX_SHADER_BUFFERS) != 0),
.shaderTessellationAndGeometryPointSize = true,
.shaderImageGatherExtended = true,