From: Erik Faye-Lund Date: Fri, 14 Feb 2020 14:42:51 +0000 (+0100) Subject: zink: do not report texture-samplers for unsupported stages X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=b7e966dc7feaed8e0830f9f9ab5904966c7356a0;p=mesa.git 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: --- 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);