diff options
| author | Mai <mai.iam2048@gmail.com> | 2023-12-17 14:40:39 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-12-17 14:40:39 -0500 |
| commit | f589c04aa7684e72f9866d1d85e9cb32b3d281ca (patch) | |
| tree | d5cf7a22f818ad48ee5c6f4e333772058b9660ab /Source/Core/VideoCommon/TextureConfig.h | |
| parent | e6c85bf8f09c54297bc71fd37432d7daa7f22bcc (diff) | |
| parent | 12dd15c8ddb587e2f76351b59e0097940061485b (diff) | |
Merge pull request #12372 from iwubcode/texture_usage_flag
VideoBackends / VideoCommon: add type enum to dictate how the texture is used; support texture 2d
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 |
