unsigned i;
for (i = 0; i < ARRAY_SIZE(llvm->jit_context.vs_constants); ++i) {
+ /*
+ * There could be a potential issue with rounding this up, as the
+ * shader expects 16-byte allocations, the fix is likely to move
+ * to LOAD intrinsic in the future and remove the vec4 constraint.
+ */
int num_consts =
- draw->pt.user.vs_constants_size[i] / (sizeof(float) * 4);
+ DIV_ROUND_UP(draw->pt.user.vs_constants_size[i], (sizeof(float) * 4));
llvm->jit_context.vs_constants[i] = draw->pt.user.vs_constants[i];
llvm->jit_context.num_vs_constants[i] = num_consts;
if (num_consts == 0) {
for (i = 0; i < ARRAY_SIZE(llvm->gs_jit_context.constants); ++i) {
int num_consts =
- draw->pt.user.gs_constants_size[i] / (sizeof(float) * 4);
+ DIV_ROUND_UP(draw->pt.user.gs_constants_size[i], (sizeof(float) * 4));
llvm->gs_jit_context.constants[i] = draw->pt.user.gs_constants[i];
llvm->gs_jit_context.num_constants[i] = num_consts;
if (num_consts == 0) {
}
num_constants =
- setup->constants[i].stored_size / (sizeof(float) * 4);
+ DIV_ROUND_UP(setup->constants[i].stored_size, (sizeof(float) * 4));
setup->fs.current.jit_context.num_constants[i] = num_constants;
setup->dirty |= LP_SETUP_NEW_FS;
}