Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrecht Van Lommel <brechtvanlommel@gmail.com>2018-02-06 00:13:08 +0300
committerBrecht Van Lommel <brechtvanlommel@gmail.com>2018-02-06 00:19:49 +0300
commitce3e0afe5971fbd75e314714f7bcfa79fedcbe7b (patch)
tree81c5e1cb7ad943c09fbda42e21d6664d6e4b5027 /intern/cycles
parentbd9ed0228b8455167a404c11121f0d4d46e4c689 (diff)
Fix T54001: AMD OpenCL fails with certain resolutions, after recent changes.
We should actually be using CL_DEVICE_MEM_BASE_ADDR_ALIGN for sub buffers, previous change in this code was incorrect. Renamed the function now to make the specific purpose of this alignment clear, it's not required for data types in general.
Diffstat (limited to 'intern/cycles')
-rw-r--r--intern/cycles/device/device.h2
-rw-r--r--intern/cycles/device/device_cpu.cpp2
-rw-r--r--intern/cycles/device/device_denoising.cpp2
-rw-r--r--intern/cycles/device/opencl/opencl.h4
-rw-r--r--intern/cycles/device/opencl/opencl_base.cpp4
-rw-r--r--intern/cycles/device/opencl/opencl_util.cpp10
6 files changed, 12 insertions, 12 deletions
diff --git a/intern/cycles/device/device.h b/intern/cycles/device/device.h
index 99e80d10424..555fd5ec2d2 100644
--- a/intern/cycles/device/device.h
+++ b/intern/cycles/device/device.h
@@ -288,7 +288,7 @@ public:
Stats &stats;
/* memory alignment */
- virtual int mem_address_alignment() { return MIN_ALIGNMENT_CPU_DATA_TYPES; }
+ virtual int mem_sub_ptr_alignment() { return MIN_ALIGNMENT_CPU_DATA_TYPES; }
/* constant memory */
virtual void const_copy_to(const char *name, void *host, size_t size) = 0;
diff --git a/intern/cycles/device/device_cpu.cpp b/intern/cycles/device/device_cpu.cpp
index fd55ec3687a..6be60f8bbb6 100644
--- a/intern/cycles/device/device_cpu.cpp
+++ b/intern/cycles/device/device_cpu.cpp
@@ -299,7 +299,7 @@ public:
if(mem.type == MEM_DEVICE_ONLY) {
assert(!mem.host_pointer);
- size_t alignment = mem_address_alignment();
+ size_t alignment = MIN_ALIGNMENT_CPU_DATA_TYPES;
void *data = util_aligned_malloc(mem.memory_size(), alignment);
mem.device_pointer = (device_ptr)data;
}
diff --git a/intern/cycles/device/device_denoising.cpp b/intern/cycles/device/device_denoising.cpp
index 1862deb9a61..644cf6cd10e 100644
--- a/intern/cycles/device/device_denoising.cpp
+++ b/intern/cycles/device/device_denoising.cpp
@@ -95,7 +95,7 @@ bool DenoisingTask::run_denoising()
buffer.width = rect.z - rect.x;
buffer.stride = align_up(buffer.width, 4);
buffer.h = rect.w - rect.y;
- buffer.pass_stride = align_up(buffer.stride * buffer.h, divide_up(device->mem_address_alignment(), sizeof(float)));
+ buffer.pass_stride = align_up(buffer.stride * buffer.h, divide_up(device->mem_sub_ptr_alignment(), sizeof(float)));
buffer.mem.alloc_to_device(buffer.pass_stride * buffer.passes, false);
device_ptr null_ptr = (device_ptr) 0;
diff --git a/intern/cycles/device/opencl/opencl.h b/intern/cycles/device/opencl/opencl.h
index f38c2f65c1e..85ef14ee29a 100644
--- a/intern/cycles/device/opencl/opencl.h
+++ b/intern/cycles/device/opencl/opencl.h
@@ -140,7 +140,7 @@ public:
int *minor,
cl_int* error = NULL);
- static int mem_address_alignment(cl_device_id device_id);
+ static int mem_sub_ptr_alignment(cl_device_id device_id);
/* Get somewhat more readable device name.
* Main difference is AMD OpenCL here which only gives code name
@@ -346,7 +346,7 @@ public:
void mem_zero(device_memory& mem);
void mem_free(device_memory& mem);
- int mem_address_alignment();
+ int mem_sub_ptr_alignment();
void const_copy_to(const char *name, void *host, size_t size);
void tex_alloc(device_memory& mem);
diff --git a/intern/cycles/device/opencl/opencl_base.cpp b/intern/cycles/device/opencl/opencl_base.cpp
index 7de78d413ed..bfa2702ad62 100644
--- a/intern/cycles/device/opencl/opencl_base.cpp
+++ b/intern/cycles/device/opencl/opencl_base.cpp
@@ -473,9 +473,9 @@ void OpenCLDeviceBase::mem_free(device_memory& mem)
}
}
-int OpenCLDeviceBase::mem_address_alignment()
+int OpenCLDeviceBase::mem_sub_ptr_alignment()
{
- return OpenCLInfo::mem_address_alignment(cdDevice);
+ return OpenCLInfo::mem_sub_ptr_alignment(cdDevice);
}
device_ptr OpenCLDeviceBase::mem_alloc_sub_ptr(device_memory& mem, int offset, int size)
diff --git a/intern/cycles/device/opencl/opencl_util.cpp b/intern/cycles/device/opencl/opencl_util.cpp
index 7db6fa0c416..a776f48b5e9 100644
--- a/intern/cycles/device/opencl/opencl_util.cpp
+++ b/intern/cycles/device/opencl/opencl_util.cpp
@@ -1136,16 +1136,16 @@ bool OpenCLInfo::get_driver_version(cl_device_id device_id,
return true;
}
-int OpenCLInfo::mem_address_alignment(cl_device_id device_id)
+int OpenCLInfo::mem_sub_ptr_alignment(cl_device_id device_id)
{
- int base_align_bytes;
+ int base_align_bits;
if(clGetDeviceInfo(device_id,
- CL_DEVICE_MIN_DATA_TYPE_ALIGN_SIZE,
+ CL_DEVICE_MEM_BASE_ADDR_ALIGN,
sizeof(int),
- &base_align_bytes,
+ &base_align_bits,
NULL) == CL_SUCCESS)
{
- return base_align_bytes;
+ return base_align_bits/8;
}
return 1;
}