From f0a38398ae7209a4d5687cd623b4f4951c75b96c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ale=C5=A1=20Mlakar?= Date: Mon, 6 Dec 2021 18:38:23 +0100 Subject: [PATCH] 40-svt: Use BGFX_TEXTURE_BLIT_DST when creating Atlas and Page Table textures so they can be blit to (#2678) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Alesˌ Mlakar --- examples/40-svt/vt.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/40-svt/vt.cpp b/examples/40-svt/vt.cpp index 039c04796..1ff3e6efd 100644 --- a/examples/40-svt/vt.cpp +++ b/examples/40-svt/vt.cpp @@ -440,7 +440,7 @@ PageTable::PageTable(PageCache* _cache, VirtualTextureInfo* _info, PageIndexer* { auto size = m_info->GetPageTableSize(); m_quadtree = BX_NEW(VirtualTexture::getAllocator(), Quadtree)({ 0, 0, size, size }, (int)bx::log2((float)size)); - m_texture = bgfx::createTexture2D((uint16_t)size, (uint16_t)size, true, 1, bgfx::TextureFormat::BGRA8, BGFX_SAMPLER_UVW_CLAMP | BGFX_SAMPLER_POINT); + m_texture = bgfx::createTexture2D((uint16_t)size, (uint16_t)size, true, 1, bgfx::TextureFormat::BGRA8, BGFX_SAMPLER_UVW_CLAMP | BGFX_SAMPLER_POINT | BGFX_TEXTURE_BLIT_DST); _cache->added = [=](Page page, Point pt) { m_quadtreeDirty = true; m_quadtree->add(page, pt); }; _cache->removed = [=](Page page, Point pt) { m_quadtreeDirty = true; m_quadtree->remove(page); BX_UNUSED(pt); }; @@ -712,7 +712,7 @@ TextureAtlas::TextureAtlas(VirtualTextureInfo* _info, int _count, int _uploadspe , false , 1 , bgfx::TextureFormat::BGRA8 - , BGFX_SAMPLER_UVW_CLAMP + , BGFX_SAMPLER_UVW_CLAMP | BGFX_TEXTURE_BLIT_DST ); }