Renames es2dx and dx2es namespaces to something better.

TRAC #22002 Signed-off-by: Daniel Koch Author: Shannon Woods git-svn-id: https://angleproject.googlecode.com/svn/branches/dx11proto@1415 736b8ea6-26fd-11df-bfd4-992fa37f6226
parent 31b13e1f
...@@ -2083,7 +2083,7 @@ void Context::applyState(GLenum drawMode) ...@@ -2083,7 +2083,7 @@ void Context::applyState(GLenum drawMode)
{ {
if (mState.cullFace) if (mState.cullFace)
{ {
mDevice->SetRenderState(D3DRS_CULLMODE, es2dx::ConvertCullMode(mState.cullMode, mState.frontFace)); mDevice->SetRenderState(D3DRS_CULLMODE, gl_d3d9::ConvertCullMode(mState.cullMode, mState.frontFace));
} }
else else
{ {
...@@ -2098,7 +2098,7 @@ void Context::applyState(GLenum drawMode) ...@@ -2098,7 +2098,7 @@ void Context::applyState(GLenum drawMode)
if (mState.depthTest) if (mState.depthTest)
{ {
mDevice->SetRenderState(D3DRS_ZENABLE, D3DZB_TRUE); mDevice->SetRenderState(D3DRS_ZENABLE, D3DZB_TRUE);
mDevice->SetRenderState(D3DRS_ZFUNC, es2dx::ConvertComparison(mState.depthFunc)); mDevice->SetRenderState(D3DRS_ZFUNC, gl_d3d9::ConvertComparison(mState.depthFunc));
} }
else else
{ {
...@@ -2123,7 +2123,7 @@ void Context::applyState(GLenum drawMode) ...@@ -2123,7 +2123,7 @@ void Context::applyState(GLenum drawMode)
if (mState.sourceBlendRGB != GL_CONSTANT_ALPHA && mState.sourceBlendRGB != GL_ONE_MINUS_CONSTANT_ALPHA && if (mState.sourceBlendRGB != GL_CONSTANT_ALPHA && mState.sourceBlendRGB != GL_ONE_MINUS_CONSTANT_ALPHA &&
mState.destBlendRGB != GL_CONSTANT_ALPHA && mState.destBlendRGB != GL_ONE_MINUS_CONSTANT_ALPHA) mState.destBlendRGB != GL_CONSTANT_ALPHA && mState.destBlendRGB != GL_ONE_MINUS_CONSTANT_ALPHA)
{ {
mDevice->SetRenderState(D3DRS_BLENDFACTOR, es2dx::ConvertColor(mState.blendColor)); mDevice->SetRenderState(D3DRS_BLENDFACTOR, gl_d3d9::ConvertColor(mState.blendColor));
} }
else else
{ {
...@@ -2133,9 +2133,9 @@ void Context::applyState(GLenum drawMode) ...@@ -2133,9 +2133,9 @@ void Context::applyState(GLenum drawMode)
unorm<8>(mState.blendColor.alpha))); unorm<8>(mState.blendColor.alpha)));
} }
mDevice->SetRenderState(D3DRS_SRCBLEND, es2dx::ConvertBlendFunc(mState.sourceBlendRGB)); mDevice->SetRenderState(D3DRS_SRCBLEND, gl_d3d9::ConvertBlendFunc(mState.sourceBlendRGB));
mDevice->SetRenderState(D3DRS_DESTBLEND, es2dx::ConvertBlendFunc(mState.destBlendRGB)); mDevice->SetRenderState(D3DRS_DESTBLEND, gl_d3d9::ConvertBlendFunc(mState.destBlendRGB));
mDevice->SetRenderState(D3DRS_BLENDOP, es2dx::ConvertBlendOp(mState.blendEquationRGB)); mDevice->SetRenderState(D3DRS_BLENDOP, gl_d3d9::ConvertBlendOp(mState.blendEquationRGB));
if (mState.sourceBlendRGB != mState.sourceBlendAlpha || if (mState.sourceBlendRGB != mState.sourceBlendAlpha ||
mState.destBlendRGB != mState.destBlendAlpha || mState.destBlendRGB != mState.destBlendAlpha ||
...@@ -2143,9 +2143,9 @@ void Context::applyState(GLenum drawMode) ...@@ -2143,9 +2143,9 @@ void Context::applyState(GLenum drawMode)
{ {
mDevice->SetRenderState(D3DRS_SEPARATEALPHABLENDENABLE, TRUE); mDevice->SetRenderState(D3DRS_SEPARATEALPHABLENDENABLE, TRUE);
mDevice->SetRenderState(D3DRS_SRCBLENDALPHA, es2dx::ConvertBlendFunc(mState.sourceBlendAlpha)); mDevice->SetRenderState(D3DRS_SRCBLENDALPHA, gl_d3d9::ConvertBlendFunc(mState.sourceBlendAlpha));
mDevice->SetRenderState(D3DRS_DESTBLENDALPHA, es2dx::ConvertBlendFunc(mState.destBlendAlpha)); mDevice->SetRenderState(D3DRS_DESTBLENDALPHA, gl_d3d9::ConvertBlendFunc(mState.destBlendAlpha));
mDevice->SetRenderState(D3DRS_BLENDOPALPHA, es2dx::ConvertBlendOp(mState.blendEquationAlpha)); mDevice->SetRenderState(D3DRS_BLENDOPALPHA, gl_d3d9::ConvertBlendOp(mState.blendEquationAlpha));
} }
else else
{ {
...@@ -2185,31 +2185,31 @@ void Context::applyState(GLenum drawMode) ...@@ -2185,31 +2185,31 @@ void Context::applyState(GLenum drawMode)
mDevice->SetRenderState(mState.frontFace == GL_CCW ? D3DRS_STENCILWRITEMASK : D3DRS_CCW_STENCILWRITEMASK, mState.stencilWritemask); mDevice->SetRenderState(mState.frontFace == GL_CCW ? D3DRS_STENCILWRITEMASK : D3DRS_CCW_STENCILWRITEMASK, mState.stencilWritemask);
mDevice->SetRenderState(mState.frontFace == GL_CCW ? D3DRS_STENCILFUNC : D3DRS_CCW_STENCILFUNC, mDevice->SetRenderState(mState.frontFace == GL_CCW ? D3DRS_STENCILFUNC : D3DRS_CCW_STENCILFUNC,
es2dx::ConvertComparison(mState.stencilFunc)); gl_d3d9::ConvertComparison(mState.stencilFunc));
mDevice->SetRenderState(mState.frontFace == GL_CCW ? D3DRS_STENCILREF : D3DRS_CCW_STENCILREF, (mState.stencilRef < (GLint)maxStencil) ? mState.stencilRef : maxStencil); mDevice->SetRenderState(mState.frontFace == GL_CCW ? D3DRS_STENCILREF : D3DRS_CCW_STENCILREF, (mState.stencilRef < (GLint)maxStencil) ? mState.stencilRef : maxStencil);
mDevice->SetRenderState(mState.frontFace == GL_CCW ? D3DRS_STENCILMASK : D3DRS_CCW_STENCILMASK, mState.stencilMask); mDevice->SetRenderState(mState.frontFace == GL_CCW ? D3DRS_STENCILMASK : D3DRS_CCW_STENCILMASK, mState.stencilMask);
mDevice->SetRenderState(mState.frontFace == GL_CCW ? D3DRS_STENCILFAIL : D3DRS_CCW_STENCILFAIL, mDevice->SetRenderState(mState.frontFace == GL_CCW ? D3DRS_STENCILFAIL : D3DRS_CCW_STENCILFAIL,
es2dx::ConvertStencilOp(mState.stencilFail)); gl_d3d9::ConvertStencilOp(mState.stencilFail));
mDevice->SetRenderState(mState.frontFace == GL_CCW ? D3DRS_STENCILZFAIL : D3DRS_CCW_STENCILZFAIL, mDevice->SetRenderState(mState.frontFace == GL_CCW ? D3DRS_STENCILZFAIL : D3DRS_CCW_STENCILZFAIL,
es2dx::ConvertStencilOp(mState.stencilPassDepthFail)); gl_d3d9::ConvertStencilOp(mState.stencilPassDepthFail));
mDevice->SetRenderState(mState.frontFace == GL_CCW ? D3DRS_STENCILPASS : D3DRS_CCW_STENCILPASS, mDevice->SetRenderState(mState.frontFace == GL_CCW ? D3DRS_STENCILPASS : D3DRS_CCW_STENCILPASS,
es2dx::ConvertStencilOp(mState.stencilPassDepthPass)); gl_d3d9::ConvertStencilOp(mState.stencilPassDepthPass));
mDevice->SetRenderState(mState.frontFace == GL_CW ? D3DRS_STENCILWRITEMASK : D3DRS_CCW_STENCILWRITEMASK, mState.stencilBackWritemask); mDevice->SetRenderState(mState.frontFace == GL_CW ? D3DRS_STENCILWRITEMASK : D3DRS_CCW_STENCILWRITEMASK, mState.stencilBackWritemask);
mDevice->SetRenderState(mState.frontFace == GL_CW ? D3DRS_STENCILFUNC : D3DRS_CCW_STENCILFUNC, mDevice->SetRenderState(mState.frontFace == GL_CW ? D3DRS_STENCILFUNC : D3DRS_CCW_STENCILFUNC,
es2dx::ConvertComparison(mState.stencilBackFunc)); gl_d3d9::ConvertComparison(mState.stencilBackFunc));
mDevice->SetRenderState(mState.frontFace == GL_CW ? D3DRS_STENCILREF : D3DRS_CCW_STENCILREF, (mState.stencilBackRef < (GLint)maxStencil) ? mState.stencilBackRef : maxStencil); mDevice->SetRenderState(mState.frontFace == GL_CW ? D3DRS_STENCILREF : D3DRS_CCW_STENCILREF, (mState.stencilBackRef < (GLint)maxStencil) ? mState.stencilBackRef : maxStencil);
mDevice->SetRenderState(mState.frontFace == GL_CW ? D3DRS_STENCILMASK : D3DRS_CCW_STENCILMASK, mState.stencilBackMask); mDevice->SetRenderState(mState.frontFace == GL_CW ? D3DRS_STENCILMASK : D3DRS_CCW_STENCILMASK, mState.stencilBackMask);
mDevice->SetRenderState(mState.frontFace == GL_CW ? D3DRS_STENCILFAIL : D3DRS_CCW_STENCILFAIL, mDevice->SetRenderState(mState.frontFace == GL_CW ? D3DRS_STENCILFAIL : D3DRS_CCW_STENCILFAIL,
es2dx::ConvertStencilOp(mState.stencilBackFail)); gl_d3d9::ConvertStencilOp(mState.stencilBackFail));
mDevice->SetRenderState(mState.frontFace == GL_CW ? D3DRS_STENCILZFAIL : D3DRS_CCW_STENCILZFAIL, mDevice->SetRenderState(mState.frontFace == GL_CW ? D3DRS_STENCILZFAIL : D3DRS_CCW_STENCILZFAIL,
es2dx::ConvertStencilOp(mState.stencilBackPassDepthFail)); gl_d3d9::ConvertStencilOp(mState.stencilBackPassDepthFail));
mDevice->SetRenderState(mState.frontFace == GL_CW ? D3DRS_STENCILPASS : D3DRS_CCW_STENCILPASS, mDevice->SetRenderState(mState.frontFace == GL_CW ? D3DRS_STENCILPASS : D3DRS_CCW_STENCILPASS,
es2dx::ConvertStencilOp(mState.stencilBackPassDepthPass)); gl_d3d9::ConvertStencilOp(mState.stencilBackPassDepthPass));
} }
else else
{ {
...@@ -2222,7 +2222,7 @@ void Context::applyState(GLenum drawMode) ...@@ -2222,7 +2222,7 @@ void Context::applyState(GLenum drawMode)
if (mMaskStateDirty) if (mMaskStateDirty)
{ {
int colorMask = es2dx::ConvertColorMask(mState.colorMaskRed, mState.colorMaskGreen, int colorMask = gl_d3d9::ConvertColorMask(mState.colorMaskRed, mState.colorMaskGreen,
mState.colorMaskBlue, mState.colorMaskAlpha); mState.colorMaskBlue, mState.colorMaskAlpha);
if (colorMask == 0 && !zeroColorMaskAllowed) if (colorMask == 0 && !zeroColorMaskAllowed)
{ {
...@@ -2833,7 +2833,7 @@ void Context::clear(GLbitfield mask) ...@@ -2833,7 +2833,7 @@ void Context::clear(GLbitfield mask)
depthStencil->GetDesc(&desc); depthStencil->GetDesc(&desc);
depthStencil->Release(); depthStencil->Release();
unsigned int stencilSize = dx2es::GetStencilSize(desc.Format); unsigned int stencilSize = d3d9_gl::GetStencilSize(desc.Format);
stencilUnmasked = (0x1 << stencilSize) - 1; stencilUnmasked = (0x1 << stencilSize) - 1;
if (stencilUnmasked != 0x0) if (stencilUnmasked != 0x0)
...@@ -2860,7 +2860,7 @@ void Context::clear(GLbitfield mask) ...@@ -2860,7 +2860,7 @@ void Context::clear(GLbitfield mask)
float depth = clamp01(mState.depthClearValue); float depth = clamp01(mState.depthClearValue);
int stencil = mState.stencilClearValue & 0x000000FF; int stencil = mState.stencilClearValue & 0x000000FF;
bool alphaUnmasked = (dx2es::GetAlphaSize(mRenderTargetDesc.Format) == 0) || mState.colorMaskAlpha; bool alphaUnmasked = (d3d9_gl::GetAlphaSize(mRenderTargetDesc.Format) == 0) || mState.colorMaskAlpha;
const bool needMaskedStencilClear = (flags & D3DCLEAR_STENCIL) && const bool needMaskedStencilClear = (flags & D3DCLEAR_STENCIL) &&
(mState.stencilWritemask & stencilUnmasked) != stencilUnmasked; (mState.stencilWritemask & stencilUnmasked) != stencilUnmasked;
...@@ -2929,7 +2929,7 @@ void Context::clear(GLbitfield mask) ...@@ -2929,7 +2929,7 @@ void Context::clear(GLbitfield mask)
if (flags & D3DCLEAR_TARGET) if (flags & D3DCLEAR_TARGET)
{ {
mDevice->SetRenderState(D3DRS_COLORWRITEENABLE, es2dx::ConvertColorMask(mState.colorMaskRed, mState.colorMaskGreen, mState.colorMaskBlue, mState.colorMaskAlpha)); mDevice->SetRenderState(D3DRS_COLORWRITEENABLE, gl_d3d9::ConvertColorMask(mState.colorMaskRed, mState.colorMaskGreen, mState.colorMaskBlue, mState.colorMaskAlpha));
} }
else else
{ {
...@@ -3021,7 +3021,7 @@ void Context::drawArrays(GLenum mode, GLint first, GLsizei count, GLsizei instan ...@@ -3021,7 +3021,7 @@ void Context::drawArrays(GLenum mode, GLint first, GLsizei count, GLsizei instan
D3DPRIMITIVETYPE primitiveType; D3DPRIMITIVETYPE primitiveType;
int primitiveCount; int primitiveCount;
if(!es2dx::ConvertPrimitiveType(mode, count, &primitiveType, &primitiveCount)) if(!gl_d3d9::ConvertPrimitiveType(mode, count, &primitiveType, &primitiveCount))
return error(GL_INVALID_ENUM); return error(GL_INVALID_ENUM);
if (primitiveCount <= 0) if (primitiveCount <= 0)
...@@ -3103,7 +3103,7 @@ void Context::drawElements(GLenum mode, GLsizei count, GLenum type, const GLvoid ...@@ -3103,7 +3103,7 @@ void Context::drawElements(GLenum mode, GLsizei count, GLenum type, const GLvoid
D3DPRIMITIVETYPE primitiveType; D3DPRIMITIVETYPE primitiveType;
int primitiveCount; int primitiveCount;
if(!es2dx::ConvertPrimitiveType(mode, count, &primitiveType, &primitiveCount)) if(!gl_d3d9::ConvertPrimitiveType(mode, count, &primitiveType, &primitiveCount))
return error(GL_INVALID_ENUM); return error(GL_INVALID_ENUM);
if (primitiveCount <= 0) if (primitiveCount <= 0)
......
...@@ -392,10 +392,10 @@ Colorbuffer::Colorbuffer(rx::Renderer *renderer, rx::SwapChain *swapChain) ...@@ -392,10 +392,10 @@ Colorbuffer::Colorbuffer(rx::Renderer *renderer, rx::SwapChain *swapChain)
mWidth = description.Width; mWidth = description.Width;
mHeight = description.Height; mHeight = description.Height;
mInternalFormat = dx2es::ConvertBackBufferFormat(description.Format); mInternalFormat = d3d9_gl::ConvertBackBufferFormat(description.Format);
mD3DFormat = description.Format; mD3DFormat = description.Format;
mActualFormat = dx2es::GetEquivalentFormat(mD3DFormat); mActualFormat = d3d9_gl::GetEquivalentFormat(mD3DFormat);
mSamples = dx2es::GetSamplesFromMultisampleType(description.MultiSampleType); mSamples = d3d9_gl::GetSamplesFromMultisampleType(description.MultiSampleType);
} }
} }
...@@ -405,7 +405,7 @@ Colorbuffer::Colorbuffer(rx::Renderer *renderer, int width, int height, GLenum f ...@@ -405,7 +405,7 @@ Colorbuffer::Colorbuffer(rx::Renderer *renderer, int width, int height, GLenum f
rx::Renderer9 *renderer9 = static_cast<rx::Renderer9*>(renderer); // D3D9_REPLACE rx::Renderer9 *renderer9 = static_cast<rx::Renderer9*>(renderer); // D3D9_REPLACE
IDirect3DDevice9 *device = renderer9->getDevice(); // D3D9_REPLACE IDirect3DDevice9 *device = renderer9->getDevice(); // D3D9_REPLACE
D3DFORMAT requestedFormat = es2dx::ConvertRenderbufferFormat(format); D3DFORMAT requestedFormat = gl_d3d9::ConvertRenderbufferFormat(format);
int supportedSamples = renderer9->getNearestSupportedSamples(requestedFormat, samples); int supportedSamples = renderer9->getNearestSupportedSamples(requestedFormat, samples);
if (supportedSamples == -1) if (supportedSamples == -1)
...@@ -418,7 +418,7 @@ Colorbuffer::Colorbuffer(rx::Renderer *renderer, int width, int height, GLenum f ...@@ -418,7 +418,7 @@ Colorbuffer::Colorbuffer(rx::Renderer *renderer, int width, int height, GLenum f
if (width > 0 && height > 0) if (width > 0 && height > 0)
{ {
HRESULT result = device->CreateRenderTarget(width, height, requestedFormat, HRESULT result = device->CreateRenderTarget(width, height, requestedFormat,
es2dx::GetMultisampleTypeFromSamples(supportedSamples), 0, FALSE, &mRenderTarget, NULL); gl_d3d9::GetMultisampleTypeFromSamples(supportedSamples), 0, FALSE, &mRenderTarget, NULL);
if (result == D3DERR_OUTOFVIDEOMEMORY || result == E_OUTOFMEMORY) if (result == D3DERR_OUTOFVIDEOMEMORY || result == E_OUTOFMEMORY)
{ {
...@@ -434,7 +434,7 @@ Colorbuffer::Colorbuffer(rx::Renderer *renderer, int width, int height, GLenum f ...@@ -434,7 +434,7 @@ Colorbuffer::Colorbuffer(rx::Renderer *renderer, int width, int height, GLenum f
mHeight = height; mHeight = height;
mInternalFormat = format; mInternalFormat = format;
mD3DFormat = requestedFormat; mD3DFormat = requestedFormat;
mActualFormat = dx2es::GetEquivalentFormat(mD3DFormat); mActualFormat = d3d9_gl::GetEquivalentFormat(mD3DFormat);
mSamples = supportedSamples; mSamples = supportedSamples;
} }
...@@ -468,10 +468,10 @@ DepthStencilbuffer::DepthStencilbuffer(rx::Renderer *renderer, rx::SwapChain *sw ...@@ -468,10 +468,10 @@ DepthStencilbuffer::DepthStencilbuffer(rx::Renderer *renderer, rx::SwapChain *sw
mWidth = description.Width; mWidth = description.Width;
mHeight = description.Height; mHeight = description.Height;
mInternalFormat = dx2es::ConvertDepthStencilFormat(description.Format); mInternalFormat = d3d9_gl::ConvertDepthStencilFormat(description.Format);
mSamples = dx2es::GetSamplesFromMultisampleType(description.MultiSampleType); mSamples = d3d9_gl::GetSamplesFromMultisampleType(description.MultiSampleType);
mD3DFormat = description.Format; mD3DFormat = description.Format;
mActualFormat = dx2es::GetEquivalentFormat(mD3DFormat); mActualFormat = d3d9_gl::GetEquivalentFormat(mD3DFormat);
} }
} }
...@@ -494,7 +494,7 @@ DepthStencilbuffer::DepthStencilbuffer(rx::Renderer *renderer, int width, int he ...@@ -494,7 +494,7 @@ DepthStencilbuffer::DepthStencilbuffer(rx::Renderer *renderer, int width, int he
if (width > 0 && height > 0) if (width > 0 && height > 0)
{ {
HRESULT result = device->CreateDepthStencilSurface(width, height, D3DFMT_D24S8, es2dx::GetMultisampleTypeFromSamples(supportedSamples), HRESULT result = device->CreateDepthStencilSurface(width, height, D3DFMT_D24S8, gl_d3d9::GetMultisampleTypeFromSamples(supportedSamples),
0, FALSE, &mDepthStencil, 0); 0, FALSE, &mDepthStencil, 0);
if (result == D3DERR_OUTOFVIDEOMEMORY || result == E_OUTOFMEMORY) if (result == D3DERR_OUTOFVIDEOMEMORY || result == E_OUTOFMEMORY)
......
...@@ -273,7 +273,7 @@ bool Blit::copy(IDirect3DSurface9 *source, const RECT &sourceRect, GLenum destFo ...@@ -273,7 +273,7 @@ bool Blit::copy(IDirect3DSurface9 *source, const RECT &sourceRect, GLenum destFo
dest->GetDesc(&destDesc); dest->GetDesc(&destDesc);
if (sourceDesc.Format == destDesc.Format && destDesc.Usage & D3DUSAGE_RENDERTARGET && if (sourceDesc.Format == destDesc.Format && destDesc.Usage & D3DUSAGE_RENDERTARGET &&
dx2es::IsFormatChannelEquivalent(destDesc.Format, destFormat)) // Can use StretchRect d3d9_gl::IsFormatChannelEquivalent(destDesc.Format, destFormat)) // Can use StretchRect
{ {
RECT destRect = {xoffset, yoffset, xoffset + (sourceRect.right - sourceRect.left), yoffset + (sourceRect.bottom - sourceRect.top)}; RECT destRect = {xoffset, yoffset, xoffset + (sourceRect.right - sourceRect.left), yoffset + (sourceRect.bottom - sourceRect.top)};
HRESULT result = device->StretchRect(source, &sourceRect, dest, &destRect, D3DTEXF_POINT); HRESULT result = device->StretchRect(source, &sourceRect, dest, &destRect, D3DTEXF_POINT);
......
...@@ -277,7 +277,7 @@ bool Image::redefine(rx::Renderer9 *renderer, GLint internalformat, GLsizei widt ...@@ -277,7 +277,7 @@ bool Image::redefine(rx::Renderer9 *renderer, GLint internalformat, GLsizei widt
mInternalFormat = internalformat; mInternalFormat = internalformat;
// compute the d3d format that will be used // compute the d3d format that will be used
mD3DFormat = renderer->ConvertTextureInternalFormat(internalformat); mD3DFormat = renderer->ConvertTextureInternalFormat(internalformat);
mActualFormat = dx2es::GetEquivalentFormat(mD3DFormat); mActualFormat = d3d9_gl::GetEquivalentFormat(mD3DFormat);
ASSERT(dynamic_cast<rx::Renderer9*>(renderer) != NULL); // D3D9_REPLACE ASSERT(dynamic_cast<rx::Renderer9*>(renderer) != NULL); // D3D9_REPLACE
mRenderer = static_cast<rx::Renderer9*>(renderer); // D3D9_REPLACE mRenderer = static_cast<rx::Renderer9*>(renderer); // D3D9_REPLACE
......
...@@ -409,8 +409,8 @@ int Renderer9::generateConfigs(ConfigDesc **configDescList) ...@@ -409,8 +409,8 @@ int Renderer9::generateConfigs(ConfigDesc **configDescList)
if (SUCCEEDED(result)) if (SUCCEEDED(result))
{ {
ConfigDesc newConfig; ConfigDesc newConfig;
newConfig.renderTargetFormat = dx2es::ConvertBackBufferFormat(renderTargetFormat); newConfig.renderTargetFormat = d3d9_gl::ConvertBackBufferFormat(renderTargetFormat);
newConfig.depthStencilFormat = dx2es::ConvertDepthStencilFormat(depthStencilFormat); newConfig.depthStencilFormat = d3d9_gl::ConvertDepthStencilFormat(depthStencilFormat);
newConfig.multiSample = 0; // FIXME: enumerate multi-sampling newConfig.multiSample = 0; // FIXME: enumerate multi-sampling
newConfig.fastConfig = (currentDisplayMode.Format == renderTargetFormat); newConfig.fastConfig = (currentDisplayMode.Format == renderTargetFormat);
...@@ -553,12 +553,12 @@ void Renderer9::setSamplerState(gl::SamplerType type, int index, const gl::Sampl ...@@ -553,12 +553,12 @@ void Renderer9::setSamplerState(gl::SamplerType type, int index, const gl::Sampl
int d3dSamplerOffset = (type == gl::SAMPLER_PIXEL) ? 0 : D3DVERTEXTEXTURESAMPLER0; int d3dSamplerOffset = (type == gl::SAMPLER_PIXEL) ? 0 : D3DVERTEXTEXTURESAMPLER0;
int d3dSampler = index + d3dSamplerOffset; int d3dSampler = index + d3dSamplerOffset;
mDevice->SetSamplerState(d3dSampler, D3DSAMP_ADDRESSU, es2dx::ConvertTextureWrap(samplerState.wrapS)); mDevice->SetSamplerState(d3dSampler, D3DSAMP_ADDRESSU, gl_d3d9::ConvertTextureWrap(samplerState.wrapS));
mDevice->SetSamplerState(d3dSampler, D3DSAMP_ADDRESSV, es2dx::ConvertTextureWrap(samplerState.wrapT)); mDevice->SetSamplerState(d3dSampler, D3DSAMP_ADDRESSV, gl_d3d9::ConvertTextureWrap(samplerState.wrapT));
mDevice->SetSamplerState(d3dSampler, D3DSAMP_MAGFILTER, es2dx::ConvertMagFilter(samplerState.magFilter, samplerState.maxAnisotropy)); mDevice->SetSamplerState(d3dSampler, D3DSAMP_MAGFILTER, gl_d3d9::ConvertMagFilter(samplerState.magFilter, samplerState.maxAnisotropy));
D3DTEXTUREFILTERTYPE d3dMinFilter, d3dMipFilter; D3DTEXTUREFILTERTYPE d3dMinFilter, d3dMipFilter;
es2dx::ConvertMinFilter(samplerState.minFilter, &d3dMinFilter, &d3dMipFilter, samplerState.maxAnisotropy); gl_d3d9::ConvertMinFilter(samplerState.minFilter, &d3dMinFilter, &d3dMipFilter, samplerState.maxAnisotropy);
mDevice->SetSamplerState(d3dSampler, D3DSAMP_MINFILTER, d3dMinFilter); mDevice->SetSamplerState(d3dSampler, D3DSAMP_MINFILTER, d3dMinFilter);
mDevice->SetSamplerState(d3dSampler, D3DSAMP_MIPFILTER, d3dMipFilter); mDevice->SetSamplerState(d3dSampler, D3DSAMP_MIPFILTER, d3dMipFilter);
mDevice->SetSamplerState(d3dSampler, D3DSAMP_MAXMIPLEVEL, samplerState.lodOffset); mDevice->SetSamplerState(d3dSampler, D3DSAMP_MAXMIPLEVEL, samplerState.lodOffset);
......
...@@ -138,7 +138,7 @@ EGLint SwapChain::reset(int backbufferWidth, int backbufferHeight, EGLint swapIn ...@@ -138,7 +138,7 @@ EGLint SwapChain::reset(int backbufferWidth, int backbufferHeight, EGLint swapIn
} }
result = device->CreateTexture(backbufferWidth, backbufferHeight, 1, D3DUSAGE_RENDERTARGET, result = device->CreateTexture(backbufferWidth, backbufferHeight, 1, D3DUSAGE_RENDERTARGET,
es2dx::ConvertRenderbufferFormat(mBackBufferFormat), D3DPOOL_DEFAULT, gl_d3d9::ConvertRenderbufferFormat(mBackBufferFormat), D3DPOOL_DEFAULT,
&mOffscreenTexture, pShareHandle); &mOffscreenTexture, pShareHandle);
if (FAILED(result)) if (FAILED(result))
{ {
...@@ -189,9 +189,9 @@ EGLint SwapChain::reset(int backbufferWidth, int backbufferHeight, EGLint swapIn ...@@ -189,9 +189,9 @@ EGLint SwapChain::reset(int backbufferWidth, int backbufferHeight, EGLint swapIn
if (mWindow) if (mWindow)
{ {
D3DPRESENT_PARAMETERS presentParameters = {0}; D3DPRESENT_PARAMETERS presentParameters = {0};
presentParameters.AutoDepthStencilFormat = es2dx::ConvertRenderbufferFormat(mDepthBufferFormat); presentParameters.AutoDepthStencilFormat = gl_d3d9::ConvertRenderbufferFormat(mDepthBufferFormat);
presentParameters.BackBufferCount = 1; presentParameters.BackBufferCount = 1;
presentParameters.BackBufferFormat = es2dx::ConvertRenderbufferFormat(mBackBufferFormat); presentParameters.BackBufferFormat = gl_d3d9::ConvertRenderbufferFormat(mBackBufferFormat);
presentParameters.EnableAutoDepthStencil = FALSE; presentParameters.EnableAutoDepthStencil = FALSE;
presentParameters.Flags = 0; presentParameters.Flags = 0;
presentParameters.hDeviceWindow = mWindow; presentParameters.hDeviceWindow = mWindow;
...@@ -242,7 +242,7 @@ EGLint SwapChain::reset(int backbufferWidth, int backbufferHeight, EGLint swapIn ...@@ -242,7 +242,7 @@ EGLint SwapChain::reset(int backbufferWidth, int backbufferHeight, EGLint swapIn
if (mDepthBufferFormat != D3DFMT_UNKNOWN) if (mDepthBufferFormat != D3DFMT_UNKNOWN)
{ {
result = device->CreateDepthStencilSurface(backbufferWidth, backbufferHeight, result = device->CreateDepthStencilSurface(backbufferWidth, backbufferHeight,
es2dx::ConvertRenderbufferFormat(mDepthBufferFormat), gl_d3d9::ConvertRenderbufferFormat(mDepthBufferFormat),
D3DMULTISAMPLE_NONE, 0, FALSE, &mDepthStencil, NULL); D3DMULTISAMPLE_NONE, 0, FALSE, &mDepthStencil, NULL);
if (FAILED(result)) if (FAILED(result))
......
...@@ -235,7 +235,7 @@ IDirect3DSurface9 *TextureStorageCubeMap::getCubeMapSurface(GLenum faceTarget, i ...@@ -235,7 +235,7 @@ IDirect3DSurface9 *TextureStorageCubeMap::getCubeMapSurface(GLenum faceTarget, i
if (mTexture) if (mTexture)
{ {
D3DCUBEMAP_FACES face = es2dx::ConvertCubeFace(faceTarget); D3DCUBEMAP_FACES face = gl_d3d9::ConvertCubeFace(faceTarget);
HRESULT result = mTexture->GetCubeMapSurface(face, level + mLodOffset, &surface); HRESULT result = mTexture->GetCubeMapSurface(face, level + mLodOffset, &surface);
ASSERT(SUCCEEDED(result)); ASSERT(SUCCEEDED(result));
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
#include "common/debug.h" #include "common/debug.h"
namespace es2dx namespace gl_d3d9
{ {
D3DCMPFUNC ConvertComparison(GLenum comparison) D3DCMPFUNC ConvertComparison(GLenum comparison)
...@@ -303,7 +303,7 @@ D3DMULTISAMPLE_TYPE GetMultisampleTypeFromSamples(GLsizei samples) ...@@ -303,7 +303,7 @@ D3DMULTISAMPLE_TYPE GetMultisampleTypeFromSamples(GLsizei samples)
} }
namespace dx2es namespace d3d9_gl
{ {
unsigned int GetStencilSize(D3DFORMAT stencilFormat) unsigned int GetStencilSize(D3DFORMAT stencilFormat)
......
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
const D3DFORMAT D3DFMT_INTZ = ((D3DFORMAT)(MAKEFOURCC('I','N','T','Z'))); const D3DFORMAT D3DFMT_INTZ = ((D3DFORMAT)(MAKEFOURCC('I','N','T','Z')));
const D3DFORMAT D3DFMT_NULL = ((D3DFORMAT)(MAKEFOURCC('N','U','L','L'))); const D3DFORMAT D3DFMT_NULL = ((D3DFORMAT)(MAKEFOURCC('N','U','L','L')));
namespace es2dx namespace gl_d3d9
{ {
D3DCMPFUNC ConvertComparison(GLenum comparison); D3DCMPFUNC ConvertComparison(GLenum comparison);
...@@ -41,7 +41,7 @@ D3DMULTISAMPLE_TYPE GetMultisampleTypeFromSamples(GLsizei samples); ...@@ -41,7 +41,7 @@ D3DMULTISAMPLE_TYPE GetMultisampleTypeFromSamples(GLsizei samples);
} }
namespace dx2es namespace d3d9_gl
{ {
GLuint GetAlphaSize(D3DFORMAT colorFormat); GLuint GetAlphaSize(D3DFORMAT colorFormat);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment