zink: clamped limits to INT_MAX when stored as uint32_t.
authorDuncan Hopkins <duncan@duncanhopkins.me.uk>
Tue, 9 Apr 2019 16:22:53 +0000 (17:22 +0100)
committerErik Faye-Lund <erik.faye-lund@collabora.com>
Mon, 28 Oct 2019 08:51:45 +0000 (08:51 +0000)
Acked-by: Jordan Justen <jordan.l.justen@intel.com>
src/gallium/drivers/zink/zink_screen.c

index 88b2d5088d473c3a6dab12f0fb353c637190a70a..c5ce0c3054e9c92eb3fa7b1e51691bdac6e3e38c 100644 (file)
@@ -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: