2011-04-27 11:58:34 +00:00
|
|
|
/*
|
2013-08-18 14:16:15 +00:00
|
|
|
* Copyright 2011-2013 Blender Foundation
|
2011-04-27 11:58:34 +00:00
|
|
|
*
|
2013-08-18 14:16:15 +00:00
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
* you may not use this file except in compliance with the License.
|
|
|
|
* You may obtain a copy of the License at
|
2011-04-27 11:58:34 +00:00
|
|
|
*
|
2013-08-18 14:16:15 +00:00
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
2011-04-27 11:58:34 +00:00
|
|
|
*
|
2013-08-18 14:16:15 +00:00
|
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
* See the License for the specific language governing permissions and
|
2014-12-25 01:50:24 +00:00
|
|
|
* limitations under the License.
|
2011-04-27 11:58:34 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
/* OpenCL kernel entry points - unfinished */
|
|
|
|
|
2015-05-21 12:40:04 +00:00
|
|
|
#include "../../kernel_compat_opencl.h"
|
|
|
|
#include "../../kernel_math.h"
|
|
|
|
#include "../../kernel_types.h"
|
|
|
|
#include "../../kernel_globals.h"
|
2016-10-22 21:38:42 +00:00
|
|
|
#include "../../kernel_image_opencl.h"
|
2011-04-27 11:58:34 +00:00
|
|
|
|
2015-05-21 12:40:04 +00:00
|
|
|
#include "../../kernel_film.h"
|
2016-02-05 13:11:16 +00:00
|
|
|
|
2016-02-17 00:20:46 +00:00
|
|
|
#if defined(__COMPILE_ONLY_MEGAKERNEL__) || !defined(__NO_BAKING__)
|
2016-02-12 17:33:43 +00:00
|
|
|
# include "../../kernel_path.h"
|
|
|
|
# include "../../kernel_path_branched.h"
|
2016-02-05 13:11:16 +00:00
|
|
|
#else /* __COMPILE_ONLY_MEGAKERNEL__ */
|
|
|
|
/* Include only actually used headers for the case
|
|
|
|
* when path tracing kernels are not needed.
|
|
|
|
*/
|
2016-02-12 17:33:43 +00:00
|
|
|
# include "../../kernel_random.h"
|
|
|
|
# include "../../kernel_differential.h"
|
|
|
|
# include "../../kernel_montecarlo.h"
|
|
|
|
# include "../../kernel_projection.h"
|
|
|
|
# include "../../geom/geom.h"
|
2016-07-11 10:28:45 +00:00
|
|
|
# include "../../bvh/bvh.h"
|
2016-02-05 13:11:16 +00:00
|
|
|
|
2016-02-12 17:33:43 +00:00
|
|
|
# include "../../kernel_accumulate.h"
|
|
|
|
# include "../../kernel_camera.h"
|
|
|
|
# include "../../kernel_shader.h"
|
2016-02-17 00:20:46 +00:00
|
|
|
#endif /* defined(__COMPILE_ONLY_MEGAKERNEL__) || !defined(__NO_BAKING__) */
|
2016-02-05 13:11:16 +00:00
|
|
|
|
2015-05-21 12:40:04 +00:00
|
|
|
#include "../../kernel_bake.h"
|
2011-04-27 11:58:34 +00:00
|
|
|
|
Cycles: OpenCL kernel split
This commit contains all the work related on the AMD megakernel split work
which was mainly done by Varun Sundar, George Kyriazis and Lenny Wang, plus
some help from Sergey Sharybin, Martijn Berger, Thomas Dinges and likely
someone else which we're forgetting to mention.
Currently only AMD cards are enabled for the new split kernel, but it is
possible to force split opencl kernel to be used by setting the following
environment variable: CYCLES_OPENCL_SPLIT_KERNEL_TEST=1.
Not all the features are supported yet, and that being said no motion blur,
camera blur, SSS and volumetrics for now. Also transparent shadows are
disabled on AMD device because of some compiler bug.
This kernel is also only implements regular path tracing and supporting
branched one will take a bit. Branched path tracing is exposed to the
interface still, which is a bit misleading and will be hidden there soon.
More feature will be enabled once they're ported to the split kernel and
tested.
Neither regular CPU nor CUDA has any difference, they're generating the
same exact code, which means no regressions/improvements there.
Based on the research paper:
https://research.nvidia.com/sites/default/files/publications/laine2013hpg_paper.pdf
Here's the documentation:
https://docs.google.com/document/d/1LuXW-CV-sVJkQaEGZlMJ86jZ8FmoPfecaMdR-oiWbUY/edit
Design discussion of the patch:
https://developer.blender.org/T44197
Differential Revision: https://developer.blender.org/D1200
2015-05-09 14:34:30 +00:00
|
|
|
#ifdef __COMPILE_ONLY_MEGAKERNEL__
|
|
|
|
|
2011-05-20 12:26:01 +00:00
|
|
|
__kernel void kernel_ocl_path_trace(
|
2013-11-15 23:17:10 +00:00
|
|
|
ccl_constant KernelData *data,
|
|
|
|
ccl_global float *buffer,
|
|
|
|
ccl_global uint *rng_state,
|
2011-05-20 12:26:01 +00:00
|
|
|
|
|
|
|
#define KERNEL_TEX(type, ttype, name) \
|
2013-11-15 23:17:10 +00:00
|
|
|
ccl_global type *name,
|
2015-05-21 12:40:04 +00:00
|
|
|
#include "../../kernel_textures.h"
|
2011-05-20 12:26:01 +00:00
|
|
|
|
2011-09-16 13:14:02 +00:00
|
|
|
int sample,
|
2011-12-20 12:25:37 +00:00
|
|
|
int sx, int sy, int sw, int sh, int offset, int stride)
|
2011-04-27 11:58:34 +00:00
|
|
|
{
|
|
|
|
KernelGlobals kglobals, *kg = &kglobals;
|
2011-05-20 12:26:01 +00:00
|
|
|
|
2011-04-27 11:58:34 +00:00
|
|
|
kg->data = data;
|
|
|
|
|
2011-05-20 12:26:01 +00:00
|
|
|
#define KERNEL_TEX(type, ttype, name) \
|
2011-11-22 13:15:19 +00:00
|
|
|
kg->name = name;
|
2015-05-21 12:40:04 +00:00
|
|
|
#include "../../kernel_textures.h"
|
2011-05-20 12:26:01 +00:00
|
|
|
|
|
|
|
int x = sx + get_global_id(0);
|
|
|
|
int y = sy + get_global_id(1);
|
2011-04-27 11:58:34 +00:00
|
|
|
|
2011-05-20 12:26:01 +00:00
|
|
|
if(x < sx + sw && y < sy + sh)
|
2013-08-28 14:36:47 +00:00
|
|
|
kernel_path_trace(kg, buffer, rng_state, sample, x, y, offset, stride);
|
2011-04-27 11:58:34 +00:00
|
|
|
}
|
|
|
|
|
2016-02-05 13:11:16 +00:00
|
|
|
#else /* __COMPILE_ONLY_MEGAKERNEL__ */
|
Cycles: OpenCL kernel split
This commit contains all the work related on the AMD megakernel split work
which was mainly done by Varun Sundar, George Kyriazis and Lenny Wang, plus
some help from Sergey Sharybin, Martijn Berger, Thomas Dinges and likely
someone else which we're forgetting to mention.
Currently only AMD cards are enabled for the new split kernel, but it is
possible to force split opencl kernel to be used by setting the following
environment variable: CYCLES_OPENCL_SPLIT_KERNEL_TEST=1.
Not all the features are supported yet, and that being said no motion blur,
camera blur, SSS and volumetrics for now. Also transparent shadows are
disabled on AMD device because of some compiler bug.
This kernel is also only implements regular path tracing and supporting
branched one will take a bit. Branched path tracing is exposed to the
interface still, which is a bit misleading and will be hidden there soon.
More feature will be enabled once they're ported to the split kernel and
tested.
Neither regular CPU nor CUDA has any difference, they're generating the
same exact code, which means no regressions/improvements there.
Based on the research paper:
https://research.nvidia.com/sites/default/files/publications/laine2013hpg_paper.pdf
Here's the documentation:
https://docs.google.com/document/d/1LuXW-CV-sVJkQaEGZlMJ86jZ8FmoPfecaMdR-oiWbUY/edit
Design discussion of the patch:
https://developer.blender.org/T44197
Differential Revision: https://developer.blender.org/D1200
2015-05-09 14:34:30 +00:00
|
|
|
|
|
|
|
__kernel void kernel_ocl_shader(
|
2013-11-15 23:17:10 +00:00
|
|
|
ccl_constant KernelData *data,
|
Cycles: OpenCL kernel split
This commit contains all the work related on the AMD megakernel split work
which was mainly done by Varun Sundar, George Kyriazis and Lenny Wang, plus
some help from Sergey Sharybin, Martijn Berger, Thomas Dinges and likely
someone else which we're forgetting to mention.
Currently only AMD cards are enabled for the new split kernel, but it is
possible to force split opencl kernel to be used by setting the following
environment variable: CYCLES_OPENCL_SPLIT_KERNEL_TEST=1.
Not all the features are supported yet, and that being said no motion blur,
camera blur, SSS and volumetrics for now. Also transparent shadows are
disabled on AMD device because of some compiler bug.
This kernel is also only implements regular path tracing and supporting
branched one will take a bit. Branched path tracing is exposed to the
interface still, which is a bit misleading and will be hidden there soon.
More feature will be enabled once they're ported to the split kernel and
tested.
Neither regular CPU nor CUDA has any difference, they're generating the
same exact code, which means no regressions/improvements there.
Based on the research paper:
https://research.nvidia.com/sites/default/files/publications/laine2013hpg_paper.pdf
Here's the documentation:
https://docs.google.com/document/d/1LuXW-CV-sVJkQaEGZlMJ86jZ8FmoPfecaMdR-oiWbUY/edit
Design discussion of the patch:
https://developer.blender.org/T44197
Differential Revision: https://developer.blender.org/D1200
2015-05-09 14:34:30 +00:00
|
|
|
ccl_global uint4 *input,
|
|
|
|
ccl_global float4 *output,
|
2015-12-30 14:04:01 +00:00
|
|
|
ccl_global float *output_luma,
|
2011-05-20 12:26:01 +00:00
|
|
|
|
|
|
|
#define KERNEL_TEX(type, ttype, name) \
|
2013-11-15 23:17:10 +00:00
|
|
|
ccl_global type *name,
|
2015-05-21 12:40:04 +00:00
|
|
|
#include "../../kernel_textures.h"
|
2011-05-20 12:26:01 +00:00
|
|
|
|
Cycles: OpenCL kernel split
This commit contains all the work related on the AMD megakernel split work
which was mainly done by Varun Sundar, George Kyriazis and Lenny Wang, plus
some help from Sergey Sharybin, Martijn Berger, Thomas Dinges and likely
someone else which we're forgetting to mention.
Currently only AMD cards are enabled for the new split kernel, but it is
possible to force split opencl kernel to be used by setting the following
environment variable: CYCLES_OPENCL_SPLIT_KERNEL_TEST=1.
Not all the features are supported yet, and that being said no motion blur,
camera blur, SSS and volumetrics for now. Also transparent shadows are
disabled on AMD device because of some compiler bug.
This kernel is also only implements regular path tracing and supporting
branched one will take a bit. Branched path tracing is exposed to the
interface still, which is a bit misleading and will be hidden there soon.
More feature will be enabled once they're ported to the split kernel and
tested.
Neither regular CPU nor CUDA has any difference, they're generating the
same exact code, which means no regressions/improvements there.
Based on the research paper:
https://research.nvidia.com/sites/default/files/publications/laine2013hpg_paper.pdf
Here's the documentation:
https://docs.google.com/document/d/1LuXW-CV-sVJkQaEGZlMJ86jZ8FmoPfecaMdR-oiWbUY/edit
Design discussion of the patch:
https://developer.blender.org/T44197
Differential Revision: https://developer.blender.org/D1200
2015-05-09 14:34:30 +00:00
|
|
|
int type, int sx, int sw, int offset, int sample)
|
2013-08-30 23:49:38 +00:00
|
|
|
{
|
|
|
|
KernelGlobals kglobals, *kg = &kglobals;
|
|
|
|
|
|
|
|
kg->data = data;
|
|
|
|
|
|
|
|
#define KERNEL_TEX(type, ttype, name) \
|
|
|
|
kg->name = name;
|
2015-05-21 12:40:04 +00:00
|
|
|
#include "../../kernel_textures.h"
|
2013-08-30 23:49:38 +00:00
|
|
|
|
|
|
|
int x = sx + get_global_id(0);
|
|
|
|
|
2015-12-30 14:04:01 +00:00
|
|
|
if(x < sx + sw) {
|
|
|
|
kernel_shader_evaluate(kg,
|
|
|
|
input,
|
|
|
|
output,
|
|
|
|
output_luma,
|
|
|
|
(ShaderEvalType)type,
|
|
|
|
x,
|
|
|
|
sample);
|
|
|
|
}
|
2013-08-30 23:49:38 +00:00
|
|
|
}
|
|
|
|
|
Cycles: OpenCL kernel split
This commit contains all the work related on the AMD megakernel split work
which was mainly done by Varun Sundar, George Kyriazis and Lenny Wang, plus
some help from Sergey Sharybin, Martijn Berger, Thomas Dinges and likely
someone else which we're forgetting to mention.
Currently only AMD cards are enabled for the new split kernel, but it is
possible to force split opencl kernel to be used by setting the following
environment variable: CYCLES_OPENCL_SPLIT_KERNEL_TEST=1.
Not all the features are supported yet, and that being said no motion blur,
camera blur, SSS and volumetrics for now. Also transparent shadows are
disabled on AMD device because of some compiler bug.
This kernel is also only implements regular path tracing and supporting
branched one will take a bit. Branched path tracing is exposed to the
interface still, which is a bit misleading and will be hidden there soon.
More feature will be enabled once they're ported to the split kernel and
tested.
Neither regular CPU nor CUDA has any difference, they're generating the
same exact code, which means no regressions/improvements there.
Based on the research paper:
https://research.nvidia.com/sites/default/files/publications/laine2013hpg_paper.pdf
Here's the documentation:
https://docs.google.com/document/d/1LuXW-CV-sVJkQaEGZlMJ86jZ8FmoPfecaMdR-oiWbUY/edit
Design discussion of the patch:
https://developer.blender.org/T44197
Differential Revision: https://developer.blender.org/D1200
2015-05-09 14:34:30 +00:00
|
|
|
__kernel void kernel_ocl_bake(
|
2013-11-15 23:17:10 +00:00
|
|
|
ccl_constant KernelData *data,
|
Cycles: OpenCL kernel split
This commit contains all the work related on the AMD megakernel split work
which was mainly done by Varun Sundar, George Kyriazis and Lenny Wang, plus
some help from Sergey Sharybin, Martijn Berger, Thomas Dinges and likely
someone else which we're forgetting to mention.
Currently only AMD cards are enabled for the new split kernel, but it is
possible to force split opencl kernel to be used by setting the following
environment variable: CYCLES_OPENCL_SPLIT_KERNEL_TEST=1.
Not all the features are supported yet, and that being said no motion blur,
camera blur, SSS and volumetrics for now. Also transparent shadows are
disabled on AMD device because of some compiler bug.
This kernel is also only implements regular path tracing and supporting
branched one will take a bit. Branched path tracing is exposed to the
interface still, which is a bit misleading and will be hidden there soon.
More feature will be enabled once they're ported to the split kernel and
tested.
Neither regular CPU nor CUDA has any difference, they're generating the
same exact code, which means no regressions/improvements there.
Based on the research paper:
https://research.nvidia.com/sites/default/files/publications/laine2013hpg_paper.pdf
Here's the documentation:
https://docs.google.com/document/d/1LuXW-CV-sVJkQaEGZlMJ86jZ8FmoPfecaMdR-oiWbUY/edit
Design discussion of the patch:
https://developer.blender.org/T44197
Differential Revision: https://developer.blender.org/D1200
2015-05-09 14:34:30 +00:00
|
|
|
ccl_global uint4 *input,
|
|
|
|
ccl_global float4 *output,
|
2013-08-30 23:49:38 +00:00
|
|
|
|
|
|
|
#define KERNEL_TEX(type, ttype, name) \
|
2013-11-15 23:17:10 +00:00
|
|
|
ccl_global type *name,
|
2015-05-21 12:40:04 +00:00
|
|
|
#include "../../kernel_textures.h"
|
2013-08-30 23:49:38 +00:00
|
|
|
|
2016-01-15 15:00:56 +00:00
|
|
|
int type, int filter, int sx, int sw, int offset, int sample)
|
2011-04-27 11:58:34 +00:00
|
|
|
{
|
|
|
|
KernelGlobals kglobals, *kg = &kglobals;
|
|
|
|
|
|
|
|
kg->data = data;
|
2011-05-20 12:26:01 +00:00
|
|
|
|
|
|
|
#define KERNEL_TEX(type, ttype, name) \
|
2011-11-22 13:15:19 +00:00
|
|
|
kg->name = name;
|
2015-05-21 12:40:04 +00:00
|
|
|
#include "../../kernel_textures.h"
|
2011-04-27 11:58:34 +00:00
|
|
|
|
|
|
|
int x = sx + get_global_id(0);
|
|
|
|
|
2015-05-15 07:30:04 +00:00
|
|
|
if(x < sx + sw) {
|
2015-07-18 14:26:41 +00:00
|
|
|
#ifdef __NO_BAKING__
|
2015-05-15 07:30:04 +00:00
|
|
|
output[x] = make_float4(0.0f, 0.0f, 0.0f, 0.0f);
|
|
|
|
#else
|
2016-01-15 15:00:56 +00:00
|
|
|
kernel_bake_evaluate(kg, input, output, (ShaderEvalType)type, filter, x, offset, sample);
|
2015-05-15 07:30:04 +00:00
|
|
|
#endif
|
|
|
|
}
|
2011-04-27 11:58:34 +00:00
|
|
|
}
|
|
|
|
|
Cycles: OpenCL kernel split
This commit contains all the work related on the AMD megakernel split work
which was mainly done by Varun Sundar, George Kyriazis and Lenny Wang, plus
some help from Sergey Sharybin, Martijn Berger, Thomas Dinges and likely
someone else which we're forgetting to mention.
Currently only AMD cards are enabled for the new split kernel, but it is
possible to force split opencl kernel to be used by setting the following
environment variable: CYCLES_OPENCL_SPLIT_KERNEL_TEST=1.
Not all the features are supported yet, and that being said no motion blur,
camera blur, SSS and volumetrics for now. Also transparent shadows are
disabled on AMD device because of some compiler bug.
This kernel is also only implements regular path tracing and supporting
branched one will take a bit. Branched path tracing is exposed to the
interface still, which is a bit misleading and will be hidden there soon.
More feature will be enabled once they're ported to the split kernel and
tested.
Neither regular CPU nor CUDA has any difference, they're generating the
same exact code, which means no regressions/improvements there.
Based on the research paper:
https://research.nvidia.com/sites/default/files/publications/laine2013hpg_paper.pdf
Here's the documentation:
https://docs.google.com/document/d/1LuXW-CV-sVJkQaEGZlMJ86jZ8FmoPfecaMdR-oiWbUY/edit
Design discussion of the patch:
https://developer.blender.org/T44197
Differential Revision: https://developer.blender.org/D1200
2015-05-09 14:34:30 +00:00
|
|
|
__kernel void kernel_ocl_convert_to_byte(
|
2013-11-15 23:17:10 +00:00
|
|
|
ccl_constant KernelData *data,
|
Cycles: OpenCL kernel split
This commit contains all the work related on the AMD megakernel split work
which was mainly done by Varun Sundar, George Kyriazis and Lenny Wang, plus
some help from Sergey Sharybin, Martijn Berger, Thomas Dinges and likely
someone else which we're forgetting to mention.
Currently only AMD cards are enabled for the new split kernel, but it is
possible to force split opencl kernel to be used by setting the following
environment variable: CYCLES_OPENCL_SPLIT_KERNEL_TEST=1.
Not all the features are supported yet, and that being said no motion blur,
camera blur, SSS and volumetrics for now. Also transparent shadows are
disabled on AMD device because of some compiler bug.
This kernel is also only implements regular path tracing and supporting
branched one will take a bit. Branched path tracing is exposed to the
interface still, which is a bit misleading and will be hidden there soon.
More feature will be enabled once they're ported to the split kernel and
tested.
Neither regular CPU nor CUDA has any difference, they're generating the
same exact code, which means no regressions/improvements there.
Based on the research paper:
https://research.nvidia.com/sites/default/files/publications/laine2013hpg_paper.pdf
Here's the documentation:
https://docs.google.com/document/d/1LuXW-CV-sVJkQaEGZlMJ86jZ8FmoPfecaMdR-oiWbUY/edit
Design discussion of the patch:
https://developer.blender.org/T44197
Differential Revision: https://developer.blender.org/D1200
2015-05-09 14:34:30 +00:00
|
|
|
ccl_global uchar4 *rgba,
|
|
|
|
ccl_global float *buffer,
|
2013-06-21 13:05:08 +00:00
|
|
|
|
|
|
|
#define KERNEL_TEX(type, ttype, name) \
|
2013-11-15 23:17:10 +00:00
|
|
|
ccl_global type *name,
|
2015-05-21 12:40:04 +00:00
|
|
|
#include "../../kernel_textures.h"
|
2013-06-21 13:05:08 +00:00
|
|
|
|
Cycles: OpenCL kernel split
This commit contains all the work related on the AMD megakernel split work
which was mainly done by Varun Sundar, George Kyriazis and Lenny Wang, plus
some help from Sergey Sharybin, Martijn Berger, Thomas Dinges and likely
someone else which we're forgetting to mention.
Currently only AMD cards are enabled for the new split kernel, but it is
possible to force split opencl kernel to be used by setting the following
environment variable: CYCLES_OPENCL_SPLIT_KERNEL_TEST=1.
Not all the features are supported yet, and that being said no motion blur,
camera blur, SSS and volumetrics for now. Also transparent shadows are
disabled on AMD device because of some compiler bug.
This kernel is also only implements regular path tracing and supporting
branched one will take a bit. Branched path tracing is exposed to the
interface still, which is a bit misleading and will be hidden there soon.
More feature will be enabled once they're ported to the split kernel and
tested.
Neither regular CPU nor CUDA has any difference, they're generating the
same exact code, which means no regressions/improvements there.
Based on the research paper:
https://research.nvidia.com/sites/default/files/publications/laine2013hpg_paper.pdf
Here's the documentation:
https://docs.google.com/document/d/1LuXW-CV-sVJkQaEGZlMJ86jZ8FmoPfecaMdR-oiWbUY/edit
Design discussion of the patch:
https://developer.blender.org/T44197
Differential Revision: https://developer.blender.org/D1200
2015-05-09 14:34:30 +00:00
|
|
|
float sample_scale,
|
|
|
|
int sx, int sy, int sw, int sh, int offset, int stride)
|
2011-04-27 11:58:34 +00:00
|
|
|
{
|
2013-06-21 13:05:08 +00:00
|
|
|
KernelGlobals kglobals, *kg = &kglobals;
|
|
|
|
|
|
|
|
kg->data = data;
|
|
|
|
|
|
|
|
#define KERNEL_TEX(type, ttype, name) \
|
|
|
|
kg->name = name;
|
2015-05-21 12:40:04 +00:00
|
|
|
#include "../../kernel_textures.h"
|
2013-06-21 13:05:08 +00:00
|
|
|
|
2011-04-27 11:58:34 +00:00
|
|
|
int x = sx + get_global_id(0);
|
Cycles: OpenCL kernel split
This commit contains all the work related on the AMD megakernel split work
which was mainly done by Varun Sundar, George Kyriazis and Lenny Wang, plus
some help from Sergey Sharybin, Martijn Berger, Thomas Dinges and likely
someone else which we're forgetting to mention.
Currently only AMD cards are enabled for the new split kernel, but it is
possible to force split opencl kernel to be used by setting the following
environment variable: CYCLES_OPENCL_SPLIT_KERNEL_TEST=1.
Not all the features are supported yet, and that being said no motion blur,
camera blur, SSS and volumetrics for now. Also transparent shadows are
disabled on AMD device because of some compiler bug.
This kernel is also only implements regular path tracing and supporting
branched one will take a bit. Branched path tracing is exposed to the
interface still, which is a bit misleading and will be hidden there soon.
More feature will be enabled once they're ported to the split kernel and
tested.
Neither regular CPU nor CUDA has any difference, they're generating the
same exact code, which means no regressions/improvements there.
Based on the research paper:
https://research.nvidia.com/sites/default/files/publications/laine2013hpg_paper.pdf
Here's the documentation:
https://docs.google.com/document/d/1LuXW-CV-sVJkQaEGZlMJ86jZ8FmoPfecaMdR-oiWbUY/edit
Design discussion of the patch:
https://developer.blender.org/T44197
Differential Revision: https://developer.blender.org/D1200
2015-05-09 14:34:30 +00:00
|
|
|
int y = sy + get_global_id(1);
|
2011-04-27 11:58:34 +00:00
|
|
|
|
Cycles: OpenCL kernel split
This commit contains all the work related on the AMD megakernel split work
which was mainly done by Varun Sundar, George Kyriazis and Lenny Wang, plus
some help from Sergey Sharybin, Martijn Berger, Thomas Dinges and likely
someone else which we're forgetting to mention.
Currently only AMD cards are enabled for the new split kernel, but it is
possible to force split opencl kernel to be used by setting the following
environment variable: CYCLES_OPENCL_SPLIT_KERNEL_TEST=1.
Not all the features are supported yet, and that being said no motion blur,
camera blur, SSS and volumetrics for now. Also transparent shadows are
disabled on AMD device because of some compiler bug.
This kernel is also only implements regular path tracing and supporting
branched one will take a bit. Branched path tracing is exposed to the
interface still, which is a bit misleading and will be hidden there soon.
More feature will be enabled once they're ported to the split kernel and
tested.
Neither regular CPU nor CUDA has any difference, they're generating the
same exact code, which means no regressions/improvements there.
Based on the research paper:
https://research.nvidia.com/sites/default/files/publications/laine2013hpg_paper.pdf
Here's the documentation:
https://docs.google.com/document/d/1LuXW-CV-sVJkQaEGZlMJ86jZ8FmoPfecaMdR-oiWbUY/edit
Design discussion of the patch:
https://developer.blender.org/T44197
Differential Revision: https://developer.blender.org/D1200
2015-05-09 14:34:30 +00:00
|
|
|
if(x < sx + sw && y < sy + sh)
|
|
|
|
kernel_film_convert_to_byte(kg, rgba, buffer, sample_scale, x, y, offset, stride);
|
2013-06-21 13:05:08 +00:00
|
|
|
}
|
2011-04-27 11:58:34 +00:00
|
|
|
|
Cycles: OpenCL kernel split
This commit contains all the work related on the AMD megakernel split work
which was mainly done by Varun Sundar, George Kyriazis and Lenny Wang, plus
some help from Sergey Sharybin, Martijn Berger, Thomas Dinges and likely
someone else which we're forgetting to mention.
Currently only AMD cards are enabled for the new split kernel, but it is
possible to force split opencl kernel to be used by setting the following
environment variable: CYCLES_OPENCL_SPLIT_KERNEL_TEST=1.
Not all the features are supported yet, and that being said no motion blur,
camera blur, SSS and volumetrics for now. Also transparent shadows are
disabled on AMD device because of some compiler bug.
This kernel is also only implements regular path tracing and supporting
branched one will take a bit. Branched path tracing is exposed to the
interface still, which is a bit misleading and will be hidden there soon.
More feature will be enabled once they're ported to the split kernel and
tested.
Neither regular CPU nor CUDA has any difference, they're generating the
same exact code, which means no regressions/improvements there.
Based on the research paper:
https://research.nvidia.com/sites/default/files/publications/laine2013hpg_paper.pdf
Here's the documentation:
https://docs.google.com/document/d/1LuXW-CV-sVJkQaEGZlMJ86jZ8FmoPfecaMdR-oiWbUY/edit
Design discussion of the patch:
https://developer.blender.org/T44197
Differential Revision: https://developer.blender.org/D1200
2015-05-09 14:34:30 +00:00
|
|
|
__kernel void kernel_ocl_convert_to_half_float(
|
2014-05-27 11:20:07 +00:00
|
|
|
ccl_constant KernelData *data,
|
Cycles: OpenCL kernel split
This commit contains all the work related on the AMD megakernel split work
which was mainly done by Varun Sundar, George Kyriazis and Lenny Wang, plus
some help from Sergey Sharybin, Martijn Berger, Thomas Dinges and likely
someone else which we're forgetting to mention.
Currently only AMD cards are enabled for the new split kernel, but it is
possible to force split opencl kernel to be used by setting the following
environment variable: CYCLES_OPENCL_SPLIT_KERNEL_TEST=1.
Not all the features are supported yet, and that being said no motion blur,
camera blur, SSS and volumetrics for now. Also transparent shadows are
disabled on AMD device because of some compiler bug.
This kernel is also only implements regular path tracing and supporting
branched one will take a bit. Branched path tracing is exposed to the
interface still, which is a bit misleading and will be hidden there soon.
More feature will be enabled once they're ported to the split kernel and
tested.
Neither regular CPU nor CUDA has any difference, they're generating the
same exact code, which means no regressions/improvements there.
Based on the research paper:
https://research.nvidia.com/sites/default/files/publications/laine2013hpg_paper.pdf
Here's the documentation:
https://docs.google.com/document/d/1LuXW-CV-sVJkQaEGZlMJ86jZ8FmoPfecaMdR-oiWbUY/edit
Design discussion of the patch:
https://developer.blender.org/T44197
Differential Revision: https://developer.blender.org/D1200
2015-05-09 14:34:30 +00:00
|
|
|
ccl_global uchar4 *rgba,
|
|
|
|
ccl_global float *buffer,
|
2014-05-27 11:20:07 +00:00
|
|
|
|
|
|
|
#define KERNEL_TEX(type, ttype, name) \
|
|
|
|
ccl_global type *name,
|
2015-05-21 12:40:04 +00:00
|
|
|
#include "../../kernel_textures.h"
|
2014-05-27 11:20:07 +00:00
|
|
|
|
Cycles: OpenCL kernel split
This commit contains all the work related on the AMD megakernel split work
which was mainly done by Varun Sundar, George Kyriazis and Lenny Wang, plus
some help from Sergey Sharybin, Martijn Berger, Thomas Dinges and likely
someone else which we're forgetting to mention.
Currently only AMD cards are enabled for the new split kernel, but it is
possible to force split opencl kernel to be used by setting the following
environment variable: CYCLES_OPENCL_SPLIT_KERNEL_TEST=1.
Not all the features are supported yet, and that being said no motion blur,
camera blur, SSS and volumetrics for now. Also transparent shadows are
disabled on AMD device because of some compiler bug.
This kernel is also only implements regular path tracing and supporting
branched one will take a bit. Branched path tracing is exposed to the
interface still, which is a bit misleading and will be hidden there soon.
More feature will be enabled once they're ported to the split kernel and
tested.
Neither regular CPU nor CUDA has any difference, they're generating the
same exact code, which means no regressions/improvements there.
Based on the research paper:
https://research.nvidia.com/sites/default/files/publications/laine2013hpg_paper.pdf
Here's the documentation:
https://docs.google.com/document/d/1LuXW-CV-sVJkQaEGZlMJ86jZ8FmoPfecaMdR-oiWbUY/edit
Design discussion of the patch:
https://developer.blender.org/T44197
Differential Revision: https://developer.blender.org/D1200
2015-05-09 14:34:30 +00:00
|
|
|
float sample_scale,
|
|
|
|
int sx, int sy, int sw, int sh, int offset, int stride)
|
2014-05-27 11:20:07 +00:00
|
|
|
{
|
|
|
|
KernelGlobals kglobals, *kg = &kglobals;
|
|
|
|
|
|
|
|
kg->data = data;
|
|
|
|
|
|
|
|
#define KERNEL_TEX(type, ttype, name) \
|
|
|
|
kg->name = name;
|
2015-05-21 12:40:04 +00:00
|
|
|
#include "../../kernel_textures.h"
|
2014-05-27 11:20:07 +00:00
|
|
|
|
|
|
|
int x = sx + get_global_id(0);
|
Cycles: OpenCL kernel split
This commit contains all the work related on the AMD megakernel split work
which was mainly done by Varun Sundar, George Kyriazis and Lenny Wang, plus
some help from Sergey Sharybin, Martijn Berger, Thomas Dinges and likely
someone else which we're forgetting to mention.
Currently only AMD cards are enabled for the new split kernel, but it is
possible to force split opencl kernel to be used by setting the following
environment variable: CYCLES_OPENCL_SPLIT_KERNEL_TEST=1.
Not all the features are supported yet, and that being said no motion blur,
camera blur, SSS and volumetrics for now. Also transparent shadows are
disabled on AMD device because of some compiler bug.
This kernel is also only implements regular path tracing and supporting
branched one will take a bit. Branched path tracing is exposed to the
interface still, which is a bit misleading and will be hidden there soon.
More feature will be enabled once they're ported to the split kernel and
tested.
Neither regular CPU nor CUDA has any difference, they're generating the
same exact code, which means no regressions/improvements there.
Based on the research paper:
https://research.nvidia.com/sites/default/files/publications/laine2013hpg_paper.pdf
Here's the documentation:
https://docs.google.com/document/d/1LuXW-CV-sVJkQaEGZlMJ86jZ8FmoPfecaMdR-oiWbUY/edit
Design discussion of the patch:
https://developer.blender.org/T44197
Differential Revision: https://developer.blender.org/D1200
2015-05-09 14:34:30 +00:00
|
|
|
int y = sy + get_global_id(1);
|
2014-05-27 11:20:07 +00:00
|
|
|
|
Cycles: OpenCL kernel split
This commit contains all the work related on the AMD megakernel split work
which was mainly done by Varun Sundar, George Kyriazis and Lenny Wang, plus
some help from Sergey Sharybin, Martijn Berger, Thomas Dinges and likely
someone else which we're forgetting to mention.
Currently only AMD cards are enabled for the new split kernel, but it is
possible to force split opencl kernel to be used by setting the following
environment variable: CYCLES_OPENCL_SPLIT_KERNEL_TEST=1.
Not all the features are supported yet, and that being said no motion blur,
camera blur, SSS and volumetrics for now. Also transparent shadows are
disabled on AMD device because of some compiler bug.
This kernel is also only implements regular path tracing and supporting
branched one will take a bit. Branched path tracing is exposed to the
interface still, which is a bit misleading and will be hidden there soon.
More feature will be enabled once they're ported to the split kernel and
tested.
Neither regular CPU nor CUDA has any difference, they're generating the
same exact code, which means no regressions/improvements there.
Based on the research paper:
https://research.nvidia.com/sites/default/files/publications/laine2013hpg_paper.pdf
Here's the documentation:
https://docs.google.com/document/d/1LuXW-CV-sVJkQaEGZlMJ86jZ8FmoPfecaMdR-oiWbUY/edit
Design discussion of the patch:
https://developer.blender.org/T44197
Differential Revision: https://developer.blender.org/D1200
2015-05-09 14:34:30 +00:00
|
|
|
if(x < sx + sw && y < sy + sh)
|
|
|
|
kernel_film_convert_to_half_float(kg, rgba, buffer, sample_scale, x, y, offset, stride);
|
2014-05-27 11:20:07 +00:00
|
|
|
}
|
|
|
|
|
2017-01-26 06:41:48 +00:00
|
|
|
__kernel void kernel_ocl_zero_buffer(ccl_global float4 *buffer, ulong size, ulong offset)
|
|
|
|
{
|
|
|
|
size_t i = get_global_id(0) + get_global_id(1) * get_global_size(0);
|
|
|
|
|
|
|
|
if(i < size / sizeof(float4)) {
|
|
|
|
buffer[i+offset/sizeof(float4)] = make_float4(0.0f, 0.0f, 0.0f, 0.0f);
|
|
|
|
}
|
|
|
|
else if(i == size / sizeof(float4)) {
|
|
|
|
ccl_global uchar *b = (ccl_global uchar*)&buffer[i+offset/sizeof(float4)];
|
|
|
|
|
|
|
|
for(i = 0; i < size % sizeof(float4); i++) {
|
|
|
|
*(b++) = 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-02-05 13:11:16 +00:00
|
|
|
#endif /* __COMPILE_ONLY_MEGAKERNEL__ */
|