From 96c7b101e5640ac76f50c4c46d9f1f2f95f84be0 Mon Sep 17 00:00:00 2001 From: Michael Fabian 'Xaymar' Dirks Date: Mon, 26 Apr 2021 04:19:21 +0200 Subject: [PATCH] obs/gs/texture: Add new flags and fix flag decoding --- source/obs/gs/gs-texture.cpp | 8 ++++++-- source/obs/gs/gs-texture.hpp | 2 ++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/source/obs/gs/gs-texture.cpp b/source/obs/gs/gs-texture.cpp index a49d6a1..a61ae51 100644 --- a/source/obs/gs/gs-texture.cpp +++ b/source/obs/gs/gs-texture.cpp @@ -26,10 +26,14 @@ static uint32_t decode_flags(gs::texture::flags texture_flags) { uint32_t flags = 0; - if (exact(texture_flags, gs::texture::flags::Dynamic)) + if (has(texture_flags, gs::texture::flags::Dynamic)) flags |= GS_DYNAMIC; - if (exact(texture_flags, gs::texture::flags::BuildMipMaps)) + if (has(texture_flags, gs::texture::flags::BuildMipMaps)) 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; } diff --git a/source/obs/gs/gs-texture.hpp b/source/obs/gs/gs-texture.hpp index dd93fb1..2364c24 100644 --- a/source/obs/gs/gs-texture.hpp +++ b/source/obs/gs/gs-texture.hpp @@ -29,6 +29,8 @@ namespace gs { None, Dynamic, BuildMipMaps, + Shared, + GlobalShared, }; protected: