mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 06:09:50 -06:00
TextureCacheBase: Support dumping individual mipmaps.
This commit is contained in:
@ -58,9 +58,17 @@ void TextureCache::TCacheEntry::Bind(unsigned int stage)
|
||||
D3D::SetTexture(stage, texture);
|
||||
}
|
||||
|
||||
bool TextureCache::TCacheEntry::Save(const char filename[])
|
||||
bool TextureCache::TCacheEntry::Save(const char filename[], unsigned int level)
|
||||
{
|
||||
return SUCCEEDED(PD3DXSaveTextureToFileA(filename, D3DXIFF_PNG, texture, 0));
|
||||
IDirect3DSurface9* surface;
|
||||
HRESULT hr = texture->GetSurfaceLevel(level, &surface);
|
||||
if (FAILED(hr))
|
||||
return false;
|
||||
|
||||
hr = PD3DXSaveSurfaceToFileA(filename, D3DXIFF_PNG, surface, NULL, NULL);
|
||||
surface->Release();
|
||||
|
||||
return SUCCEEDED(hr);
|
||||
}
|
||||
|
||||
void TextureCache::TCacheEntry::Load(unsigned int width, unsigned int height,
|
||||
|
@ -52,7 +52,7 @@ private:
|
||||
const float *colmat);
|
||||
|
||||
void Bind(unsigned int stage);
|
||||
bool Save(const char filename[]);
|
||||
bool Save(const char filename[], unsigned int level);
|
||||
};
|
||||
|
||||
TCacheEntryBase* CreateTexture(unsigned int width, unsigned int height,
|
||||
|
Reference in New Issue
Block a user