Commit c4718040 by Jamie Madill Committed by Commit Bot

Remove DXGI_FORMAT_UNKNOWN cases from load table.

These cases were unreachable. BUG=angleproject:1455 Change-Id: I5f3b969de3aca3862944ac9ed510c9f5e9fd77e2 Reviewed-on: https://chromium-review.googlesource.com/367695 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: 's avatarGeoff Lang <geofflang@chromium.org>
parent 04d3d895
......@@ -107,41 +107,54 @@ dxgi_format_unknown = "DXGI_FORMAT_UNKNOWN"
def get_function_maps_string(typestr, function):
requiresConversion = str('LoadToNative<' not in function).lower()
return ' { ' + typestr + ', LoadImageFunctionInfo(' + function + ', ' + requiresConversion + ') },\n'
return ' { ' + typestr + ', LoadImageFunctionInfo(' + function + ', ' + requiresConversion + ') },\n'
def get_unknown_format_string(dxgi_to_type_map, dxgi_unknown_string):
def get_unknown_format_string(s, dxgi_to_type_map, dxgi_unknown_string):
if dxgi_unknown_string not in dxgi_to_type_map:
return ''
table_data = ''
for gl_type, load_function in sorted(dxgi_to_type_map[dxgi_unknown_string].iteritems()):
table_data += get_function_maps_string(gl_type, load_function)
table_data += s + get_function_maps_string(gl_type, load_function)
return table_data
def get_load_function_map_snippet(insert_map_string):
def get_load_function_map_snippet(s, insert_map_string):
load_function_map_snippet = ''
load_function_map_snippet += ' static const std::map<GLenum, LoadImageFunctionInfo> loadFunctionsMap = {\n'
load_function_map_snippet += s + 'static const std::map<GLenum, LoadImageFunctionInfo> loadFunctionsMap = {\n'
load_function_map_snippet += insert_map_string
load_function_map_snippet += ' };\n\n'
load_function_map_snippet += ' return loadFunctionsMap;\n'
load_function_map_snippet += s + '};\n\n'
load_function_map_snippet += s + 'return loadFunctionsMap;\n'
return load_function_map_snippet
def parse_json_into_switch_string(json_data):
table_data = ''
for internal_format, dxgi_to_type_map in sorted(json_data.iteritems()):
table_data += ' case ' + internal_format + ':\n'
table_data += ' {\n'
table_data += ' switch (' + dxgi_format_param + ')\n'
table_data += ' {\n'
s = ' '
table_data += s + 'case ' + internal_format + ':\n'
do_switch = len(dxgi_to_type_map) > 1 or dxgi_to_type_map.keys()[0] != dxgi_format_unknown
if do_switch:
table_data += s + '{\n'
s += ' '
table_data += s + 'switch (' + dxgi_format_param + ')\n'
table_data += s + '{\n'
s += ' '
for dxgi_format, type_functions in sorted(dxgi_to_type_map.iteritems()):
if dxgi_format == dxgi_format_unknown:
continue
# Main case statements
table_data += ' case ' + dxgi_format + ':\n'
table_data += ' {\n'
table_data += s + 'case ' + dxgi_format + ':\n'
table_data += s + '{\n'
s += ' '
insert_map_string = ''
if dxgi_format_unknown in dxgi_to_type_map:
......@@ -150,22 +163,31 @@ def parse_json_into_switch_string(json_data):
type_functions[gl_type] = load_function
for gl_type, load_function in sorted(type_functions.iteritems()):
insert_map_string += get_function_maps_string(gl_type, load_function)
table_data += get_load_function_map_snippet(insert_map_string)
table_data += ' }\n'
table_data += ' default:\n'
dxgi_unknown_str = get_unknown_format_string(dxgi_to_type_map, dxgi_format_unknown);
if dxgi_unknown_str:
table_data += ' {\n'
table_data += get_load_function_map_snippet(dxgi_unknown_str)
table_data += ' }\n'
insert_map_string += s + get_function_maps_string(gl_type, load_function)
table_data += get_load_function_map_snippet(s, insert_map_string)
s = s[4:]
table_data += s + '}\n'
if do_switch:
table_data += s + 'default:\n'
if dxgi_format_unknown in dxgi_to_type_map:
table_data += s + '{\n'
s += ' '
dxgi_unknown_str = get_unknown_format_string(
s, dxgi_to_type_map, dxgi_format_unknown);
table_data += get_load_function_map_snippet(s, dxgi_unknown_str)
s = s[4:]
table_data += s + '}\n'
else:
table_data += ' break;\n'
table_data += ' }\n'
table_data += ' }\n'
table_data += s + ' break;\n'
if do_switch:
s = s[4:]
table_data += s + '}\n'
s = s[4:]
table_data += s + '}\n'
return table_data
......
......@@ -94,14 +94,6 @@ const std::map<GLenum, LoadImageFunctionInfo> &GetLoadFunctionsMap(GLenum intern
return loadFunctionsMap;
}
case DXGI_FORMAT_UNKNOWN:
{
static const std::map<GLenum, LoadImageFunctionInfo> loadFunctionsMap = {
{ GL_UNSIGNED_BYTE, LoadImageFunctionInfo(UnreachableLoadFunction, true) },
};
return loadFunctionsMap;
}
default:
{
static const std::map<GLenum, LoadImageFunctionInfo> loadFunctionsMap = {
......@@ -114,49 +106,20 @@ const std::map<GLenum, LoadImageFunctionInfo> &GetLoadFunctionsMap(GLenum intern
}
case GL_ALPHA16F_EXT:
{
switch (dxgiFormat)
{
case DXGI_FORMAT_UNKNOWN:
{
static const std::map<GLenum, LoadImageFunctionInfo> loadFunctionsMap = {
{ GL_HALF_FLOAT, LoadImageFunctionInfo(LoadA16FToRGBA16F, true) },
{ GL_HALF_FLOAT_OES, LoadImageFunctionInfo(LoadA16FToRGBA16F, true) },
};
return loadFunctionsMap;
}
default:
{
static const std::map<GLenum, LoadImageFunctionInfo> loadFunctionsMap = {
{ GL_HALF_FLOAT, LoadImageFunctionInfo(LoadA16FToRGBA16F, true) },
{ GL_HALF_FLOAT_OES, LoadImageFunctionInfo(LoadA16FToRGBA16F, true) },
};
static const std::map<GLenum, LoadImageFunctionInfo> loadFunctionsMap = {
{ GL_HALF_FLOAT, LoadImageFunctionInfo(LoadA16FToRGBA16F, true) },
{ GL_HALF_FLOAT_OES, LoadImageFunctionInfo(LoadA16FToRGBA16F, true) },
};
return loadFunctionsMap;
}
}
return loadFunctionsMap;
}
case GL_ALPHA32F_EXT:
{
switch (dxgiFormat)
{
case DXGI_FORMAT_UNKNOWN:
{
static const std::map<GLenum, LoadImageFunctionInfo> loadFunctionsMap = {
{ GL_FLOAT, LoadImageFunctionInfo(LoadA32FToRGBA32F, true) },
};
static const std::map<GLenum, LoadImageFunctionInfo> loadFunctionsMap = {
{ GL_FLOAT, LoadImageFunctionInfo(LoadA32FToRGBA32F, true) },
};
return loadFunctionsMap;
}
default:
{
static const std::map<GLenum, LoadImageFunctionInfo> loadFunctionsMap = {
{ GL_FLOAT, LoadImageFunctionInfo(LoadA32FToRGBA32F, true) },
};
return loadFunctionsMap;
}
}
return loadFunctionsMap;
}
case GL_ALPHA8_EXT:
{
......@@ -201,95 +164,37 @@ const std::map<GLenum, LoadImageFunctionInfo> &GetLoadFunctionsMap(GLenum intern
}
case GL_BGR5_A1_ANGLEX:
{
switch (dxgiFormat)
{
case DXGI_FORMAT_UNKNOWN:
{
static const std::map<GLenum, LoadImageFunctionInfo> loadFunctionsMap = {
{ GL_UNSIGNED_BYTE, LoadImageFunctionInfo(LoadToNative<GLubyte,4>, false) },
{ GL_UNSIGNED_SHORT_1_5_5_5_REV_EXT, LoadImageFunctionInfo(LoadRGB5A1ToRGBA8, true) },
};
return loadFunctionsMap;
}
default:
{
static const std::map<GLenum, LoadImageFunctionInfo> loadFunctionsMap = {
{ GL_UNSIGNED_BYTE, LoadImageFunctionInfo(LoadToNative<GLubyte,4>, false) },
{ GL_UNSIGNED_SHORT_1_5_5_5_REV_EXT, LoadImageFunctionInfo(LoadRGB5A1ToRGBA8, true) },
};
static const std::map<GLenum, LoadImageFunctionInfo> loadFunctionsMap = {
{ GL_UNSIGNED_BYTE, LoadImageFunctionInfo(LoadToNative<GLubyte,4>, false) },
{ GL_UNSIGNED_SHORT_1_5_5_5_REV_EXT, LoadImageFunctionInfo(LoadRGB5A1ToRGBA8, true) },
};
return loadFunctionsMap;
}
}
return loadFunctionsMap;
}
case GL_BGRA4_ANGLEX:
{
switch (dxgiFormat)
{
case DXGI_FORMAT_UNKNOWN:
{
static const std::map<GLenum, LoadImageFunctionInfo> loadFunctionsMap = {
{ GL_UNSIGNED_BYTE, LoadImageFunctionInfo(LoadToNative<GLubyte,4>, false) },
{ GL_UNSIGNED_SHORT_4_4_4_4_REV_EXT, LoadImageFunctionInfo(LoadRGBA4ToRGBA8, true) },
};
return loadFunctionsMap;
}
default:
{
static const std::map<GLenum, LoadImageFunctionInfo> loadFunctionsMap = {
{ GL_UNSIGNED_BYTE, LoadImageFunctionInfo(LoadToNative<GLubyte,4>, false) },
{ GL_UNSIGNED_SHORT_4_4_4_4_REV_EXT, LoadImageFunctionInfo(LoadRGBA4ToRGBA8, true) },
};
static const std::map<GLenum, LoadImageFunctionInfo> loadFunctionsMap = {
{ GL_UNSIGNED_BYTE, LoadImageFunctionInfo(LoadToNative<GLubyte,4>, false) },
{ GL_UNSIGNED_SHORT_4_4_4_4_REV_EXT, LoadImageFunctionInfo(LoadRGBA4ToRGBA8, true) },
};
return loadFunctionsMap;
}
}
return loadFunctionsMap;
}
case GL_BGRA8_EXT:
{
switch (dxgiFormat)
{
case DXGI_FORMAT_UNKNOWN:
{
static const std::map<GLenum, LoadImageFunctionInfo> loadFunctionsMap = {
{ GL_UNSIGNED_BYTE, LoadImageFunctionInfo(LoadToNative<GLubyte,4>, false) },
};
static const std::map<GLenum, LoadImageFunctionInfo> loadFunctionsMap = {
{ GL_UNSIGNED_BYTE, LoadImageFunctionInfo(LoadToNative<GLubyte,4>, false) },
};
return loadFunctionsMap;
}
default:
{
static const std::map<GLenum, LoadImageFunctionInfo> loadFunctionsMap = {
{ GL_UNSIGNED_BYTE, LoadImageFunctionInfo(LoadToNative<GLubyte,4>, false) },
};
return loadFunctionsMap;
}
}
return loadFunctionsMap;
}
case GL_BGRA_EXT:
{
switch (dxgiFormat)
{
case DXGI_FORMAT_UNKNOWN:
{
static const std::map<GLenum, LoadImageFunctionInfo> loadFunctionsMap = {
{ GL_UNSIGNED_BYTE, LoadImageFunctionInfo(UnreachableLoadFunction, true) },
};
static const std::map<GLenum, LoadImageFunctionInfo> loadFunctionsMap = {
{ GL_UNSIGNED_BYTE, LoadImageFunctionInfo(UnreachableLoadFunction, true) },
};
return loadFunctionsMap;
}
default:
{
static const std::map<GLenum, LoadImageFunctionInfo> loadFunctionsMap = {
{ GL_UNSIGNED_BYTE, LoadImageFunctionInfo(UnreachableLoadFunction, true) },
};
return loadFunctionsMap;
}
}
return loadFunctionsMap;
}
case GL_COMPRESSED_R11_EAC:
{
......@@ -373,91 +278,35 @@ const std::map<GLenum, LoadImageFunctionInfo> &GetLoadFunctionsMap(GLenum intern
}
case GL_COMPRESSED_RGBA_S3TC_DXT1_EXT:
{
switch (dxgiFormat)
{
case DXGI_FORMAT_UNKNOWN:
{
static const std::map<GLenum, LoadImageFunctionInfo> loadFunctionsMap = {
{ GL_UNSIGNED_BYTE, LoadImageFunctionInfo(LoadCompressedToNative<4,4,8>, true) },
};
return loadFunctionsMap;
}
default:
{
static const std::map<GLenum, LoadImageFunctionInfo> loadFunctionsMap = {
{ GL_UNSIGNED_BYTE, LoadImageFunctionInfo(LoadCompressedToNative<4,4,8>, true) },
};
static const std::map<GLenum, LoadImageFunctionInfo> loadFunctionsMap = {
{ GL_UNSIGNED_BYTE, LoadImageFunctionInfo(LoadCompressedToNative<4,4,8>, true) },
};
return loadFunctionsMap;
}
}
return loadFunctionsMap;
}
case GL_COMPRESSED_RGBA_S3TC_DXT3_ANGLE:
{
switch (dxgiFormat)
{
case DXGI_FORMAT_UNKNOWN:
{
static const std::map<GLenum, LoadImageFunctionInfo> loadFunctionsMap = {
{ GL_UNSIGNED_BYTE, LoadImageFunctionInfo(LoadCompressedToNative<4,4,16>, true) },
};
return loadFunctionsMap;
}
default:
{
static const std::map<GLenum, LoadImageFunctionInfo> loadFunctionsMap = {
{ GL_UNSIGNED_BYTE, LoadImageFunctionInfo(LoadCompressedToNative<4,4,16>, true) },
};
static const std::map<GLenum, LoadImageFunctionInfo> loadFunctionsMap = {
{ GL_UNSIGNED_BYTE, LoadImageFunctionInfo(LoadCompressedToNative<4,4,16>, true) },
};
return loadFunctionsMap;
}
}
return loadFunctionsMap;
}
case GL_COMPRESSED_RGBA_S3TC_DXT5_ANGLE:
{
switch (dxgiFormat)
{
case DXGI_FORMAT_UNKNOWN:
{
static const std::map<GLenum, LoadImageFunctionInfo> loadFunctionsMap = {
{ GL_UNSIGNED_BYTE, LoadImageFunctionInfo(LoadCompressedToNative<4,4,16>, true) },
};
static const std::map<GLenum, LoadImageFunctionInfo> loadFunctionsMap = {
{ GL_UNSIGNED_BYTE, LoadImageFunctionInfo(LoadCompressedToNative<4,4,16>, true) },
};
return loadFunctionsMap;
}
default:
{
static const std::map<GLenum, LoadImageFunctionInfo> loadFunctionsMap = {
{ GL_UNSIGNED_BYTE, LoadImageFunctionInfo(LoadCompressedToNative<4,4,16>, true) },
};
return loadFunctionsMap;
}
}
return loadFunctionsMap;
}
case GL_COMPRESSED_RGB_S3TC_DXT1_EXT:
{
switch (dxgiFormat)
{
case DXGI_FORMAT_UNKNOWN:
{
static const std::map<GLenum, LoadImageFunctionInfo> loadFunctionsMap = {
{ GL_UNSIGNED_BYTE, LoadImageFunctionInfo(LoadCompressedToNative<4,4,8>, true) },
};
static const std::map<GLenum, LoadImageFunctionInfo> loadFunctionsMap = {
{ GL_UNSIGNED_BYTE, LoadImageFunctionInfo(LoadCompressedToNative<4,4,8>, true) },
};
return loadFunctionsMap;
}
default:
{
static const std::map<GLenum, LoadImageFunctionInfo> loadFunctionsMap = {
{ GL_UNSIGNED_BYTE, LoadImageFunctionInfo(LoadCompressedToNative<4,4,8>, true) },
};
return loadFunctionsMap;
}
}
return loadFunctionsMap;
}
case GL_COMPRESSED_SIGNED_R11_EAC:
{
......@@ -575,14 +424,6 @@ const std::map<GLenum, LoadImageFunctionInfo> &GetLoadFunctionsMap(GLenum intern
return loadFunctionsMap;
}
case DXGI_FORMAT_UNKNOWN:
{
static const std::map<GLenum, LoadImageFunctionInfo> loadFunctionsMap = {
{ GL_FLOAT_32_UNSIGNED_INT_24_8_REV, LoadImageFunctionInfo(UnimplementedLoadFunction, true) },
};
return loadFunctionsMap;
}
default:
{
static const std::map<GLenum, LoadImageFunctionInfo> loadFunctionsMap = {
......@@ -654,14 +495,6 @@ const std::map<GLenum, LoadImageFunctionInfo> &GetLoadFunctionsMap(GLenum intern
return loadFunctionsMap;
}
case DXGI_FORMAT_UNKNOWN:
{
static const std::map<GLenum, LoadImageFunctionInfo> loadFunctionsMap = {
{ GL_FLOAT, LoadImageFunctionInfo(UnimplementedLoadFunction, true) },
};
return loadFunctionsMap;
}
default:
{
static const std::map<GLenum, LoadImageFunctionInfo> loadFunctionsMap = {
......@@ -674,25 +507,11 @@ const std::map<GLenum, LoadImageFunctionInfo> &GetLoadFunctionsMap(GLenum intern
}
case GL_DEPTH_COMPONENT32_OES:
{
switch (dxgiFormat)
{
case DXGI_FORMAT_UNKNOWN:
{
static const std::map<GLenum, LoadImageFunctionInfo> loadFunctionsMap = {
{ GL_UNSIGNED_INT, LoadImageFunctionInfo(LoadR32ToR24G8, true) },
};
static const std::map<GLenum, LoadImageFunctionInfo> loadFunctionsMap = {
{ GL_UNSIGNED_INT, LoadImageFunctionInfo(LoadR32ToR24G8, true) },
};
return loadFunctionsMap;
}
default:
{
static const std::map<GLenum, LoadImageFunctionInfo> loadFunctionsMap = {
{ GL_UNSIGNED_INT, LoadImageFunctionInfo(LoadR32ToR24G8, true) },
};
return loadFunctionsMap;
}
}
return loadFunctionsMap;
}
case GL_ETC1_RGB8_LOSSY_DECODE_ANGLE:
{
......@@ -749,14 +568,6 @@ const std::map<GLenum, LoadImageFunctionInfo> &GetLoadFunctionsMap(GLenum intern
return loadFunctionsMap;
}
case DXGI_FORMAT_UNKNOWN:
{
static const std::map<GLenum, LoadImageFunctionInfo> loadFunctionsMap = {
{ GL_UNSIGNED_BYTE, LoadImageFunctionInfo(UnreachableLoadFunction, true) },
};
return loadFunctionsMap;
}
default:
{
static const std::map<GLenum, LoadImageFunctionInfo> loadFunctionsMap = {
......@@ -769,93 +580,36 @@ const std::map<GLenum, LoadImageFunctionInfo> &GetLoadFunctionsMap(GLenum intern
}
case GL_LUMINANCE16F_EXT:
{
switch (dxgiFormat)
{
case DXGI_FORMAT_UNKNOWN:
{
static const std::map<GLenum, LoadImageFunctionInfo> loadFunctionsMap = {
{ GL_HALF_FLOAT, LoadImageFunctionInfo(LoadL16FToRGBA16F, true) },
{ GL_HALF_FLOAT_OES, LoadImageFunctionInfo(LoadL16FToRGBA16F, true) },
};
static const std::map<GLenum, LoadImageFunctionInfo> loadFunctionsMap = {
{ GL_HALF_FLOAT, LoadImageFunctionInfo(LoadL16FToRGBA16F, true) },
{ GL_HALF_FLOAT_OES, LoadImageFunctionInfo(LoadL16FToRGBA16F, true) },
};
return loadFunctionsMap;
}
default:
{
static const std::map<GLenum, LoadImageFunctionInfo> loadFunctionsMap = {
{ GL_HALF_FLOAT, LoadImageFunctionInfo(LoadL16FToRGBA16F, true) },
{ GL_HALF_FLOAT_OES, LoadImageFunctionInfo(LoadL16FToRGBA16F, true) },
};
return loadFunctionsMap;
}
}
return loadFunctionsMap;
}
case GL_LUMINANCE32F_EXT:
{
switch (dxgiFormat)
{
case DXGI_FORMAT_UNKNOWN:
{
static const std::map<GLenum, LoadImageFunctionInfo> loadFunctionsMap = {
{ GL_FLOAT, LoadImageFunctionInfo(LoadL32FToRGBA32F, true) },
};
return loadFunctionsMap;
}
default:
{
static const std::map<GLenum, LoadImageFunctionInfo> loadFunctionsMap = {
{ GL_FLOAT, LoadImageFunctionInfo(LoadL32FToRGBA32F, true) },
};
static const std::map<GLenum, LoadImageFunctionInfo> loadFunctionsMap = {
{ GL_FLOAT, LoadImageFunctionInfo(LoadL32FToRGBA32F, true) },
};
return loadFunctionsMap;
}
}
return loadFunctionsMap;
}
case GL_LUMINANCE8_ALPHA8_EXT:
{
switch (dxgiFormat)
{
case DXGI_FORMAT_UNKNOWN:
{
static const std::map<GLenum, LoadImageFunctionInfo> loadFunctionsMap = {
{ GL_UNSIGNED_BYTE, LoadImageFunctionInfo(LoadLA8ToRGBA8, true) },
};
return loadFunctionsMap;
}
default:
{
static const std::map<GLenum, LoadImageFunctionInfo> loadFunctionsMap = {
{ GL_UNSIGNED_BYTE, LoadImageFunctionInfo(LoadLA8ToRGBA8, true) },
};
static const std::map<GLenum, LoadImageFunctionInfo> loadFunctionsMap = {
{ GL_UNSIGNED_BYTE, LoadImageFunctionInfo(LoadLA8ToRGBA8, true) },
};
return loadFunctionsMap;
}
}
return loadFunctionsMap;
}
case GL_LUMINANCE8_EXT:
{
switch (dxgiFormat)
{
case DXGI_FORMAT_UNKNOWN:
{
static const std::map<GLenum, LoadImageFunctionInfo> loadFunctionsMap = {
{ GL_UNSIGNED_BYTE, LoadImageFunctionInfo(LoadL8ToRGBA8, true) },
};
static const std::map<GLenum, LoadImageFunctionInfo> loadFunctionsMap = {
{ GL_UNSIGNED_BYTE, LoadImageFunctionInfo(LoadL8ToRGBA8, true) },
};
return loadFunctionsMap;
}
default:
{
static const std::map<GLenum, LoadImageFunctionInfo> loadFunctionsMap = {
{ GL_UNSIGNED_BYTE, LoadImageFunctionInfo(LoadL8ToRGBA8, true) },
};
return loadFunctionsMap;
}
}
return loadFunctionsMap;
}
case GL_LUMINANCE_ALPHA:
{
......@@ -880,14 +634,6 @@ const std::map<GLenum, LoadImageFunctionInfo> &GetLoadFunctionsMap(GLenum intern
return loadFunctionsMap;
}
case DXGI_FORMAT_UNKNOWN:
{
static const std::map<GLenum, LoadImageFunctionInfo> loadFunctionsMap = {
{ GL_UNSIGNED_BYTE, LoadImageFunctionInfo(UnreachableLoadFunction, true) },
};
return loadFunctionsMap;
}
default:
{
static const std::map<GLenum, LoadImageFunctionInfo> loadFunctionsMap = {
......@@ -900,49 +646,20 @@ const std::map<GLenum, LoadImageFunctionInfo> &GetLoadFunctionsMap(GLenum intern
}
case GL_LUMINANCE_ALPHA16F_EXT:
{
switch (dxgiFormat)
{
case DXGI_FORMAT_UNKNOWN:
{
static const std::map<GLenum, LoadImageFunctionInfo> loadFunctionsMap = {
{ GL_HALF_FLOAT, LoadImageFunctionInfo(LoadLA16FToRGBA16F, true) },
{ GL_HALF_FLOAT_OES, LoadImageFunctionInfo(LoadLA16FToRGBA16F, true) },
};
static const std::map<GLenum, LoadImageFunctionInfo> loadFunctionsMap = {
{ GL_HALF_FLOAT, LoadImageFunctionInfo(LoadLA16FToRGBA16F, true) },
{ GL_HALF_FLOAT_OES, LoadImageFunctionInfo(LoadLA16FToRGBA16F, true) },
};
return loadFunctionsMap;
}
default:
{
static const std::map<GLenum, LoadImageFunctionInfo> loadFunctionsMap = {
{ GL_HALF_FLOAT, LoadImageFunctionInfo(LoadLA16FToRGBA16F, true) },
{ GL_HALF_FLOAT_OES, LoadImageFunctionInfo(LoadLA16FToRGBA16F, true) },
};
return loadFunctionsMap;
}
}
return loadFunctionsMap;
}
case GL_LUMINANCE_ALPHA32F_EXT:
{
switch (dxgiFormat)
{
case DXGI_FORMAT_UNKNOWN:
{
static const std::map<GLenum, LoadImageFunctionInfo> loadFunctionsMap = {
{ GL_FLOAT, LoadImageFunctionInfo(LoadLA32FToRGBA32F, true) },
};
static const std::map<GLenum, LoadImageFunctionInfo> loadFunctionsMap = {
{ GL_FLOAT, LoadImageFunctionInfo(LoadLA32FToRGBA32F, true) },
};
return loadFunctionsMap;
}
default:
{
static const std::map<GLenum, LoadImageFunctionInfo> loadFunctionsMap = {
{ GL_FLOAT, LoadImageFunctionInfo(LoadLA32FToRGBA32F, true) },
};
return loadFunctionsMap;
}
}
return loadFunctionsMap;
}
case GL_R11F_G11F_B10F:
{
......@@ -1353,27 +1070,12 @@ const std::map<GLenum, LoadImageFunctionInfo> &GetLoadFunctionsMap(GLenum intern
}
case GL_RGB:
{
switch (dxgiFormat)
{
case DXGI_FORMAT_UNKNOWN:
{
static const std::map<GLenum, LoadImageFunctionInfo> loadFunctionsMap = {
{ GL_UNSIGNED_BYTE, LoadImageFunctionInfo(UnreachableLoadFunction, true) },
{ GL_UNSIGNED_SHORT_5_6_5, LoadImageFunctionInfo(UnreachableLoadFunction, true) },
};
return loadFunctionsMap;
}
default:
{
static const std::map<GLenum, LoadImageFunctionInfo> loadFunctionsMap = {
{ GL_UNSIGNED_BYTE, LoadImageFunctionInfo(UnreachableLoadFunction, true) },
{ GL_UNSIGNED_SHORT_5_6_5, LoadImageFunctionInfo(UnreachableLoadFunction, true) },
};
static const std::map<GLenum, LoadImageFunctionInfo> loadFunctionsMap = {
{ GL_UNSIGNED_BYTE, LoadImageFunctionInfo(UnreachableLoadFunction, true) },
{ GL_UNSIGNED_SHORT_5_6_5, LoadImageFunctionInfo(UnreachableLoadFunction, true) },
};
return loadFunctionsMap;
}
}
return loadFunctionsMap;
}
case GL_RGB10_A2:
{
......@@ -1676,29 +1378,13 @@ const std::map<GLenum, LoadImageFunctionInfo> &GetLoadFunctionsMap(GLenum intern
}
case GL_RGBA:
{
switch (dxgiFormat)
{
case DXGI_FORMAT_UNKNOWN:
{
static const std::map<GLenum, LoadImageFunctionInfo> loadFunctionsMap = {
{ GL_UNSIGNED_BYTE, LoadImageFunctionInfo(UnreachableLoadFunction, true) },
{ GL_UNSIGNED_SHORT_4_4_4_4, LoadImageFunctionInfo(UnreachableLoadFunction, true) },
{ GL_UNSIGNED_SHORT_5_5_5_1, LoadImageFunctionInfo(UnreachableLoadFunction, true) },
};
static const std::map<GLenum, LoadImageFunctionInfo> loadFunctionsMap = {
{ GL_UNSIGNED_BYTE, LoadImageFunctionInfo(UnreachableLoadFunction, true) },
{ GL_UNSIGNED_SHORT_4_4_4_4, LoadImageFunctionInfo(UnreachableLoadFunction, true) },
{ GL_UNSIGNED_SHORT_5_5_5_1, LoadImageFunctionInfo(UnreachableLoadFunction, true) },
};
return loadFunctionsMap;
}
default:
{
static const std::map<GLenum, LoadImageFunctionInfo> loadFunctionsMap = {
{ GL_UNSIGNED_BYTE, LoadImageFunctionInfo(UnreachableLoadFunction, true) },
{ GL_UNSIGNED_SHORT_4_4_4_4, LoadImageFunctionInfo(UnreachableLoadFunction, true) },
{ GL_UNSIGNED_SHORT_5_5_5_1, LoadImageFunctionInfo(UnreachableLoadFunction, true) },
};
return loadFunctionsMap;
}
}
return loadFunctionsMap;
}
case GL_RGBA16F:
{
......@@ -1954,27 +1640,12 @@ const std::map<GLenum, LoadImageFunctionInfo> &GetLoadFunctionsMap(GLenum intern
}
case GL_STENCIL_INDEX8:
{
switch (dxgiFormat)
{
case DXGI_FORMAT_UNKNOWN:
{
static const std::map<GLenum, LoadImageFunctionInfo> loadFunctionsMap = {
{ DXGI_FORMAT_D24_UNORM_S8_UINT, LoadImageFunctionInfo(UnimplementedLoadFunction, true) },
{ DXGI_FORMAT_R24G8_TYPELESS, LoadImageFunctionInfo(UnimplementedLoadFunction, true) },
};
static const std::map<GLenum, LoadImageFunctionInfo> loadFunctionsMap = {
{ DXGI_FORMAT_D24_UNORM_S8_UINT, LoadImageFunctionInfo(UnimplementedLoadFunction, true) },
{ DXGI_FORMAT_R24G8_TYPELESS, LoadImageFunctionInfo(UnimplementedLoadFunction, true) },
};
return loadFunctionsMap;
}
default:
{
static const std::map<GLenum, LoadImageFunctionInfo> loadFunctionsMap = {
{ DXGI_FORMAT_D24_UNORM_S8_UINT, LoadImageFunctionInfo(UnimplementedLoadFunction, true) },
{ DXGI_FORMAT_R24G8_TYPELESS, LoadImageFunctionInfo(UnimplementedLoadFunction, true) },
};
return loadFunctionsMap;
}
}
return loadFunctionsMap;
}
default:
......
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