Metal: Optimize SSR shader for Apple Silicon #106231

Merged
Jeroen Bakker merged 3 commits from Jason-Fielder/blender:EEVEE_SSR_OptiMetal into main 2023-04-03 08:37:35 +02:00
2216 changed files with 7042 additions and 13289 deletions
Showing only changes of commit 4c5fa3434d - Show all commits

View File

@ -130,7 +130,7 @@ PenaltyReturnTypeOnItsOwnLine: 10000
#
PenaltyBreakAssignment: 100
AllowShortFunctionsOnASingleLine: None
AllowShortFunctionsOnASingleLine: Empty
SortIncludes: true

View File

@ -1,5 +1,5 @@
# SPDX-License-Identifier: GPL-2.0-or-later
# Copyright 2006 Blender Foundation. All rights reserved.
# Copyright 2006 Blender Foundation
# -----------------------------------------------------------------------------
# Early Initialization

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,5 +1,5 @@
# SPDX-License-Identifier: GPL-2.0-or-later
# Copyright 2022 Blender Foundation. All rights reserved.
# Copyright 2022 Blender Foundation
# This file is used to test the system for headers & symbols.
# Variables should use the `HAVE_` prefix.

View File

@ -1,5 +1,5 @@
# SPDX-License-Identifier: GPL-2.0-or-later
# Copyright 2006 Blender Foundation. All rights reserved.
# Copyright 2006 Blender Foundation
macro(list_insert_after
list_id item_check item_add

View File

@ -1,5 +1,5 @@
# SPDX-License-Identifier: GPL-2.0-or-later
# Copyright 2016 Blender Foundation. All rights reserved.
# Copyright 2016 Blender Foundation
# Libraries configuration for Apple.

View File

@ -1,5 +1,5 @@
# SPDX-License-Identifier: GPL-2.0-or-later
# Copyright 2016 Blender Foundation. All rights reserved.
# Copyright 2016 Blender Foundation
# Xcode and system configuration for Apple.

View File

@ -1,5 +1,5 @@
# SPDX-License-Identifier: GPL-2.0-or-later
# Copyright 2022 Blender Foundation. All rights reserved.
# Copyright 2022 Blender Foundation
# Auto update existing CMake caches for new libraries.

View File

@ -1,5 +1,5 @@
# SPDX-License-Identifier: GPL-2.0-or-later
# Copyright 2016 Blender Foundation. All rights reserved.
# Copyright 2016 Blender Foundation
# Libraries configuration for any *nix system including Linux and Unix (excluding APPLE).
@ -645,7 +645,7 @@ if(WITH_GHOST_WAYLAND)
else()
# Rocky8 packages have too old a version, a newer version exist in the pre-compiled libraries.
find_path(WAYLAND_PROTOCOLS_DIR
NAMES unstable/xdg-decoration/xdg-decoration-unstable-v1.xml
NAMES staging/xdg-activation/xdg-activation-v1.xml
PATH_SUFFIXES share/wayland-protocols
PATHS ${LIBDIR}/wayland-protocols
)

View File

@ -1,5 +1,5 @@
# SPDX-License-Identifier: GPL-2.0-or-later
# Copyright 2016 Blender Foundation. All rights reserved.
# Copyright 2016 Blender Foundation
# Libraries configuration for Windows.

View File

@ -1,5 +1,5 @@
# SPDX-License-Identifier: GPL-2.0-or-later
# Copyright 2006 Blender Foundation. All rights reserved.
# Copyright 2006 Blender Foundation
# Libs that adhere to strict flags
add_subdirectory(curve_fit_nd)

View File

@ -1,5 +1,5 @@
# SPDX-License-Identifier: GPL-2.0-or-later
# Copyright 2008 Blender Foundation. All rights reserved.
# Copyright 2008 Blender Foundation
set(INC
include

View File

@ -1,5 +1,5 @@
# SPDX-License-Identifier: GPL-2.0-or-later
# Copyright 2006 Blender Foundation. All rights reserved.
# Copyright 2006 Blender Foundation
# avoid noisy warnings
if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID MATCHES "Clang")

View File

@ -1,5 +1,5 @@
# SPDX-License-Identifier: GPL-2.0-or-later
# Copyright 2012 Blender Foundation. All rights reserved.
# Copyright 2012 Blender Foundation
set(INC
.

View File

@ -1,5 +1,5 @@
# SPDX-License-Identifier: GPL-2.0-or-later
# Copyright 2006 Blender Foundation. All rights reserved.
# Copyright 2006 Blender Foundation
set(INC
.

View File

@ -1,5 +1,5 @@
# SPDX-License-Identifier: GPL-2.0-or-later
# Copyright 2006 Blender Foundation. All rights reserved.
# Copyright 2006 Blender Foundation
set(INC
.

View File

@ -1,5 +1,5 @@
# SPDX-License-Identifier: GPL-2.0-or-later
# Copyright 2019 Blender Foundation. All rights reserved.
# Copyright 2019 Blender Foundation
# Build Draco library.
add_subdirectory(draco)

View File

@ -1,5 +1,5 @@
# SPDX-License-Identifier: GPL-2.0-or-later
# Copyright 2016 Blender Foundation. All rights reserved.
# Copyright 2016 Blender Foundation
# Too noisy for code we don't maintain.
if(CMAKE_COMPILER_IS_GNUCC)

View File

@ -1,5 +1,5 @@
# SPDX-License-Identifier: GPL-2.0-or-later
# Copyright 2016 Blender Foundation. All rights reserved.
# Copyright 2016 Blender Foundation
set(INC
src

View File

@ -1,5 +1,5 @@
# SPDX-License-Identifier: GPL-2.0-or-later
# Copyright 2014 Blender Foundation. All rights reserved.
# Copyright 2014 Blender Foundation
set(INC
.

View File

@ -1,5 +1,5 @@
# SPDX-License-Identifier: GPL-2.0-or-later
# Copyright 2014 Blender Foundation. All rights reserved.
# Copyright 2014 Blender Foundation
# avoid noisy warnings
if(CMAKE_COMPILER_IS_GNUCC)

View File

@ -1,5 +1,5 @@
# SPDX-License-Identifier: GPL-2.0-or-later
# Copyright 2021 Blender Foundation. All rights reserved.
# Copyright 2021 Blender Foundation
set(INC
.

View File

@ -1,5 +1,5 @@
# SPDX-License-Identifier: GPL-2.0-or-later
# Copyright 2006 Blender Foundation. All rights reserved.
# Copyright 2006 Blender Foundation
# avoid noisy warnings
if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID MATCHES "Clang")

View File

@ -1,5 +1,5 @@
# SPDX-License-Identifier: GPL-2.0-or-later
# Copyright 2006 Blender Foundation. All rights reserved.
# Copyright 2006 Blender Foundation
remove_strict_flags()

View File

@ -1,5 +1,5 @@
# SPDX-License-Identifier: GPL-2.0-or-later
# Copyright 2016 Blender Foundation. All rights reserved.
# Copyright 2016 Blender Foundation
# The Original Code is: all of this file.
# Contributor(s): Sebastian Barschkis (sebbas).

View File

@ -1,5 +1,5 @@
# SPDX-License-Identifier: GPL-2.0-or-later
# Copyright 2019 Blender Foundation. All rights reserved.
# Copyright 2019 Blender Foundation
# avoid noisy warnings
if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID MATCHES "Clang")

View File

@ -1,5 +1,5 @@
# SPDX-License-Identifier: GPL-2.0-or-later
# Copyright 2006 Blender Foundation. All rights reserved.
# Copyright 2006 Blender Foundation
set(INC
.

View File

@ -1,5 +1,5 @@
# SPDX-License-Identifier: GPL-2.0-or-later
# Copyright 2017 Blender Foundation. All rights reserved.
# Copyright 2017 Blender Foundation
# The Original Code is: all of this file.
# Contributor(s): IRIE Shinsuke.

View File

@ -1,5 +1,5 @@
# SPDX-License-Identifier: GPL-2.0-or-later
# Copyright 2022 Blender Foundation. All rights reserved.
# Copyright 2022 Blender Foundation
set(INC
.

View File

@ -1,5 +1,5 @@
/* SPDX-License-Identifier: GPL-2.0-or-later
* Copyright 2022 Blender Foundation. All rights reserved. */
* Copyright 2022 Blender Foundation */
#ifdef __APPLE__
# include <MoltenVK/vk_mvk_moltenvk.h>

View File

@ -1,5 +1,5 @@
# SPDX-License-Identifier: GPL-2.0-or-later
# Copyright 2013 Blender Foundation. All rights reserved.
# Copyright 2013 Blender Foundation
set(INC
.

View File

@ -1,5 +1,5 @@
# SPDX-License-Identifier: GPL-2.0-or-later
# Copyright 2012 Blender Foundation. All rights reserved.
# Copyright 2012 Blender Foundation
set(INC
.

View File

@ -1,5 +1,5 @@
# SPDX-License-Identifier: GPL-2.0-or-later
# Copyright 2006 Blender Foundation. All rights reserved.
# Copyright 2006 Blender Foundation
# add_subdirectory(atomic) # header only
add_subdirectory(atomic)

View File

@ -1,5 +1,5 @@
# SPDX-License-Identifier: GPL-2.0-or-later
# Copyright 2020 Blender Foundation. All rights reserved.
# Copyright 2020 Blender Foundation
set(INC
.

View File

@ -38,10 +38,8 @@
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* The Original Code is Copyright (C) 2016 Blender Foundation.
* All rights reserved.
*
* The Original Code is: adapted from jemalloc.
* The Original Code is adapted from jemalloc.
* Modifications Copyright (C) 2016 Blender Foundation.
*/
/** \file

View File

@ -38,10 +38,8 @@
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* The Original Code is Copyright (C) 2016 Blender Foundation.
* All rights reserved.
*
* The Original Code is: adapted from jemalloc.
* The Original Code is adapted from jemalloc.
* Modifications Copyright (C) 2016 Blender Foundation.
*/
/** \file

View File

@ -38,10 +38,8 @@
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* The Original Code is Copyright (C) 2016 Blender Foundation.
* All rights reserved.
*
* The Original Code is: adapted from jemalloc.
* The Original Code is adapted from jemalloc.
* Modifications Copyright (C) 2016 Blender Foundation.
*/
/** \file

View File

@ -38,10 +38,8 @@
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* The Original Code is Copyright (C) 2016 Blender Foundation.
* All rights reserved.
*
* The Original Code is: adapted from jemalloc.
* The Original Code is adapted from jemalloc.
* Modifications Copyright (C) 2016 Blender Foundation.
*/
/** \file

View File

@ -17,9 +17,7 @@ OIIOOutputDriver::OIIOOutputDriver(const string_view filepath,
{
}
OIIOOutputDriver::~OIIOOutputDriver()
{
}
OIIOOutputDriver::~OIIOOutputDriver() {}
void OIIOOutputDriver::write_render_tile(const Tile &tile)
{

View File

@ -22,9 +22,7 @@ OpenGLDisplayDriver::OpenGLDisplayDriver(const function<bool()> &gl_context_enab
{
}
OpenGLDisplayDriver::~OpenGLDisplayDriver()
{
}
OpenGLDisplayDriver::~OpenGLDisplayDriver() {}
/* --------------------------------------------------------------------
* Update procedure.

View File

@ -149,9 +149,7 @@ void OpenGLShader::bind(int width, int height)
glUniform2f(fullscreen_location_, width, height);
}
void OpenGLShader::unbind()
{
}
void OpenGLShader::unbind() {}
uint OpenGLShader::get_shader_program()
{

View File

@ -20,13 +20,9 @@
CCL_NAMESPACE_BEGIN
ParticleCurveData::ParticleCurveData()
{
}
ParticleCurveData::ParticleCurveData() {}
ParticleCurveData::~ParticleCurveData()
{
}
ParticleCurveData::~ParticleCurveData() {}
static float shaperadius(float shape, float root, float tip, float time)
{

View File

@ -22,9 +22,7 @@ CCL_NAMESPACE_BEGIN
template<typename K, typename T, typename Flags = uint> class id_map {
public:
id_map(Scene *scene_) : scene(scene_)
{
}
id_map(Scene *scene_) : scene(scene_) {}
~id_map()
{
@ -262,9 +260,7 @@ struct GeometryKey {
void *id;
Geometry::Type geometry_type;
GeometryKey(void *id, Geometry::Type geometry_type) : id(id), geometry_type(geometry_type)
{
}
GeometryKey(void *id, Geometry::Type geometry_type) : id(id), geometry_type(geometry_type) {}
bool operator<(const GeometryKey &k) const
{

View File

@ -649,9 +649,7 @@ static void attr_create_subd_uv_map(Scene *scene, Mesh *mesh, BL::Mesh &b_mesh,
/* Compare vertices by sum of their coordinates. */
class VertexAverageComparator {
public:
VertexAverageComparator(const array<float3> &verts) : verts_(verts)
{
}
VertexAverageComparator(const array<float3> &verts) : verts_(verts) {}
bool operator()(const int &vert_idx_a, const int &vert_idx_b)
{

View File

@ -5,13 +5,9 @@
CCL_NAMESPACE_BEGIN
BlenderOutputDriver::BlenderOutputDriver(BL::RenderEngine &b_engine) : b_engine_(b_engine)
{
}
BlenderOutputDriver::BlenderOutputDriver(BL::RenderEngine &b_engine) : b_engine_(b_engine) {}
BlenderOutputDriver::~BlenderOutputDriver()
{
}
BlenderOutputDriver::~BlenderOutputDriver() {}
bool BlenderOutputDriver::read_render_tile(const Tile &tile)
{

View File

@ -67,9 +67,7 @@ BlenderSync::BlenderSync(BL::RenderEngine &b_engine,
max_subdivisions = RNA_int_get(&cscene, "max_subdivisions");
}
BlenderSync::~BlenderSync()
{
}
BlenderSync::~BlenderSync() {}
void BlenderSync::reset(BL::BlendData &b_data, BL::Scene &b_scene)
{

View File

@ -702,9 +702,7 @@ static inline bool object_need_motion_attribute(BObjectInfo &b_ob_info, Scene *s
class EdgeMap {
public:
EdgeMap()
{
}
EdgeMap() {}
void clear()
{

View File

@ -16,18 +16,10 @@ CCL_NAMESPACE_BEGIN
/* SSE replacements */
__forceinline void prefetch_L1(const void * /*ptr*/)
{
}
__forceinline void prefetch_L2(const void * /*ptr*/)
{
}
__forceinline void prefetch_L3(const void * /*ptr*/)
{
}
__forceinline void prefetch_NTA(const void * /*ptr*/)
{
}
__forceinline void prefetch_L1(const void * /*ptr*/) {}
__forceinline void prefetch_L2(const void * /*ptr*/) {}
__forceinline void prefetch_L3(const void * /*ptr*/) {}
__forceinline void prefetch_NTA(const void * /*ptr*/) {}
template<size_t src> __forceinline float extract(const int4 &b)
{

View File

@ -23,9 +23,7 @@ class BVHBuild;
class BVHObjectBinning : public BVHRange {
public:
__forceinline BVHObjectBinning() : leafSAH(FLT_MAX)
{
}
__forceinline BVHObjectBinning() : leafSAH(FLT_MAX) {}
BVHObjectBinning(const BVHRange &job,
BVHReference *prims,

View File

@ -49,9 +49,7 @@ BVHBuild::BVHBuild(const vector<Object *> &objects_,
spatial_min_overlap = 0.0f;
}
BVHBuild::~BVHBuild()
{
}
BVHBuild::~BVHBuild() {}
/* Adding References */

View File

@ -70,9 +70,7 @@ class BVH {
const vector<Geometry *> &geometry,
const vector<Object *> &objects,
Device *device);
virtual ~BVH()
{
}
virtual ~BVH() {}
virtual void replace_geometry(const vector<Geometry *> &geometry,
const vector<Object *> &objects)

View File

@ -18,9 +18,7 @@
CCL_NAMESPACE_BEGIN
BVHStackEntry::BVHStackEntry(const BVHNode *n, int i) : node(n), idx(i)
{
}
BVHStackEntry::BVHStackEntry(const BVHNode *n, int i) : node(n), idx(i) {}
int BVHStackEntry::encodeIdx() const
{

View File

@ -211,9 +211,7 @@ class LeafNode : public BVHNode {
this->visibility = visibility;
}
LeafNode(const LeafNode &other) : BVHNode(other), lo(other.lo), hi(other.hi)
{
}
LeafNode(const LeafNode &other) : BVHNode(other), lo(other.lo), hi(other.hi) {}
bool is_leaf() const
{

View File

@ -183,9 +183,7 @@ class BVHParams {
class BVHReference {
public:
__forceinline BVHReference()
{
}
__forceinline BVHReference() {}
__forceinline BVHReference(const BoundBox &bounds_,
int prim_index_,
@ -307,9 +305,7 @@ struct BVHSpatialBin {
int enter;
int exit;
__forceinline BVHSpatialBin()
{
}
__forceinline BVHSpatialBin() {}
};
/* BVH Spatial Storage

View File

@ -26,9 +26,7 @@ class BVHObjectSplit {
BoundBox left_bounds;
BoundBox right_bounds;
BVHObjectSplit()
{
}
BVHObjectSplit() {}
BVHObjectSplit(BVHBuild *builder,
BVHSpatialStorage *storage,
const BVHRange &range,
@ -64,9 +62,7 @@ class BVHSpatialSplit {
int dim;
float pos;
BVHSpatialSplit() : sah(FLT_MAX), dim(0), pos(0.0f), storage_(NULL), references_(NULL)
{
}
BVHSpatialSplit() : sah(FLT_MAX), dim(0), pos(0.0f), storage_(NULL), references_(NULL) {}
BVHSpatialSplit(const BVHBuild &builder,
BVHSpatialStorage *storage,
const BVHRange &range,
@ -181,9 +177,7 @@ class BVHMixedSplit {
BoundBox bounds;
BVHMixedSplit()
{
}
BVHMixedSplit() {}
__forceinline BVHMixedSplit(BVHBuild *builder,
BVHSpatialStorage *storage,

View File

@ -14,9 +14,7 @@
CCL_NAMESPACE_BEGIN
BVHUnaligned::BVHUnaligned(const vector<Object *> &objects) : objects_(objects)
{
}
BVHUnaligned::BVHUnaligned(const vector<Object *> &objects) : objects_(objects) {}
Transform BVHUnaligned::compute_aligned_space(const BVHObjectBinning &range,
const BVHReference *references) const

View File

@ -40,9 +40,7 @@ template<typename FunctionType> class CPUKernelFunction {
* pointer. */
class KernelInfo {
public:
KernelInfo() : KernelInfo("", nullptr)
{
}
KernelInfo() : KernelInfo("", nullptr) {}
/* TODO(sergey): Use string view, to have higher-level functionality (i.e. comparison) without
* memory allocation. */

View File

@ -70,8 +70,6 @@ NODE_DEFINE(DenoiseParams)
return type;
}
DenoiseParams::DenoiseParams() : Node(get_node_type())
{
}
DenoiseParams::DenoiseParams() : Node(get_node_type()) {}
CCL_NAMESPACE_END

View File

@ -45,9 +45,7 @@ uint Device::devices_initialized_mask = 0;
/* Device */
Device::~Device() noexcept(false)
{
}
Device::~Device() noexcept(false) {}
void Device::build_bvh(BVH *bvh, Progress &progress, bool refit)
{
@ -452,9 +450,7 @@ void *Device::get_cpu_osl_memory()
return nullptr;
}
GPUDevice::~GPUDevice() noexcept(false)
{
}
GPUDevice::~GPUDevice() noexcept(false) {}
bool GPUDevice::load_texture_info()
{

View File

@ -178,9 +178,7 @@ class Device {
}
/* Request cancellation of any long-running work. */
virtual void cancel()
{
}
virtual void cancel() {}
/* Report status and return true if device is ready for rendering. */
virtual bool is_ready(string & /*status*/) const
@ -218,9 +216,7 @@ class Device {
}
/* Called after kernel texture setup, and prior to integrator state setup. */
virtual void optimize_for_scene(Scene * /*scene*/)
{
}
virtual void optimize_for_scene(Scene * /*scene*/) {}
virtual bool is_resident(device_ptr /*key*/, Device *sub_device)
{
@ -350,9 +346,7 @@ class GPUDevice : public Device {
typedef unsigned long long texMemObject;
typedef unsigned long long arrayMemObject;
struct Mem {
Mem() : texobject(0), array(0), use_mapped_host(false)
{
}
Mem() : texobject(0), array(0), use_mapped_host(false) {}
texMemObject texobject;
arrayMemObject array;

View File

@ -18,38 +18,24 @@ class DummyDevice : public Device {
error_msg = info.error_msg;
}
~DummyDevice()
{
}
~DummyDevice() {}
virtual BVHLayoutMask get_bvh_layout_mask() const override
{
return 0;
}
virtual void mem_alloc(device_memory &) override
{
}
virtual void mem_alloc(device_memory &) override {}
virtual void mem_copy_to(device_memory &) override
{
}
virtual void mem_copy_to(device_memory &) override {}
virtual void mem_copy_from(device_memory &, size_t, size_t, size_t, size_t) override
{
}
virtual void mem_copy_from(device_memory &, size_t, size_t, size_t, size_t) override {}
virtual void mem_zero(device_memory &) override
{
}
virtual void mem_zero(device_memory &) override {}
virtual void mem_free(device_memory &) override
{
}
virtual void mem_free(device_memory &) override {}
virtual void const_copy_to(const char *, void *, size_t) override
{
}
virtual void const_copy_to(const char *, void *, size_t) override {}
};
Device *device_dummy_create(const DeviceInfo &info, Stats &stats, Profiler &profiler)

View File

@ -305,9 +305,7 @@ template<typename T> class device_only_memory : public device_memory {
data_elements = max(device_type_traits<T>::num_elements, size_t(1));
}
device_only_memory(device_only_memory &&other) noexcept : device_memory(std::move(other))
{
}
device_only_memory(device_only_memory &&other) noexcept : device_memory(std::move(other)) {}
virtual ~device_only_memory()
{

View File

@ -93,9 +93,7 @@ bool device_metal_init()
return false;
}
void device_metal_info(vector<DeviceInfo> &devices)
{
}
void device_metal_info(vector<DeviceInfo> &devices) {}
string device_metal_capabilities()
{

View File

@ -590,11 +590,10 @@ bool MetalDeviceQueue::enqueue(DeviceKernel kernel,
[mtlComputeCommandEncoder setThreadgroupMemoryLength:shared_mem_bytes atIndex:0];
}
MTLSize size_threadgroups_per_dispatch = MTLSizeMake(
divide_up(work_size, num_threads_per_block), 1, 1);
MTLSize size_threads_per_dispatch = MTLSizeMake(work_size, 1, 1);
MTLSize size_threads_per_threadgroup = MTLSizeMake(num_threads_per_block, 1, 1);
[mtlComputeCommandEncoder dispatchThreadgroups:size_threadgroups_per_dispatch
threadsPerThreadgroup:size_threads_per_threadgroup];
[mtlComputeCommandEncoder dispatchThreads:size_threads_per_dispatch
threadsPerThreadgroup:size_threads_per_threadgroup];
[mtlCommandBuffer_ addCompletedHandler:^(id<MTLCommandBuffer> command_buffer) {
NSString *kernel_name = metal_kernel_pso->function.label;

View File

@ -15,9 +15,7 @@ CCL_NAMESPACE_BEGIN
/* CUDADeviceQueue */
OptiXDeviceQueue::OptiXDeviceQueue(OptiXDevice *device) : CUDADeviceQueue(device)
{
}
OptiXDeviceQueue::OptiXDeviceQueue(OptiXDevice *device) : CUDADeviceQueue(device) {}
void OptiXDeviceQueue::init_execution()
{

View File

@ -36,9 +36,7 @@ struct DeviceKernelArguments {
size_t sizes[MAX_ARGS];
size_t count = 0;
DeviceKernelArguments()
{
}
DeviceKernelArguments() {}
template<class T> DeviceKernelArguments(const T *arg)
{

View File

@ -13,9 +13,7 @@ CCL_NAMESPACE_BEGIN
/* Node Type */
NodeOwner::~NodeOwner()
{
}
NodeOwner::~NodeOwner() {}
Node::Node(const NodeType *type_, ustring name_) : name(name_), type(type_)
{
@ -35,9 +33,7 @@ Node::Node(const NodeType *type_, ustring name_) : name(name_), type(type_)
}
}
Node::~Node()
{
}
Node::~Node() {}
#ifndef NDEBUG
static bool is_socket_float3(const SocketType &socket)

View File

@ -131,9 +131,7 @@ NodeType::NodeType(Type type, const NodeType *base) : type(type), base(base)
}
}
NodeType::~NodeType()
{
}
NodeType::~NodeType() {}
void NodeType::register_input(ustring name,
ustring ui_name,

View File

@ -51,9 +51,7 @@ HdCyclesCamera::HdCyclesCamera(const SdfPath &sprimId) : HdCamera(sprimId)
#endif
}
HdCyclesCamera::~HdCyclesCamera()
{
}
HdCyclesCamera::~HdCyclesCamera() {}
HdDirtyBits HdCyclesCamera::GetInitialDirtyBitsMask() const
{

View File

@ -25,9 +25,7 @@ HdCyclesCurves::HdCyclesCurves(const SdfPath &rprimId
{
}
HdCyclesCurves::~HdCyclesCurves()
{
}
HdCyclesCurves::~HdCyclesCurves() {}
HdDirtyBits HdCyclesCurves::GetInitialDirtyBitsMask() const
{

View File

@ -112,9 +112,7 @@ void HdCyclesDisplayDriver::gl_context_dispose()
#endif
}
void HdCyclesDisplayDriver::next_tile_begin()
{
}
void HdCyclesDisplayDriver::next_tile_begin() {}
bool HdCyclesDisplayDriver::update_begin(const Params &params,
int texture_width,

View File

@ -37,13 +37,9 @@ class HdCyclesVolumeLoader : public VDBImageLoader {
};
#endif
HdCyclesField::HdCyclesField(const SdfPath &bprimId, const TfToken &typeId) : HdField(bprimId)
{
}
HdCyclesField::HdCyclesField(const SdfPath &bprimId, const TfToken &typeId) : HdField(bprimId) {}
HdCyclesField::~HdCyclesField()
{
}
HdCyclesField::~HdCyclesField() {}
HdDirtyBits HdCyclesField::GetInitialDirtyBitsMask() const
{

View File

@ -32,17 +32,11 @@ class DummyHdTask : public HdTask {
}
protected:
void Sync(HdSceneDelegate *delegate, HdTaskContext *ctx, HdDirtyBits *dirtyBits) override
{
}
void Sync(HdSceneDelegate *delegate, HdTaskContext *ctx, HdDirtyBits *dirtyBits) override {}
void Prepare(HdTaskContext *ctx, HdRenderIndex *render_index) override
{
}
void Prepare(HdTaskContext *ctx, HdRenderIndex *render_index) override {}
void Execute(HdTaskContext *ctx) override
{
}
void Execute(HdTaskContext *ctx) override {}
const TfTokenVector &GetRenderTags() const override
{

View File

@ -26,9 +26,7 @@ HdCyclesInstancer::HdCyclesInstancer(HdSceneDelegate *delegate,
{
}
HdCyclesInstancer::~HdCyclesInstancer()
{
}
HdCyclesInstancer::~HdCyclesInstancer() {}
#if PXR_VERSION > 2011
void HdCyclesInstancer::Sync(HdSceneDelegate *sceneDelegate,

View File

@ -29,9 +29,7 @@ HdCyclesLight::HdCyclesLight(const SdfPath &sprimId, const TfToken &lightType)
{
}
HdCyclesLight::~HdCyclesLight()
{
}
HdCyclesLight::~HdCyclesLight() {}
HdDirtyBits HdCyclesLight::GetInitialDirtyBitsMask() const
{

View File

@ -183,13 +183,9 @@ TfStaticData<UsdToCycles> sUsdToCyles;
} // namespace
HdCyclesMaterial::HdCyclesMaterial(const SdfPath &sprimId) : HdMaterial(sprimId)
{
}
HdCyclesMaterial::HdCyclesMaterial(const SdfPath &sprimId) : HdMaterial(sprimId) {}
HdCyclesMaterial::~HdCyclesMaterial()
{
}
HdCyclesMaterial::~HdCyclesMaterial() {}
HdDirtyBits HdCyclesMaterial::GetInitialDirtyBitsMask() const
{

View File

@ -22,9 +22,7 @@ class HdCyclesMaterial final : public PXR_NS::HdMaterial {
PXR_NS::HdDirtyBits *dirtyBits) override;
#if PXR_VERSION < 2011
void Reload() override
{
}
void Reload() override {}
#endif
void Finalize(PXR_NS::HdRenderParam *renderParam) override;

View File

@ -94,9 +94,7 @@ HdCyclesMesh::HdCyclesMesh(const SdfPath &rprimId
{
}
HdCyclesMesh::~HdCyclesMesh()
{
}
HdCyclesMesh::~HdCyclesMesh() {}
HdDirtyBits HdCyclesMesh::GetInitialDirtyBitsMask() const
{

View File

@ -35,9 +35,7 @@ HdCyclesPlugin::HdCyclesPlugin()
#endif
}
HdCyclesPlugin::~HdCyclesPlugin()
{
}
HdCyclesPlugin::~HdCyclesPlugin() {}
bool HdCyclesPlugin::IsSupported() const
{

View File

@ -25,9 +25,7 @@ HdCyclesPoints::HdCyclesPoints(const SdfPath &rprimId
{
}
HdCyclesPoints::~HdCyclesPoints()
{
}
HdCyclesPoints::~HdCyclesPoints() {}
HdDirtyBits HdCyclesPoints::GetInitialDirtyBitsMask() const
{

View File

@ -11,13 +11,9 @@
HDCYCLES_NAMESPACE_OPEN_SCOPE
HdCyclesRenderBuffer::HdCyclesRenderBuffer(const SdfPath &bprimId) : HdRenderBuffer(bprimId)
{
}
HdCyclesRenderBuffer::HdCyclesRenderBuffer(const SdfPath &bprimId) : HdRenderBuffer(bprimId) {}
HdCyclesRenderBuffer::~HdCyclesRenderBuffer()
{
}
HdCyclesRenderBuffer::~HdCyclesRenderBuffer() {}
void HdCyclesRenderBuffer::Finalize(HdRenderParam *renderParam)
{
@ -94,9 +90,7 @@ bool HdCyclesRenderBuffer::IsMapped() const
return _mapped != 0;
}
void HdCyclesRenderBuffer::Resolve()
{
}
void HdCyclesRenderBuffer::Resolve() {}
bool HdCyclesRenderBuffer::IsConverged() const
{

View File

@ -131,9 +131,7 @@ HdCyclesDelegate::HdCyclesDelegate(const HdRenderSettingsMap &settingsMap,
}
}
HdCyclesDelegate::~HdCyclesDelegate()
{
}
HdCyclesDelegate::~HdCyclesDelegate() {}
void HdCyclesDelegate::SetDrivers(const HdDriverVector &drivers)
{

View File

@ -176,8 +176,6 @@ void HdCyclesRenderPass::_Execute(const HdRenderPassStateSharedPtr &renderPassSt
session->draw();
}
void HdCyclesRenderPass::_MarkCollectionDirty()
{
}
void HdCyclesRenderPass::_MarkCollectionDirty() {}
HDCYCLES_NAMESPACE_CLOSE_SCOPE

View File

@ -32,9 +32,7 @@ SceneLock::SceneLock(const HdRenderParam *renderParam)
{
}
SceneLock::~SceneLock()
{
}
SceneLock::~SceneLock() {}
HdCyclesSession::HdCyclesSession(Session *session_, const bool keep_nodes)
: session(session_), keep_nodes(true), _ownCyclesSession(false)

View File

@ -30,9 +30,7 @@ HdCyclesVolume::HdCyclesVolume(const SdfPath &rprimId
{
}
HdCyclesVolume::~HdCyclesVolume()
{
}
HdCyclesVolume::~HdCyclesVolume() {}
HdDirtyBits HdCyclesVolume::GetInitialDirtyBitsMask() const
{

View File

@ -7,9 +7,7 @@
CCL_NAMESPACE_BEGIN
AdaptiveSampling::AdaptiveSampling()
{
}
AdaptiveSampling::AdaptiveSampling() {}
int AdaptiveSampling::align_samples(int start_sample, int num_samples) const
{

View File

@ -9,9 +9,7 @@
CCL_NAMESPACE_BEGIN
PathTraceDisplay::PathTraceDisplay(unique_ptr<DisplayDriver> driver) : driver_(move(driver))
{
}
PathTraceDisplay::PathTraceDisplay(unique_ptr<DisplayDriver> driver) : driver_(move(driver)) {}
void PathTraceDisplay::reset(const BufferParams &buffer_params, const bool reset_rendering)
{

View File

@ -44,9 +44,7 @@ PathTraceWork::PathTraceWork(Device *device,
{
}
PathTraceWork::~PathTraceWork()
{
}
PathTraceWork::~PathTraceWork() {}
RenderBuffers *PathTraceWork::get_render_buffers()
{

View File

@ -142,9 +142,7 @@ class PathTraceWork {
#ifdef WITH_PATH_GUIDING
/* Initializes the per-thread guiding kernel data. */
virtual void guiding_init_kernel_globals(void *, void *, const bool)
{
}
virtual void guiding_init_kernel_globals(void *, void *, const bool) {}
#endif
protected:

View File

@ -189,9 +189,7 @@ void PathTraceWorkCPU::copy_to_display(PathTraceDisplay *display,
display->unmap_texture_buffer();
}
void PathTraceWorkCPU::destroy_gpu_resources(PathTraceDisplay * /*display*/)
{
}
void PathTraceWorkCPU::destroy_gpu_resources(PathTraceDisplay * /*display*/) {}
bool PathTraceWorkCPU::copy_render_buffers_from_device()
{

View File

@ -11,9 +11,7 @@
CCL_NAMESPACE_BEGIN
WorkTileScheduler::WorkTileScheduler()
{
}
WorkTileScheduler::WorkTileScheduler() {}
void WorkTileScheduler::set_accelerated_rt(bool accelerated_rt)
{

View File

@ -43,9 +43,7 @@ ccl_device int bsdf_diffuse_ramp_setup(DiffuseRampBsdf *bsdf)
return SD_BSDF | SD_BSDF_HAS_EVAL;
}
ccl_device void bsdf_diffuse_ramp_blur(ccl_private ShaderClosure *sc, float roughness)
{
}
ccl_device void bsdf_diffuse_ramp_blur(ccl_private ShaderClosure *sc, float roughness) {}
ccl_device Spectrum bsdf_diffuse_ramp_eval(ccl_private const ShaderClosure *sc,
const float3 wi,

View File

@ -91,6 +91,7 @@
#define ccl_gpu_kernel_postfix
#define ccl_gpu_kernel_call(x) x
#define ccl_gpu_kernel_within_bounds(i, n) ((i) < (n))
/* Define a function object where "func" is the lambda body, and additional parameters are used to
* specify captured state */

View File

@ -136,7 +136,7 @@ ccl_gpu_kernel(GPU_KERNEL_BLOCK_NUM_THREADS, GPU_KERNEL_MAX_REGISTERS)
{
const int global_index = ccl_gpu_global_id_x();
if (global_index < work_size) {
if (ccl_gpu_kernel_within_bounds(global_index, work_size)) {
const int state = (path_index_array) ? path_index_array[global_index] : global_index;
ccl_gpu_kernel_call(integrator_intersect_closest(NULL, state, render_buffer));
}
@ -150,7 +150,7 @@ ccl_gpu_kernel(GPU_KERNEL_BLOCK_NUM_THREADS, GPU_KERNEL_MAX_REGISTERS)
{
const int global_index = ccl_gpu_global_id_x();
if (global_index < work_size) {
if (ccl_gpu_kernel_within_bounds(global_index, work_size)) {
const int state = (path_index_array) ? path_index_array[global_index] : global_index;
ccl_gpu_kernel_call(integrator_intersect_shadow(NULL, state));
}
@ -164,7 +164,7 @@ ccl_gpu_kernel(GPU_KERNEL_BLOCK_NUM_THREADS, GPU_KERNEL_MAX_REGISTERS)
{
const int global_index = ccl_gpu_global_id_x();
if (global_index < work_size) {
if (ccl_gpu_kernel_within_bounds(global_index, work_size)) {
const int state = (path_index_array) ? path_index_array[global_index] : global_index;
ccl_gpu_kernel_call(integrator_intersect_subsurface(NULL, state));
}
@ -178,7 +178,7 @@ ccl_gpu_kernel(GPU_KERNEL_BLOCK_NUM_THREADS, GPU_KERNEL_MAX_REGISTERS)
{
const int global_index = ccl_gpu_global_id_x();
if (global_index < work_size) {
if (ccl_gpu_kernel_within_bounds(global_index, work_size)) {
const int state = (path_index_array) ? path_index_array[global_index] : global_index;
ccl_gpu_kernel_call(integrator_intersect_volume_stack(NULL, state));
}
@ -193,7 +193,7 @@ ccl_gpu_kernel(GPU_KERNEL_BLOCK_NUM_THREADS, GPU_KERNEL_MAX_REGISTERS)
{
const int global_index = ccl_gpu_global_id_x();
if (global_index < work_size) {
if (ccl_gpu_kernel_within_bounds(global_index, work_size)) {
const int state = (path_index_array) ? path_index_array[global_index] : global_index;
ccl_gpu_kernel_call(integrator_shade_background(NULL, state, render_buffer));
}
@ -208,7 +208,7 @@ ccl_gpu_kernel(GPU_KERNEL_BLOCK_NUM_THREADS, GPU_KERNEL_MAX_REGISTERS)
{
const int global_index = ccl_gpu_global_id_x();
if (global_index < work_size) {
if (ccl_gpu_kernel_within_bounds(global_index, work_size)) {
const int state = (path_index_array) ? path_index_array[global_index] : global_index;
ccl_gpu_kernel_call(integrator_shade_light(NULL, state, render_buffer));
}
@ -223,7 +223,7 @@ ccl_gpu_kernel(GPU_KERNEL_BLOCK_NUM_THREADS, GPU_KERNEL_MAX_REGISTERS)
{
const int global_index = ccl_gpu_global_id_x();
if (global_index < work_size) {
if (ccl_gpu_kernel_within_bounds(global_index, work_size)) {
const int state = (path_index_array) ? path_index_array[global_index] : global_index;
ccl_gpu_kernel_call(integrator_shade_shadow(NULL, state, render_buffer));
}
@ -238,7 +238,7 @@ ccl_gpu_kernel(GPU_KERNEL_BLOCK_NUM_THREADS, GPU_KERNEL_MAX_REGISTERS)
{
const int global_index = ccl_gpu_global_id_x();
if (global_index < work_size) {
if (ccl_gpu_kernel_within_bounds(global_index, work_size)) {
const int state = (path_index_array) ? path_index_array[global_index] : global_index;
ccl_gpu_kernel_call(integrator_shade_surface(NULL, state, render_buffer));
}
@ -257,7 +257,7 @@ ccl_gpu_kernel(GPU_KERNEL_BLOCK_NUM_THREADS, GPU_KERNEL_MAX_REGISTERS)
{
const int global_index = ccl_gpu_global_id_x();
if (global_index < work_size) {
if (ccl_gpu_kernel_within_bounds(global_index, work_size)) {
const int state = (path_index_array) ? path_index_array[global_index] : global_index;
#if defined(__KERNEL_METAL_APPLE__) && defined(__METALRT__)
@ -281,7 +281,7 @@ ccl_gpu_kernel(GPU_KERNEL_BLOCK_NUM_THREADS, GPU_KERNEL_MAX_REGISTERS)
{
const int global_index = ccl_gpu_global_id_x();
if (global_index < work_size) {
if (ccl_gpu_kernel_within_bounds(global_index, work_size)) {
const int state = (path_index_array) ? path_index_array[global_index] : global_index;
ccl_gpu_kernel_call(integrator_shade_surface_mnee(NULL, state, render_buffer));
}
@ -296,7 +296,7 @@ ccl_gpu_kernel(GPU_KERNEL_BLOCK_NUM_THREADS, GPU_KERNEL_MAX_REGISTERS)
{
const int global_index = ccl_gpu_global_id_x();
if (global_index < work_size) {
if (ccl_gpu_kernel_within_bounds(global_index, work_size)) {
const int state = (path_index_array) ? path_index_array[global_index] : global_index;
ccl_gpu_kernel_call(integrator_shade_volume(NULL, state, render_buffer));
}
@ -492,7 +492,7 @@ ccl_gpu_kernel_threads(GPU_PARALLEL_SORTED_INDEX_DEFAULT_BLOCK_SIZE)
{
const int global_index = ccl_gpu_global_id_x();
if (global_index < work_size) {
if (ccl_gpu_kernel_within_bounds(global_index, work_size)) {
const int from_state = active_terminated_states[active_states_offset + global_index];
const int to_state = active_terminated_states[terminated_states_offset + global_index];
@ -526,7 +526,7 @@ ccl_gpu_kernel_threads(GPU_PARALLEL_SORTED_INDEX_DEFAULT_BLOCK_SIZE)
{
const int global_index = ccl_gpu_global_id_x();
if (global_index < work_size) {
if (ccl_gpu_kernel_within_bounds(global_index, work_size)) {
const int from_state = active_terminated_states[active_states_offset + global_index];
const int to_state = active_terminated_states[terminated_states_offset + global_index];

View File

@ -34,6 +34,7 @@
#define ccl_gpu_kernel_postfix
#define ccl_gpu_kernel_call(x) x
#define ccl_gpu_kernel_within_bounds(i, n) ((i) < (n))
/* Define a function object where "func" is the lambda body, and additional parameters are used to
* specify captured state */

View File

@ -143,6 +143,7 @@ void kernel_gpu_##name::run(thread MetalKernelContext& context, \
#define ccl_gpu_kernel_postfix
#define ccl_gpu_kernel_call(x) context.x
#define ccl_gpu_kernel_within_bounds(i,n) true
/* define a function object where "func" is the lambda body, and additional parameters are used to specify captured state */
#define ccl_gpu_kernel_lambda(func, ...) \

View File

@ -289,9 +289,8 @@ bool metalrt_shadow_all_hit(constant KernelParamsMetal &launch_params_metal,
}
if (ray_tmax >= max_recorded_t) {
/* Accept hit, so that we don't consider any more hits beyond the distance of the
* current hit anymore. */
payload.result = true;
/* Ray hits are not guaranteed to be ordered by distance so don't exit early here.
* Continue search. */
return true;
}

View File

@ -101,6 +101,7 @@ void oneapi_kernel_##name(KernelGlobalsGPU *ccl_restrict kg, \
#endif
#define ccl_gpu_kernel_call(x) ((ONEAPIKernelContext*)kg)->x
#define ccl_gpu_kernel_within_bounds(i, n) ((i) < (n))
#define ccl_gpu_kernel_lambda(func, ...) \
struct KernelLambda \

View File

@ -179,8 +179,8 @@ ccl_device_inline void surface_shader_validate_bsdf_sample(const KernelGlobals k
const float2 org_roughness,
const float org_eta)
{
/* Validate the the bsdf_label and bsdf_roughness_eta functions
* by estimating the values after a bsdf sample. */
/* Validate the #bsdf_label and #bsdf_roughness_eta functions
* by estimating the values after a BSDF sample. */
const int comp_label = bsdf_label(kg, sc, wo);
kernel_assert(org_label == comp_label);

Some files were not shown because too many files have changed in this diff Show More