Initialize renderbuffer variables. Make serials constant. Removed X1R5G5B5 support.
TRAC #13792
Signed-off-by: Daniel Koch
Author: Nicolas Capens
git-svn-id: https://angleproject.googlecode.com/svn/trunk@460 736b8ea6-26fd-11df-bfd4-992fa37f6226
diff --git a/src/libGLESv2/Renderbuffer.cpp b/src/libGLESv2/Renderbuffer.cpp
index de8ea07..6e4494b 100644
--- a/src/libGLESv2/Renderbuffer.cpp
+++ b/src/libGLESv2/Renderbuffer.cpp
@@ -87,9 +87,13 @@
mStorage = newStorage;
}
-RenderbufferStorage::RenderbufferStorage()
+RenderbufferStorage::RenderbufferStorage() : mSerial(issueSerial())
{
- mSerial = issueSerial();
+ mWidth = 0;
+ mHeight = 0;
+ mFormat = GL_RGBA4;
+ mD3DFormat = D3DFMT_A8R8G8B8;
+ mSamples = 0;
}
RenderbufferStorage::~RenderbufferStorage()
@@ -177,14 +181,10 @@
renderTarget->GetDesc(&description);
setSize(description.Width, description.Height);
+ mFormat = dx2es::ConvertBackBufferFormat(description.Format);
mD3DFormat = description.Format;
mSamples = es2dx::GetSamplesFromMultisampleType(description.MultiSampleType);
}
- else
- {
- mD3DFormat = D3DFMT_UNKNOWN;
- mSamples = 0;
- }
}
Colorbuffer::Colorbuffer(const Texture* texture) : mRenderTarget(NULL)
@@ -231,13 +231,6 @@
mD3DFormat = requestedFormat;
mSamples = supportedSamples;
}
- else
- {
- setSize(0, 0);
- mFormat = GL_RGBA4;
- mD3DFormat = D3DFMT_UNKNOWN;
- mSamples = 0;
- }
}
Colorbuffer::~Colorbuffer()
@@ -320,15 +313,10 @@
depthStencil->GetDesc(&description);
setSize(description.Width, description.Height);
- mFormat = (description.Format == D3DFMT_D16 ? GL_DEPTH_COMPONENT16 : GL_DEPTH24_STENCIL8_OES);
+ mFormat = dx2es::ConvertDepthStencilFormat(description.Format);
mSamples = es2dx::GetSamplesFromMultisampleType(description.MultiSampleType);
mD3DFormat = description.Format;
}
- else
- {
- mD3DFormat = D3DFMT_UNKNOWN;
- mSamples = 0;
- }
}
DepthStencilbuffer::DepthStencilbuffer(int width, int height, GLsizei samples)
@@ -365,13 +353,6 @@
mD3DFormat = D3DFMT_D24S8;
mSamples = supportedSamples;
}
- else
- {
- setSize(0, 0);
- mFormat = GL_RGBA4; //default format
- mD3DFormat = D3DFMT_UNKNOWN;
- mSamples = 0;
- }
}
DepthStencilbuffer::~DepthStencilbuffer()