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:
authorLukas Stockner <lukas.stockner@freenet.de>2016-06-26 01:46:27 +0300
committerLukas Stockner <lukas.stockner@freenet.de>2016-06-26 01:51:16 +0300
commit2a69b09b62c2f339f68883c9c7edfc4a6dd1ef8d (patch)
tree6cbeeeed64af02addaa0015081486ec62976bf05 /intern/cycles/kernel/kernel_random.h
parentaff81c6393a56727b4ed5c37f1055b4c2a525677 (diff)
Fix T48732 v2: New GGX breaks OpenCL kernel
As far as I can see, the second issue there was that the functions receive a pointer to a member variable of the ShaderData, which is stored in global memory. However, this means that the pointer points to global memory as well, therefore OpenCL requires the ccl_addr_space "keyword" in front of the pointer. With this commit, the OpenCL kernels build on Linux with the Intel CPU OpenCL runtime - however, they already did without the change and I don't have an AMD card, so I can't really test whether the AMD runtime is happy as well now.
Diffstat (limited to 'intern/cycles/kernel/kernel_random.h')
-rw-r--r--intern/cycles/kernel/kernel_random.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/intern/cycles/kernel/kernel_random.h b/intern/cycles/kernel/kernel_random.h
index 631a2cb75de..bf3c25d2cb2 100644
--- a/intern/cycles/kernel/kernel_random.h
+++ b/intern/cycles/kernel/kernel_random.h
@@ -232,14 +232,14 @@ ccl_device void path_rng_end(KernelGlobals *kg, ccl_global uint *rng_state, RNG
/* Linear Congruential Generator */
-ccl_device uint lcg_step_uint(uint *rng)
+ccl_device uint lcg_step_uint(ccl_addr_space uint *rng)
{
/* implicit mod 2^32 */
*rng = (1103515245*(*rng) + 12345);
return *rng;
}
-ccl_device float lcg_step_float(uint *rng)
+ccl_device float lcg_step_float(ccl_addr_space uint *rng)
{
/* implicit mod 2^32 */
*rng = (1103515245*(*rng) + 12345);
@@ -309,7 +309,7 @@ ccl_device_inline void path_state_branch(PathState *state, int branch, int num_b
state->num_samples = state->num_samples*num_branches;
}
-ccl_device_inline uint lcg_state_init(RNG *rng, const PathState *state, uint scramble)
+ccl_device_inline uint lcg_state_init(RNG *rng, const ccl_addr_space PathState *state, uint scramble)
{
return lcg_init(*rng + state->rng_offset + state->sample*scramble);
}