summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEllie Hermaszewska <ellieh@nvidia.com>2023-12-06 10:28:23 +0800
committerGitHub <noreply@github.com>2023-12-05 18:28:23 -0800
commitfa6d8717d02912697c09f2d7de802723ac6d6e47 (patch)
tree65c3662b6cd47ffd56cc0b5727df31daf46f8c0e
parent1050e0eb96d6c8e7a6cfb253458155e1014625c3 (diff)
squash warnings (#3378)
Co-authored-by: Yong He <yonghe@outlook.com>
-rw-r--r--source/slang/slang-ir.h2
-rw-r--r--tools/gfx/cpu/cpu-shader-object.h2
-rw-r--r--tools/gfx/renderer-shared.h2
-rw-r--r--tools/test-server/test-server-main.cpp3
4 files changed, 6 insertions, 3 deletions
diff --git a/source/slang/slang-ir.h b/source/slang/slang-ir.h
index 6b055b19e..f1a4bdf3f 100644
--- a/source/slang/slang-ir.h
+++ b/source/slang/slang-ir.h
@@ -1399,7 +1399,7 @@ struct IRResourceTypeBase : IRType
bool isShadow() { return getIntVal(getIsShadowInst()) != 0; }
bool isCombined() { return getIntVal(getIsCombinedInst()) != 0; }
- SlangResourceShape getShape() { return (SlangResourceShape)((uint32_t)GetBaseShape() | (isArray() ? SLANG_TEXTURE_ARRAY_FLAG : 0)); }
+ SlangResourceShape getShape() { return (SlangResourceShape)((uint32_t)GetBaseShape() | (isArray() ? SLANG_TEXTURE_ARRAY_FLAG : SLANG_RESOURCE_NONE)); }
SlangResourceAccess getAccess()
{
auto constVal = as<IRIntLit>(getOperand(kStdlibTextureAccessParameterIndex));
diff --git a/tools/gfx/cpu/cpu-shader-object.h b/tools/gfx/cpu/cpu-shader-object.h
index 5d0b5c366..2be703dc5 100644
--- a/tools/gfx/cpu/cpu-shader-object.h
+++ b/tools/gfx/cpu/cpu-shader-object.h
@@ -81,7 +81,9 @@ public:
virtual SLANG_NO_THROW uint32_t SLANG_MCALL addRef() override;
virtual SLANG_NO_THROW uint32_t SLANG_MCALL release() override;
+ // An overload for the `init` virtual function, with a more specific type
Result init(IDevice* device, RootShaderObjectLayoutImpl* programLayout);
+ using ShaderObjectImpl::init;
RootShaderObjectLayoutImpl* getLayout();
diff --git a/tools/gfx/renderer-shared.h b/tools/gfx/renderer-shared.h
index 9e208c34c..d39b64873 100644
--- a/tools/gfx/renderer-shared.h
+++ b/tools/gfx/renderer-shared.h
@@ -342,7 +342,7 @@ struct ExtendedShaderObjectTypeList
void add(const ExtendedShaderObjectType& component)
{
componentIDs.add(component.componentID);
- components.add(slang::SpecializationArg{ slang::SpecializationArg::Kind::Type, component.slangType });
+ components.add(slang::SpecializationArg{ slang::SpecializationArg::Kind::Type, {component.slangType} });
}
void addRange(const ExtendedShaderObjectTypeList& list)
{
diff --git a/tools/test-server/test-server-main.cpp b/tools/test-server/test-server-main.cpp
index b37f8b29f..9f7376556 100644
--- a/tools/test-server/test-server-main.cpp
+++ b/tools/test-server/test-server-main.cpp
@@ -117,7 +117,7 @@ SlangResult innerMain(StdWriters* stdWriters, slang::IGlobalSession* sharedSessi
SLANG_RETURN_ON_FAIL(session->createCompileRequest(compileRequest.writeRef()));
// Do any app specific configuration
- for (int i = 0; i < SLANG_WRITER_CHANNEL_COUNT_OF; ++i)
+ for (int i = 0; i < int{SLANG_WRITER_CHANNEL_COUNT_OF}; ++i)
{
const auto channel = SlangWriterChannel(i);
compileRequest->setWriter(channel, stdWriters->getWriter(channel));
@@ -504,6 +504,7 @@ SlangResult TestServer::execute()
while (m_connection->isActive() && !m_quit)
{
// Failure doesn't make the execution terminate
+ [[maybe_unused]]
const SlangResult res = _executeSingle();
}