mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-31 16:20:13 +01:00
gallivm: added lp_build_fract()
This commit is contained in:
parent
6464d81e77
commit
516bad2272
2 changed files with 17 additions and 0 deletions
|
|
@ -899,6 +899,19 @@ lp_build_ceil(struct lp_build_context *bld,
|
|||
}
|
||||
|
||||
|
||||
/**
|
||||
* Return fractional part of 'a' computed as a - floor(f)
|
||||
* Typically used in texture coord arithmetic.
|
||||
*/
|
||||
LLVMValueRef
|
||||
lp_build_fract(struct lp_build_context *bld,
|
||||
LLVMValueRef a)
|
||||
{
|
||||
assert(bld->type.floating);
|
||||
return lp_build_sub(bld, a, lp_build_floor(bld, a));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Convert to integer, through whichever rounding method that's fastest,
|
||||
* typically truncating toward zero.
|
||||
|
|
|
|||
|
|
@ -148,6 +148,10 @@ LLVMValueRef
|
|||
lp_build_trunc(struct lp_build_context *bld,
|
||||
LLVMValueRef a);
|
||||
|
||||
LLVMValueRef
|
||||
lp_build_fract(struct lp_build_context *bld,
|
||||
LLVMValueRef a);
|
||||
|
||||
LLVMValueRef
|
||||
lp_build_ifloor(struct lp_build_context *bld,
|
||||
LLVMValueRef a);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue