Skip to content

Commit

Permalink
add clang-format QualifierAlignment: Left (#153)
Browse files Browse the repository at this point in the history
  • Loading branch information
skallweitNV authored Jan 22, 2025
1 parent d367340 commit bf818a7
Show file tree
Hide file tree
Showing 8 changed files with 11 additions and 10 deletions.
1 change: 1 addition & 0 deletions .clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,4 @@ AlignTrailingComments: true
ReflowComments: true
CommentPragmas: '^\\.+'
PenaltyBreakComment: 0
QualifierAlignment: Left
4 changes: 2 additions & 2 deletions src/sgl/core/bitmap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1617,7 +1617,7 @@ void Bitmap::read_exr(Stream* stream)
std::sort(
channels_sorted.begin(),
channels_sorted.end(),
[&](auto const& v0, auto const& v1) { return channel_key(v0) < channel_key(v1); }
[&](const auto& v0, const auto& v1) { return channel_key(v0) < channel_key(v1); }
);

// Create pixel struct.
Expand Down Expand Up @@ -2142,7 +2142,7 @@ void Bitmap::read_exr(Stream* stream)
std::sort(
channels_sorted.begin(),
channels_sorted.end(),
[&](auto const& v0, auto const& v1) { return channel_key(v0) < channel_key(v1); }
[&](const auto& v0, const auto& v1) { return channel_key(v0) < channel_key(v1); }
);

// Create pixel struct.
Expand Down
2 changes: 1 addition & 1 deletion src/sgl/device/device.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ class Device::PipelineCreationAPIDispatcher : public gfx::IPipelineCreationAPIDi
SGL_THROW("Failed to unload NVAPI.");
}

virtual SLANG_NO_THROW SlangResult SLANG_MCALL queryInterface(SlangUUID const& uuid, void** outObject) override
virtual SLANG_NO_THROW SlangResult SLANG_MCALL queryInterface(const SlangUUID& uuid, void** outObject) override
{
if (uuid == SlangUUID SLANG_UUID_IPipelineCreationAPIDispatcher) {
*outObject = static_cast<gfx::IPipelineCreationAPIDispatcher*>(this);
Expand Down
4 changes: 2 additions & 2 deletions src/sgl/device/reflection.h
Original file line number Diff line number Diff line change
Expand Up @@ -563,7 +563,7 @@ class SGL_API TypeReflection : public BaseReflectionObjectImpl<slang::TypeReflec

Kind kind() const { return static_cast<Kind>(slang_target()->getKind()); }

char const* name() const { return slang_target()->getName(); }
const char* name() const { return slang_target()->getName(); }

std::string full_name() const;

Expand Down Expand Up @@ -804,7 +804,7 @@ class SGL_API FunctionReflection : public BaseReflectionObjectImpl<slang::Functi
}

/// Function name.
char const* name() const { return slang_target()->getName(); }
const char* name() const { return slang_target()->getName(); }

/// Function return type.
ref<const TypeReflection> return_type() { return detail::from_slang(m_owner, slang_target()->getReturnType()); }
Expand Down
2 changes: 1 addition & 1 deletion src/sgl/device/shader_object.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ void ShaderObject::set_acceleration_structure(
));
}

void ShaderObject::set_data(const ShaderOffset& offset, void const* data, size_t size)
void ShaderObject::set_data(const ShaderOffset& offset, const void* data, size_t size)
{
SLANG_CALL(m_shader_object->setData(gfx_shader_offset(offset), data, size));
}
Expand Down
2 changes: 1 addition & 1 deletion src/sgl/device/shader_object.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class SGL_API ShaderObject : public Object {
virtual void set_sampler(const ShaderOffset& offset, const ref<Sampler>& sampler);
virtual void
set_acceleration_structure(const ShaderOffset& offset, const ref<AccelerationStructure>& acceleration_structure);
virtual void set_data(const ShaderOffset& offset, void const* data, size_t size);
virtual void set_data(const ShaderOffset& offset, const void* data, size_t size);

virtual void set_cuda_tensor_view(const ShaderOffset& offset, const cuda::TensorView& tensor_view, bool is_uav);
virtual void get_cuda_interop_buffers(std::vector<ref<cuda::InteropBuffer>>& cuda_interop_buffers) const;
Expand Down
4 changes: 2 additions & 2 deletions src/sgl/device/slang_utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ class UnownedSlangBlob : public ISlangBlob {
{
}

virtual SLANG_NO_THROW void const* SLANG_MCALL getBufferPointer() override { return m_data; }
virtual SLANG_NO_THROW const void* SLANG_MCALL getBufferPointer() override { return m_data; }
virtual SLANG_NO_THROW size_t SLANG_MCALL getBufferSize() override { return m_size; }

virtual SLANG_NO_THROW SlangResult SLANG_MCALL queryInterface(SlangUUID const& uuid, void** outObject) override
virtual SLANG_NO_THROW SlangResult SLANG_MCALL queryInterface(const SlangUUID& uuid, void** outObject) override
{
if (uuid == SLANG_UUID_ISlangBlob) {
*outObject = static_cast<ISlangBlob*>(this);
Expand Down
2 changes: 1 addition & 1 deletion src/sgl/stl/bit.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ namespace bit {
((sizeof(To) == sizeof(From)) && std::is_trivially_copyable<From>::value && std::is_trivial<To>::value
&& (std::is_copy_constructible<To>::value || std::is_move_constructible<To>::value)),
To>::type
bit_cast(From const& src) noexcept
bit_cast(const From& src) noexcept
{
To dst;
std::memcpy(&dst, &src, sizeof(To));
Expand Down

0 comments on commit bf818a7

Please sign in to comment.