summaryrefslogtreecommitdiff
path: root/tools/gfx/cuda/cuda-shader-object.cpp
diff options
context:
space:
mode:
authorEllie Hermaszewska <ellieh@nvidia.com>2024-10-29 14:49:26 +0800
committerGitHub <noreply@github.com>2024-10-29 14:49:26 +0800
commitf65d756bff8d4c5cbc15bd0322a2ae8e6b896a21 (patch)
treeea1d61342cd29368e19135000ec2948813096205 /tools/gfx/cuda/cuda-shader-object.cpp
parenta729c15e9dce9f5116a38afc66329ab2ca4cea54 (diff)
format
* format * Minor test fixes * enable checking cpp format in ci
Diffstat (limited to 'tools/gfx/cuda/cuda-shader-object.cpp')
-rw-r--r--tools/gfx/cuda/cuda-shader-object.cpp37
1 files changed, 19 insertions, 18 deletions
diff --git a/tools/gfx/cuda/cuda-shader-object.cpp b/tools/gfx/cuda/cuda-shader-object.cpp
index 02b4cf695..e7033e403 100644
--- a/tools/gfx/cuda/cuda-shader-object.cpp
+++ b/tools/gfx/cuda/cuda-shader-object.cpp
@@ -1,10 +1,9 @@
// cuda-shader-object.cpp
#include "cuda-shader-object.h"
-#include "cuda-shader-object-layout.h"
-#include "cuda-resource-views.h"
-
#include "cuda-helper-functions.h"
+#include "cuda-resource-views.h"
+#include "cuda-shader-object-layout.h"
namespace gfx
{
@@ -37,7 +36,8 @@ Result ShaderObjectData::setCount(Index count)
m_bufferResource = new BufferResourceImpl(desc);
if (count)
{
- SLANG_CUDA_RETURN_ON_FAIL(cuMemAlloc((CUdeviceptr*)&m_bufferResource->m_cudaMemory, (size_t)count));
+ SLANG_CUDA_RETURN_ON_FAIL(
+ cuMemAlloc((CUdeviceptr*)&m_bufferResource->m_cudaMemory, (size_t)count));
}
IResourceView::Desc viewDesc = {};
viewDesc.type = IResourceView::Type::UnorderedAccess;
@@ -167,7 +167,7 @@ SLANG_NO_THROW GfxCount SLANG_MCALL ShaderObjectImpl::getEntryPointCount()
}
SLANG_NO_THROW Result SLANG_MCALL
- ShaderObjectImpl::getEntryPoint(GfxIndex index, IShaderObject** outEntryPoint)
+ShaderObjectImpl::getEntryPoint(GfxIndex index, IShaderObject** outEntryPoint)
{
*outEntryPoint = nullptr;
return SLANG_OK;
@@ -184,7 +184,7 @@ SLANG_NO_THROW Size SLANG_MCALL ShaderObjectImpl::getSize()
}
SLANG_NO_THROW Result SLANG_MCALL
- ShaderObjectImpl::setData(ShaderOffset const& offset, void const* data, Size size)
+ShaderObjectImpl::setData(ShaderOffset const& offset, void const* data, Size size)
{
Size temp = m_data.getCount() - (Size)offset.uniformOffset;
size = Math::Min(size, temp);
@@ -196,7 +196,7 @@ SLANG_NO_THROW Result SLANG_MCALL
}
SLANG_NO_THROW Result SLANG_MCALL
- ShaderObjectImpl::setResource(ShaderOffset const& offset, IResourceView* resourceView)
+ShaderObjectImpl::setResource(ShaderOffset const& offset, IResourceView* resourceView)
{
if (!resourceView)
return SLANG_OK;
@@ -255,7 +255,7 @@ SLANG_NO_THROW Result SLANG_MCALL
}
SLANG_NO_THROW Result SLANG_MCALL
- ShaderObjectImpl::setObject(ShaderOffset const& offset, IShaderObject* object)
+ShaderObjectImpl::setObject(ShaderOffset const& offset, IShaderObject* object)
{
SLANG_RETURN_ON_FAIL(Super::setObject(offset, object));
@@ -266,21 +266,20 @@ SLANG_NO_THROW Result SLANG_MCALL
switch (bindingRange.bindingType)
{
default:
- {
- void* subObjectDataBuffer = subObject->getBuffer();
- SLANG_RETURN_ON_FAIL(setData(offset, &subObjectDataBuffer, sizeof(void*)));
- }
- break;
+ {
+ void* subObjectDataBuffer = subObject->getBuffer();
+ SLANG_RETURN_ON_FAIL(setData(offset, &subObjectDataBuffer, sizeof(void*)));
+ }
+ break;
case slang::BindingType::ExistentialValue:
case slang::BindingType::RawBuffer:
- case slang::BindingType::MutableRawBuffer:
- break;
+ case slang::BindingType::MutableRawBuffer: break;
}
return SLANG_OK;
}
SLANG_NO_THROW Result SLANG_MCALL
- ShaderObjectImpl::setSampler(ShaderOffset const& offset, ISamplerState* sampler)
+ShaderObjectImpl::setSampler(ShaderOffset const& offset, ISamplerState* sampler)
{
SLANG_UNUSED(sampler);
SLANG_UNUSED(offset);
@@ -288,7 +287,9 @@ SLANG_NO_THROW Result SLANG_MCALL
}
SLANG_NO_THROW Result SLANG_MCALL ShaderObjectImpl::setCombinedTextureSampler(
- ShaderOffset const& offset, IResourceView* textureView, ISamplerState* sampler)
+ ShaderOffset const& offset,
+ IResourceView* textureView,
+ ISamplerState* sampler)
{
SLANG_UNUSED(sampler);
setResource(offset, textureView);
@@ -329,7 +330,7 @@ SLANG_NO_THROW GfxCount SLANG_MCALL RootShaderObjectImpl::getEntryPointCount()
}
SLANG_NO_THROW Result SLANG_MCALL
- RootShaderObjectImpl::getEntryPoint(GfxIndex index, IShaderObject** outEntryPoint)
+RootShaderObjectImpl::getEntryPoint(GfxIndex index, IShaderObject** outEntryPoint)
{
returnComPtr(outEntryPoint, entryPointObjects[index]);
return SLANG_OK;