summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/cl_command_queue_gen7.c7
-rw-r--r--src/cl_gt_device.h2
-rw-r--r--src/intel/intel_gpgpu.c17
3 files changed, 23 insertions, 3 deletions
diff --git a/src/cl_command_queue_gen7.c b/src/cl_command_queue_gen7.c
index 68630cf4..f2c051be 100644
--- a/src/cl_command_queue_gen7.c
+++ b/src/cl_command_queue_gen7.c
@@ -180,6 +180,13 @@ cl_curbe_fill(cl_kernel ker,
UPLOAD(GBE_CURBE_WORK_DIM, work_dim);
#undef UPLOAD
+ /* Upload sampler information. */
+ offset = gbe_kernel_get_curbe_offset(ker->opaque, GBE_CURBE_SAMPLER_INFO, 0);
+ uint32_t i;
+ for(i = 0; i < ker->sampler_sz; i++, offset += 2) {
+ *((uint16_t *) (ker->curbe + offset)) = ker->samplers[i] & 0xFF;
+ }
+
/* Write identity for the stack pointer. This is required by the stack pointer
* computation in the kernel
*/
diff --git a/src/cl_gt_device.h b/src/cl_gt_device.h
index 1eb790f0..6bfc453c 100644
--- a/src/cl_gt_device.h
+++ b/src/cl_gt_device.h
@@ -45,7 +45,7 @@
.image3d_max_width = 8192,
.image3d_max_height = 8192,
.image3d_max_depth = 8192,
-.max_samplers = 0,
+.max_samplers = 8,
.mem_base_addr_align = sizeof(cl_uint) * 8,
.min_data_type_align_size = sizeof(cl_uint),
.single_fp_config = 0, /* XXX */
diff --git a/src/intel/intel_gpgpu.c b/src/intel/intel_gpgpu.c
index 44f44eff..034ecbac 100644
--- a/src/intel/intel_gpgpu.c
+++ b/src/intel/intel_gpgpu.c
@@ -832,9 +832,22 @@ static void
intel_gpgpu_bind_sampler(intel_gpgpu_t *gpgpu, uint32_t *samplers, size_t sampler_sz)
{
int index;
+#ifdef GEN7_SAMPLER_CLAMP_BORDER_WORKAROUND
+ assert(sampler_sz <= GEN_MAX_SAMPLERS/2);
+#else
assert(sampler_sz <= GEN_MAX_SAMPLERS);
- for(index = 0; index < sampler_sz; index++)
- intel_gpgpu_insert_sampler(gpgpu, index, samplers[index] & __CLK_SAMPLER_MASK);
+#endif
+ for(index = 0; index < sampler_sz; index++) {
+ intel_gpgpu_insert_sampler(gpgpu, index, samplers[index]);
+#ifdef GEN7_SAMPLER_CLAMP_BORDER_WORKAROUND
+ /* Duplicate the sampler to 8 + index and fixup the address mode
+ * to repeat.*/
+ if ((samplers[index] & __CLK_ADDRESS_MASK) == CLK_ADDRESS_CLAMP) {
+ intel_gpgpu_insert_sampler(gpgpu, index + 8,
+ (samplers[index] & ~__CLK_ADDRESS_MASK) | CLK_ADDRESS_REPEAT);
+ }
+#endif
+ }
}
static void