From b7e966dc7feaed8e0830f9f9ab5904966c7356a0 Mon Sep 17 00:00:00 2001 From: Erik Faye-Lund Date: Fri, 14 Feb 2020 15:42:51 +0100 Subject: [PATCH] zink: do not report texture-samplers for unsupported stages This caused the max combined samplers to be reported as artificially high. Tested-by: Marge Bot Part-of: --- src/gallium/drivers/zink/zink_screen.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/gallium/drivers/zink/zink_screen.c b/src/gallium/drivers/zink/zink_screen.c index b3299976f8f..9d751d30eff 100644 --- a/src/gallium/drivers/zink/zink_screen.c +++ b/src/gallium/drivers/zink/zink_screen.c @@ -386,9 +386,15 @@ zink_get_shader_param(struct pipe_screen *pscreen, } case PIPE_SHADER_CAP_MAX_TEXTURE_SAMPLERS: - /* this might be a bit simplistic... */ - return MIN2(screen->props.limits.maxPerStageDescriptorSamplers, - PIPE_MAX_SAMPLERS); + switch (shader) { + case PIPE_SHADER_VERTEX: + case PIPE_SHADER_FRAGMENT: + /* this might be a bit simplistic... */ + return MIN2(screen->props.limits.maxPerStageDescriptorSamplers, + PIPE_MAX_SAMPLERS); + default: + return 0; /* unsupported stage */ + } case PIPE_SHADER_CAP_MAX_CONST_BUFFER_SIZE: return MIN2(screen->props.limits.maxUniformBufferRange, INT_MAX); -- 2.30.2