HomeWildfire Games

Uploads cube textures in SkyManager via DeviceCommandContext.

Description

Uploads cube textures in SkyManager via DeviceCommandContext.

Commented By: Stan

Differential Revision: https://code.wildfiregames.com/D4421

Event Timeline

DeviceCommandContext.cpp
In file included from ../../../source/lib/precompiled.h:74,
                 from ../../../source/pch/graphics/precompiled.h:18,
                 from ../../../source/renderer/backend/gl/DeviceCommandContext.cpp:18:
../../../source/renderer/backend/gl/DeviceCommandContext.cpp: In member function ‘void Renderer::Backend::GL::CDeviceCommandContext::UploadTextureRegion(Renderer::Backend::GL::CTexture*, Renderer::Backend::Format, const void*, size_t, uint32_t, uint32_t, uint32_t, uint32_t, uint32_t, uint32_t)’:
../../../source/renderer/backend/gl/DeviceCommandContext.cpp:89:48: warning: comparison of unsigned expression in ‘>= 0’ is always true [-Wtype-limits]
   89 |                         ENSURE(level == 0 && 0 <= layer && layer < 6);
      |                                              ~~^~~~~~~~
../../../source/lib/debug.h:295:22: note: in definition of macro ‘ENSURE’
  295 |                 if(!(expr))\
      |                      ^~~~

(This might have been here before.)

DeviceCommandContext.cpp
In file included from ../../../source/lib/precompiled.h:74,
                 from ../../../source/pch/graphics/precompiled.h:18,
                 from ../../../source/renderer/backend/gl/DeviceCommandContext.cpp:18:
../../../source/renderer/backend/gl/DeviceCommandContext.cpp: In member function ‘void Renderer::Backend::GL::CDeviceCommandContext::UploadTextureRegion(Renderer::Backend::GL::CTexture*, Renderer::Backend::Format, const void*, size_t, uint32_t, uint32_t, uint32_t, uint32_t, uint32_t, uint32_t)’:
../../../source/renderer/backend/gl/DeviceCommandContext.cpp:89:48: warning: comparison of unsigned expression in ‘>= 0’ is always true [-Wtype-limits]
   89 |                         ENSURE(level == 0 && 0 <= layer && layer < 6);
      |                                              ~~^~~~~~~~
../../../source/lib/debug.h:295:22: note: in definition of macro ‘ENSURE’
  295 |                 if(!(expr))\
      |                      ^~~~

(This might have been here before.)

Thanks! I’ll fix that.

vladislavbelov added inline comments.Jan 8 2022, 9:56 AM
/ps/trunk/source/renderer/backend/gl/DeviceCommandContext.cpp
89

layer is unsigned, so it can’t be less than zero. That what’s the warning about.