diff options
author | Siddhartha Jejurkar <f20180617@goa.bits-pilani.ac.in> | 2021-12-17 16:01:32 +0300 |
---|---|---|
committer | Siddhartha Jejurkar <f20180617@goa.bits-pilani.ac.in> | 2021-12-17 16:01:32 +0300 |
commit | dbc41b30f88b96f7d8c6e995b17f5930eb55cc77 (patch) | |
tree | c6c495328443ea3621e5df2ef483b0e0dd504496 /intern/cycles/integrator/shader_eval.cpp | |
parent | 99a2af76d10e05a18987be5d554ada197b1ca086 (diff) | |
parent | 7c9e4099854a4fc8eab4db97173c1aacd25f9e08 (diff) |
Merge branch 'master' into soc-2021-uv-edge-select-supportsoc-2021-uv-edge-select-support
Diffstat (limited to 'intern/cycles/integrator/shader_eval.cpp')
-rw-r--r-- | intern/cycles/integrator/shader_eval.cpp | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/intern/cycles/integrator/shader_eval.cpp b/intern/cycles/integrator/shader_eval.cpp index 9ec530c81df..95a1adeb016 100644 --- a/intern/cycles/integrator/shader_eval.cpp +++ b/intern/cycles/integrator/shader_eval.cpp @@ -158,14 +158,16 @@ bool ShaderEval::eval_gpu(Device *device, /* Execute work on GPU in chunk, so we can cancel. * TODO : query appropriate size from device.*/ - const int64_t chunk_size = 65536; + const int32_t chunk_size = 65536; - void *d_input = (void *)input.device_pointer; - void *d_output = (void *)output.device_pointer; + device_ptr d_input = input.device_pointer; + device_ptr d_output = output.device_pointer; - for (int64_t d_offset = 0; d_offset < work_size; d_offset += chunk_size) { - int64_t d_work_size = std::min(chunk_size, work_size - d_offset); - void *args[] = {&d_input, &d_output, &d_offset, &d_work_size}; + assert(work_size <= 0x7fffffff); + for (int32_t d_offset = 0; d_offset < int32_t(work_size); d_offset += chunk_size) { + int32_t d_work_size = std::min(chunk_size, int32_t(work_size) - d_offset); + + DeviceKernelArguments args(&d_input, &d_output, &d_offset, &d_work_size); queue->enqueue(kernel, d_work_size, args); queue->synchronize(); |