aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDuncan Hopkins <[email protected]>2019-04-09 17:22:53 +0100
committerErik Faye-Lund <[email protected]>2019-10-28 08:51:45 +0000
commitd850e2a3f2feabcb622aef56537b0d66ed7ba931 (patch)
treeedfee82e48679ddf771f49aa92b028d3f02c5bb2
parent737a2bba356cf6f8bb79df6eceb87aff13c3f3d5 (diff)
zink: clamped limits to INT_MAX when stored as uint32_t.
Acked-by: Jordan Justen <[email protected]>
-rw-r--r--src/gallium/drivers/zink/zink_screen.c5
1 files changed, 3 insertions, 2 deletions
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: