mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-07-17 04:57:09 +00:00
Move SaveTexture logic to replay layer
* Expand the abilities of the GetTextureData in replay drivers to be able to resolve samples and render down to RGBA8 unorm for file export to other programs. * Greatly improve the ability to save textures - in theory any texture format/type/dimension/etc should now be mappable in sensible & useful ways to output formats.
This commit is contained in:
@@ -703,7 +703,7 @@ void ProxySerialiser::EnsureCached(ResourceId texid, uint32_t arrayIdx, uint32_t
|
||||
ResourceId proxyid = m_ProxyTextureIds[texid];
|
||||
|
||||
size_t size;
|
||||
byte *data = GetTextureData(texid, arrayIdx, mip, size);
|
||||
byte *data = GetTextureData(texid, arrayIdx, mip, false, false, 0.0f, 0.0f, size);
|
||||
|
||||
if(data)
|
||||
m_Proxy->SetProxyTextureData(proxyid, arrayIdx, mip, data, size);
|
||||
@@ -799,7 +799,7 @@ bool ProxySerialiser::Tick()
|
||||
case eCommand_GetTextureData:
|
||||
{
|
||||
size_t dummy;
|
||||
GetTextureData(ResourceId(), 0, 0, dummy);
|
||||
GetTextureData(ResourceId(), 0, 0, false, false, 0.0f, 0.0f, dummy);
|
||||
break;
|
||||
}
|
||||
case eCommand_InitPostVS:
|
||||
@@ -1222,15 +1222,20 @@ vector<byte> ProxySerialiser::GetBufferData(ResourceId buff, uint32_t offset, ui
|
||||
return ret;
|
||||
}
|
||||
|
||||
byte *ProxySerialiser::GetTextureData(ResourceId tex, uint32_t arrayIdx, uint32_t mip, size_t &dataSize)
|
||||
byte *ProxySerialiser::GetTextureData(ResourceId tex, uint32_t arrayIdx, uint32_t mip, bool resolve, bool forceRGBA8unorm,
|
||||
float blackPoint, float whitePoint, size_t &dataSize)
|
||||
{
|
||||
m_ToReplaySerialiser->Serialise("", tex);
|
||||
m_ToReplaySerialiser->Serialise("", arrayIdx);
|
||||
m_ToReplaySerialiser->Serialise("", mip);
|
||||
m_ToReplaySerialiser->Serialise("", resolve);
|
||||
m_ToReplaySerialiser->Serialise("", forceRGBA8unorm);
|
||||
m_ToReplaySerialiser->Serialise("", blackPoint);
|
||||
m_ToReplaySerialiser->Serialise("", whitePoint);
|
||||
|
||||
if(m_ReplayHost)
|
||||
{
|
||||
byte *data = m_Remote->GetTextureData(tex, arrayIdx, mip, dataSize);
|
||||
byte *data = m_Remote->GetTextureData(tex, arrayIdx, mip, resolve, forceRGBA8unorm, blackPoint, whitePoint, dataSize);
|
||||
|
||||
byte *compressed = new byte[dataSize+512];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user