瀏覽代碼

llvmpipe: Utility functions for linear and bilinear interpolation.

tags/android-x86-1.6
José Fonseca 16 年之前
父節點
當前提交
fa0f4b35be
共有 2 個文件被更改,包括 45 次插入0 次删除
  1. 25
    0
      src/gallium/drivers/llvmpipe/lp_bld_arit.c
  2. 20
    0
      src/gallium/drivers/llvmpipe/lp_bld_arit.h

+ 25
- 0
src/gallium/drivers/llvmpipe/lp_bld_arit.c 查看文件

@@ -502,6 +502,31 @@ lp_build_div(struct lp_build_context *bld,
}


LLVMValueRef
lp_build_lerp(struct lp_build_context *bld,
LLVMValueRef x,
LLVMValueRef v0,
LLVMValueRef v1)
{
return lp_build_add(bld, v0, lp_build_mul(bld, x, lp_build_sub(bld, v1, v0)));
}


LLVMValueRef
lp_build_lerp_2d(struct lp_build_context *bld,
LLVMValueRef x,
LLVMValueRef y,
LLVMValueRef v00,
LLVMValueRef v01,
LLVMValueRef v10,
LLVMValueRef v11)
{
LLVMValueRef v0 = lp_build_lerp(bld, x, v00, v01);
LLVMValueRef v1 = lp_build_lerp(bld, x, v10, v11);
return lp_build_lerp(bld, y, v0, v1);
}


/**
* Generate min(a, b)
* Do checks for special cases.

+ 20
- 0
src/gallium/drivers/llvmpipe/lp_bld_arit.h 查看文件

@@ -71,6 +71,26 @@ lp_build_div(struct lp_build_context *bld,
LLVMValueRef a,
LLVMValueRef b);

LLVMValueRef
lp_build_lerp(struct lp_build_context *bld,
LLVMValueRef x,
LLVMValueRef v0,
LLVMValueRef v1);

/**
* Bilinear interpolation.
*
* Values indices are in v_{yx}.
*/
LLVMValueRef
lp_build_lerp_2d(struct lp_build_context *bld,
LLVMValueRef x,
LLVMValueRef y,
LLVMValueRef v00,
LLVMValueRef v01,
LLVMValueRef v10,
LLVMValueRef v11);

LLVMValueRef
lp_build_min(struct lp_build_context *bld,
LLVMValueRef a,

Loading…
取消
儲存