obs/gs/texture: Add new flags and fix flag decoding

This commit is contained in:
Michael Fabian 'Xaymar' Dirks 2021-04-26 04:19:21 +02:00
parent 1d183ae680
commit 96c7b101e5
2 changed files with 8 additions and 2 deletions

View File

@ -26,10 +26,14 @@
static uint32_t decode_flags(gs::texture::flags texture_flags) static uint32_t decode_flags(gs::texture::flags texture_flags)
{ {
uint32_t flags = 0; uint32_t flags = 0;
if (exact(texture_flags, gs::texture::flags::Dynamic)) if (has(texture_flags, gs::texture::flags::Dynamic))
flags |= GS_DYNAMIC; flags |= GS_DYNAMIC;
if (exact(texture_flags, gs::texture::flags::BuildMipMaps)) if (has(texture_flags, gs::texture::flags::BuildMipMaps))
flags |= GS_BUILD_MIPMAPS; flags |= GS_BUILD_MIPMAPS;
if (has(texture_flags, gs::texture::flags::Shared))
flags |= GS_SHARED_TEX;
if (has(texture_flags, gs::texture::flags::GlobalShared))
flags |= GS_SHARED_KM_TEX;
return flags; return flags;
} }

View File

@ -29,6 +29,8 @@ namespace gs {
None, None,
Dynamic, Dynamic,
BuildMipMaps, BuildMipMaps,
Shared,
GlobalShared,
}; };
protected: protected: