diff options
| author | iwubcode <iwubcode@users.noreply.github.com> | 2023-12-09 19:00:11 -0600 |
|---|---|---|
| committer | iwubcode <iwubcode@users.noreply.github.com> | 2023-12-15 11:06:02 -0600 |
| commit | 12dd15c8ddb587e2f76351b59e0097940061485b (patch) | |
| tree | 0a0ba100b4b60b208ee5dfbeceeb73d6d990bb90 /Source/Core/VideoCommon/TextureConfig.h | |
| parent | 370474a7cbec12c9647b155f9d7cc4409c438df8 (diff) | |
VideoBackends / VideoCommon: add type enum to dictate whether a texture is a 2D texture, a texture array, or a cube map; support 2D texture type across backends
Co-authored-by: TellowKrinkle <tellowkrinkle@gmail.com>
Diffstat (limited to 'Source/Core/VideoCommon/TextureConfig.h')
| -rw-r--r-- | Source/Core/VideoCommon/TextureConfig.h | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/Source/Core/VideoCommon/TextureConfig.h b/Source/Core/VideoCommon/TextureConfig.h index 75d7387f17..462b3dddff 100644 --- a/Source/Core/VideoCommon/TextureConfig.h +++ b/Source/Core/VideoCommon/TextureConfig.h @@ -39,16 +39,22 @@ enum AbstractTextureFlag : u32 { AbstractTextureFlag_RenderTarget = (1 << 0), // Texture is used as a framebuffer. AbstractTextureFlag_ComputeImage = (1 << 1), // Texture is used as a compute image. - AbstractTextureFlag_CubeMap = (1 << 2), // Texture is used as a cube map. +}; + +enum class AbstractTextureType +{ + Texture_2DArray, // Used as a 2D texture array + Texture_2D, // Used as a normal 2D texture + Texture_CubeMap, // Used as a cube map texture }; struct TextureConfig { constexpr TextureConfig() = default; constexpr TextureConfig(u32 width_, u32 height_, u32 levels_, u32 layers_, u32 samples_, - AbstractTextureFormat format_, u32 flags_) + AbstractTextureFormat format_, u32 flags_, AbstractTextureType type_) : width(width_), height(height_), levels(levels_), layers(layers_), samples(samples_), - format(format_), flags(flags_) + format(format_), flags(flags_), type(type_) { } @@ -62,7 +68,6 @@ struct TextureConfig bool IsMultisampled() const { return samples > 1; } bool IsRenderTarget() const { return (flags & AbstractTextureFlag_RenderTarget) != 0; } bool IsComputeImage() const { return (flags & AbstractTextureFlag_ComputeImage) != 0; } - bool IsCubeMap() const { return (flags & AbstractTextureFlag_CubeMap) != 0; } u32 width = 0; u32 height = 0; @@ -71,6 +76,7 @@ struct TextureConfig u32 samples = 1; AbstractTextureFormat format = AbstractTextureFormat::RGBA8; u32 flags = 0; + AbstractTextureType type = AbstractTextureType::Texture_2DArray; }; namespace std |
