From: Duncan Hopkins Date: Tue, 9 Apr 2019 16:22:53 +0000 (+0100) Subject: zink: clamped limits to INT_MAX when stored as uint32_t. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=d850e2a3f2feabcb622aef56537b0d66ed7ba931;p=mesa.git zink: clamped limits to INT_MAX when stored as uint32_t. Acked-by: Jordan Justen --- diff --git a/src/gallium/drivers/zink/zink_screen.c b/src/gallium/drivers/zink/zink_screen.c index 88b2d5088d4..c5ce0c3054e 100644 --- a/src/gallium/drivers/zink/zink_screen.c +++ b/src/gallium/drivers/zink/zink_screen.c @@ -361,7 +361,7 @@ zink_get_shader_param(struct pipe_screen *pscreen, PIPE_MAX_SAMPLERS); case PIPE_SHADER_CAP_MAX_CONST_BUFFER_SIZE: - return screen->props.limits.maxUniformBufferRange; + return MIN2(screen->props.limits.maxUniformBufferRange, INT_MAX); case PIPE_SHADER_CAP_MAX_CONST_BUFFERS: return screen->props.limits.maxPerStageDescriptorUniformBuffers; @@ -408,7 +408,8 @@ zink_get_shader_param(struct pipe_screen *pscreen, return (1 << PIPE_SHADER_IR_NIR) | (1 << PIPE_SHADER_IR_TGSI); case PIPE_SHADER_CAP_MAX_SHADER_IMAGES: - return screen->props.limits.maxPerStageDescriptorStorageImages; + return MIN2(screen->props.limits.maxPerStageDescriptorStorageImages, + PIPE_MAX_SHADER_IMAGES); case PIPE_SHADER_CAP_LOWER_IF_THRESHOLD: case PIPE_SHADER_CAP_TGSI_SKIP_MERGE_REGISTERS: