summaryrefslogtreecommitdiff
path: root/Source/Plugins/Plugin_VideoDX9/Src/TextureCache.cpp
diff options
context:
space:
mode:
authorNolan Check <Nolan.Check@gmail.com>2011-02-26 23:41:02 +0000
committerNolan Check <Nolan.Check@gmail.com>2011-02-26 23:41:02 +0000
commitf0c5cc76a998b59ddb1dd720354db366b5e15e9b (patch)
treec1dfc0723b6599d7e3f40610776f1685b4049898 /Source/Plugins/Plugin_VideoDX9/Src/TextureCache.cpp
parent8351177738857041bf87408d48a2efbc168e1c59 (diff)
Add EFB encode-to-RAM support in DX11 backend. It could probably be simplified a lot, and not all the possible formats are implemented. I tried to use the dynamic-linking feature of shader model 5, but Microsoft's HLSL compiler is broken. "Dynamic mode" is implemented, but disabled for now.
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@7253 8ced0084-cf51-0410-be5f-012b33b47a6e
Diffstat (limited to 'Source/Plugins/Plugin_VideoDX9/Src/TextureCache.cpp')
-rw-r--r--Source/Plugins/Plugin_VideoDX9/Src/TextureCache.cpp27
1 files changed, 14 insertions, 13 deletions
diff --git a/Source/Plugins/Plugin_VideoDX9/Src/TextureCache.cpp b/Source/Plugins/Plugin_VideoDX9/Src/TextureCache.cpp
index 03eeefd169..b7b77e6d9b 100644
--- a/Source/Plugins/Plugin_VideoDX9/Src/TextureCache.cpp
+++ b/Source/Plugins/Plugin_VideoDX9/Src/TextureCache.cpp
@@ -69,11 +69,12 @@ void TextureCache::TCacheEntry::Load(unsigned int width, unsigned int height,
// D3D9 will automatically generate mip maps if necessary
}
-void TextureCache::TCacheEntry::FromRenderTarget(bool bFromZBuffer, bool bScaleByHalf,
- unsigned int cbufid, const float *colmat, const EFBRectangle &source_rect,
- bool bIsIntensityFmt, u32 copyfmt)
+void TextureCache::TCacheEntry::FromRenderTarget(u32 dstAddr, unsigned int dstFormat,
+ unsigned int srcFormat, const EFBRectangle& srcRect,
+ bool isIntensity, bool scaleByHalf, unsigned int cbufid,
+ const float *colmat)
{
- const LPDIRECT3DTEXTURE9 read_texture = bFromZBuffer ?
+ const LPDIRECT3DTEXTURE9 read_texture = (srcFormat == PIXELFMT_Z24) ?
FramebufferManager::GetEFBDepthTexture() :
FramebufferManager::GetEFBColorTexture();
@@ -101,16 +102,16 @@ void TextureCache::TCacheEntry::FromRenderTarget(bool bFromZBuffer, bool bScaleB
destrect.top = 0;
PixelShaderManager::SetColorMatrix(colmat); // set transformation
- TargetRectangle targetSource = g_renderer->ConvertEFBRectangle(source_rect);
+ TargetRectangle targetSource = g_renderer->ConvertEFBRectangle(srcRect);
RECT sourcerect;
sourcerect.bottom = targetSource.bottom;
sourcerect.left = targetSource.left;
sourcerect.right = targetSource.right;
sourcerect.top = targetSource.top;
- if (bFromZBuffer)
+ if (srcFormat == PIXELFMT_Z24)
{
- if (bScaleByHalf || g_ActiveConfig.iMultisampleMode)
+ if (scaleByHalf || g_ActiveConfig.iMultisampleMode)
{
D3D::ChangeSamplerState(0, D3DSAMP_MINFILTER, D3DTEXF_LINEAR);
D3D::ChangeSamplerState(0, D3DSAMP_MAGFILTER, D3DTEXF_LINEAR);
@@ -134,7 +135,7 @@ void TextureCache::TCacheEntry::FromRenderTarget(bool bFromZBuffer, bool bScaleB
Renderer::GetFullTargetWidth(), Renderer::GetFullTargetHeight(),
virtualW, virtualH,
// TODO: why is D3DFMT_D24X8 singled out here? why not D3DFMT_D24X4S4/D24S8/D24FS8/D32/D16/D15S1 too, or none of them?
- PixelShaderCache::GetDepthMatrixProgram(SSAAMode, bFromZBuffer && bformat != FOURCC_RAWZ && bformat != D3DFMT_D24X8),
+ PixelShaderCache::GetDepthMatrixProgram(SSAAMode, (srcFormat == PIXELFMT_Z24) && bformat != FOURCC_RAWZ && bformat != D3DFMT_D24X8),
VertexShaderCache::GetSimpleVertexShader(SSAAMode));
Rendersurf->Release();
@@ -147,11 +148,11 @@ void TextureCache::TCacheEntry::FromRenderTarget(bool bFromZBuffer, bool bScaleB
read_texture,
Renderer::GetFullTargetWidth(),
Renderer::GetFullTargetHeight(),
- bFromZBuffer,
- bIsIntensityFmt,
- copyfmt,
- bScaleByHalf,
- source_rect);
+ srcFormat == PIXELFMT_Z24,
+ isIntensity,
+ dstFormat,
+ scaleByHalf,
+ srcRect);
}
D3D::RefreshSamplerState(0, D3DSAMP_MINFILTER);