zink: check for stores and atomics features

These limits depens on feature-bits.

Fixes: 322a3d4fb0 ("zink: partially enable SSBO pipe cap")
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9803>
This commit is contained in:
Erik Faye-Lund 2021-03-24 16:54:25 +01:00 committed by Marge Bot
parent 215ff8246f
commit a466c2a783
2 changed files with 20 additions and 0 deletions

View File

@ -138,6 +138,8 @@ supported:
* ``VkPhysicalDeviceVulkan11Features``:
* ``shaderDrawParameters``
* ``vertexPipelineStoresAndAtomics``
* ``fragmentStoresAndAtomics``
* For Vulkan 1.1 and below:

View File

@ -713,6 +713,24 @@ zink_get_shader_param(struct pipe_screen *pscreen,
return 32; /* arbitrary */
case PIPE_SHADER_CAP_MAX_SHADER_BUFFERS:
switch (shader) {
case PIPE_SHADER_VERTEX:
case PIPE_SHADER_TESS_CTRL:
case PIPE_SHADER_TESS_EVAL:
case PIPE_SHADER_GEOMETRY:
if (!screen->info.feats.features.vertexPipelineStoresAndAtomics)
return 0;
break;
case PIPE_SHADER_FRAGMENT:
if (!screen->info.feats.features.fragmentStoresAndAtomics)
return 0;
break;
default:
break;
}
/* TODO: this limitation is dumb, and will need some fixes in mesa */
return MIN2(screen->info.props.limits.maxPerStageDescriptorStorageBuffers, PIPE_MAX_SHADER_BUFFERS);