Skip to content

Commit 4a4058b

Browse files
added getters for IGPUImage only creation parameters
1 parent 490bec7 commit 4a4058b

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

include/nbl/asset/IImageView.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ template<class ImageType>
1515
class IImageView : public IDescriptor
1616
{
1717
public:
18-
_NBL_STATIC_INLINE_CONSTEXPR size_t remaining_mip_levels = ~static_cast<size_t>(0u);
19-
_NBL_STATIC_INLINE_CONSTEXPR size_t remaining_array_layers = ~static_cast<size_t>(0u);
18+
static inline constexpr size_t remaining_mip_levels = ~static_cast<size_t>(0u);
19+
static inline constexpr size_t remaining_array_layers = ~static_cast<size_t>(0u);
2020

2121
// no flags for now, yet
2222
enum E_CREATE_FLAGS

include/nbl/video/IGPUImage.h

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ class IGPUImage : public asset::IImage, public IDeviceMemoryBacked, public IBack
2828
};
2929
struct SCreationParams : asset::IImage::SCreationParams, IDeviceMemoryBacked::SCreationParams
3030
{
31-
// stuff below is irrelevant in OpenGL backend
3231
E_TILING tiling = ET_OPTIMAL;
3332
E_LAYOUT initialLayout = EL_UNDEFINED;
3433

@@ -39,6 +38,12 @@ class IGPUImage : public asset::IImage, public IDeviceMemoryBacked, public IBack
3938
}
4039
};
4140

41+
//!
42+
inline E_TILING getTiling() const {return m_tiling;}
43+
44+
//!
45+
inline E_LAYOUT getInitialLayout() const { return m_initialLayout; }
46+
4247
//!
4348
E_OBJECT_TYPE getObjectType() const override { return EOT_IMAGE; }
4449

@@ -143,14 +148,16 @@ class IGPUImage : public asset::IImage, public IDeviceMemoryBacked, public IBack
143148
virtual const void* getNativeHandle() const = 0;
144149

145150
protected:
151+
const E_TILING m_tiling;
152+
const E_LAYOUT m_initialLayout;
146153

147154
_NBL_INTERFACE_CHILD(IGPUImage) {}
148155

149156
//! constructor
150157
IGPUImage(core::smart_refctd_ptr<const ILogicalDevice>&& dev,
151158
const IDeviceMemoryBacked::SDeviceMemoryRequirements& reqs,
152159
SCreationParams&& _params
153-
) : IImage(_params), IDeviceMemoryBacked(std::move(_params),reqs), IBackendObject(std::move(dev)) {}
160+
) : IImage(_params), IDeviceMemoryBacked(std::move(_params),reqs), IBackendObject(std::move(dev)), m_tiling(_params.tiling), m_initialLayout(_params.initialLayout) {}
154161
};
155162

156163

0 commit comments

Comments
 (0)