Moves portions of utilities specific to D3D9 to the Renderer's domain

TRAC #21931 Signed-off-by: Daniel Koch Author: Shannon Woods git-svn-id: https://angleproject.googlecode.com/svn/branches/dx11proto@1376 736b8ea6-26fd-11df-bfd4-992fa37f6226
parent 3cef5391
......@@ -257,6 +257,8 @@
'libGLESv2/renderer/Renderer.h',
'libGLESv2/renderer/Renderer9.cpp',
'libGLESv2/renderer/Renderer9.h',
'libGLESv2/renderer/renderer9_utils.cpp',
'libGLESv2/renderer/renderer9_utils.h',
'libGLESv2/renderer/ShaderCache.h',
'libGLESv2/renderer/SwapChain.cpp',
'libGLESv2/renderer/SwapChain.h',
......
......@@ -12,6 +12,7 @@
#include "libGLESv2/main.h"
#include "libGLESv2/utilities.h"
#include "libGLESv2/renderer/renderer9_utils.h" // D3D9_REPLACE
#include "libGLESv2/Framebuffer.h"
namespace
......
......@@ -16,6 +16,7 @@
#include "libGLESv2/main.h"
#include "libGLESv2/mathutil.h"
#include "libGLESv2/utilities.h"
#include "libGLESv2/renderer/renderer9_utils.h" // D3D9_REPLACE
#include "libGLESv2/Blit.h"
#include "libGLESv2/ResourceManager.h"
#include "libGLESv2/Buffer.h"
......
......@@ -14,6 +14,8 @@
#include "libGLESv2/Texture.h"
#include "libGLESv2/utilities.h"
#include "libGLESv2/renderer/renderer9_utils.h" // D3D9_REPLACE
namespace gl
{
unsigned int RenderbufferStorage::mCurrentSerial = 1;
......
......@@ -247,6 +247,7 @@ copy "$(OutDir)libGLESv2.lib" "$(ProjectDir)..\..\lib\$(Configuration)\"
<ClCompile Include="Renderbuffer.cpp" />
<ClCompile Include="renderer\Renderer9.cpp" />
<ClCompile Include="renderer\Image.cpp" />
<ClCompile Include="renderer\renderer9_utils.cpp" />
<ClCompile Include="renderer\SwapChain.cpp" />
<ClCompile Include="renderer\TextureStorage.cpp" />
<ClCompile Include="ResourceManager.cpp" />
......@@ -280,6 +281,7 @@ copy "$(OutDir)libGLESv2.lib" "$(ProjectDir)..\..\lib\$(Configuration)\"
<ClInclude Include="renderer\Image.h" />
<ClInclude Include="renderer\Renderer.h" />
<ClInclude Include="renderer\Renderer9.h" />
<ClInclude Include="renderer\renderer9_utils.h" />
<ClInclude Include="renderer\ShaderCache.h" />
<ClInclude Include="renderer\SwapChain.h" />
<ClInclude Include="renderer\TextureStorage.h" />
......@@ -311,4 +313,4 @@ copy "$(OutDir)libGLESv2.lib" "$(ProjectDir)..\..\lib\$(Configuration)\"
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
</Project>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
......@@ -95,6 +95,9 @@
<ClCompile Include="renderer\TextureStorage.cpp">
<Filter>Renderer</Filter>
</ClCompile>
<ClCompile Include="renderer\renderer9_utils.cpp">
<Filter>Renderer</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="BinaryStream.h">
......@@ -199,6 +202,9 @@
<ClInclude Include="renderer\TextureStorage.h">
<Filter>Renderer</Filter>
</ClInclude>
<ClInclude Include="renderer\renderer9_utils.h">
<Filter>Renderer</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<None Include="libGLESv2.def">
......@@ -208,4 +214,4 @@
<ItemGroup>
<ResourceCompile Include="libGLESv2.rc" />
</ItemGroup>
</Project>
</Project>
\ No newline at end of file
......@@ -17,6 +17,8 @@
#include "libGLESv2/Texture.h"
#include "libGLESv2/Framebuffer.h"
#include "libGLESv2/renderer/renderer9_utils.h"
namespace gl
{
......
......@@ -10,6 +10,7 @@
#include "common/debug.h"
#include "libGLESv2/utilities.h"
#include "libGLESv2/renderer/Renderer9.h"
#include "libGLESv2/renderer/renderer9_utils.h"
#include "libGLESv2/renderer/TextureStorage.h"
#include "libEGL/Config.h"
......
......@@ -11,13 +11,14 @@
#include "common/debug.h"
#include "libGLESv2/utilities.h"
#include "libGLESv2/renderer/Renderer9.h" // D3D9_REPLACE
#include "libGLESv2/renderer/renderer9_utils.h" // D3D9_REPLACE
#include "libGLESv2/renderer/Renderer9.h" // D3D9_REPLACE
#include "libGLESv2/Context.h"
namespace renderer
{
SwapChain::SwapChain(Renderer9 *renderer, HWND window, HANDLE shareHandle,
SwapChain::SwapChain(Renderer9 *renderer, HWND window, HANDLE shareHandle,
GLenum backBufferFormat, GLenum depthBufferFormat)
: mRenderer(renderer), mWindow(window), mShareHandle(shareHandle),
mBackBufferFormat(backBufferFormat), mDepthBufferFormat(depthBufferFormat)
......@@ -209,7 +210,7 @@ EGLint SwapChain::reset(int backbufferWidth, int backbufferHeight, EGLint swapIn
//
// Some non-switchable AMD GPUs / drivers do not respect the source rectangle to Present. Therefore, when the vendor ID
// is not Intel, the back buffer width must be exactly the same width as the window or horizontal scaling will occur.
if (mRenderer->getAdapterVendor() == VENDOR_ID_INTEL)
if (mRenderer->getAdapterVendor() == VENDOR_ID_INTEL)
{
presentParameters.BackBufferWidth = (presentParameters.BackBufferWidth + 63) / 64 * 64;
}
......
......@@ -13,6 +13,8 @@
#include "libGLESv2/renderer/SwapChain.h"
#include "libGLESv2/Blit.h"
#include "libGLESv2/renderer/renderer9_utils.h"
#include "common/debug.h"
namespace gl
......
//
// Copyright (c) 2002-2012 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
// renderer9_utils.h: Conversion functions and other utility routines
// specific to the D3D9 renderer
#ifndef LIBGLESV2_RENDERER_RENDERER9_UTILS_H
#define LIBGLESV2_RENDERER_RENDERER9_UTILS_H
#define GL_APICALL
#include <GLES2/gl2.h>
#include <GLES2/gl2ext.h>
#include <d3d9.h>
#include "libGLESv2/utilities.h"
const D3DFORMAT D3DFMT_INTZ = ((D3DFORMAT)(MAKEFOURCC('I','N','T','Z')));
const D3DFORMAT D3DFMT_NULL = ((D3DFORMAT)(MAKEFOURCC('N','U','L','L')));
namespace es2dx
{
D3DCMPFUNC ConvertComparison(GLenum comparison);
D3DCOLOR ConvertColor(gl::Color color);
D3DBLEND ConvertBlendFunc(GLenum blend);
D3DBLENDOP ConvertBlendOp(GLenum blendOp);
D3DSTENCILOP ConvertStencilOp(GLenum stencilOp);
D3DTEXTUREADDRESS ConvertTextureWrap(GLenum wrap);
D3DCULL ConvertCullMode(GLenum cullFace, GLenum frontFace);
D3DCUBEMAP_FACES ConvertCubeFace(GLenum cubeFace);
DWORD ConvertColorMask(bool red, bool green, bool blue, bool alpha);
D3DTEXTUREFILTERTYPE ConvertMagFilter(GLenum magFilter, float maxAnisotropy);
void ConvertMinFilter(GLenum minFilter, D3DTEXTUREFILTERTYPE *d3dMinFilter, D3DTEXTUREFILTERTYPE *d3dMipFilter, float maxAnisotropy);
bool ConvertPrimitiveType(GLenum primitiveType, GLsizei elementCount,
D3DPRIMITIVETYPE *d3dPrimitiveType, int *d3dPrimitiveCount);
D3DFORMAT ConvertRenderbufferFormat(GLenum format);
D3DMULTISAMPLE_TYPE GetMultisampleTypeFromSamples(GLsizei samples);
}
namespace dx2es
{
GLuint GetAlphaSize(D3DFORMAT colorFormat);
GLuint GetStencilSize(D3DFORMAT stencilFormat);
GLsizei GetSamplesFromMultisampleType(D3DMULTISAMPLE_TYPE type);
bool IsFormatChannelEquivalent(D3DFORMAT d3dformat, GLenum format);
GLenum ConvertBackBufferFormat(D3DFORMAT format);
GLenum ConvertDepthStencilFormat(D3DFORMAT format);
GLenum GetEquivalentFormat(D3DFORMAT format);
}
namespace dx
{
bool IsCompressedFormat(D3DFORMAT format);
size_t ComputeRowSize(D3DFORMAT format, unsigned int width);
}
#endif // LIBGLESV2_RENDERER_RENDERER9_UTILS_H
......@@ -16,9 +16,6 @@
#include <string>
const D3DFORMAT D3DFMT_INTZ = ((D3DFORMAT)(MAKEFOURCC('I','N','T','Z')));
const D3DFORMAT D3DFMT_NULL = ((D3DFORMAT)(MAKEFOURCC('N','U','L','L')));
namespace gl
{
......@@ -63,53 +60,6 @@ GLuint GetDepthSize(GLenum depthFormat);
GLuint GetStencilSize(GLenum stencilFormat);
}
namespace es2dx
{
D3DCMPFUNC ConvertComparison(GLenum comparison);
D3DCOLOR ConvertColor(gl::Color color);
D3DBLEND ConvertBlendFunc(GLenum blend);
D3DBLENDOP ConvertBlendOp(GLenum blendOp);
D3DSTENCILOP ConvertStencilOp(GLenum stencilOp);
D3DTEXTUREADDRESS ConvertTextureWrap(GLenum wrap);
D3DCULL ConvertCullMode(GLenum cullFace, GLenum frontFace);
D3DCUBEMAP_FACES ConvertCubeFace(GLenum cubeFace);
DWORD ConvertColorMask(bool red, bool green, bool blue, bool alpha);
D3DTEXTUREFILTERTYPE ConvertMagFilter(GLenum magFilter, float maxAnisotropy);
void ConvertMinFilter(GLenum minFilter, D3DTEXTUREFILTERTYPE *d3dMinFilter, D3DTEXTUREFILTERTYPE *d3dMipFilter, float maxAnisotropy);
bool ConvertPrimitiveType(GLenum primitiveType, GLsizei elementCount,
D3DPRIMITIVETYPE *d3dPrimitiveType, int *d3dPrimitiveCount);
D3DFORMAT ConvertRenderbufferFormat(GLenum format);
D3DMULTISAMPLE_TYPE GetMultisampleTypeFromSamples(GLsizei samples);
}
namespace dx2es
{
GLuint GetAlphaSize(D3DFORMAT colorFormat);
GLuint GetRedSize(D3DFORMAT colorFormat);
GLuint GetGreenSize(D3DFORMAT colorFormat);
GLuint GetBlueSize(D3DFORMAT colorFormat);
GLuint GetDepthSize(D3DFORMAT depthFormat);
GLuint GetStencilSize(D3DFORMAT stencilFormat);
GLsizei GetSamplesFromMultisampleType(D3DMULTISAMPLE_TYPE type);
bool IsFormatChannelEquivalent(D3DFORMAT d3dformat, GLenum format);
bool ConvertReadBufferFormat(D3DFORMAT d3dformat, GLenum *format, GLenum *type);
GLenum ConvertBackBufferFormat(D3DFORMAT format);
GLenum ConvertDepthStencilFormat(D3DFORMAT format);
GLenum GetEquivalentFormat(D3DFORMAT format);
}
namespace dx
{
bool IsCompressedFormat(D3DFORMAT format);
size_t ComputeRowSize(D3DFORMAT format, unsigned int width);
}
std::string getTempPath();
void writeFile(const char* path, const void* data, size_t size);
......
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