diff options
author | Erik Faye-Lund <erik.faye-lund@collabora.com> | 2021-04-12 17:16:12 +0200 |
---|---|---|
committer | Dylan Baker <dylan.c.baker@intel.com> | 2021-04-21 09:53:37 -0700 |
commit | 444e3aad141d67a5224bbfe593a0afad410e82ea (patch) | |
tree | 27ac806321ca608e2d27f63a546e462e2f22046c | |
parent | 5a37a1cd744608bffc7b2301799cafed627660db (diff) |
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: b38879f8c5f ("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>
(cherry picked from commit d91a549b67f3a13c4763d82e333e50395c300507)
Conflicts:
src/gallium/frontends/lavapipe/lvp_device.c
-rw-r--r-- | .pick_status.json | 2 | ||||
-rw-r--r-- | src/gallium/frontends/lavapipe/lvp_device.c | 19 |
2 files changed, 18 insertions, 3 deletions
diff --git a/.pick_status.json b/.pick_status.json index 295be8555da..24d72090e30 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -571,7 +571,7 @@ "description": "lavapipe: check all vertex-stages", "nominated": true, "nomination_type": 1, - "resolution": 0, + "resolution": 1, "master_sha": null, "because_sha": "b38879f8c5f57b7f1802e433e33181bdf5e72aef" }, diff --git a/src/gallium/frontends/lavapipe/lvp_device.c b/src/gallium/frontends/lavapipe/lvp_device.c index 98032341e80..d276f8f05bb 100644 --- a/src/gallium/frontends/lavapipe/lvp_device.c +++ b/src/gallium/frontends/lavapipe/lvp_device.c @@ -319,7 +319,22 @@ VKAPI_ATTR VkResult VKAPI_CALL lvp_EnumeratePhysicalDeviceGroups( return vk_outarray_status(&out); } -void lvp_GetPhysicalDeviceFeatures( +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; +} + +void VKAPI_CALL lvp_GetPhysicalDeviceFeatures( VkPhysicalDevice physicalDevice, VkPhysicalDeviceFeatures* pFeatures) { @@ -352,7 +367,7 @@ void 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, |