Commit 831fe2af by apatrick@chromium.org

Fixed framebuffer-object-attachment WebGL conformance test.

We updated it with WebGL conformance test r14153 to exercise zero-size FBO attachments, which failed with ANGLE. The new conformance test passes with OpenGL and Mesa. See this Chromium bug: http://code.google.com/p/chromium/issues/detail?id=75666 D3D fails if you try to create a zero size depth buffer but OpenGL ES2 allows it. D3D / drivers seem to sometimes crash rather than fail normally, though this might just be because some users have enabled the D3D debug runtime and break on error and we're getting the reports. It was also returning unexpected results when calling GetRenderbufferParameter for parameters that do not apply to a particular buffer. For example, RED_SIZE for a zero sized depth buffer should be 0. Tested by running WebGL conformance test with retail D3D runtime (passes) and debug D3D runtime (passes and does not assert in D3D or ANGLE). Review URL: http://codereview.appspot.com/4284053 git-svn-id: https://angleproject.googlecode.com/svn/trunk@577 736b8ea6-26fd-11df-bfd4-992fa37f6226
parent f963e92f
#define MAJOR_VERSION 0 #define MAJOR_VERSION 0
#define MINOR_VERSION 0 #define MINOR_VERSION 0
#define BUILD_VERSION 0 #define BUILD_VERSION 0
#define BUILD_REVISION 576 #define BUILD_REVISION 577
#define STRINGIFY(x) #x #define STRINGIFY(x) #x
#define MACRO_STRINGIFY(x) STRINGIFY(x) #define MACRO_STRINGIFY(x) STRINGIFY(x)
......
...@@ -280,14 +280,11 @@ Colorbuffer::Colorbuffer(int width, int height, GLenum format, GLsizei samples) ...@@ -280,14 +280,11 @@ Colorbuffer::Colorbuffer(int width, int height, GLenum format, GLsizei samples)
ASSERT(SUCCEEDED(result)); ASSERT(SUCCEEDED(result));
} }
if (mRenderTarget)
{
mWidth = width; mWidth = width;
mHeight = height; mHeight = height;
mInternalFormat = format; mInternalFormat = format;
mD3DFormat = requestedFormat; mD3DFormat = requestedFormat;
mSamples = supportedSamples; mSamples = supportedSamples;
}
} }
Colorbuffer::~Colorbuffer() Colorbuffer::~Colorbuffer()
...@@ -400,6 +397,8 @@ DepthStencilbuffer::DepthStencilbuffer(int width, int height, GLsizei samples) ...@@ -400,6 +397,8 @@ DepthStencilbuffer::DepthStencilbuffer(int width, int height, GLsizei samples)
return; return;
} }
if (width > 0 && height > 0)
{
HRESULT result = device->CreateDepthStencilSurface(width, height, D3DFMT_D24S8, es2dx::GetMultisampleTypeFromSamples(supportedSamples), HRESULT result = device->CreateDepthStencilSurface(width, height, D3DFMT_D24S8, es2dx::GetMultisampleTypeFromSamples(supportedSamples),
0, FALSE, &mDepthStencil, 0); 0, FALSE, &mDepthStencil, 0);
...@@ -411,15 +410,13 @@ DepthStencilbuffer::DepthStencilbuffer(int width, int height, GLsizei samples) ...@@ -411,15 +410,13 @@ DepthStencilbuffer::DepthStencilbuffer(int width, int height, GLsizei samples)
} }
ASSERT(SUCCEEDED(result)); ASSERT(SUCCEEDED(result));
}
if (mDepthStencil)
{
mWidth = width; mWidth = width;
mHeight = height; mHeight = height;
mInternalFormat = GL_DEPTH24_STENCIL8_OES; mInternalFormat = GL_DEPTH24_STENCIL8_OES;
mD3DFormat = D3DFMT_D24S8; mD3DFormat = D3DFMT_D24S8;
mSamples = supportedSamples; mSamples = supportedSamples;
}
} }
DepthStencilbuffer::~DepthStencilbuffer() DepthStencilbuffer::~DepthStencilbuffer()
......
...@@ -696,9 +696,9 @@ unsigned int GetStencilSize(D3DFORMAT stencilFormat) ...@@ -696,9 +696,9 @@ unsigned int GetStencilSize(D3DFORMAT stencilFormat)
return 0; return 0;
//case D3DFMT_D32_LOCKABLE: return 0; // DirectX 9Ex only //case D3DFMT_D32_LOCKABLE: return 0; // DirectX 9Ex only
//case D3DFMT_S8_LOCKABLE: return 8; // DirectX 9Ex only //case D3DFMT_S8_LOCKABLE: return 8; // DirectX 9Ex only
default: UNREACHABLE(); default:
}
return 0; return 0;
}
} }
unsigned int GetAlphaSize(D3DFORMAT colorFormat) unsigned int GetAlphaSize(D3DFORMAT colorFormat)
...@@ -718,9 +718,9 @@ unsigned int GetAlphaSize(D3DFORMAT colorFormat) ...@@ -718,9 +718,9 @@ unsigned int GetAlphaSize(D3DFORMAT colorFormat)
case D3DFMT_X8R8G8B8: case D3DFMT_X8R8G8B8:
case D3DFMT_R5G6B5: case D3DFMT_R5G6B5:
return 0; return 0;
default: UNREACHABLE(); default:
}
return 0; return 0;
}
} }
unsigned int GetRedSize(D3DFORMAT colorFormat) unsigned int GetRedSize(D3DFORMAT colorFormat)
...@@ -739,9 +739,9 @@ unsigned int GetRedSize(D3DFORMAT colorFormat) ...@@ -739,9 +739,9 @@ unsigned int GetRedSize(D3DFORMAT colorFormat)
case D3DFMT_A1R5G5B5: case D3DFMT_A1R5G5B5:
case D3DFMT_R5G6B5: case D3DFMT_R5G6B5:
return 5; return 5;
default: UNREACHABLE(); default:
}
return 0; return 0;
}
} }
unsigned int GetGreenSize(D3DFORMAT colorFormat) unsigned int GetGreenSize(D3DFORMAT colorFormat)
...@@ -761,9 +761,9 @@ unsigned int GetGreenSize(D3DFORMAT colorFormat) ...@@ -761,9 +761,9 @@ unsigned int GetGreenSize(D3DFORMAT colorFormat)
return 5; return 5;
case D3DFMT_R5G6B5: case D3DFMT_R5G6B5:
return 6; return 6;
default: UNREACHABLE(); default:
}
return 0; return 0;
}
} }
unsigned int GetBlueSize(D3DFORMAT colorFormat) unsigned int GetBlueSize(D3DFORMAT colorFormat)
...@@ -782,9 +782,9 @@ unsigned int GetBlueSize(D3DFORMAT colorFormat) ...@@ -782,9 +782,9 @@ unsigned int GetBlueSize(D3DFORMAT colorFormat)
case D3DFMT_A1R5G5B5: case D3DFMT_A1R5G5B5:
case D3DFMT_R5G6B5: case D3DFMT_R5G6B5:
return 5; return 5;
default: UNREACHABLE(); default:
}
return 0; return 0;
}
} }
unsigned int GetDepthSize(D3DFORMAT depthFormat) unsigned int GetDepthSize(D3DFORMAT depthFormat)
...@@ -802,10 +802,8 @@ unsigned int GetDepthSize(D3DFORMAT depthFormat) ...@@ -802,10 +802,8 @@ unsigned int GetDepthSize(D3DFORMAT depthFormat)
case D3DFMT_D24FS8: return 24; case D3DFMT_D24FS8: return 24;
//case D3DFMT_D32_LOCKABLE: return 32; // D3D9Ex only //case D3DFMT_D32_LOCKABLE: return 32; // D3D9Ex only
//case D3DFMT_S8_LOCKABLE: return 0; // D3D9Ex only //case D3DFMT_S8_LOCKABLE: return 0; // D3D9Ex only
default: default: return 0;
UNREACHABLE();
} }
return 0;
} }
GLsizei GetSamplesFromMultisampleType(D3DMULTISAMPLE_TYPE type) GLsizei GetSamplesFromMultisampleType(D3DMULTISAMPLE_TYPE type)
......
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