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:
authorMichael Jones <michael_p_jones@apple.com>2021-11-29 17:49:53 +0300
committerMichael Jones <michael_p_jones@apple.com>2021-11-29 17:56:06 +0300
commit98a5c924fca00b4b39e75a4fc16585cfa040398c (patch)
tree19ec6546e095717e7c1e3ed922f46655f7255a08 /intern/cycles/integrator/shader_eval.cpp
parentf9add2d63e57e883e6befc5f6c8beffa869905ce (diff)
Cycles: Metal readiness: Specify DeviceQueue::enqueue arg types
This patch adds new arg-type parameters to `DeviceQueue::enqueue` and its overrides. This is in preparation for the Metal backend which needs this information for correct argument encoding. Ref T92212 Reviewed By: brecht Maniphest Tasks: T92212 Differential Revision: https://developer.blender.org/D13357
Diffstat (limited to 'intern/cycles/integrator/shader_eval.cpp')
-rw-r--r--intern/cycles/integrator/shader_eval.cpp14
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();