Bug 629538 - Upgrade ANGLE to r550 - 2/3 - r=vlad, a=blocking2.0

This commit is contained in:
Benoit Jacob 2011-01-29 22:31:21 -05:00
parent 3a128e9a04
commit 28f3b24534
9 changed files with 154 additions and 101 deletions

View File

@ -1,16 +1,14 @@
This is the ANGLE project, from http://code.google.com/p/angleproject/. This is the ANGLE project, from http://code.google.com/p/angleproject/.
Current revision: r515 Current revision: r550
Local patches: Applied local patches:
angle-shared.patch - add declspec dllexport/dllimport support on win32 angle-shared.patch - add declspec dllexport/dllimport support on win32
angle-fixes.patch - fix angle issues 51 & 52 angle-fixes.patch - fix angle issues 51 & 52
angle-nspr-misc.patch - don't bother with ANGLE_OS detection with NSPR angle-nspr-misc.patch - don't bother with ANGLE_OS detection with NSPR
angle-pbuffers.patch - add pbuffer support to ANGLE, and d3d texture handle query (angle issue 91)
== Visual Studio Solution Files == == Visual Studio Solution Files ==
The VS solution/project files that are used to build ANGLE are built The VS solution/project files that are used to build ANGLE are built

View File

@ -1,37 +1,14 @@
Fixes for angle defects 51 and 52 # HG changeset patch
# Parent 50279bda70bb802be20e508ef1f2d7deebf9bc64
Index: src/libGLESv2/Texture.cpp diff --git a/gfx/angle/src/libGLESv2/Renderbuffer.cpp b/gfx/angle/src/libGLESv2/Renderbuffer.cpp
=================================================================== --- a/gfx/angle/src/libGLESv2/Renderbuffer.cpp
--- src/libGLESv2/Texture.cpp (revision 474) +++ b/gfx/angle/src/libGLESv2/Renderbuffer.cpp
+++ src/libGLESv2/Texture.cpp (working copy) @@ -241,61 +241,61 @@ Colorbuffer::~Colorbuffer()
@@ -1207,6 +1207,9 @@
mHeight = height << level;
mImageArray[0].format = internalFormat;
mType = type;
+
+ if (mColorbufferProxy.get())
+ mColorbufferProxy->setStorage(new TextureColorbufferProxy(this, GL_TEXTURE_2D));
} }
}
return !textureOkay; bool Colorbuffer::isColorbuffer() const
@@ -2081,6 +2084,12 @@ {
mImageArray[0][0].height = width << level;
mImageArray[0][0].format = internalFormat;
+
+ for (int i = 0; i < 6; i++)
+ {
+ if (mFaceProxies[i].get())
+ mFaceProxies[i]->setStorage(new TextureColorbufferProxy(this, GL_TEXTURE_CUBE_MAP_POSITIVE_X + i));
+ }
}
return !textureOkay;
Index: src/libGLESv2/Renderbuffer.cpp
===================================================================
--- src/libGLESv2/Renderbuffer.cpp (revision 474)
+++ src/libGLESv2/Renderbuffer.cpp (working copy)
@@ -246,12 +246,12 @@
return true; return true;
} }
@ -47,7 +24,7 @@ Index: src/libGLESv2/Renderbuffer.cpp
return es2dx::GetRedSize(description.Format); return es2dx::GetRedSize(description.Format);
} }
@@ -259,12 +259,12 @@
return 0; return 0;
} }
@ -63,7 +40,7 @@ Index: src/libGLESv2/Renderbuffer.cpp
return es2dx::GetGreenSize(description.Format); return es2dx::GetGreenSize(description.Format);
} }
@@ -272,12 +272,12 @@
return 0; return 0;
} }
@ -79,7 +56,7 @@ Index: src/libGLESv2/Renderbuffer.cpp
return es2dx::GetBlueSize(description.Format); return es2dx::GetBlueSize(description.Format);
} }
@@ -285,12 +285,12 @@
return 0; return 0;
} }
@ -95,11 +72,20 @@ Index: src/libGLESv2/Renderbuffer.cpp
return es2dx::GetAlphaSize(description.Format); return es2dx::GetAlphaSize(description.Format);
} }
Index: src/libGLESv2/Renderbuffer.h
=================================================================== return 0;
--- src/libGLESv2/Renderbuffer.h (revision 474) }
+++ src/libGLESv2/Renderbuffer.h (working copy)
@@ -109,10 +109,10 @@ IDirect3DSurface9 *Colorbuffer::getRenderTarget()
diff --git a/gfx/angle/src/libGLESv2/Renderbuffer.h b/gfx/angle/src/libGLESv2/Renderbuffer.h
--- a/gfx/angle/src/libGLESv2/Renderbuffer.h
+++ b/gfx/angle/src/libGLESv2/Renderbuffer.h
@@ -104,20 +104,20 @@ class Colorbuffer : public RenderbufferS
explicit Colorbuffer(IDirect3DSurface9 *renderTarget);
explicit Colorbuffer(const Texture* texture);
Colorbuffer(int width, int height, GLenum format, GLsizei samples);
~Colorbuffer();
bool isColorbuffer() const; bool isColorbuffer() const;
@ -114,3 +100,54 @@ Index: src/libGLESv2/Renderbuffer.h
IDirect3DSurface9 *getRenderTarget(); IDirect3DSurface9 *getRenderTarget();
protected:
IDirect3DSurface9 *mRenderTarget;
private:
DISALLOW_COPY_AND_ASSIGN(Colorbuffer);
diff --git a/gfx/angle/src/libGLESv2/Texture.cpp b/gfx/angle/src/libGLESv2/Texture.cpp
--- a/gfx/angle/src/libGLESv2/Texture.cpp
+++ b/gfx/angle/src/libGLESv2/Texture.cpp
@@ -1313,16 +1313,19 @@ bool Texture2D::redefineTexture(GLint le
mTexture = NULL;
dropTexture();
}
mWidth = width << level;
mHeight = height << level;
mImageArray[0].format = internalFormat;
mType = type;
+
+ if (mColorbufferProxy.get())
+ mColorbufferProxy->setStorage(new TextureColorbufferProxy(this, GL_TEXTURE_2D));
}
return !textureOkay;
}
void Texture2D::setImage(GLint level, GLenum internalFormat, GLsizei width, GLsizei height, GLenum format, GLenum type, GLint unpackAlignment, const void *pixels)
{
redefineTexture(level, internalFormat, width, height, type);
@@ -2210,16 +2213,22 @@ bool TextureCubeMap::redefineTexture(GLi
}
mWidth = width << level;
mImageArray[0][0].width = width << level;
mHeight = width << level;
mImageArray[0][0].height = width << level;
mImageArray[0][0].format = internalFormat;
+
+ for (int i = 0; i < 6; i++)
+ {
+ if (mFaceProxies[i].get())
+ mFaceProxies[i]->setStorage(new TextureColorbufferProxy(this, GL_TEXTURE_CUBE_MAP_POSITIVE_X + i));
+ }
}
return !textureOkay;
}
void TextureCubeMap::copyImage(GLenum target, GLint level, GLenum internalFormat, GLint x, GLint y, GLsizei width, GLsizei height, Framebuffer *source)
{
IDirect3DSurface9 *renderTarget = source->getRenderTarget();

View File

@ -1,9 +1,14 @@
# HG changeset patch # HG changeset patch
# Parent f0e6e4c311dd940147f1589d72cc87f8ce755697 # Parent 3f4e2a35c49bb865018798a76b62c169d8e3537b
diff --git a/gfx/angle/src/compiler/osinclude.h b/gfx/angle/src/compiler/osinclude.h diff --git a/gfx/angle/src/compiler/osinclude.h b/gfx/angle/src/compiler/osinclude.h
--- a/gfx/angle/src/compiler/osinclude.h --- a/gfx/angle/src/compiler/osinclude.h
+++ b/gfx/angle/src/compiler/osinclude.h +++ b/gfx/angle/src/compiler/osinclude.h
@@ -12,8 +12,10 @@ @@ -7,17 +7,19 @@
#ifndef __OSINCLUDE_H
#define __OSINCLUDE_H
//
// This file contains contains os-specific datatypes and
// declares any os-specific functions. // declares any os-specific functions.
// //
@ -15,3 +20,7 @@ diff --git a/gfx/angle/src/compiler/osinclude.h b/gfx/angle/src/compiler/osinclu
#elif defined(__APPLE__) || defined(__linux__) || \ #elif defined(__APPLE__) || defined(__linux__) || \
defined(__FreeBSD__) || defined(__OpenBSD__) || \ defined(__FreeBSD__) || defined(__OpenBSD__) || \
defined(__sun) defined(__sun)
#define ANGLE_OS_POSIX
#else
#error Unsupported platform.
#endif

View File

@ -1,3 +1,5 @@
# HG changeset patch
# Parent 0f2a334e5049bffe457bd31d3d8f5550af7ba299
diff --git a/gfx/angle/include/GLSLANG/ShaderLang.h b/gfx/angle/include/GLSLANG/ShaderLang.h diff --git a/gfx/angle/include/GLSLANG/ShaderLang.h b/gfx/angle/include/GLSLANG/ShaderLang.h
--- a/gfx/angle/include/GLSLANG/ShaderLang.h --- a/gfx/angle/include/GLSLANG/ShaderLang.h
+++ b/gfx/angle/include/GLSLANG/ShaderLang.h +++ b/gfx/angle/include/GLSLANG/ShaderLang.h
@ -38,31 +40,7 @@ diff --git a/gfx/angle/include/GLSLANG/ShaderLang.h b/gfx/angle/include/GLSLANG/
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
@@ -73,21 +93,21 @@ typedef enum { @@ -107,17 +127,17 @@ typedef struct
SH_OBJECT_CODE = 0x0004,
SH_ATTRIBUTES_UNIFORMS = 0x0008
} ShCompileOptions;
//
// Driver must call this first, once, before doing any other
// compiler operations.
//
-int ShInitialize();
+ANGLE_API int ShInitialize();
//
// Driver should call this at shutdown.
//
-int ShFinalize();
+ANGLE_API int ShFinalize();
//
// Implementation dependent built-in resources (constants and extensions).
// The names for these resources has been obtained by stripping gl_/GL_.
//
typedef struct
{
// Constants.
@@ -103,17 +123,17 @@ typedef struct
// Extensions. // Extensions.
// Set to 1 to enable the extension, else 0. // Set to 1 to enable the extension, else 0.
int OES_standard_derivatives; int OES_standard_derivatives;
@ -81,7 +59,7 @@ diff --git a/gfx/angle/include/GLSLANG/ShaderLang.h b/gfx/angle/include/GLSLANG/
// //
// If handle creation fails, 0 will be returned. // If handle creation fails, 0 will be returned.
// //
@@ -123,19 +143,19 @@ typedef void* ShHandle; @@ -127,19 +147,19 @@ typedef void* ShHandle;
// Driver calls these to create and destroy compiler objects. // Driver calls these to create and destroy compiler objects.
// //
// Returns the handle of constructed compiler. // Returns the handle of constructed compiler.
@ -103,7 +81,7 @@ diff --git a/gfx/angle/include/GLSLANG/ShaderLang.h b/gfx/angle/include/GLSLANG/
// handle: Specifies the handle of compiler to be used. // handle: Specifies the handle of compiler to be used.
// shaderStrings: Specifies an array of pointers to null-terminated strings // shaderStrings: Specifies an array of pointers to null-terminated strings
// containing the shader source code. // containing the shader source code.
@@ -152,17 +172,17 @@ void ShDestruct(ShHandle handle); @@ -156,17 +176,17 @@ void ShDestruct(ShHandle handle);
// SH_INTERMEDIATE_TREE: Writes intermediate tree to info log. // SH_INTERMEDIATE_TREE: Writes intermediate tree to info log.
// Can be queried by calling ShGetInfoLog(). // Can be queried by calling ShGetInfoLog().
// SH_OBJECT_CODE: Translates intermediate tree to glsl or hlsl shader. // SH_OBJECT_CODE: Translates intermediate tree to glsl or hlsl shader.
@ -122,7 +100,7 @@ diff --git a/gfx/angle/include/GLSLANG/ShaderLang.h b/gfx/angle/include/GLSLANG/
// Returns a parameter from a compiled shader. // Returns a parameter from a compiled shader.
// Parameters: // Parameters:
@@ -178,53 +198,53 @@ int ShCompile( @@ -182,53 +202,53 @@ int ShCompile(
// variable name including the null // variable name including the null
// termination character. // termination character.
// SH_ACTIVE_UNIFORMS: the number of active uniform variables. // SH_ACTIVE_UNIFORMS: the number of active uniform variables.
@ -180,7 +158,7 @@ diff --git a/gfx/angle/include/GLSLANG/ShaderLang.h b/gfx/angle/include/GLSLANG/
// Returns information about an active uniform variable. // Returns information about an active uniform variable.
// Parameters: // Parameters:
@@ -235,17 +255,17 @@ void ShGetActiveAttrib(const ShHandle ha @@ -239,17 +259,17 @@ void ShGetActiveAttrib(const ShHandle ha
// other than NULL is passed. // other than NULL is passed.
// size: Returns the size of the uniform variable. // size: Returns the size of the uniform variable.
// type: Returns the data type of the uniform variable. // type: Returns the data type of the uniform variable.

View File

@ -6,6 +6,26 @@
#ifndef _COMPILER_INTERFACE_INCLUDED_ #ifndef _COMPILER_INTERFACE_INCLUDED_
#define _COMPILER_INTERFACE_INCLUDED_ #define _COMPILER_INTERFACE_INCLUDED_
#ifdef MOZILLA_VERSION
#include "nscore.h"
#ifdef WIN32
# if !defined(MOZ_ENABLE_LIBXUL) && !defined(MOZ_STATIC_BUILD)
# ifdef ANGLE_BUILD
# define ANGLE_API NS_EXPORT
# else
# define ANGLE_API NS_IMPORT
# endif
# else
# define ANGLE_API /*nothing*/
# endif
#else
# define ANGLE_API NS_EXTERNAL_VIS
#endif
#else
#define ANGLE_API /*nothing*/
#endif
// //
// This is the platform independent interface between an OGL driver // This is the platform independent interface between an OGL driver
// and the shading language compiler. // and the shading language compiler.
@ -112,7 +132,7 @@ typedef struct
// //
// Initialize built-in resources with minimum expected values. // Initialize built-in resources with minimum expected values.
// //
void ShInitBuiltInResources(ShBuiltInResources* resources); ANGLE_API void ShInitBuiltInResources(ShBuiltInResources* resources);
// //
// ShHandle held by but opaque to the driver. It is allocated, // ShHandle held by but opaque to the driver. It is allocated,
@ -132,9 +152,9 @@ typedef void* ShHandle;
// spec: Specifies the language spec the compiler must conform to - // spec: Specifies the language spec the compiler must conform to -
// SH_GLES2_SPEC or SH_WEBGL_SPEC. // SH_GLES2_SPEC or SH_WEBGL_SPEC.
// resources: Specifies the built-in resources. // resources: Specifies the built-in resources.
ShHandle ShConstructCompiler(ShShaderType type, ShShaderSpec spec, ANGLE_API ShHandle ShConstructCompiler(ShShaderType type, ShShaderSpec spec,
const ShBuiltInResources* resources); const ShBuiltInResources* resources);
void ShDestruct(ShHandle handle); ANGLE_API void ShDestruct(ShHandle handle);
// //
// Compiles the given shader source. // Compiles the given shader source.
@ -161,7 +181,7 @@ void ShDestruct(ShHandle handle);
// Can be queried by calling ShGetActiveAttrib() and // Can be queried by calling ShGetActiveAttrib() and
// ShGetActiveUniform(). // ShGetActiveUniform().
// //
int ShCompile( ANGLE_API int ShCompile(
const ShHandle handle, const ShHandle handle,
const char* const shaderStrings[], const char* const shaderStrings[],
const int numStrings, const int numStrings,
@ -187,7 +207,7 @@ int ShCompile(
// termination character. // termination character.
// //
// params: Requested parameter // params: Requested parameter
void ShGetInfo(const ShHandle handle, ShShaderInfo pname, int* params); ANGLE_API void ShGetInfo(const ShHandle handle, ShShaderInfo pname, int* params);
// Returns nul-terminated information log for a compiled shader. // Returns nul-terminated information log for a compiled shader.
// Parameters: // Parameters:
@ -197,7 +217,7 @@ void ShGetInfo(const ShHandle handle, ShShaderInfo pname, int* params);
// to accomodate the information log. The size of the buffer required // to accomodate the information log. The size of the buffer required
// to store the returned information log can be obtained by calling // to store the returned information log can be obtained by calling
// ShGetInfo with SH_INFO_LOG_LENGTH. // ShGetInfo with SH_INFO_LOG_LENGTH.
void ShGetInfoLog(const ShHandle handle, char* infoLog); ANGLE_API void ShGetInfoLog(const ShHandle handle, char* infoLog);
// Returns null-terminated object code for a compiled shader. // Returns null-terminated object code for a compiled shader.
// Parameters: // Parameters:
@ -207,7 +227,7 @@ void ShGetInfoLog(const ShHandle handle, char* infoLog);
// accomodate the object code. The size of the buffer required to // accomodate the object code. The size of the buffer required to
// store the returned object code can be obtained by calling // store the returned object code can be obtained by calling
// ShGetInfo with SH_OBJECT_CODE_LENGTH. // ShGetInfo with SH_OBJECT_CODE_LENGTH.
void ShGetObjectCode(const ShHandle handle, char* objCode); ANGLE_API void ShGetObjectCode(const ShHandle handle, char* objCode);
// Returns information about an active attribute variable. // Returns information about an active attribute variable.
// Parameters: // Parameters:
@ -223,7 +243,7 @@ void ShGetObjectCode(const ShHandle handle, char* objCode);
// accomodate the attribute variable name. The size of the buffer // accomodate the attribute variable name. The size of the buffer
// required to store the attribute variable name can be obtained by // required to store the attribute variable name can be obtained by
// calling ShGetInfo with SH_ACTIVE_ATTRIBUTE_MAX_LENGTH. // calling ShGetInfo with SH_ACTIVE_ATTRIBUTE_MAX_LENGTH.
void ShGetActiveAttrib(const ShHandle handle, ANGLE_API void ShGetActiveAttrib(const ShHandle handle,
int index, int index,
int* length, int* length,
int* size, int* size,
@ -244,7 +264,7 @@ void ShGetActiveAttrib(const ShHandle handle,
// accomodate the uniform variable name. The size of the buffer required // accomodate the uniform variable name. The size of the buffer required
// to store the uniform variable name can be obtained by calling // to store the uniform variable name can be obtained by calling
// ShGetInfo with SH_ACTIVE_UNIFORMS_MAX_LENGTH. // ShGetInfo with SH_ACTIVE_UNIFORMS_MAX_LENGTH.
void ShGetActiveUniform(const ShHandle handle, ANGLE_API void ShGetActiveUniform(const ShHandle handle,
int index, int index,
int* length, int* length,
int* size, int* size,

View File

@ -12,7 +12,9 @@
// declares any os-specific functions. // declares any os-specific functions.
// //
#if defined(_WIN32) || defined(_WIN64) #if defined(ANGLE_USE_NSPR)
/* no need to define anything when using NSPR */
#elif defined(_WIN32) || defined(_WIN64)
#define ANGLE_OS_WIN #define ANGLE_OS_WIN
#elif defined(__APPLE__) || defined(__linux__) || \ #elif defined(__APPLE__) || defined(__linux__) || \
defined(__FreeBSD__) || defined(__OpenBSD__) || \ defined(__FreeBSD__) || defined(__OpenBSD__) || \

View File

@ -246,12 +246,12 @@ bool Colorbuffer::isColorbuffer() const
return true; return true;
} }
GLuint Colorbuffer::getRedSize() const GLuint Colorbuffer::getRedSize()
{ {
if (mRenderTarget) if (getRenderTarget())
{ {
D3DSURFACE_DESC description; D3DSURFACE_DESC description;
mRenderTarget->GetDesc(&description); getRenderTarget()->GetDesc(&description);
return es2dx::GetRedSize(description.Format); return es2dx::GetRedSize(description.Format);
} }
@ -259,12 +259,12 @@ GLuint Colorbuffer::getRedSize() const
return 0; return 0;
} }
GLuint Colorbuffer::getGreenSize() const GLuint Colorbuffer::getGreenSize()
{ {
if (mRenderTarget) if (getRenderTarget())
{ {
D3DSURFACE_DESC description; D3DSURFACE_DESC description;
mRenderTarget->GetDesc(&description); getRenderTarget()->GetDesc(&description);
return es2dx::GetGreenSize(description.Format); return es2dx::GetGreenSize(description.Format);
} }
@ -272,12 +272,12 @@ GLuint Colorbuffer::getGreenSize() const
return 0; return 0;
} }
GLuint Colorbuffer::getBlueSize() const GLuint Colorbuffer::getBlueSize()
{ {
if (mRenderTarget) if (getRenderTarget())
{ {
D3DSURFACE_DESC description; D3DSURFACE_DESC description;
mRenderTarget->GetDesc(&description); getRenderTarget()->GetDesc(&description);
return es2dx::GetBlueSize(description.Format); return es2dx::GetBlueSize(description.Format);
} }
@ -285,12 +285,12 @@ GLuint Colorbuffer::getBlueSize() const
return 0; return 0;
} }
GLuint Colorbuffer::getAlphaSize() const GLuint Colorbuffer::getAlphaSize()
{ {
if (mRenderTarget) if (getRenderTarget())
{ {
D3DSURFACE_DESC description; D3DSURFACE_DESC description;
mRenderTarget->GetDesc(&description); getRenderTarget()->GetDesc(&description);
return es2dx::GetAlphaSize(description.Format); return es2dx::GetAlphaSize(description.Format);
} }

View File

@ -109,10 +109,10 @@ class Colorbuffer : public RenderbufferStorage
bool isColorbuffer() const; bool isColorbuffer() const;
GLuint getRedSize() const; GLuint getRedSize();
GLuint getGreenSize() const; GLuint getGreenSize();
GLuint getBlueSize() const; GLuint getBlueSize();
GLuint getAlphaSize() const; GLuint getAlphaSize();
IDirect3DSurface9 *getRenderTarget(); IDirect3DSurface9 *getRenderTarget();

View File

@ -1318,6 +1318,9 @@ bool Texture2D::redefineTexture(GLint level, GLenum internalFormat, GLsizei widt
mHeight = height << level; mHeight = height << level;
mImageArray[0].format = internalFormat; mImageArray[0].format = internalFormat;
mType = type; mType = type;
if (mColorbufferProxy.get())
mColorbufferProxy->setStorage(new TextureColorbufferProxy(this, GL_TEXTURE_2D));
} }
return !textureOkay; return !textureOkay;
@ -2215,6 +2218,12 @@ bool TextureCubeMap::redefineTexture(GLint level, GLenum internalFormat, GLsizei
mImageArray[0][0].height = width << level; mImageArray[0][0].height = width << level;
mImageArray[0][0].format = internalFormat; mImageArray[0][0].format = internalFormat;
for (int i = 0; i < 6; i++)
{
if (mFaceProxies[i].get())
mFaceProxies[i]->setStorage(new TextureColorbufferProxy(this, GL_TEXTURE_CUBE_MAP_POSITIVE_X + i));
}
} }
return !textureOkay; return !textureOkay;