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/utilities.cpp b/src/libGLESv2/utilities.cpp
index b20f0a5..4815662 100644
--- a/src/libGLESv2/utilities.cpp
+++ b/src/libGLESv2/utilities.cpp
@@ -623,7 +623,6 @@
case D3DFMT_A1R5G5B5:
return 1;
case D3DFMT_X8R8G8B8:
- case D3DFMT_X1R5G5B5:
case D3DFMT_R5G6B5:
return 0;
default: UNREACHABLE();
@@ -646,7 +645,6 @@
return 8;
case D3DFMT_A1R5G5B5:
case D3DFMT_R5G6B5:
- case D3DFMT_X1R5G5B5:
return 5;
default: UNREACHABLE();
}
@@ -667,7 +665,6 @@
case D3DFMT_X8R8G8B8:
return 8;
case D3DFMT_A1R5G5B5:
- case D3DFMT_X1R5G5B5:
return 5;
case D3DFMT_R5G6B5:
return 6;
@@ -691,7 +688,6 @@
return 8;
case D3DFMT_A1R5G5B5:
case D3DFMT_R5G6B5:
- case D3DFMT_X1R5G5B5:
return 5;
default: UNREACHABLE();
}
@@ -792,3 +788,40 @@
}
}
+
+namespace dx2es
+{
+
+GLenum ConvertBackBufferFormat(D3DFORMAT format)
+{
+ switch (format)
+ {
+ case D3DFMT_A4R4G4B4: return GL_RGBA4;
+ case D3DFMT_A8R8G8B8: return GL_RGBA8_OES;
+ case D3DFMT_A1R5G5B5: return GL_RGB5_A1;
+ case D3DFMT_R5G6B5: return GL_RGB565;
+ case D3DFMT_X8R8G8B8: return GL_RGB8_OES;
+ default:
+ UNREACHABLE();
+ }
+
+ return GL_RGBA4;
+}
+
+GLenum ConvertDepthStencilFormat(D3DFORMAT format)
+{
+ switch (format)
+ {
+ case D3DFMT_D16:
+ case D3DFMT_D24X8:
+ return GL_DEPTH_COMPONENT16;
+ case D3DFMT_D24S8:
+ return GL_DEPTH24_STENCIL8_OES;
+ default:
+ UNREACHABLE();
+ }
+
+ return GL_DEPTH24_STENCIL8_OES;
+}
+
+}