Skip to content

Commit fa6d871

Browse files
squash warnings (shader-slang#3378)
Co-authored-by: Yong He <yonghe@outlook.com>
1 parent 1050e0e commit fa6d871

File tree

4 files changed

+6
-3
lines changed

4 files changed

+6
-3
lines changed

source/slang/slang-ir.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -1399,7 +1399,7 @@ struct IRResourceTypeBase : IRType
13991399
bool isShadow() { return getIntVal(getIsShadowInst()) != 0; }
14001400
bool isCombined() { return getIntVal(getIsCombinedInst()) != 0; }
14011401

1402-
SlangResourceShape getShape() { return (SlangResourceShape)((uint32_t)GetBaseShape() | (isArray() ? SLANG_TEXTURE_ARRAY_FLAG : 0)); }
1402+
SlangResourceShape getShape() { return (SlangResourceShape)((uint32_t)GetBaseShape() | (isArray() ? SLANG_TEXTURE_ARRAY_FLAG : SLANG_RESOURCE_NONE)); }
14031403
SlangResourceAccess getAccess()
14041404
{
14051405
auto constVal = as<IRIntLit>(getOperand(kStdlibTextureAccessParameterIndex));

tools/gfx/cpu/cpu-shader-object.h

+2
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,9 @@ class RootShaderObjectImpl : public ShaderObjectImpl
8181
virtual SLANG_NO_THROW uint32_t SLANG_MCALL addRef() override;
8282
virtual SLANG_NO_THROW uint32_t SLANG_MCALL release() override;
8383

84+
// An overload for the `init` virtual function, with a more specific type
8485
Result init(IDevice* device, RootShaderObjectLayoutImpl* programLayout);
86+
using ShaderObjectImpl::init;
8587

8688
RootShaderObjectLayoutImpl* getLayout();
8789

tools/gfx/renderer-shared.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,7 @@ struct ExtendedShaderObjectTypeList
342342
void add(const ExtendedShaderObjectType& component)
343343
{
344344
componentIDs.add(component.componentID);
345-
components.add(slang::SpecializationArg{ slang::SpecializationArg::Kind::Type, component.slangType });
345+
components.add(slang::SpecializationArg{ slang::SpecializationArg::Kind::Type, {component.slangType} });
346346
}
347347
void addRange(const ExtendedShaderObjectTypeList& list)
348348
{

tools/test-server/test-server-main.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ SlangResult innerMain(StdWriters* stdWriters, slang::IGlobalSession* sharedSessi
117117
SLANG_RETURN_ON_FAIL(session->createCompileRequest(compileRequest.writeRef()));
118118

119119
// Do any app specific configuration
120-
for (int i = 0; i < SLANG_WRITER_CHANNEL_COUNT_OF; ++i)
120+
for (int i = 0; i < int{SLANG_WRITER_CHANNEL_COUNT_OF}; ++i)
121121
{
122122
const auto channel = SlangWriterChannel(i);
123123
compileRequest->setWriter(channel, stdWriters->getWriter(channel));
@@ -504,6 +504,7 @@ SlangResult TestServer::execute()
504504
while (m_connection->isActive() && !m_quit)
505505
{
506506
// Failure doesn't make the execution terminate
507+
[[maybe_unused]]
507508
const SlangResult res = _executeSingle();
508509
}
509510

0 commit comments

Comments
 (0)