summaryrefslogtreecommitdiff
path: root/utests/compiler_copy_image1.cpp
diff options
context:
space:
mode:
authorZhigang Gong <zhigang.gong@linux.intel.com>2013-09-25 18:26:49 +0800
committerZhigang Gong <zhigang.gong@linux.intel.com>2013-09-26 16:53:01 +0800
commitb835433189a3dca202e7fc7d9ff0bfbc49676281 (patch)
treed8b7e6ce5a04d392d477deeda2f396da9f431277 /utests/compiler_copy_image1.cpp
parent7291cf314b55496f56eaddb6a4b0506bd1d6bfcb (diff)
GBE/Runtime: implement workaround for IVB sampler bug
Per IVB spec, If the surface format of the associated surface is UINT or SINT, the Surface Type cannot be SURFTYPE_3D or SURFTYPE_CUBE and Address Control Mode cannot be CLAMP_BORDER or HALF_BORDER. Besides this bug, there is another undocumented issue. If a surface data type is IEEE float. Then when we use sampler to sample the pixel, if the value is betweeo -1p-20 to 0, the sampler will rounding it to zero. And this will also bring problem when we are using the clamp mode. This patch is to workaround the above two hardware issues. It introduces a new intrinsic get_sampler_info to get a sampler type at runtime. When calling to read_image, it will check whether it hits the above two cases. If it hit case 1, then we will force it to use clamp to edge for those pixels within the box, And for those pixel out of the box, we manually set the border color. To achieve this solution, we have to prepare two sampler slot for each CL_ADDRESS_CLAMP sampler. And the first has slot_1 which is using CL_ADDRESS_CLAMP, the second use slot_1 + 8. Thus we can only use half of 16 samplers. Fortunately, 8 samplers comply with the OpenCL's minimal requirement. If it hits case 2, then we minor a epsilon to the coordinate, and let it not rounds to zero. If possible, programer should avoid to use float coordinates and/or int/uint format image. Otherwise, it will hit the very slow path. With this workaround, the compiler_copy_image1 can pass now. Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com> Reviewed-by: "Yang, Rong R" <rong.r.yang@intel.com>
Diffstat (limited to 'utests/compiler_copy_image1.cpp')
-rw-r--r--utests/compiler_copy_image1.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/utests/compiler_copy_image1.cpp b/utests/compiler_copy_image1.cpp
index 39ff3f5e..d469fbda 100644
--- a/utests/compiler_copy_image1.cpp
+++ b/utests/compiler_copy_image1.cpp
@@ -68,4 +68,4 @@ static void compiler_copy_image1(void)
OCL_UNMAP_BUFFER(5);
}
-MAKE_UTEST_FROM_FUNCTION_WITH_ISSUE(compiler_copy_image1);
+MAKE_UTEST_FROM_FUNCTION(compiler_copy_image1);