diff options
| author | Pierre Bourdon <delroth@gmail.com> | 2014-03-26 00:08:58 +0100 |
|---|---|---|
| committer | Pierre Bourdon <delroth@gmail.com> | 2014-03-26 00:08:58 +0100 |
| commit | b4337a21928745bef151c8ab665138f7a435f198 (patch) | |
| tree | f3792e8f08d1c847059a2354db188a8d62fdd2df /Source/Core/VideoBackends/D3D/PSTextureEncoder.cpp | |
| parent | 6351f28ab41172d7b07626da737d691ce88c9285 (diff) | |
| parent | 16105db7092707bc130a345ed1e630e2ef1f7747 (diff) | |
Merge pull request #204 from neobrain/bitfield_cleanup
Bitfield cleanup
Diffstat (limited to 'Source/Core/VideoBackends/D3D/PSTextureEncoder.cpp')
| -rw-r--r-- | Source/Core/VideoBackends/D3D/PSTextureEncoder.cpp | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/Source/Core/VideoBackends/D3D/PSTextureEncoder.cpp b/Source/Core/VideoBackends/D3D/PSTextureEncoder.cpp index db7eb9ee3e..d5ef9ef715 100644 --- a/Source/Core/VideoBackends/D3D/PSTextureEncoder.cpp +++ b/Source/Core/VideoBackends/D3D/PSTextureEncoder.cpp @@ -10,7 +10,6 @@ #include "VideoBackends/D3D/PSTextureEncoder.h" #include "VideoBackends/D3D/Render.h" #include "VideoBackends/D3D/TextureCache.h" -#include "VideoCommon/BPMemory.h" // "Static mode" will compile a new EFB encoder shader for every combination of // encoding configurations. It's compatible with Shader Model 4. @@ -1031,8 +1030,8 @@ void PSTextureEncoder::Shutdown() } size_t PSTextureEncoder::Encode(u8* dst, unsigned int dstFormat, - unsigned int srcFormat, const EFBRectangle& srcRect, bool isIntensity, - bool scaleByHalf) + PEControl::PixelFormat srcFormat, const EFBRectangle& srcRect, + bool isIntensity, bool scaleByHalf) { if (!m_ready) // Make sure we initialized OK return 0; @@ -1122,7 +1121,7 @@ size_t PSTextureEncoder::Encode(u8* dst, unsigned int dstFormat, D3D::context->OMSetRenderTargets(1, &m_outRTV, nullptr); - ID3D11ShaderResourceView* pEFB = (srcFormat == PIXELFMT_Z24) ? + ID3D11ShaderResourceView* pEFB = (srcFormat == PEControl::Z24) ? FramebufferManager::GetEFBDepthTexture()->GetSRV() : // FIXME: Instead of resolving EFB, it would be better to pick out a // single sample from each pixel. The game may break if it isn't @@ -1208,10 +1207,10 @@ static const char* INTENSITY_FUNC_NAMES[2] = { "Intensity_0", "Intensity_1" }; -bool PSTextureEncoder::SetStaticShader(unsigned int dstFormat, unsigned int srcFormat, +bool PSTextureEncoder::SetStaticShader(unsigned int dstFormat, PEControl::PixelFormat srcFormat, bool isIntensity, bool scaleByHalf) { - size_t fetchNum = srcFormat; + size_t fetchNum = static_cast<size_t>(srcFormat); size_t scaledFetchNum = scaleByHalf ? 1 : 0; size_t intensityNum = isIntensity ? 1 : 0; size_t generatorNum = dstFormat; @@ -1244,7 +1243,7 @@ bool PSTextureEncoder::SetStaticShader(unsigned int dstFormat, unsigned int srcF } INFO_LOG(VIDEO, "Compiling efb encoding shader for dstFormat 0x%X, srcFormat %d, isIntensity %d, scaleByHalf %d", - dstFormat, srcFormat, isIntensity ? 1 : 0, scaleByHalf ? 1 : 0); + dstFormat, static_cast<int>(srcFormat), isIntensity ? 1 : 0, scaleByHalf ? 1 : 0); // Shader permutation not found, so compile it D3DBlob* bytecode = nullptr; @@ -1258,7 +1257,7 @@ bool PSTextureEncoder::SetStaticShader(unsigned int dstFormat, unsigned int srcF if (!D3D::CompilePixelShader(EFB_ENCODE_PS, sizeof(EFB_ENCODE_PS), &bytecode, macros)) { WARN_LOG(VIDEO, "EFB encoder shader for dstFormat 0x%X, srcFormat %d, isIntensity %d, scaleByHalf %d failed to compile", - dstFormat, srcFormat, isIntensity ? 1 : 0, scaleByHalf ? 1 : 0); + dstFormat, static_cast<int>(srcFormat), isIntensity ? 1 : 0, scaleByHalf ? 1 : 0); // Add dummy shader to map to prevent trying to compile over and // over again m_staticShaders[key] = nullptr; @@ -1369,9 +1368,9 @@ static const char* INTENSITY_CLASS_NAMES[2] = { }; bool PSTextureEncoder::SetDynamicShader(unsigned int dstFormat, - unsigned int srcFormat, bool isIntensity, bool scaleByHalf) + PEControl::PixelFormat srcFormat, bool isIntensity, bool scaleByHalf) { - size_t fetchNum = srcFormat; + size_t fetchNum = static_cast<size_t>(srcFormat); size_t scaledFetchNum = scaleByHalf ? 1 : 0; size_t intensityNum = isIntensity ? 1 : 0; size_t generatorNum = dstFormat; |
