summaryrefslogtreecommitdiff
path: root/src/intel/intel_gpgpu.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/intel/intel_gpgpu.c')
-rw-r--r--src/intel/intel_gpgpu.c17
1 files changed, 15 insertions, 2 deletions
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