Commit d1e9a9a6 by Geoff Lang Committed by Geoff Lang

Add missing ES3 unsized internal formats and properly return 1 for alpha in…

Add missing ES3 unsized internal formats and properly return 1 for alpha in integer formats with no alpha channel. TRAC #23949 Signed-off-by: Jamie Madill Signed-off-by: Shannon Woods
parent f6d6901c
...@@ -740,8 +740,14 @@ static InternalFormatInfoMap BuildES3InternalFormatInfoMap() ...@@ -740,8 +740,14 @@ static InternalFormatInfoMap BuildES3InternalFormatInfoMap()
map.insert(InternalFormatInfoPair(GL_ALPHA, InternalFormatInfo::UnsizedFormat(GL_ALPHA, AlwaysSupported))); map.insert(InternalFormatInfoPair(GL_ALPHA, InternalFormatInfo::UnsizedFormat(GL_ALPHA, AlwaysSupported)));
map.insert(InternalFormatInfoPair(GL_LUMINANCE, InternalFormatInfo::UnsizedFormat(GL_LUMINANCE, AlwaysSupported))); map.insert(InternalFormatInfoPair(GL_LUMINANCE, InternalFormatInfo::UnsizedFormat(GL_LUMINANCE, AlwaysSupported)));
map.insert(InternalFormatInfoPair(GL_LUMINANCE_ALPHA, InternalFormatInfo::UnsizedFormat(GL_LUMINANCE_ALPHA, AlwaysSupported))); map.insert(InternalFormatInfoPair(GL_LUMINANCE_ALPHA, InternalFormatInfo::UnsizedFormat(GL_LUMINANCE_ALPHA, AlwaysSupported)));
map.insert(InternalFormatInfoPair(GL_RED, InternalFormatInfo::UnsizedFormat(GL_RED, AlwaysSupported)));
map.insert(InternalFormatInfoPair(GL_RG, InternalFormatInfo::UnsizedFormat(GL_RG, AlwaysSupported)));
map.insert(InternalFormatInfoPair(GL_RGB, InternalFormatInfo::UnsizedFormat(GL_RGB, AlwaysSupported))); map.insert(InternalFormatInfoPair(GL_RGB, InternalFormatInfo::UnsizedFormat(GL_RGB, AlwaysSupported)));
map.insert(InternalFormatInfoPair(GL_RGBA, InternalFormatInfo::UnsizedFormat(GL_RGBA, AlwaysSupported))); map.insert(InternalFormatInfoPair(GL_RGBA, InternalFormatInfo::UnsizedFormat(GL_RGBA, AlwaysSupported)));
map.insert(InternalFormatInfoPair(GL_RED_INTEGER, InternalFormatInfo::UnsizedFormat(GL_RED_INTEGER, AlwaysSupported)));
map.insert(InternalFormatInfoPair(GL_RG_INTEGER, InternalFormatInfo::UnsizedFormat(GL_RG_INTEGER, AlwaysSupported)));
map.insert(InternalFormatInfoPair(GL_RGB_INTEGER, InternalFormatInfo::UnsizedFormat(GL_RGB_INTEGER, AlwaysSupported)));
map.insert(InternalFormatInfoPair(GL_RGBA_INTEGER, InternalFormatInfo::UnsizedFormat(GL_RGBA_INTEGER, AlwaysSupported)));
map.insert(InternalFormatInfoPair(GL_BGRA_EXT, InternalFormatInfo::UnsizedFormat(GL_BGRA_EXT, AlwaysSupported))); map.insert(InternalFormatInfoPair(GL_BGRA_EXT, InternalFormatInfo::UnsizedFormat(GL_BGRA_EXT, AlwaysSupported)));
// Compressed formats, From ES 3.0.1 spec, table 3.16 // Compressed formats, From ES 3.0.1 spec, table 3.16
......
...@@ -60,7 +60,7 @@ struct R8 ...@@ -60,7 +60,7 @@ struct R8
dst->red = src->R; dst->red = src->R;
dst->green = 0; dst->green = 0;
dst->blue = 0; dst->blue = 0;
dst->alpha = 0; dst->alpha = 1;
} }
static void writeColor(R8 *dst, const gl::ColorF *src) static void writeColor(R8 *dst, const gl::ColorF *src)
...@@ -172,7 +172,7 @@ struct R8G8 ...@@ -172,7 +172,7 @@ struct R8G8
dst->red = src->R; dst->red = src->R;
dst->green = src->G; dst->green = src->G;
dst->blue = 0; dst->blue = 0;
dst->alpha = 0; dst->alpha = 1;
} }
static void writeColor(R8G8 *dst, const gl::ColorF *src) static void writeColor(R8G8 *dst, const gl::ColorF *src)
...@@ -212,7 +212,7 @@ struct R8G8B8 ...@@ -212,7 +212,7 @@ struct R8G8B8
dst->red = src->R; dst->red = src->R;
dst->green = src->G; dst->green = src->G;
dst->blue = src->G; dst->blue = src->G;
dst->alpha = 0; dst->alpha = 1;
} }
static void writeColor(R8G8B8 *dst, const gl::ColorF *src) static void writeColor(R8G8B8 *dst, const gl::ColorF *src)
...@@ -256,7 +256,7 @@ struct B8G8R8 ...@@ -256,7 +256,7 @@ struct B8G8R8
dst->red = src->R; dst->red = src->R;
dst->green = src->G; dst->green = src->G;
dst->blue = src->G; dst->blue = src->G;
dst->alpha = 0; dst->alpha = 1;
} }
static void writeColor(B8G8R8 *dst, const gl::ColorF *src) static void writeColor(B8G8R8 *dst, const gl::ColorF *src)
...@@ -614,7 +614,7 @@ struct R16 ...@@ -614,7 +614,7 @@ struct R16
dst->red = src->R; dst->red = src->R;
dst->green = 0; dst->green = 0;
dst->blue = 0; dst->blue = 0;
dst->alpha = 0; dst->alpha = 1;
} }
static void writeColor(R16 *dst, const gl::ColorF *src) static void writeColor(R16 *dst, const gl::ColorF *src)
...@@ -651,7 +651,7 @@ struct R16G16 ...@@ -651,7 +651,7 @@ struct R16G16
dst->red = src->R; dst->red = src->R;
dst->green = src->G; dst->green = src->G;
dst->blue = 0; dst->blue = 0;
dst->alpha = 0; dst->alpha = 1;
} }
static void writeColor(R16G16 *dst, const gl::ColorF *src) static void writeColor(R16G16 *dst, const gl::ColorF *src)
...@@ -692,7 +692,7 @@ struct R16G16B16 ...@@ -692,7 +692,7 @@ struct R16G16B16
dst->red = src->R; dst->red = src->R;
dst->green = src->G; dst->green = src->G;
dst->blue = src->B; dst->blue = src->B;
dst->alpha = 0; dst->alpha = 1;
} }
static void writeColor(R16G16B16 *dst, const gl::ColorF *src) static void writeColor(R16G16B16 *dst, const gl::ColorF *src)
...@@ -782,7 +782,7 @@ struct R32 ...@@ -782,7 +782,7 @@ struct R32
dst->red = src->R; dst->red = src->R;
dst->green = 0; dst->green = 0;
dst->blue = 0; dst->blue = 0;
dst->alpha = 0; dst->alpha = 1;
} }
static void writeColor(R32 *dst, const gl::ColorF *src) static void writeColor(R32 *dst, const gl::ColorF *src)
...@@ -819,7 +819,7 @@ struct R32G32 ...@@ -819,7 +819,7 @@ struct R32G32
dst->red = src->R; dst->red = src->R;
dst->green = src->G; dst->green = src->G;
dst->blue = 0; dst->blue = 0;
dst->alpha = 0; dst->alpha = 1;
} }
static void writeColor(R32G32 *dst, const gl::ColorF *src) static void writeColor(R32G32 *dst, const gl::ColorF *src)
...@@ -860,7 +860,7 @@ struct R32G32B32 ...@@ -860,7 +860,7 @@ struct R32G32B32
dst->red = src->R; dst->red = src->R;
dst->green = src->G; dst->green = src->G;
dst->blue = src->B; dst->blue = src->B;
dst->alpha = 0; dst->alpha = 1;
} }
static void writeColor(R32G32B32 *dst, const gl::ColorF *src) static void writeColor(R32G32B32 *dst, const gl::ColorF *src)
...@@ -950,7 +950,7 @@ struct R8S ...@@ -950,7 +950,7 @@ struct R8S
dst->red = src->R; dst->red = src->R;
dst->green = 0; dst->green = 0;
dst->blue = 0; dst->blue = 0;
dst->alpha = 0; dst->alpha = 1;
} }
static void writeColor(R8S *dst, const gl::ColorF *src) static void writeColor(R8S *dst, const gl::ColorF *src)
...@@ -987,7 +987,7 @@ struct R8G8S ...@@ -987,7 +987,7 @@ struct R8G8S
dst->red = src->R; dst->red = src->R;
dst->green = src->G; dst->green = src->G;
dst->blue = 0; dst->blue = 0;
dst->alpha = 0; dst->alpha = 1;
} }
static void writeColor(R8G8S *dst, const gl::ColorF *src) static void writeColor(R8G8S *dst, const gl::ColorF *src)
...@@ -1028,7 +1028,7 @@ struct R8G8B8S ...@@ -1028,7 +1028,7 @@ struct R8G8B8S
dst->red = src->R; dst->red = src->R;
dst->green = src->G; dst->green = src->G;
dst->blue = src->B; dst->blue = src->B;
dst->alpha = 0; dst->alpha = 1;
} }
static void writeColor(R8G8B8S *dst, const gl::ColorF *src) static void writeColor(R8G8B8S *dst, const gl::ColorF *src)
...@@ -1118,7 +1118,7 @@ struct R16S ...@@ -1118,7 +1118,7 @@ struct R16S
dst->red = src->R; dst->red = src->R;
dst->green = 0; dst->green = 0;
dst->blue = 0; dst->blue = 0;
dst->alpha = 0; dst->alpha = 1;
} }
static void writeColor(R16S *dst, const gl::ColorF *src) static void writeColor(R16S *dst, const gl::ColorF *src)
...@@ -1155,7 +1155,7 @@ struct R16G16S ...@@ -1155,7 +1155,7 @@ struct R16G16S
dst->red = src->R; dst->red = src->R;
dst->green = src->G; dst->green = src->G;
dst->blue = 0; dst->blue = 0;
dst->alpha = 0; dst->alpha = 1;
} }
static void writeColor(R16G16S *dst, const gl::ColorF *src) static void writeColor(R16G16S *dst, const gl::ColorF *src)
...@@ -1196,7 +1196,7 @@ struct R16G16B16S ...@@ -1196,7 +1196,7 @@ struct R16G16B16S
dst->red = src->R; dst->red = src->R;
dst->green = src->G; dst->green = src->G;
dst->blue = src->B; dst->blue = src->B;
dst->alpha = 0; dst->alpha = 1;
} }
static void writeColor(R16G16B16S *dst, const gl::ColorF *src) static void writeColor(R16G16B16S *dst, const gl::ColorF *src)
...@@ -1286,7 +1286,7 @@ struct R32S ...@@ -1286,7 +1286,7 @@ struct R32S
dst->red = src->R; dst->red = src->R;
dst->green = 0; dst->green = 0;
dst->blue = 0; dst->blue = 0;
dst->alpha = 0; dst->alpha = 1;
} }
static void writeColor(R32S *dst, const gl::ColorF *src) static void writeColor(R32S *dst, const gl::ColorF *src)
...@@ -1323,7 +1323,7 @@ struct R32G32S ...@@ -1323,7 +1323,7 @@ struct R32G32S
dst->red = src->R; dst->red = src->R;
dst->green = src->G; dst->green = src->G;
dst->blue = 0; dst->blue = 0;
dst->alpha = 0; dst->alpha = 1;
} }
static void writeColor(R32G32S *dst, const gl::ColorF *src) static void writeColor(R32G32S *dst, const gl::ColorF *src)
...@@ -1364,7 +1364,7 @@ struct R32G32B32S ...@@ -1364,7 +1364,7 @@ struct R32G32B32S
dst->red = src->R; dst->red = src->R;
dst->green = src->G; dst->green = src->G;
dst->blue = src->B; dst->blue = src->B;
dst->alpha = 0; dst->alpha = 1;
} }
static void writeColor(R32G32B32S *dst, const gl::ColorF *src) static void writeColor(R32G32B32S *dst, const gl::ColorF *src)
......
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