diff options
author | Roland Scheidegger <[email protected]> | 2013-06-05 00:17:22 +0200 |
---|---|---|
committer | Roland Scheidegger <[email protected]> | 2013-06-05 00:29:47 +0200 |
commit | ffe2a1ca3c097661dd3f6e3ca5cfd72be184426c (patch) | |
tree | 8cd2bcebb61a96090c2996e745a01e983f602d8d /src/gallium/drivers/llvmpipe/lp_bld_depth.h | |
parent | ef3e887084fbb36b9041faafc18fb75f6cfa7501 (diff) |
llvmpipe: reduce alignment requirement for 1d resources from 4x4 to 4x1
For rendering to buffers, we cannot have any y alignment.
So make sure that tile clear commands only clear up to the fb width/height,
not more (do this for all resources actually as clearing more seems
pointless for other resources too). For the jit fs function, skip execution
of the lower half of the fragment shader for the 4x4 stamp completely,
for depth/stencil only load/store the values from the first row
(replace other row with undef).
For the blend function, also only load half the values from fs output,
replace the rest with undefs so that everything still operates on the
full 4x4 block to keep code the same between 4x1 and 4x4 (except for
load/store of course which also needs to skip (store) or replace these
values with undefs (load))., at the cost of slightly less optimal code
being produced in some cases.
Also reduce 1d and 1d array alignment too, because they can be handled the
same as buffers so don't need to waste memory.
v2: don't try to run special blend code for 4x1, (very) slightly less
complexity if we just use the same code as for 4x4 which may or may not
make it easier to optimize in the future (as we care a lot more about 4x4
performance than 1d).
v2: don't use undef values for unused fs src outputs with llvm 3.1 as it
apparently can trigger a bug in llvm.
Reviewed-by: Jose Fonseca <[email protected]>
Diffstat (limited to 'src/gallium/drivers/llvmpipe/lp_bld_depth.h')
-rw-r--r-- | src/gallium/drivers/llvmpipe/lp_bld_depth.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/gallium/drivers/llvmpipe/lp_bld_depth.h b/src/gallium/drivers/llvmpipe/lp_bld_depth.h index 2534dc309ce..d169c896711 100644 --- a/src/gallium/drivers/llvmpipe/lp_bld_depth.h +++ b/src/gallium/drivers/llvmpipe/lp_bld_depth.h @@ -74,6 +74,7 @@ void lp_build_depth_stencil_load_swizzled(struct gallivm_state *gallivm, struct lp_type z_src_type, const struct util_format_description *format_desc, + boolean is_1d, LLVMValueRef depth_ptr, LLVMValueRef depth_stride, LLVMValueRef *z_fb, @@ -84,6 +85,7 @@ void lp_build_depth_stencil_write_swizzled(struct gallivm_state *gallivm, struct lp_type z_src_type, const struct util_format_description *format_desc, + boolean is_1d, struct lp_build_mask_context *mask, LLVMValueRef z_fb, LLVMValueRef s_fb, |