From 04db5a95657a8c1ad1db36570eadaeedbea01cbb Mon Sep 17 00:00:00 2001 From: Jay Kwak <82421531+jkwak-work@users.noreply.github.com> Date: Thu, 17 Apr 2025 02:34:39 -0700 Subject: Fix compiler warning with clang 18.1.8 on windows (#6843) * Fix compiler warning with clang 18.1.8 on windows --- tools/gfx/open-gl/render-gl.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'tools/gfx/open-gl/render-gl.cpp') diff --git a/tools/gfx/open-gl/render-gl.cpp b/tools/gfx/open-gl/render-gl.cpp index 5bbee254d..2a0114998 100644 --- a/tools/gfx/open-gl/render-gl.cpp +++ b/tools/gfx/open-gl/render-gl.cpp @@ -1519,12 +1519,12 @@ protected: return static_cast(m_layout.Ptr()); } - GfxCount SLANG_MCALL getEntryPointCount() SLANG_OVERRIDE + SLANG_NO_THROW GfxCount SLANG_MCALL getEntryPointCount() SLANG_OVERRIDE { return (GfxCount)m_entryPoints.getCount(); } - SlangResult SLANG_MCALL getEntryPoint(GfxIndex index, IShaderObject** outEntryPoint) - SLANG_OVERRIDE + SLANG_NO_THROW SlangResult SLANG_MCALL + getEntryPoint(GfxIndex index, IShaderObject** outEntryPoint) SLANG_OVERRIDE { *outEntryPoint = m_entryPoints[index]; m_entryPoints[index]->addRef(); @@ -2510,6 +2510,12 @@ SLANG_NO_THROW Result SLANG_MCALL GLDevice::createTextureResource( { for (int j = 0; j < srcDesc.numMipLevels; j++) { + const void* dataPtr = nullptr; + if (initData) + { + dataPtr = initData[slice].data; + ++slice; + } glTexImage3D( target, j, @@ -2520,7 +2526,7 @@ SLANG_NO_THROW Result SLANG_MCALL GLDevice::createTextureResource( 0, format, formatType, - initData ? initData[slice++].data : nullptr); + dataPtr); } } } -- cgit v1.2.3