iris: proper # of uniforms
authorKenneth Graunke <kenneth@whitecape.org>
Fri, 27 Apr 2018 06:42:16 +0000 (23:42 -0700)
committerKenneth Graunke <kenneth@whitecape.org>
Thu, 21 Feb 2019 18:26:06 +0000 (10:26 -0800)
or at least closer...we were using bytes, we want 256-bit units...

src/gallium/drivers/iris/iris_state.c

index 941080e5c9ac11e9e617b0ac215baa1fda9701cb..a5e75fceb902715cc5d2fc575d026bc426d7d5d1 100644 (file)
@@ -2132,8 +2132,9 @@ iris_upload_render_state(struct iris_context *ice,
          continue;
 
       struct iris_shader_state *shs = &ice->shaders.state[stage];
-      shs->const_size = cbuf0->buffer_size;
-      u_upload_data(ice->ctx.const_uploader, 0, shs->const_size, 32,
+      // XXX: DIV_ROUND_UP(prog_data->nr_params, 8)?
+      shs->const_size = DIV_ROUND_UP(cbuf0->buffer_size, 32);
+      u_upload_data(ice->ctx.const_uploader, 0, 32 * shs->const_size, 32,
                     cbuf0->user_buffer, &shs->const_offset,
                     &shs->push_resource);
    }