Cleanup extraneous D3D9_REPLACE comments

Trac #22394 Signed-off-by: Nicolas Capens Signed-off-by: Shannon Woods Blit.cpp and Renderer9.h/.cpp will remain d3d9-specific. Remove various unused includes and a typedef. git-svn-id: https://angleproject.googlecode.com/svn/branches/dx11proto@1714 736b8ea6-26fd-11df-bfd4-992fa37f6226
parent ed36abd8
...@@ -17,7 +17,6 @@ ...@@ -17,7 +17,6 @@
#include "libGLESv2/main.h" #include "libGLESv2/main.h"
#include "libGLESv2/mathutil.h" #include "libGLESv2/mathutil.h"
#include "libGLESv2/utilities.h" #include "libGLESv2/utilities.h"
#include "libGLESv2/renderer/renderer9_utils.h" // D3D9_REPLACE
#include "libGLESv2/ResourceManager.h" #include "libGLESv2/ResourceManager.h"
#include "libGLESv2/Buffer.h" #include "libGLESv2/Buffer.h"
#include "libGLESv2/Fence.h" #include "libGLESv2/Fence.h"
......
...@@ -8,7 +8,6 @@ ...@@ -8,7 +8,6 @@
#include "libGLESv2/main.h" #include "libGLESv2/main.h"
#include "libGLESv2/utilities.h" #include "libGLESv2/utilities.h"
#include "libGLESv2/renderer/renderer9_utils.h" // D3D9_REPLACE
#include "common/debug.h" #include "common/debug.h"
#include "libEGL/Surface.h" #include "libEGL/Surface.h"
......
...@@ -12,9 +12,9 @@ ...@@ -12,9 +12,9 @@
#include "libGLESv2/main.h" #include "libGLESv2/main.h"
#include "libGLESv2/utilities.h" #include "libGLESv2/utilities.h"
#include "libGLESv2/renderer/renderer9_utils.h" // D3D9_REPLACE #include "libGLESv2/renderer/renderer9_utils.h"
#include "libGLESv2/renderer/TextureStorage9.h" // D3D9_REPLACE #include "libGLESv2/renderer/TextureStorage9.h"
#include "libGLESv2/renderer/RenderTarget9.h" // D3D9_REPLACE #include "libGLESv2/renderer/RenderTarget9.h"
#include "libGLESv2/Framebuffer.h" #include "libGLESv2/Framebuffer.h"
namespace namespace
...@@ -68,7 +68,6 @@ Blit::~Blit() ...@@ -68,7 +68,6 @@ Blit::~Blit()
} }
} }
// D3D9_REPLACE
void Blit::initGeometry() void Blit::initGeometry()
{ {
static const float quad[] = static const float quad[] =
...@@ -121,7 +120,7 @@ bool Blit::setShader(ShaderId source, const char *profile, ...@@ -121,7 +120,7 @@ bool Blit::setShader(ShaderId source, const char *profile,
D3DShaderType *(rx::Renderer9::*createShader)(const DWORD *, size_t length), D3DShaderType *(rx::Renderer9::*createShader)(const DWORD *, size_t length),
HRESULT (WINAPI IDirect3DDevice9::*setShader)(D3DShaderType*)) HRESULT (WINAPI IDirect3DDevice9::*setShader)(D3DShaderType*))
{ {
IDirect3DDevice9 *device = mRenderer->getDevice(); // D3D9_REPLACE IDirect3DDevice9 *device = mRenderer->getDevice();
D3DShaderType *shader; D3DShaderType *shader;
...@@ -187,7 +186,6 @@ bool Blit::boxFilter(IDirect3DSurface9 *source, IDirect3DSurface9 *dest) ...@@ -187,7 +186,6 @@ bool Blit::boxFilter(IDirect3DSurface9 *source, IDirect3DSurface9 *dest)
return false; return false;
} }
// D3D9_REPLACE
IDirect3DDevice9 *device = mRenderer->getDevice(); IDirect3DDevice9 *device = mRenderer->getDevice();
saveState(); saveState();
...@@ -215,7 +213,6 @@ bool Blit::boxFilter(IDirect3DSurface9 *source, IDirect3DSurface9 *dest) ...@@ -215,7 +213,6 @@ bool Blit::boxFilter(IDirect3DSurface9 *source, IDirect3DSurface9 *dest)
bool Blit::copy(gl::Framebuffer *framebuffer, const RECT &sourceRect, GLenum destFormat, GLint xoffset, GLint yoffset, TextureStorageInterface2D *storage, GLint level) bool Blit::copy(gl::Framebuffer *framebuffer, const RECT &sourceRect, GLenum destFormat, GLint xoffset, GLint yoffset, TextureStorageInterface2D *storage, GLint level)
{ {
// D3D9_REPLACE
RenderTarget9 *renderTarget = NULL; RenderTarget9 *renderTarget = NULL;
IDirect3DSurface9 *source = NULL; IDirect3DSurface9 *source = NULL;
gl::Renderbuffer *colorbuffer = framebuffer->getColorbuffer(); gl::Renderbuffer *colorbuffer = framebuffer->getColorbuffer();
...@@ -252,7 +249,6 @@ bool Blit::copy(gl::Framebuffer *framebuffer, const RECT &sourceRect, GLenum des ...@@ -252,7 +249,6 @@ bool Blit::copy(gl::Framebuffer *framebuffer, const RECT &sourceRect, GLenum des
bool Blit::copy(gl::Framebuffer *framebuffer, const RECT &sourceRect, GLenum destFormat, GLint xoffset, GLint yoffset, TextureStorageInterfaceCube *storage, GLenum target, GLint level) bool Blit::copy(gl::Framebuffer *framebuffer, const RECT &sourceRect, GLenum destFormat, GLint xoffset, GLint yoffset, TextureStorageInterfaceCube *storage, GLenum target, GLint level)
{ {
// D3D9_REPLACE
RenderTarget9 *renderTarget = NULL; RenderTarget9 *renderTarget = NULL;
IDirect3DSurface9 *source = NULL; IDirect3DSurface9 *source = NULL;
gl::Renderbuffer *colorbuffer = framebuffer->getColorbuffer(); gl::Renderbuffer *colorbuffer = framebuffer->getColorbuffer();
...@@ -328,7 +324,6 @@ bool Blit::formatConvert(IDirect3DSurface9 *source, const RECT &sourceRect, GLen ...@@ -328,7 +324,6 @@ bool Blit::formatConvert(IDirect3DSurface9 *source, const RECT &sourceRect, GLen
return false; return false;
} }
// D3D9_REPLACE
IDirect3DDevice9 *device = mRenderer->getDevice(); IDirect3DDevice9 *device = mRenderer->getDevice();
saveState(); saveState();
...@@ -409,12 +404,11 @@ bool Blit::setFormatConvertShaders(GLenum destFormat) ...@@ -409,12 +404,11 @@ bool Blit::setFormatConvertShaders(GLenum destFormat)
break; break;
} }
mRenderer->getDevice()->SetPixelShaderConstantF(0, psConst0, 1); // D3D9_REPLACE mRenderer->getDevice()->SetPixelShaderConstantF(0, psConst0, 1);
return true; return true;
} }
// D3D9_REPLACE
IDirect3DTexture9 *Blit::copySurfaceToTexture(IDirect3DSurface9 *surface, const RECT &sourceRect) IDirect3DTexture9 *Blit::copySurfaceToTexture(IDirect3DSurface9 *surface, const RECT &sourceRect)
{ {
if (!surface) if (!surface)
...@@ -422,7 +416,7 @@ IDirect3DTexture9 *Blit::copySurfaceToTexture(IDirect3DSurface9 *surface, const ...@@ -422,7 +416,7 @@ IDirect3DTexture9 *Blit::copySurfaceToTexture(IDirect3DSurface9 *surface, const
return NULL; return NULL;
} }
IDirect3DDevice9 *device = mRenderer->getDevice(); // D3D9_REPLACE IDirect3DDevice9 *device = mRenderer->getDevice();
D3DSURFACE_DESC sourceDesc; D3DSURFACE_DESC sourceDesc;
surface->GetDesc(&sourceDesc); surface->GetDesc(&sourceDesc);
...@@ -464,7 +458,7 @@ IDirect3DTexture9 *Blit::copySurfaceToTexture(IDirect3DSurface9 *surface, const ...@@ -464,7 +458,7 @@ IDirect3DTexture9 *Blit::copySurfaceToTexture(IDirect3DSurface9 *surface, const
void Blit::setViewport(const RECT &sourceRect, GLint xoffset, GLint yoffset) void Blit::setViewport(const RECT &sourceRect, GLint xoffset, GLint yoffset)
{ {
IDirect3DDevice9 *device = mRenderer->getDevice(); // D3D9_REPLACE IDirect3DDevice9 *device = mRenderer->getDevice();
D3DVIEWPORT9 vp; D3DVIEWPORT9 vp;
vp.X = xoffset; vp.X = xoffset;
...@@ -479,7 +473,6 @@ void Blit::setViewport(const RECT &sourceRect, GLint xoffset, GLint yoffset) ...@@ -479,7 +473,6 @@ void Blit::setViewport(const RECT &sourceRect, GLint xoffset, GLint yoffset)
device->SetVertexShaderConstantF(0, halfPixelAdjust, 1); device->SetVertexShaderConstantF(0, halfPixelAdjust, 1);
} }
// D3D9_REPLACE
void Blit::setCommonBlitState() void Blit::setCommonBlitState()
{ {
IDirect3DDevice9 *device = mRenderer->getDevice(); IDirect3DDevice9 *device = mRenderer->getDevice();
...@@ -510,7 +503,6 @@ void Blit::setCommonBlitState() ...@@ -510,7 +503,6 @@ void Blit::setCommonBlitState()
} }
} }
// D3D9_REPLACE
void Blit::render() void Blit::render()
{ {
IDirect3DDevice9 *device = mRenderer->getDevice(); IDirect3DDevice9 *device = mRenderer->getDevice();
...@@ -522,7 +514,6 @@ void Blit::render() ...@@ -522,7 +514,6 @@ void Blit::render()
hr = device->DrawPrimitive(D3DPT_TRIANGLESTRIP, 0, 2); hr = device->DrawPrimitive(D3DPT_TRIANGLESTRIP, 0, 2);
} }
// D3D9_REPLACE
void Blit::saveState() void Blit::saveState()
{ {
IDirect3DDevice9 *device = mRenderer->getDevice(); IDirect3DDevice9 *device = mRenderer->getDevice();
...@@ -575,7 +566,6 @@ void Blit::saveState() ...@@ -575,7 +566,6 @@ void Blit::saveState()
} }
} }
// D3D9_REPLACE
void Blit::restoreState() void Blit::restoreState()
{ {
IDirect3DDevice9 *device = mRenderer->getDevice(); IDirect3DDevice9 *device = mRenderer->getDevice();
......
...@@ -191,7 +191,7 @@ void Image9::createSurface() ...@@ -191,7 +191,7 @@ void Image9::createSurface()
GLsizei requestHeight = mHeight; GLsizei requestHeight = mHeight;
gl::MakeValidSize(true, gl::IsCompressed(mInternalFormat), &requestWidth, &requestHeight, &levelToFetch); gl::MakeValidSize(true, gl::IsCompressed(mInternalFormat), &requestWidth, &requestHeight, &levelToFetch);
IDirect3DDevice9 *device = mRenderer->getDevice(); // D3D9_REPLACE IDirect3DDevice9 *device = mRenderer->getDevice();
HRESULT result = device->CreateTexture(requestWidth, requestHeight, levelToFetch + 1, 0, d3dFormat, HRESULT result = device->CreateTexture(requestWidth, requestHeight, levelToFetch + 1, 0, d3dFormat,
poolToUse, &newTexture, NULL); poolToUse, &newTexture, NULL);
...@@ -321,7 +321,7 @@ bool Image9::updateSurface(IDirect3DSurface9 *destSurface, GLint xoffset, GLint ...@@ -321,7 +321,7 @@ bool Image9::updateSurface(IDirect3DSurface9 *destSurface, GLint xoffset, GLint
POINT point = {rect.left, rect.top}; POINT point = {rect.left, rect.top};
IDirect3DDevice9 *device = mRenderer->getDevice(); // D3D9_REPLACE IDirect3DDevice9 *device = mRenderer->getDevice();
if (mD3DPool == D3DPOOL_MANAGED) if (mD3DPool == D3DPOOL_MANAGED)
{ {
...@@ -504,7 +504,7 @@ void Image9::copy(GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, ...@@ -504,7 +504,7 @@ void Image9::copy(GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width,
return error(GL_OUT_OF_MEMORY); return error(GL_OUT_OF_MEMORY);
} }
IDirect3DDevice9 *device = mRenderer->getDevice(); // D3D9_REPLACE IDirect3DDevice9 *device = mRenderer->getDevice();
IDirect3DSurface9 *renderTargetData = NULL; IDirect3DSurface9 *renderTargetData = NULL;
D3DSURFACE_DESC description; D3DSURFACE_DESC description;
......
...@@ -15,8 +15,6 @@ ...@@ -15,8 +15,6 @@
#include "common/angleutils.h" #include "common/angleutils.h"
struct IDirect3DSurface9; // D3D9_REPLACE
namespace rx namespace rx
{ {
class RenderTarget class RenderTarget
......
...@@ -596,7 +596,6 @@ void Renderer9::endScene() ...@@ -596,7 +596,6 @@ void Renderer9::endScene()
} }
} }
// D3D9_REPLACE
void Renderer9::sync(bool block) void Renderer9::sync(bool block)
{ {
HRESULT result; HRESULT result;
...@@ -642,7 +641,6 @@ SwapChain *Renderer9::createSwapChain(HWND window, HANDLE shareHandle, GLenum ba ...@@ -642,7 +641,6 @@ SwapChain *Renderer9::createSwapChain(HWND window, HANDLE shareHandle, GLenum ba
return new rx::SwapChain9(this, window, shareHandle, backBufferFormat, depthBufferFormat); return new rx::SwapChain9(this, window, shareHandle, backBufferFormat, depthBufferFormat);
} }
// D3D9_REPLACE
IDirect3DQuery9* Renderer9::allocateEventQuery() IDirect3DQuery9* Renderer9::allocateEventQuery()
{ {
IDirect3DQuery9 *query = NULL; IDirect3DQuery9 *query = NULL;
...@@ -661,7 +659,6 @@ IDirect3DQuery9* Renderer9::allocateEventQuery() ...@@ -661,7 +659,6 @@ IDirect3DQuery9* Renderer9::allocateEventQuery()
return query; return query;
} }
// D3D9_REPLACE
void Renderer9::freeEventQuery(IDirect3DQuery9* query) void Renderer9::freeEventQuery(IDirect3DQuery9* query)
{ {
if (mEventQueryPool.size() > 1000) if (mEventQueryPool.size() > 1000)
...@@ -2252,7 +2249,6 @@ bool Renderer9::getInstancingSupport() const ...@@ -2252,7 +2249,6 @@ bool Renderer9::getInstancingSupport() const
bool Renderer9::getShareHandleSupport() const bool Renderer9::getShareHandleSupport() const
{ {
// PIX doesn't seem to support using share handles, so disable them. // PIX doesn't seem to support using share handles, so disable them.
// D3D9_REPLACE
return (mD3d9Ex != NULL) && !gl::perfActive(); return (mD3d9Ex != NULL) && !gl::perfActive();
} }
...@@ -3029,7 +3025,6 @@ bool Renderer9::copyToRenderTarget(IDirect3DSurface9 *dest, IDirect3DSurface9 *s ...@@ -3029,7 +3025,6 @@ bool Renderer9::copyToRenderTarget(IDirect3DSurface9 *dest, IDirect3DSurface9 *s
if (source && dest) if (source && dest)
{ {
HRESULT result = D3DERR_OUTOFVIDEOMEMORY; HRESULT result = D3DERR_OUTOFVIDEOMEMORY;
IDirect3DDevice9 *device = getDevice(); // D3D9_REPLACE
if (fromManaged) if (fromManaged)
{ {
...@@ -3037,19 +3032,19 @@ bool Renderer9::copyToRenderTarget(IDirect3DSurface9 *dest, IDirect3DSurface9 *s ...@@ -3037,19 +3032,19 @@ bool Renderer9::copyToRenderTarget(IDirect3DSurface9 *dest, IDirect3DSurface9 *s
source->GetDesc(&desc); source->GetDesc(&desc);
IDirect3DSurface9 *surf = 0; IDirect3DSurface9 *surf = 0;
result = device->CreateOffscreenPlainSurface(desc.Width, desc.Height, desc.Format, D3DPOOL_SYSTEMMEM, &surf, NULL); result = mDevice->CreateOffscreenPlainSurface(desc.Width, desc.Height, desc.Format, D3DPOOL_SYSTEMMEM, &surf, NULL);
if (SUCCEEDED(result)) if (SUCCEEDED(result))
{ {
Image9::copyLockableSurfaces(surf, source); Image9::copyLockableSurfaces(surf, source);
result = device->UpdateSurface(surf, NULL, dest, NULL); result = mDevice->UpdateSurface(surf, NULL, dest, NULL);
surf->Release(); surf->Release();
} }
} }
else else
{ {
endScene(); endScene();
result = device->StretchRect(source, NULL, dest, NULL, D3DTEXF_NONE); result = mDevice->StretchRect(source, NULL, dest, NULL, D3DTEXF_NONE);
} }
if (FAILED(result)) if (FAILED(result))
......
...@@ -137,7 +137,7 @@ class Renderer9 : public Renderer ...@@ -137,7 +137,7 @@ class Renderer9 : public Renderer
virtual int getMaxTextureWidth() const; virtual int getMaxTextureWidth() const;
virtual int getMaxTextureHeight() const; virtual int getMaxTextureHeight() const;
virtual bool get32BitIndexSupport() const; virtual bool get32BitIndexSupport() const;
DWORD getCapsDeclTypes() const; // D3D9_REPLACE DWORD getCapsDeclTypes() const;
virtual int getMinSwapInterval() const; virtual int getMinSwapInterval() const;
virtual int getMaxSwapInterval() const; virtual int getMaxSwapInterval() const;
......
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