lazily fetch subsamples in MSAA textures

This commit is contained in:
Remi Palandri
2022-02-09 17:18:01 -08:00
committed by Baldur Karlsson
parent 38fa7a1ac7
commit 3d07a0b568
3 changed files with 12 additions and 4 deletions
+5 -2
View File
@@ -2447,11 +2447,14 @@ void ReplayProxy::EnsureTexCached(ResourceId &texid, CompType &typeCast, const S
}
const ProxyTextureProperties &proxy = proxyit->second;
const bool allSamples = sub.sample == ~0U;
for(uint32_t sample = 0; sample < proxy.msSamp; sample++)
uint32_t numSamplesToFetch = allSamples ? proxy.msSamp : 1;
for(uint32_t sample = 0; sample < numSamplesToFetch; sample++)
{
Subresource s = sub;
s.sample = sample;
if(allSamples)
s.sample = sample;
TextureCacheEntry sampleArrayEntry = {texid, s};
+6 -1
View File
@@ -430,7 +430,12 @@ public:
{
if(m_Proxy)
{
EnsureTexCached(display.resourceId, display.typeCast, display.subresource);
Subresource customShaderSubresource = display.subresource;
// fetch all subsamples in case the custom shader wants to fetch more than simply the active
// subsample
customShaderSubresource.sample = ~0U;
EnsureTexCached(display.resourceId, display.typeCast, customShaderSubresource);
if(display.resourceId == ResourceId())
return ResourceId();
+1 -1
View File
@@ -691,7 +691,7 @@ void ReplayOutput::Display()
disp.linearDisplayAsGamma = true;
disp.flipY = false;
disp.subresource = m_Thumbnails[i].sub;
disp.subresource.sample = ~0U;
disp.subresource.sample = 0;
disp.customShaderId = ResourceId();
disp.resourceId = m_pDevice->GetLiveID(m_Thumbnails[i].texture);
disp.typeCast = m_Thumbnails[i].typeCast;