mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 05:18:08 +02:00
gallivm: check for level=0 case in lp_build_minify()
This lets us avoid the shift and max() operations.
This commit is contained in:
parent
4e6f5e8d43
commit
874f3a57ce
1 changed files with 10 additions and 3 deletions
|
|
@ -362,9 +362,16 @@ lp_build_minify(struct lp_build_sample_context *bld,
|
|||
LLVMValueRef base_size,
|
||||
LLVMValueRef level)
|
||||
{
|
||||
LLVMValueRef size = LLVMBuildLShr(bld->builder, base_size, level, "minify");
|
||||
size = lp_build_max(&bld->int_coord_bld, size, bld->int_coord_bld.one);
|
||||
return size;
|
||||
if (level == bld->int_coord_bld.zero) {
|
||||
/* if we're using mipmap level zero, no minification is needed */
|
||||
return base_size;
|
||||
}
|
||||
else {
|
||||
LLVMValueRef size =
|
||||
LLVMBuildLShr(bld->builder, base_size, level, "minify");
|
||||
size = lp_build_max(&bld->int_coord_bld, size, bld->int_coord_bld.one);
|
||||
return size;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue