diff options
author | Dave Airlie <[email protected]> | 2019-10-09 15:11:14 +1000 |
---|---|---|
committer | Dave Airlie <[email protected]> | 2019-10-10 21:52:20 +0000 |
commit | 1b221f4e7bdae9c6ae2961b31a7fc0e917711eb6 (patch) | |
tree | 37cd5f5e778711922e6a25a37a9b300142478c1a /src/gallium/auxiliary | |
parent | 744b8936dfd7bb21bf04a47ae83bcad75716e46f (diff) |
llvmpipe/draw: handle UBOs that are < 16 bytes.
Not sure if this is a bug in the user or not, but some CTS
tests fail due to using an 8 byte constant buffer.
Fixes: KHR-GLES31.core.layout_binding.block_layout_binding_block_VertexShader
Reviewed-by: Roland Scheidegger <[email protected]>
Diffstat (limited to 'src/gallium/auxiliary')
-rw-r--r-- | src/gallium/auxiliary/draw/draw_pt_fetch_shade_pipeline_llvm.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/gallium/auxiliary/draw/draw_pt_fetch_shade_pipeline_llvm.c b/src/gallium/auxiliary/draw/draw_pt_fetch_shade_pipeline_llvm.c index b96a5c99315..0eeaf780af0 100644 --- a/src/gallium/auxiliary/draw/draw_pt_fetch_shade_pipeline_llvm.c +++ b/src/gallium/auxiliary/draw/draw_pt_fetch_shade_pipeline_llvm.c @@ -289,8 +289,13 @@ llvm_middle_end_bind_parameters(struct draw_pt_middle_end *middle) 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) { @@ -308,7 +313,7 @@ llvm_middle_end_bind_parameters(struct draw_pt_middle_end *middle) 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) { |