Renderer: Implement TextureUsage

This commit is contained in:
Jérôme Leclercq
2021-02-20 19:25:25 +01:00
parent 311cfeaf3c
commit b291f8a21c
3 changed files with 23 additions and 1 deletions

View File

@@ -154,6 +154,26 @@ namespace Nz
TransferDestination,
Undefined
};
enum class TextureUsage
{
ColorOutput,
DepthStencilOutput,
InputAttachment,
ShaderSampling,
TransferSource,
TransferDestination,
Max = TransferDestination
};
template<>
struct EnumAsFlags<TextureUsage>
{
static constexpr TextureUsage max = TextureUsage::Max;
};
using TextureUsageFlags = Flags<TextureUsage>;
}
#endif // NAZARA_ENUMS_RENDERER_HPP

View File

@@ -11,6 +11,7 @@
#include <Nazara/Core/Resource.hpp>
#include <Nazara/Math/Vector3.hpp>
#include <Nazara/Renderer/Config.hpp>
#include <Nazara/Renderer/Enums.hpp>
#include <Nazara/Utility/Enums.hpp>
namespace Nz
@@ -19,6 +20,7 @@ namespace Nz
{
PixelFormat pixelFormat;
ImageType type;
TextureUsageFlags usageFlags = TextureUsage::ShaderSampling | TextureUsage::TransferDestination;
UInt8 mipmapLevel = 1;
unsigned int depth = 1;
unsigned int height;