Commit 43341b7a by Jamie Madill Committed by Commit Bot

D3D11: Merge FL10 and 9_3 ANGLE formats.

This will let us use ANGLE formats to describe a format layout rather than a Renderer-specific usage. This in turn will let us use ANGLE formats for other Renderers, as a universal thing. BUG=angleproject:1455 Change-Id: I56492cb809d4ef6ac4b962cb12affbc853bbdaa0 Reviewed-on: https://chromium-review.googlesource.com/365269Reviewed-by: 's avatarGeoff Lang <geofflang@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
parent 509a1d46
...@@ -1984,8 +1984,9 @@ gl::Error Blit11::initResolveDepthStencil(const gl::Extents &extents) ...@@ -1984,8 +1984,9 @@ gl::Error Blit11::initResolveDepthStencil(const gl::Extents &extents)
releaseResolveDepthStencilResources(); releaseResolveDepthStencilResources();
} }
auto resolvedFormat = d3d11::ANGLE_FORMAT_R32G32_FLOAT; auto resolvedFormat = d3d11::ANGLE_FORMAT_R32G32_FLOAT;
const auto &formatSet = d3d11::GetANGLEFormatSet(resolvedFormat); const auto &formatSet =
d3d11::GetANGLEFormatSet(resolvedFormat, mRenderer->getRenderer11DeviceCaps());
D3D11_TEXTURE2D_DESC textureDesc; D3D11_TEXTURE2D_DESC textureDesc;
textureDesc.Width = extents.width; textureDesc.Width = extents.width;
......
...@@ -3280,7 +3280,8 @@ gl::Error Renderer11::createRenderTarget(int width, int height, GLenum format, G ...@@ -3280,7 +3280,8 @@ gl::Error Renderer11::createRenderTarget(int width, int height, GLenum format, G
{ {
*outRT = new TextureRenderTarget11( *outRT = new TextureRenderTarget11(
static_cast<ID3D11RenderTargetView *>(nullptr), nullptr, nullptr, nullptr, format, static_cast<ID3D11RenderTargetView *>(nullptr), nullptr, nullptr, nullptr, format,
d3d11::GetANGLEFormatSet(d3d11::ANGLE_FORMAT_NONE), width, height, 1, supportedSamples); d3d11::GetANGLEFormatSet(d3d11::ANGLE_FORMAT_NONE, mRenderer11DeviceCaps), width,
height, 1, supportedSamples);
} }
return gl::Error(GL_NO_ERROR); return gl::Error(GL_NO_ERROR);
......
...@@ -1569,7 +1569,8 @@ TextureStorage11_EGLImage::TextureStorage11_EGLImage(Renderer11 *renderer, EGLIm ...@@ -1569,7 +1569,8 @@ TextureStorage11_EGLImage::TextureStorage11_EGLImage(Renderer11 *renderer, EGLIm
mMipLevels = 1; mMipLevels = 1;
mTextureFormatSet = &renderTarget11->getFormatSet(); mTextureFormatSet = &renderTarget11->getFormatSet();
mSwizzleFormatSet = &d3d11::GetANGLEFormatSet(mTextureFormatSet->swizzleFormat); mSwizzleFormatSet = &d3d11::GetANGLEFormatSet(mTextureFormatSet->swizzleFormat,
renderer->getRenderer11DeviceCaps());
mTextureWidth = renderTarget11->getWidth(); mTextureWidth = renderTarget11->getWidth();
mTextureHeight = renderTarget11->getHeight(); mTextureHeight = renderTarget11->getHeight();
mTextureDepth = 1; mTextureDepth = 1;
......
...@@ -163,11 +163,12 @@ ANGLEFormatSet::ANGLEFormatSet() ...@@ -163,11 +163,12 @@ ANGLEFormatSet::ANGLEFormatSet()
// DSVs given a GL internal format. // DSVs given a GL internal format.
TextureFormat::TextureFormat(GLenum internalFormat, TextureFormat::TextureFormat(GLenum internalFormat,
const ANGLEFormat angleFormat, const ANGLEFormat angleFormat,
InitializeTextureDataFunction internalFormatInitializer) InitializeTextureDataFunction internalFormatInitializer,
const Renderer11DeviceCaps &deviceCaps)
: dataInitializerFunction(internalFormatInitializer) : dataInitializerFunction(internalFormatInitializer)
{{ {{
formatSet = &GetANGLEFormatSet(angleFormat); formatSet = &GetANGLEFormatSet(angleFormat, deviceCaps);
swizzleFormatSet = &GetANGLEFormatSet(formatSet->swizzleFormat); swizzleFormatSet = &GetANGLEFormatSet(formatSet->swizzleFormat, deviceCaps);
// Gather all the load functions for this internal format // Gather all the load functions for this internal format
loadFunctions = GetLoadFunctionsMap(internalFormat, formatSet->texFormat); loadFunctions = GetLoadFunctionsMap(internalFormat, formatSet->texFormat);
...@@ -200,7 +201,8 @@ ANGLEFormatSet::ANGLEFormatSet(ANGLEFormat format, ...@@ -200,7 +201,8 @@ ANGLEFormatSet::ANGLEFormatSet(ANGLEFormat format,
{{ {{
}} }}
const ANGLEFormatSet &GetANGLEFormatSet(ANGLEFormat angleFormat) const ANGLEFormatSet &GetANGLEFormatSet(ANGLEFormat angleFormat,
const Renderer11DeviceCaps &deviceCaps)
{{ {{
// clang-format off // clang-format off
switch (angleFormat) switch (angleFormat)
...@@ -217,7 +219,7 @@ const ANGLEFormatSet &GetANGLEFormatSet(ANGLEFormat angleFormat) ...@@ -217,7 +219,7 @@ const ANGLEFormatSet &GetANGLEFormatSet(ANGLEFormat angleFormat)
}} }}
const TextureFormat &GetTextureFormatInfo(GLenum internalFormat, const TextureFormat &GetTextureFormatInfo(GLenum internalFormat,
const Renderer11DeviceCaps &renderer11DeviceCaps) const Renderer11DeviceCaps &deviceCaps)
{{ {{
// clang-format off // clang-format off
switch (internalFormat) switch (internalFormat)
...@@ -229,7 +231,7 @@ const TextureFormat &GetTextureFormatInfo(GLenum internalFormat, ...@@ -229,7 +231,7 @@ const TextureFormat &GetTextureFormatInfo(GLenum internalFormat,
}} }}
// clang-format on // clang-format on
static const TextureFormat defaultInfo(GL_NONE, ANGLE_FORMAT_NONE, nullptr); static const TextureFormat defaultInfo(GL_NONE, ANGLE_FORMAT_NONE, nullptr, deviceCaps);
return defaultInfo; return defaultInfo;
}} // GetTextureFormatInfo }} // GetTextureFormatInfo
...@@ -371,15 +373,16 @@ def get_texture_format_item(idx, internal_format, requirements_fn, angle_format_ ...@@ -371,15 +373,16 @@ def get_texture_format_item(idx, internal_format, requirements_fn, angle_format_
indent = ' ' indent = ' '
if requirements_fn != None: if requirements_fn != None:
if idx == 0: if idx == 0:
table_data += ' if (' + requirements_fn + '(renderer11DeviceCaps))\n' table_data += ' if (' + requirements_fn + '(deviceCaps))\n'
else: else:
table_data += ' else if (' + requirements_fn + '(renderer11DeviceCaps))\n' table_data += ' else if (' + requirements_fn + '(deviceCaps))\n'
table_data += ' {\n' table_data += ' {\n'
indent += ' ' indent += ' '
table_data += indent + 'static const TextureFormat textureFormat(internalFormat,\n' table_data += indent + 'static const TextureFormat textureFormat(internalFormat,\n'
table_data += indent + ' ' + angle_format_id + ',\n' table_data += indent + ' ' + angle_format_id + ',\n'
table_data += indent + ' ' + internal_format_initializer + ');\n' table_data += indent + ' ' + internal_format_initializer + ',\n'
table_data += indent + ' deviceCaps);\n'
table_data += indent + 'return textureFormat;\n' table_data += indent + 'return textureFormat;\n'
if requirements_fn != None: if requirements_fn != None:
...@@ -465,39 +468,109 @@ def get_blit_srv_format(angle_format): ...@@ -465,39 +468,109 @@ def get_blit_srv_format(angle_format):
return angle_format["srvFormat"] if "srvFormat" in angle_format else "DXGI_FORMAT_UNKNOWN" return angle_format["srvFormat"] if "srvFormat" in angle_format else "DXGI_FORMAT_UNKNOWN"
format_entry_template = """{space}{{
{space} static const ANGLEFormatSet formatInfo({formatName},
{space} {glInternalFormat},
{space} {fboImplementationInternalFormat},
{space} {texFormat},
{space} {srvFormat},
{space} {rtvFormat},
{space} {dsvFormat},
{space} {blitSRVFormat},
{space} {swizzleFormat},
{space} {mipGenerationFunction},
{space} {colorReadFunction});
{space} return formatInfo;
{space}}}
"""
split_format_entry_template = """{space} {condition}
{space} {{
{space} static const ANGLEFormatSet formatInfo({formatName},
{space} {glInternalFormat},
{space} {fboImplementationInternalFormat},
{space} {texFormat},
{space} {srvFormat},
{space} {rtvFormat},
{space} {dsvFormat},
{space} {blitSRVFormat},
{space} {swizzleFormat},
{space} {mipGenerationFunction},
{space} {colorReadFunction});
{space} return formatInfo;
{space} }}
"""
def json_to_table_data(format_name, prefix, json):
table_data = ""
parsed = {
"space": " ",
"formatName": format_name,
"texFormat": "DXGI_FORMAT_UNKNOWN",
"srvFormat": "DXGI_FORMAT_UNKNOWN",
"rtvFormat": "DXGI_FORMAT_UNKNOWN",
"dsvFormat": "DXGI_FORMAT_UNKNOWN",
"glInternalFormat": "GL_NONE",
"condition": prefix,
}
for k, v in json.iteritems():
parsed[k] = v
if (format_name != "ANGLE_FORMAT_NONE") and (parsed["glInternalFormat"] == "GL_NONE"):
print("Missing 'glInternalFormat' from " + format_name)
sys.exit(1)
if "fboImplementationInternalFormat" not in parsed:
parsed["fboImplementationInternalFormat"] = parsed["glInternalFormat"]
# Derived values.
parsed["blitSRVFormat"] = get_blit_srv_format(parsed)
parsed["swizzleFormat"] = get_swizzle_format_id(format_name, parsed)
parsed["mipGenerationFunction"] = get_mip_generation_function(parsed)
parsed["colorReadFunction"] = get_color_read_function(parsed)
if len(prefix) > 0:
return split_format_entry_template.format(**parsed)
else:
return format_entry_template.format(**parsed)
def parse_json_into_switch_angle_format_string(json_data): def parse_json_into_switch_angle_format_string(json_data):
table_data = '' table_data = ''
for angle_format_item in sorted(json_data.iteritems()): for angle_format_item in sorted(json_data.iteritems()):
table_data += ' case ' + angle_format_item[0] + ':\n' table_data += ' case ' + angle_format_item[0] + ':\n'
format_name = angle_format_item[0] format_name = angle_format_item[0]
angle_format = angle_format_item[1] angle_format = angle_format_item[1]
if (format_name != "ANGLE_FORMAT_NONE") and ("glInternalFormat" not in angle_format):
print("Missing 'glInternalFormat' from " + format_name) fl10plus = {}
sys.exit(1) fl9_3 = {}
gl_internal_format = "GL_NONE" if format_name == "ANGLE_FORMAT_NONE" else angle_format["glInternalFormat"] split = False
fbo_internal_format = angle_format["fboImplementationInternalFormat"] if "fboImplementationInternalFormat" in angle_format else gl_internal_format
tex_format = angle_format["texFormat"] if "texFormat" in angle_format else "DXGI_FORMAT_UNKNOWN" for k, v in angle_format.iteritems():
srv_format = angle_format["srvFormat"] if "srvFormat" in angle_format else "DXGI_FORMAT_UNKNOWN" if k == "FL10Plus":
rtv_format = angle_format["rtvFormat"] if "rtvFormat" in angle_format else "DXGI_FORMAT_UNKNOWN" split = True
dsv_format = angle_format["dsvFormat"] if "dsvFormat" in angle_format else "DXGI_FORMAT_UNKNOWN" for k2, v2 in v.iteritems():
blit_srv_format = get_blit_srv_format(angle_format) fl10plus[k2] = v2
swizzle_format = get_swizzle_format_id(format_name, angle_format) elif k == "FL9_3":
mip_generation_function = get_mip_generation_function(angle_format) split = True
color_read_function = get_color_read_function(angle_format) for k2, v2 in v.iteritems():
table_data += ' {\n' fl9_3[k2] = v2
table_data += ' static const ANGLEFormatSet formatInfo(' + format_name + ',\n' else:
table_data += ' ' + gl_internal_format + ',\n' fl10plus[k] = v
table_data += ' ' + fbo_internal_format + ',\n' fl9_3[k] = v
table_data += ' ' + tex_format + ',\n'
table_data += ' ' + srv_format + ',\n' if split:
table_data += ' ' + rtv_format + ',\n' table_data += " {\n"
table_data += ' ' + dsv_format + ',\n' table_data += json_to_table_data(format_name, "if (OnlyFL10Plus(deviceCaps))", fl10plus)
table_data += ' ' + blit_srv_format + ',\n' table_data += json_to_table_data(format_name, "else", fl9_3)
table_data += ' ' + swizzle_format + ',\n' table_data += " }\n"
table_data += ' ' + mip_generation_function + ',\n' table_data += " break;\n"
table_data += ' ' + color_read_function + ');\n' else:
table_data += ' return formatInfo;\n' table_data += json_to_table_data(format_name, "", fl10plus)
table_data += ' }\n'
return table_data return table_data
def parse_json_into_angle_format_enum_string(json_data): def parse_json_into_angle_format_enum_string(json_data):
......
...@@ -80,22 +80,20 @@ ...@@ -80,22 +80,20 @@
"swizzleFormat": "ANGLE_FORMAT_R8G8B8A8_UNORM", "swizzleFormat": "ANGLE_FORMAT_R8G8B8A8_UNORM",
"glInternalFormat": "GL_COMPRESSED_RGBA_S3TC_DXT5_ANGLE" "glInternalFormat": "GL_COMPRESSED_RGBA_S3TC_DXT5_ANGLE"
}, },
"ANGLE_FORMAT_D24_UNORM_S8_UINT_FL10": { "ANGLE_FORMAT_D24_UNORM_S8_UINT": {
"texFormat": "DXGI_FORMAT_R24G8_TYPELESS", "FL10Plus": {
"srvFormat": "DXGI_FORMAT_R24_UNORM_X8_TYPELESS", "texFormat": "DXGI_FORMAT_R24G8_TYPELESS",
"srvFormat": "DXGI_FORMAT_R24_UNORM_X8_TYPELESS"
},
"FL9_3": {
"texFormat": "DXGI_FORMAT_D24_UNORM_S8_UINT"
},
"dsvFormat": "DXGI_FORMAT_D24_UNORM_S8_UINT", "dsvFormat": "DXGI_FORMAT_D24_UNORM_S8_UINT",
"channels": "ds", "channels": "ds",
"bits": { "depth": 24, "stencil": 8 }, "bits": { "depth": 24, "stencil": 8 },
"glInternalFormat": "GL_DEPTH24_STENCIL8_OES" "glInternalFormat": "GL_DEPTH24_STENCIL8_OES"
}, },
"ANGLE_FORMAT_D24_UNORM_S8_UINT_FL9_3": { "ANGLE_FORMAT_D32_FLOAT_S8X24_UINT": {
"texFormat": "DXGI_FORMAT_D24_UNORM_S8_UINT",
"dsvFormat": "DXGI_FORMAT_D24_UNORM_S8_UINT",
"channels": "ds",
"bits": { "depth": 24, "stencil": 8 },
"glInternalFormat": "GL_DEPTH24_STENCIL8_OES"
},
"ANGLE_FORMAT_D32_FLOAT_S8X24_UINT_FL10": {
"texFormat": "DXGI_FORMAT_R32G8X24_TYPELESS", "texFormat": "DXGI_FORMAT_R32G8X24_TYPELESS",
"srvFormat": "DXGI_FORMAT_R32_FLOAT_X8X24_TYPELESS", "srvFormat": "DXGI_FORMAT_R32_FLOAT_X8X24_TYPELESS",
"dsvFormat": "DXGI_FORMAT_D32_FLOAT_S8X24_UINT", "dsvFormat": "DXGI_FORMAT_D32_FLOAT_S8X24_UINT",
...@@ -103,17 +101,14 @@ ...@@ -103,17 +101,14 @@
"bits": { "depth": 32, "stencil": 8 }, "bits": { "depth": 32, "stencil": 8 },
"glInternalFormat": "GL_DEPTH32F_STENCIL8" "glInternalFormat": "GL_DEPTH32F_STENCIL8"
}, },
"ANGLE_FORMAT_D16_UNORM_FL10": { "ANGLE_FORMAT_D16_UNORM": {
"texFormat": "DXGI_FORMAT_R16_TYPELESS", "FL10Plus": {
"srvFormat": "DXGI_FORMAT_R16_UNORM", "texFormat": "DXGI_FORMAT_R16_TYPELESS",
"dsvFormat": "DXGI_FORMAT_D16_UNORM", "srvFormat": "DXGI_FORMAT_R16_UNORM"
"channels": "d", },
"componentType": "unorm", "FL9_3": {
"bits": { "depth": 16 }, "texFormat": "DXGI_FORMAT_D16_UNORM"
"glInternalFormat": "GL_DEPTH_COMPONENT16" },
},
"ANGLE_FORMAT_D16_UNORM_FL9_3": {
"texFormat": "DXGI_FORMAT_D16_UNORM",
"dsvFormat": "DXGI_FORMAT_D16_UNORM", "dsvFormat": "DXGI_FORMAT_D16_UNORM",
"channels": "d", "channels": "d",
"componentType": "unorm", "componentType": "unorm",
......
...@@ -77,27 +77,25 @@ ...@@ -77,27 +77,25 @@
"OnlyFL10Plus": "ANGLE_FORMAT_R8G8B8A8_UNORM_SRGB" "OnlyFL10Plus": "ANGLE_FORMAT_R8G8B8A8_UNORM_SRGB"
}, },
"GL_DEPTH24_STENCIL8": { "GL_DEPTH24_STENCIL8": {
"OnlyFL10Plus": "ANGLE_FORMAT_D24_UNORM_S8_UINT_FL10", "OnlyFL10Plus": "ANGLE_FORMAT_D24_UNORM_S8_UINT",
"OnlyFL9_3": "ANGLE_FORMAT_D24_UNORM_S8_UINT_FL9_3" "OnlyFL9_3": "ANGLE_FORMAT_D24_UNORM_S8_UINT"
}, },
"GL_DEPTH32F_STENCIL8": { "GL_DEPTH32F_STENCIL8": {
"OnlyFL10Plus": "ANGLE_FORMAT_D32_FLOAT_S8X24_UINT_FL10", "OnlyFL10Plus": "ANGLE_FORMAT_D32_FLOAT_S8X24_UINT"
"OnlyFL9_3": "ANGLE_FORMAT_NONE"
}, },
"GL_DEPTH_COMPONENT16": { "GL_DEPTH_COMPONENT16": {
"OnlyFL10Plus": "ANGLE_FORMAT_D16_UNORM_FL10", "OnlyFL10Plus": "ANGLE_FORMAT_D16_UNORM",
"OnlyFL9_3": "ANGLE_FORMAT_D16_UNORM_FL9_3" "OnlyFL9_3": "ANGLE_FORMAT_D16_UNORM"
}, },
"GL_DEPTH_COMPONENT24": { "GL_DEPTH_COMPONENT24": {
"OnlyFL10Plus": "ANGLE_FORMAT_D24_UNORM_S8_UINT_FL10", "OnlyFL10Plus": "ANGLE_FORMAT_D24_UNORM_S8_UINT",
"OnlyFL9_3": "ANGLE_FORMAT_D24_UNORM_S8_UINT_FL9_3" "OnlyFL9_3": "ANGLE_FORMAT_D24_UNORM_S8_UINT"
}, },
"GL_DEPTH_COMPONENT32F": { "GL_DEPTH_COMPONENT32F": {
"OnlyFL10Plus": "ANGLE_FORMAT_D32_FLOAT", "OnlyFL10Plus": "ANGLE_FORMAT_D32_FLOAT"
"OnlyFL9_3": "ANGLE_FORMAT_NONE"
}, },
"GL_DEPTH_COMPONENT32_OES": { "GL_DEPTH_COMPONENT32_OES": {
"OnlyFL10Plus": "ANGLE_FORMAT_D24_UNORM_S8_UINT_FL10" "OnlyFL10Plus": "ANGLE_FORMAT_D24_UNORM_S8_UINT"
}, },
"GL_ETC1_RGB8_OES": "ANGLE_FORMAT_R8G8B8A8_UNORM", "GL_ETC1_RGB8_OES": "ANGLE_FORMAT_R8G8B8A8_UNORM",
"GL_ETC1_RGB8_LOSSY_DECODE_ANGLE": "ANGLE_FORMAT_BC1_UNORM", "GL_ETC1_RGB8_LOSSY_DECODE_ANGLE": "ANGLE_FORMAT_BC1_UNORM",
...@@ -171,8 +169,8 @@ ...@@ -171,8 +169,8 @@
"GL_SRGB8": "ANGLE_FORMAT_R8G8B8A8_UNORM_SRGB", "GL_SRGB8": "ANGLE_FORMAT_R8G8B8A8_UNORM_SRGB",
"GL_SRGB8_ALPHA8": "ANGLE_FORMAT_R8G8B8A8_UNORM_SRGB", "GL_SRGB8_ALPHA8": "ANGLE_FORMAT_R8G8B8A8_UNORM_SRGB",
"GL_STENCIL_INDEX8": { "GL_STENCIL_INDEX8": {
"OnlyFL10Plus": "ANGLE_FORMAT_D24_UNORM_S8_UINT_FL10", "OnlyFL10Plus": "ANGLE_FORMAT_D24_UNORM_S8_UINT",
"OnlyFL9_3": "ANGLE_FORMAT_D24_UNORM_S8_UINT_FL9_3" "OnlyFL9_3": "ANGLE_FORMAT_D24_UNORM_S8_UINT"
}, },
"GL_R16_EXT": "ANGLE_FORMAT_R16_UNORM", "GL_R16_EXT": "ANGLE_FORMAT_R16_UNORM",
"GL_RG16_EXT": "ANGLE_FORMAT_R16G16_UNORM", "GL_RG16_EXT": "ANGLE_FORMAT_R16G16_UNORM",
......
...@@ -81,7 +81,8 @@ struct TextureFormat : public angle::NonCopyable ...@@ -81,7 +81,8 @@ struct TextureFormat : public angle::NonCopyable
{ {
TextureFormat(GLenum internalFormat, TextureFormat(GLenum internalFormat,
const ANGLEFormat angleFormat, const ANGLEFormat angleFormat,
InitializeTextureDataFunction internalFormatInitializer); InitializeTextureDataFunction internalFormatInitializer,
const Renderer11DeviceCaps &deviceCaps);
const ANGLEFormatSet *formatSet; const ANGLEFormatSet *formatSet;
const ANGLEFormatSet *swizzleFormatSet; const ANGLEFormatSet *swizzleFormatSet;
...@@ -92,7 +93,8 @@ struct TextureFormat : public angle::NonCopyable ...@@ -92,7 +93,8 @@ struct TextureFormat : public angle::NonCopyable
LoadFunctionMap loadFunctions; LoadFunctionMap loadFunctions;
}; };
const ANGLEFormatSet &GetANGLEFormatSet(ANGLEFormat angleFormat); const ANGLEFormatSet &GetANGLEFormatSet(ANGLEFormat angleFormat,
const Renderer11DeviceCaps &deviceCaps);
const TextureFormat &GetTextureFormatInfo(GLenum internalformat, const TextureFormat &GetTextureFormatInfo(GLenum internalformat,
const Renderer11DeviceCaps &renderer11DeviceCaps); const Renderer11DeviceCaps &renderer11DeviceCaps);
......
...@@ -123,11 +123,12 @@ ANGLEFormatSet::ANGLEFormatSet() ...@@ -123,11 +123,12 @@ ANGLEFormatSet::ANGLEFormatSet()
// DSVs given a GL internal format. // DSVs given a GL internal format.
TextureFormat::TextureFormat(GLenum internalFormat, TextureFormat::TextureFormat(GLenum internalFormat,
const ANGLEFormat angleFormat, const ANGLEFormat angleFormat,
InitializeTextureDataFunction internalFormatInitializer) InitializeTextureDataFunction internalFormatInitializer,
const Renderer11DeviceCaps &deviceCaps)
: dataInitializerFunction(internalFormatInitializer) : dataInitializerFunction(internalFormatInitializer)
{ {
formatSet = &GetANGLEFormatSet(angleFormat); formatSet = &GetANGLEFormatSet(angleFormat, deviceCaps);
swizzleFormatSet = &GetANGLEFormatSet(formatSet->swizzleFormat); swizzleFormatSet = &GetANGLEFormatSet(formatSet->swizzleFormat, deviceCaps);
// Gather all the load functions for this internal format // Gather all the load functions for this internal format
loadFunctions = GetLoadFunctionsMap(internalFormat, formatSet->texFormat); loadFunctions = GetLoadFunctionsMap(internalFormat, formatSet->texFormat);
...@@ -160,7 +161,8 @@ ANGLEFormatSet::ANGLEFormatSet(ANGLEFormat format, ...@@ -160,7 +161,8 @@ ANGLEFormatSet::ANGLEFormatSet(ANGLEFormat format,
{ {
} }
const ANGLEFormatSet &GetANGLEFormatSet(ANGLEFormat angleFormat) const ANGLEFormatSet &GetANGLEFormatSet(ANGLEFormat angleFormat,
const Renderer11DeviceCaps &deviceCaps)
{ {
// clang-format off // clang-format off
switch (angleFormat) switch (angleFormat)
...@@ -285,66 +287,74 @@ const ANGLEFormatSet &GetANGLEFormatSet(ANGLEFormat angleFormat) ...@@ -285,66 +287,74 @@ const ANGLEFormatSet &GetANGLEFormatSet(ANGLEFormat angleFormat)
nullptr); nullptr);
return formatInfo; return formatInfo;
} }
case ANGLE_FORMAT_D16_UNORM_FL10: case ANGLE_FORMAT_D16_UNORM:
{ {
static const ANGLEFormatSet formatInfo(ANGLE_FORMAT_D16_UNORM_FL10, if (OnlyFL10Plus(deviceCaps))
GL_DEPTH_COMPONENT16, {
GL_DEPTH_COMPONENT16, static const ANGLEFormatSet formatInfo(ANGLE_FORMAT_D16_UNORM,
DXGI_FORMAT_R16_TYPELESS, GL_DEPTH_COMPONENT16,
DXGI_FORMAT_R16_UNORM, GL_DEPTH_COMPONENT16,
DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_R16_TYPELESS,
DXGI_FORMAT_D16_UNORM, DXGI_FORMAT_R16_UNORM,
DXGI_FORMAT_R16_UNORM, DXGI_FORMAT_UNKNOWN,
ANGLE_FORMAT_R16G16B16A16_UNORM, DXGI_FORMAT_D16_UNORM,
nullptr, DXGI_FORMAT_R16_UNORM,
nullptr); ANGLE_FORMAT_R16G16B16A16_UNORM,
return formatInfo; nullptr,
} nullptr);
case ANGLE_FORMAT_D16_UNORM_FL9_3: return formatInfo;
{ }
static const ANGLEFormatSet formatInfo(ANGLE_FORMAT_D16_UNORM_FL9_3, else
GL_DEPTH_COMPONENT16, {
GL_DEPTH_COMPONENT16, static const ANGLEFormatSet formatInfo(ANGLE_FORMAT_D16_UNORM,
DXGI_FORMAT_D16_UNORM, GL_DEPTH_COMPONENT16,
DXGI_FORMAT_UNKNOWN, GL_DEPTH_COMPONENT16,
DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_D16_UNORM,
DXGI_FORMAT_D16_UNORM, DXGI_FORMAT_UNKNOWN,
DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN,
ANGLE_FORMAT_R16G16B16A16_UNORM, DXGI_FORMAT_D16_UNORM,
nullptr, DXGI_FORMAT_UNKNOWN,
nullptr); ANGLE_FORMAT_R16G16B16A16_UNORM,
return formatInfo; nullptr,
} nullptr);
case ANGLE_FORMAT_D24_UNORM_S8_UINT_FL10: return formatInfo;
{ }
static const ANGLEFormatSet formatInfo(ANGLE_FORMAT_D24_UNORM_S8_UINT_FL10,
GL_DEPTH24_STENCIL8_OES,
GL_DEPTH24_STENCIL8_OES,
DXGI_FORMAT_R24G8_TYPELESS,
DXGI_FORMAT_R24_UNORM_X8_TYPELESS,
DXGI_FORMAT_UNKNOWN,
DXGI_FORMAT_D24_UNORM_S8_UINT,
DXGI_FORMAT_R24_UNORM_X8_TYPELESS,
ANGLE_FORMAT_R32G32B32A32_FLOAT,
nullptr,
nullptr);
return formatInfo;
} }
case ANGLE_FORMAT_D24_UNORM_S8_UINT_FL9_3: break;
case ANGLE_FORMAT_D24_UNORM_S8_UINT:
{ {
static const ANGLEFormatSet formatInfo(ANGLE_FORMAT_D24_UNORM_S8_UINT_FL9_3, if (OnlyFL10Plus(deviceCaps))
GL_DEPTH24_STENCIL8_OES, {
GL_DEPTH24_STENCIL8_OES, static const ANGLEFormatSet formatInfo(ANGLE_FORMAT_D24_UNORM_S8_UINT,
DXGI_FORMAT_D24_UNORM_S8_UINT, GL_DEPTH24_STENCIL8_OES,
DXGI_FORMAT_UNKNOWN, GL_DEPTH24_STENCIL8_OES,
DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_R24G8_TYPELESS,
DXGI_FORMAT_D24_UNORM_S8_UINT, DXGI_FORMAT_R24_UNORM_X8_TYPELESS,
DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN,
ANGLE_FORMAT_R32G32B32A32_FLOAT, DXGI_FORMAT_D24_UNORM_S8_UINT,
nullptr, DXGI_FORMAT_R24_UNORM_X8_TYPELESS,
nullptr); ANGLE_FORMAT_R32G32B32A32_FLOAT,
return formatInfo; nullptr,
nullptr);
return formatInfo;
}
else
{
static const ANGLEFormatSet formatInfo(ANGLE_FORMAT_D24_UNORM_S8_UINT,
GL_DEPTH24_STENCIL8_OES,
GL_DEPTH24_STENCIL8_OES,
DXGI_FORMAT_D24_UNORM_S8_UINT,
DXGI_FORMAT_UNKNOWN,
DXGI_FORMAT_UNKNOWN,
DXGI_FORMAT_D24_UNORM_S8_UINT,
DXGI_FORMAT_UNKNOWN,
ANGLE_FORMAT_R32G32B32A32_FLOAT,
nullptr,
nullptr);
return formatInfo;
}
} }
break;
case ANGLE_FORMAT_D32_FLOAT: case ANGLE_FORMAT_D32_FLOAT:
{ {
static const ANGLEFormatSet formatInfo(ANGLE_FORMAT_D32_FLOAT, static const ANGLEFormatSet formatInfo(ANGLE_FORMAT_D32_FLOAT,
...@@ -360,9 +370,9 @@ const ANGLEFormatSet &GetANGLEFormatSet(ANGLEFormat angleFormat) ...@@ -360,9 +370,9 @@ const ANGLEFormatSet &GetANGLEFormatSet(ANGLEFormat angleFormat)
nullptr); nullptr);
return formatInfo; return formatInfo;
} }
case ANGLE_FORMAT_D32_FLOAT_S8X24_UINT_FL10: case ANGLE_FORMAT_D32_FLOAT_S8X24_UINT:
{ {
static const ANGLEFormatSet formatInfo(ANGLE_FORMAT_D32_FLOAT_S8X24_UINT_FL10, static const ANGLEFormatSet formatInfo(ANGLE_FORMAT_D32_FLOAT_S8X24_UINT,
GL_DEPTH32F_STENCIL8, GL_DEPTH32F_STENCIL8,
GL_DEPTH32F_STENCIL8, GL_DEPTH32F_STENCIL8,
DXGI_FORMAT_R32G8X24_TYPELESS, DXGI_FORMAT_R32G8X24_TYPELESS,
...@@ -1017,25 +1027,27 @@ const ANGLEFormatSet &GetANGLEFormatSet(ANGLEFormat angleFormat) ...@@ -1017,25 +1027,27 @@ const ANGLEFormatSet &GetANGLEFormatSet(ANGLEFormat angleFormat)
} }
const TextureFormat &GetTextureFormatInfo(GLenum internalFormat, const TextureFormat &GetTextureFormatInfo(GLenum internalFormat,
const Renderer11DeviceCaps &renderer11DeviceCaps) const Renderer11DeviceCaps &deviceCaps)
{ {
// clang-format off // clang-format off
switch (internalFormat) switch (internalFormat)
{ {
case GL_ALPHA: case GL_ALPHA:
{ {
if (OnlyFL10Plus(renderer11DeviceCaps)) if (OnlyFL10Plus(deviceCaps))
{ {
static const TextureFormat textureFormat(internalFormat, static const TextureFormat textureFormat(internalFormat,
ANGLE_FORMAT_A8_UNORM, ANGLE_FORMAT_A8_UNORM,
nullptr); nullptr,
deviceCaps);
return textureFormat; return textureFormat;
} }
else if (OnlyFL9_3(renderer11DeviceCaps)) else if (OnlyFL9_3(deviceCaps))
{ {
static const TextureFormat textureFormat(internalFormat, static const TextureFormat textureFormat(internalFormat,
ANGLE_FORMAT_R8G8B8A8_UNORM, ANGLE_FORMAT_R8G8B8A8_UNORM,
nullptr); nullptr,
deviceCaps);
return textureFormat; return textureFormat;
} }
else else
...@@ -1047,30 +1059,34 @@ const TextureFormat &GetTextureFormatInfo(GLenum internalFormat, ...@@ -1047,30 +1059,34 @@ const TextureFormat &GetTextureFormatInfo(GLenum internalFormat,
{ {
static const TextureFormat textureFormat(internalFormat, static const TextureFormat textureFormat(internalFormat,
ANGLE_FORMAT_R16G16B16A16_FLOAT, ANGLE_FORMAT_R16G16B16A16_FLOAT,
nullptr); nullptr,
deviceCaps);
return textureFormat; return textureFormat;
} }
case GL_ALPHA32F_EXT: case GL_ALPHA32F_EXT:
{ {
static const TextureFormat textureFormat(internalFormat, static const TextureFormat textureFormat(internalFormat,
ANGLE_FORMAT_R32G32B32A32_FLOAT, ANGLE_FORMAT_R32G32B32A32_FLOAT,
nullptr); nullptr,
deviceCaps);
return textureFormat; return textureFormat;
} }
case GL_ALPHA8_EXT: case GL_ALPHA8_EXT:
{ {
if (OnlyFL10Plus(renderer11DeviceCaps)) if (OnlyFL10Plus(deviceCaps))
{ {
static const TextureFormat textureFormat(internalFormat, static const TextureFormat textureFormat(internalFormat,
ANGLE_FORMAT_A8_UNORM, ANGLE_FORMAT_A8_UNORM,
nullptr); nullptr,
deviceCaps);
return textureFormat; return textureFormat;
} }
else if (OnlyFL9_3(renderer11DeviceCaps)) else if (OnlyFL9_3(deviceCaps))
{ {
static const TextureFormat textureFormat(internalFormat, static const TextureFormat textureFormat(internalFormat,
ANGLE_FORMAT_R8G8B8A8_UNORM, ANGLE_FORMAT_R8G8B8A8_UNORM,
nullptr); nullptr,
deviceCaps);
return textureFormat; return textureFormat;
} }
else else
...@@ -1082,44 +1098,50 @@ const TextureFormat &GetTextureFormatInfo(GLenum internalFormat, ...@@ -1082,44 +1098,50 @@ const TextureFormat &GetTextureFormatInfo(GLenum internalFormat,
{ {
static const TextureFormat textureFormat(internalFormat, static const TextureFormat textureFormat(internalFormat,
ANGLE_FORMAT_B5G6R5_UNORM, ANGLE_FORMAT_B5G6R5_UNORM,
nullptr); nullptr,
deviceCaps);
return textureFormat; return textureFormat;
} }
case GL_BGR5_A1_ANGLEX: case GL_BGR5_A1_ANGLEX:
{ {
static const TextureFormat textureFormat(internalFormat, static const TextureFormat textureFormat(internalFormat,
ANGLE_FORMAT_B8G8R8A8_UNORM, ANGLE_FORMAT_B8G8R8A8_UNORM,
nullptr); nullptr,
deviceCaps);
return textureFormat; return textureFormat;
} }
case GL_BGRA4_ANGLEX: case GL_BGRA4_ANGLEX:
{ {
static const TextureFormat textureFormat(internalFormat, static const TextureFormat textureFormat(internalFormat,
ANGLE_FORMAT_B8G8R8A8_UNORM, ANGLE_FORMAT_B8G8R8A8_UNORM,
nullptr); nullptr,
deviceCaps);
return textureFormat; return textureFormat;
} }
case GL_BGRA8_EXT: case GL_BGRA8_EXT:
{ {
static const TextureFormat textureFormat(internalFormat, static const TextureFormat textureFormat(internalFormat,
ANGLE_FORMAT_B8G8R8A8_UNORM, ANGLE_FORMAT_B8G8R8A8_UNORM,
nullptr); nullptr,
deviceCaps);
return textureFormat; return textureFormat;
} }
case GL_BGRA_EXT: case GL_BGRA_EXT:
{ {
static const TextureFormat textureFormat(internalFormat, static const TextureFormat textureFormat(internalFormat,
ANGLE_FORMAT_B8G8R8A8_UNORM, ANGLE_FORMAT_B8G8R8A8_UNORM,
nullptr); nullptr,
deviceCaps);
return textureFormat; return textureFormat;
} }
case GL_COMPRESSED_R11_EAC: case GL_COMPRESSED_R11_EAC:
{ {
if (OnlyFL10Plus(renderer11DeviceCaps)) if (OnlyFL10Plus(deviceCaps))
{ {
static const TextureFormat textureFormat(internalFormat, static const TextureFormat textureFormat(internalFormat,
ANGLE_FORMAT_R8_UNORM, ANGLE_FORMAT_R8_UNORM,
nullptr); nullptr,
deviceCaps);
return textureFormat; return textureFormat;
} }
else else
...@@ -1129,11 +1151,12 @@ const TextureFormat &GetTextureFormatInfo(GLenum internalFormat, ...@@ -1129,11 +1151,12 @@ const TextureFormat &GetTextureFormatInfo(GLenum internalFormat,
} }
case GL_COMPRESSED_RG11_EAC: case GL_COMPRESSED_RG11_EAC:
{ {
if (OnlyFL10Plus(renderer11DeviceCaps)) if (OnlyFL10Plus(deviceCaps))
{ {
static const TextureFormat textureFormat(internalFormat, static const TextureFormat textureFormat(internalFormat,
ANGLE_FORMAT_R8G8_UNORM, ANGLE_FORMAT_R8G8_UNORM,
nullptr); nullptr,
deviceCaps);
return textureFormat; return textureFormat;
} }
else else
...@@ -1143,11 +1166,12 @@ const TextureFormat &GetTextureFormatInfo(GLenum internalFormat, ...@@ -1143,11 +1166,12 @@ const TextureFormat &GetTextureFormatInfo(GLenum internalFormat,
} }
case GL_COMPRESSED_RGB8_ETC2: case GL_COMPRESSED_RGB8_ETC2:
{ {
if (OnlyFL10Plus(renderer11DeviceCaps)) if (OnlyFL10Plus(deviceCaps))
{ {
static const TextureFormat textureFormat(internalFormat, static const TextureFormat textureFormat(internalFormat,
ANGLE_FORMAT_R8G8B8A8_UNORM, ANGLE_FORMAT_R8G8B8A8_UNORM,
Initialize4ComponentData<GLubyte, 0x00, 0x00, 0x00, 0xFF>); Initialize4ComponentData<GLubyte, 0x00, 0x00, 0x00, 0xFF>,
deviceCaps);
return textureFormat; return textureFormat;
} }
else else
...@@ -1157,11 +1181,12 @@ const TextureFormat &GetTextureFormatInfo(GLenum internalFormat, ...@@ -1157,11 +1181,12 @@ const TextureFormat &GetTextureFormatInfo(GLenum internalFormat,
} }
case GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2: case GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:
{ {
if (OnlyFL10Plus(renderer11DeviceCaps)) if (OnlyFL10Plus(deviceCaps))
{ {
static const TextureFormat textureFormat(internalFormat, static const TextureFormat textureFormat(internalFormat,
ANGLE_FORMAT_R8G8B8A8_UNORM, ANGLE_FORMAT_R8G8B8A8_UNORM,
Initialize4ComponentData<GLubyte, 0x00, 0x00, 0x00, 0xFF>); Initialize4ComponentData<GLubyte, 0x00, 0x00, 0x00, 0xFF>,
deviceCaps);
return textureFormat; return textureFormat;
} }
else else
...@@ -1171,11 +1196,12 @@ const TextureFormat &GetTextureFormatInfo(GLenum internalFormat, ...@@ -1171,11 +1196,12 @@ const TextureFormat &GetTextureFormatInfo(GLenum internalFormat,
} }
case GL_COMPRESSED_RGBA8_ETC2_EAC: case GL_COMPRESSED_RGBA8_ETC2_EAC:
{ {
if (OnlyFL10Plus(renderer11DeviceCaps)) if (OnlyFL10Plus(deviceCaps))
{ {
static const TextureFormat textureFormat(internalFormat, static const TextureFormat textureFormat(internalFormat,
ANGLE_FORMAT_R8G8B8A8_UNORM, ANGLE_FORMAT_R8G8B8A8_UNORM,
nullptr); nullptr,
deviceCaps);
return textureFormat; return textureFormat;
} }
else else
...@@ -1187,135 +1213,154 @@ const TextureFormat &GetTextureFormatInfo(GLenum internalFormat, ...@@ -1187,135 +1213,154 @@ const TextureFormat &GetTextureFormatInfo(GLenum internalFormat,
{ {
static const TextureFormat textureFormat(internalFormat, static const TextureFormat textureFormat(internalFormat,
ANGLE_FORMAT_NONE, ANGLE_FORMAT_NONE,
nullptr); nullptr,
deviceCaps);
return textureFormat; return textureFormat;
} }
case GL_COMPRESSED_RGBA_ASTC_10x5_KHR: case GL_COMPRESSED_RGBA_ASTC_10x5_KHR:
{ {
static const TextureFormat textureFormat(internalFormat, static const TextureFormat textureFormat(internalFormat,
ANGLE_FORMAT_NONE, ANGLE_FORMAT_NONE,
nullptr); nullptr,
deviceCaps);
return textureFormat; return textureFormat;
} }
case GL_COMPRESSED_RGBA_ASTC_10x6_KHR: case GL_COMPRESSED_RGBA_ASTC_10x6_KHR:
{ {
static const TextureFormat textureFormat(internalFormat, static const TextureFormat textureFormat(internalFormat,
ANGLE_FORMAT_NONE, ANGLE_FORMAT_NONE,
nullptr); nullptr,
deviceCaps);
return textureFormat; return textureFormat;
} }
case GL_COMPRESSED_RGBA_ASTC_10x8_KHR: case GL_COMPRESSED_RGBA_ASTC_10x8_KHR:
{ {
static const TextureFormat textureFormat(internalFormat, static const TextureFormat textureFormat(internalFormat,
ANGLE_FORMAT_NONE, ANGLE_FORMAT_NONE,
nullptr); nullptr,
deviceCaps);
return textureFormat; return textureFormat;
} }
case GL_COMPRESSED_RGBA_ASTC_12x10_KHR: case GL_COMPRESSED_RGBA_ASTC_12x10_KHR:
{ {
static const TextureFormat textureFormat(internalFormat, static const TextureFormat textureFormat(internalFormat,
ANGLE_FORMAT_NONE, ANGLE_FORMAT_NONE,
nullptr); nullptr,
deviceCaps);
return textureFormat; return textureFormat;
} }
case GL_COMPRESSED_RGBA_ASTC_12x12_KHR: case GL_COMPRESSED_RGBA_ASTC_12x12_KHR:
{ {
static const TextureFormat textureFormat(internalFormat, static const TextureFormat textureFormat(internalFormat,
ANGLE_FORMAT_NONE, ANGLE_FORMAT_NONE,
nullptr); nullptr,
deviceCaps);
return textureFormat; return textureFormat;
} }
case GL_COMPRESSED_RGBA_ASTC_4x4_KHR: case GL_COMPRESSED_RGBA_ASTC_4x4_KHR:
{ {
static const TextureFormat textureFormat(internalFormat, static const TextureFormat textureFormat(internalFormat,
ANGLE_FORMAT_NONE, ANGLE_FORMAT_NONE,
nullptr); nullptr,
deviceCaps);
return textureFormat; return textureFormat;
} }
case GL_COMPRESSED_RGBA_ASTC_5x4_KHR: case GL_COMPRESSED_RGBA_ASTC_5x4_KHR:
{ {
static const TextureFormat textureFormat(internalFormat, static const TextureFormat textureFormat(internalFormat,
ANGLE_FORMAT_NONE, ANGLE_FORMAT_NONE,
nullptr); nullptr,
deviceCaps);
return textureFormat; return textureFormat;
} }
case GL_COMPRESSED_RGBA_ASTC_5x5_KHR: case GL_COMPRESSED_RGBA_ASTC_5x5_KHR:
{ {
static const TextureFormat textureFormat(internalFormat, static const TextureFormat textureFormat(internalFormat,
ANGLE_FORMAT_NONE, ANGLE_FORMAT_NONE,
nullptr); nullptr,
deviceCaps);
return textureFormat; return textureFormat;
} }
case GL_COMPRESSED_RGBA_ASTC_6x5_KHR: case GL_COMPRESSED_RGBA_ASTC_6x5_KHR:
{ {
static const TextureFormat textureFormat(internalFormat, static const TextureFormat textureFormat(internalFormat,
ANGLE_FORMAT_NONE, ANGLE_FORMAT_NONE,
nullptr); nullptr,
deviceCaps);
return textureFormat; return textureFormat;
} }
case GL_COMPRESSED_RGBA_ASTC_6x6_KHR: case GL_COMPRESSED_RGBA_ASTC_6x6_KHR:
{ {
static const TextureFormat textureFormat(internalFormat, static const TextureFormat textureFormat(internalFormat,
ANGLE_FORMAT_NONE, ANGLE_FORMAT_NONE,
nullptr); nullptr,
deviceCaps);
return textureFormat; return textureFormat;
} }
case GL_COMPRESSED_RGBA_ASTC_8x5_KHR: case GL_COMPRESSED_RGBA_ASTC_8x5_KHR:
{ {
static const TextureFormat textureFormat(internalFormat, static const TextureFormat textureFormat(internalFormat,
ANGLE_FORMAT_NONE, ANGLE_FORMAT_NONE,
nullptr); nullptr,
deviceCaps);
return textureFormat; return textureFormat;
} }
case GL_COMPRESSED_RGBA_ASTC_8x6_KHR: case GL_COMPRESSED_RGBA_ASTC_8x6_KHR:
{ {
static const TextureFormat textureFormat(internalFormat, static const TextureFormat textureFormat(internalFormat,
ANGLE_FORMAT_NONE, ANGLE_FORMAT_NONE,
nullptr); nullptr,
deviceCaps);
return textureFormat; return textureFormat;
} }
case GL_COMPRESSED_RGBA_ASTC_8x8_KHR: case GL_COMPRESSED_RGBA_ASTC_8x8_KHR:
{ {
static const TextureFormat textureFormat(internalFormat, static const TextureFormat textureFormat(internalFormat,
ANGLE_FORMAT_NONE, ANGLE_FORMAT_NONE,
nullptr); nullptr,
deviceCaps);
return textureFormat; return textureFormat;
} }
case GL_COMPRESSED_RGBA_S3TC_DXT1_EXT: case GL_COMPRESSED_RGBA_S3TC_DXT1_EXT:
{ {
static const TextureFormat textureFormat(internalFormat, static const TextureFormat textureFormat(internalFormat,
ANGLE_FORMAT_BC1_UNORM, ANGLE_FORMAT_BC1_UNORM,
nullptr); nullptr,
deviceCaps);
return textureFormat; return textureFormat;
} }
case GL_COMPRESSED_RGBA_S3TC_DXT3_ANGLE: case GL_COMPRESSED_RGBA_S3TC_DXT3_ANGLE:
{ {
static const TextureFormat textureFormat(internalFormat, static const TextureFormat textureFormat(internalFormat,
ANGLE_FORMAT_BC2_UNORM, ANGLE_FORMAT_BC2_UNORM,
nullptr); nullptr,
deviceCaps);
return textureFormat; return textureFormat;
} }
case GL_COMPRESSED_RGBA_S3TC_DXT5_ANGLE: case GL_COMPRESSED_RGBA_S3TC_DXT5_ANGLE:
{ {
static const TextureFormat textureFormat(internalFormat, static const TextureFormat textureFormat(internalFormat,
ANGLE_FORMAT_BC3_UNORM, ANGLE_FORMAT_BC3_UNORM,
nullptr); nullptr,
deviceCaps);
return textureFormat; return textureFormat;
} }
case GL_COMPRESSED_RGB_S3TC_DXT1_EXT: case GL_COMPRESSED_RGB_S3TC_DXT1_EXT:
{ {
static const TextureFormat textureFormat(internalFormat, static const TextureFormat textureFormat(internalFormat,
ANGLE_FORMAT_BC1_UNORM, ANGLE_FORMAT_BC1_UNORM,
nullptr); nullptr,
deviceCaps);
return textureFormat; return textureFormat;
} }
case GL_COMPRESSED_SIGNED_R11_EAC: case GL_COMPRESSED_SIGNED_R11_EAC:
{ {
if (OnlyFL10Plus(renderer11DeviceCaps)) if (OnlyFL10Plus(deviceCaps))
{ {
static const TextureFormat textureFormat(internalFormat, static const TextureFormat textureFormat(internalFormat,
ANGLE_FORMAT_R8_SNORM, ANGLE_FORMAT_R8_SNORM,
nullptr); nullptr,
deviceCaps);
return textureFormat; return textureFormat;
} }
else else
...@@ -1325,11 +1370,12 @@ const TextureFormat &GetTextureFormatInfo(GLenum internalFormat, ...@@ -1325,11 +1370,12 @@ const TextureFormat &GetTextureFormatInfo(GLenum internalFormat,
} }
case GL_COMPRESSED_SIGNED_RG11_EAC: case GL_COMPRESSED_SIGNED_RG11_EAC:
{ {
if (OnlyFL10Plus(renderer11DeviceCaps)) if (OnlyFL10Plus(deviceCaps))
{ {
static const TextureFormat textureFormat(internalFormat, static const TextureFormat textureFormat(internalFormat,
ANGLE_FORMAT_R8G8_SNORM, ANGLE_FORMAT_R8G8_SNORM,
nullptr); nullptr,
deviceCaps);
return textureFormat; return textureFormat;
} }
else else
...@@ -1341,107 +1387,122 @@ const TextureFormat &GetTextureFormatInfo(GLenum internalFormat, ...@@ -1341,107 +1387,122 @@ const TextureFormat &GetTextureFormatInfo(GLenum internalFormat,
{ {
static const TextureFormat textureFormat(internalFormat, static const TextureFormat textureFormat(internalFormat,
ANGLE_FORMAT_NONE, ANGLE_FORMAT_NONE,
nullptr); nullptr,
deviceCaps);
return textureFormat; return textureFormat;
} }
case GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR: case GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:
{ {
static const TextureFormat textureFormat(internalFormat, static const TextureFormat textureFormat(internalFormat,
ANGLE_FORMAT_NONE, ANGLE_FORMAT_NONE,
nullptr); nullptr,
deviceCaps);
return textureFormat; return textureFormat;
} }
case GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR: case GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:
{ {
static const TextureFormat textureFormat(internalFormat, static const TextureFormat textureFormat(internalFormat,
ANGLE_FORMAT_NONE, ANGLE_FORMAT_NONE,
nullptr); nullptr,
deviceCaps);
return textureFormat; return textureFormat;
} }
case GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR: case GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:
{ {
static const TextureFormat textureFormat(internalFormat, static const TextureFormat textureFormat(internalFormat,
ANGLE_FORMAT_NONE, ANGLE_FORMAT_NONE,
nullptr); nullptr,
deviceCaps);
return textureFormat; return textureFormat;
} }
case GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR: case GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:
{ {
static const TextureFormat textureFormat(internalFormat, static const TextureFormat textureFormat(internalFormat,
ANGLE_FORMAT_NONE, ANGLE_FORMAT_NONE,
nullptr); nullptr,
deviceCaps);
return textureFormat; return textureFormat;
} }
case GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR: case GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:
{ {
static const TextureFormat textureFormat(internalFormat, static const TextureFormat textureFormat(internalFormat,
ANGLE_FORMAT_NONE, ANGLE_FORMAT_NONE,
nullptr); nullptr,
deviceCaps);
return textureFormat; return textureFormat;
} }
case GL_COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR: case GL_COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:
{ {
static const TextureFormat textureFormat(internalFormat, static const TextureFormat textureFormat(internalFormat,
ANGLE_FORMAT_NONE, ANGLE_FORMAT_NONE,
nullptr); nullptr,
deviceCaps);
return textureFormat; return textureFormat;
} }
case GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR: case GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:
{ {
static const TextureFormat textureFormat(internalFormat, static const TextureFormat textureFormat(internalFormat,
ANGLE_FORMAT_NONE, ANGLE_FORMAT_NONE,
nullptr); nullptr,
deviceCaps);
return textureFormat; return textureFormat;
} }
case GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR: case GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:
{ {
static const TextureFormat textureFormat(internalFormat, static const TextureFormat textureFormat(internalFormat,
ANGLE_FORMAT_NONE, ANGLE_FORMAT_NONE,
nullptr); nullptr,
deviceCaps);
return textureFormat; return textureFormat;
} }
case GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR: case GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:
{ {
static const TextureFormat textureFormat(internalFormat, static const TextureFormat textureFormat(internalFormat,
ANGLE_FORMAT_NONE, ANGLE_FORMAT_NONE,
nullptr); nullptr,
deviceCaps);
return textureFormat; return textureFormat;
} }
case GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR: case GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:
{ {
static const TextureFormat textureFormat(internalFormat, static const TextureFormat textureFormat(internalFormat,
ANGLE_FORMAT_NONE, ANGLE_FORMAT_NONE,
nullptr); nullptr,
deviceCaps);
return textureFormat; return textureFormat;
} }
case GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR: case GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:
{ {
static const TextureFormat textureFormat(internalFormat, static const TextureFormat textureFormat(internalFormat,
ANGLE_FORMAT_NONE, ANGLE_FORMAT_NONE,
nullptr); nullptr,
deviceCaps);
return textureFormat; return textureFormat;
} }
case GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR: case GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:
{ {
static const TextureFormat textureFormat(internalFormat, static const TextureFormat textureFormat(internalFormat,
ANGLE_FORMAT_NONE, ANGLE_FORMAT_NONE,
nullptr); nullptr,
deviceCaps);
return textureFormat; return textureFormat;
} }
case GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR: case GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:
{ {
static const TextureFormat textureFormat(internalFormat, static const TextureFormat textureFormat(internalFormat,
ANGLE_FORMAT_NONE, ANGLE_FORMAT_NONE,
nullptr); nullptr,
deviceCaps);
return textureFormat; return textureFormat;
} }
case GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC: case GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:
{ {
if (OnlyFL10Plus(renderer11DeviceCaps)) if (OnlyFL10Plus(deviceCaps))
{ {
static const TextureFormat textureFormat(internalFormat, static const TextureFormat textureFormat(internalFormat,
ANGLE_FORMAT_R8G8B8A8_UNORM_SRGB, ANGLE_FORMAT_R8G8B8A8_UNORM_SRGB,
nullptr); nullptr,
deviceCaps);
return textureFormat; return textureFormat;
} }
else else
...@@ -1451,11 +1512,12 @@ const TextureFormat &GetTextureFormatInfo(GLenum internalFormat, ...@@ -1451,11 +1512,12 @@ const TextureFormat &GetTextureFormatInfo(GLenum internalFormat,
} }
case GL_COMPRESSED_SRGB8_ETC2: case GL_COMPRESSED_SRGB8_ETC2:
{ {
if (OnlyFL10Plus(renderer11DeviceCaps)) if (OnlyFL10Plus(deviceCaps))
{ {
static const TextureFormat textureFormat(internalFormat, static const TextureFormat textureFormat(internalFormat,
ANGLE_FORMAT_R8G8B8A8_UNORM_SRGB, ANGLE_FORMAT_R8G8B8A8_UNORM_SRGB,
Initialize4ComponentData<GLubyte, 0x00, 0x00, 0x00, 0xFF>); Initialize4ComponentData<GLubyte, 0x00, 0x00, 0x00, 0xFF>,
deviceCaps);
return textureFormat; return textureFormat;
} }
else else
...@@ -1465,11 +1527,12 @@ const TextureFormat &GetTextureFormatInfo(GLenum internalFormat, ...@@ -1465,11 +1527,12 @@ const TextureFormat &GetTextureFormatInfo(GLenum internalFormat,
} }
case GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2: case GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:
{ {
if (OnlyFL10Plus(renderer11DeviceCaps)) if (OnlyFL10Plus(deviceCaps))
{ {
static const TextureFormat textureFormat(internalFormat, static const TextureFormat textureFormat(internalFormat,
ANGLE_FORMAT_R8G8B8A8_UNORM_SRGB, ANGLE_FORMAT_R8G8B8A8_UNORM_SRGB,
nullptr); nullptr,
deviceCaps);
return textureFormat; return textureFormat;
} }
else else
...@@ -1479,18 +1542,20 @@ const TextureFormat &GetTextureFormatInfo(GLenum internalFormat, ...@@ -1479,18 +1542,20 @@ const TextureFormat &GetTextureFormatInfo(GLenum internalFormat,
} }
case GL_DEPTH24_STENCIL8: case GL_DEPTH24_STENCIL8:
{ {
if (OnlyFL10Plus(renderer11DeviceCaps)) if (OnlyFL10Plus(deviceCaps))
{ {
static const TextureFormat textureFormat(internalFormat, static const TextureFormat textureFormat(internalFormat,
ANGLE_FORMAT_D24_UNORM_S8_UINT_FL10, ANGLE_FORMAT_D24_UNORM_S8_UINT,
nullptr); nullptr,
deviceCaps);
return textureFormat; return textureFormat;
} }
else if (OnlyFL9_3(renderer11DeviceCaps)) else if (OnlyFL9_3(deviceCaps))
{ {
static const TextureFormat textureFormat(internalFormat, static const TextureFormat textureFormat(internalFormat,
ANGLE_FORMAT_D24_UNORM_S8_UINT_FL9_3, ANGLE_FORMAT_D24_UNORM_S8_UINT,
nullptr); nullptr,
deviceCaps);
return textureFormat; return textureFormat;
} }
else else
...@@ -1500,18 +1565,12 @@ const TextureFormat &GetTextureFormatInfo(GLenum internalFormat, ...@@ -1500,18 +1565,12 @@ const TextureFormat &GetTextureFormatInfo(GLenum internalFormat,
} }
case GL_DEPTH32F_STENCIL8: case GL_DEPTH32F_STENCIL8:
{ {
if (OnlyFL10Plus(renderer11DeviceCaps)) if (OnlyFL10Plus(deviceCaps))
{
static const TextureFormat textureFormat(internalFormat,
ANGLE_FORMAT_D32_FLOAT_S8X24_UINT_FL10,
nullptr);
return textureFormat;
}
else if (OnlyFL9_3(renderer11DeviceCaps))
{ {
static const TextureFormat textureFormat(internalFormat, static const TextureFormat textureFormat(internalFormat,
ANGLE_FORMAT_NONE, ANGLE_FORMAT_D32_FLOAT_S8X24_UINT,
nullptr); nullptr,
deviceCaps);
return textureFormat; return textureFormat;
} }
else else
...@@ -1521,18 +1580,20 @@ const TextureFormat &GetTextureFormatInfo(GLenum internalFormat, ...@@ -1521,18 +1580,20 @@ const TextureFormat &GetTextureFormatInfo(GLenum internalFormat,
} }
case GL_DEPTH_COMPONENT16: case GL_DEPTH_COMPONENT16:
{ {
if (OnlyFL10Plus(renderer11DeviceCaps)) if (OnlyFL10Plus(deviceCaps))
{ {
static const TextureFormat textureFormat(internalFormat, static const TextureFormat textureFormat(internalFormat,
ANGLE_FORMAT_D16_UNORM_FL10, ANGLE_FORMAT_D16_UNORM,
nullptr); nullptr,
deviceCaps);
return textureFormat; return textureFormat;
} }
else if (OnlyFL9_3(renderer11DeviceCaps)) else if (OnlyFL9_3(deviceCaps))
{ {
static const TextureFormat textureFormat(internalFormat, static const TextureFormat textureFormat(internalFormat,
ANGLE_FORMAT_D16_UNORM_FL9_3, ANGLE_FORMAT_D16_UNORM,
nullptr); nullptr,
deviceCaps);
return textureFormat; return textureFormat;
} }
else else
...@@ -1542,18 +1603,20 @@ const TextureFormat &GetTextureFormatInfo(GLenum internalFormat, ...@@ -1542,18 +1603,20 @@ const TextureFormat &GetTextureFormatInfo(GLenum internalFormat,
} }
case GL_DEPTH_COMPONENT24: case GL_DEPTH_COMPONENT24:
{ {
if (OnlyFL10Plus(renderer11DeviceCaps)) if (OnlyFL10Plus(deviceCaps))
{ {
static const TextureFormat textureFormat(internalFormat, static const TextureFormat textureFormat(internalFormat,
ANGLE_FORMAT_D24_UNORM_S8_UINT_FL10, ANGLE_FORMAT_D24_UNORM_S8_UINT,
nullptr); nullptr,
deviceCaps);
return textureFormat; return textureFormat;
} }
else if (OnlyFL9_3(renderer11DeviceCaps)) else if (OnlyFL9_3(deviceCaps))
{ {
static const TextureFormat textureFormat(internalFormat, static const TextureFormat textureFormat(internalFormat,
ANGLE_FORMAT_D24_UNORM_S8_UINT_FL9_3, ANGLE_FORMAT_D24_UNORM_S8_UINT,
nullptr); nullptr,
deviceCaps);
return textureFormat; return textureFormat;
} }
else else
...@@ -1563,18 +1626,12 @@ const TextureFormat &GetTextureFormatInfo(GLenum internalFormat, ...@@ -1563,18 +1626,12 @@ const TextureFormat &GetTextureFormatInfo(GLenum internalFormat,
} }
case GL_DEPTH_COMPONENT32F: case GL_DEPTH_COMPONENT32F:
{ {
if (OnlyFL10Plus(renderer11DeviceCaps)) if (OnlyFL10Plus(deviceCaps))
{ {
static const TextureFormat textureFormat(internalFormat, static const TextureFormat textureFormat(internalFormat,
ANGLE_FORMAT_D32_FLOAT, ANGLE_FORMAT_D32_FLOAT,
nullptr); nullptr,
return textureFormat; deviceCaps);
}
else if (OnlyFL9_3(renderer11DeviceCaps))
{
static const TextureFormat textureFormat(internalFormat,
ANGLE_FORMAT_NONE,
nullptr);
return textureFormat; return textureFormat;
} }
else else
...@@ -1584,11 +1641,12 @@ const TextureFormat &GetTextureFormatInfo(GLenum internalFormat, ...@@ -1584,11 +1641,12 @@ const TextureFormat &GetTextureFormatInfo(GLenum internalFormat,
} }
case GL_DEPTH_COMPONENT32_OES: case GL_DEPTH_COMPONENT32_OES:
{ {
if (OnlyFL10Plus(renderer11DeviceCaps)) if (OnlyFL10Plus(deviceCaps))
{ {
static const TextureFormat textureFormat(internalFormat, static const TextureFormat textureFormat(internalFormat,
ANGLE_FORMAT_D24_UNORM_S8_UINT_FL10, ANGLE_FORMAT_D24_UNORM_S8_UINT,
nullptr); nullptr,
deviceCaps);
return textureFormat; return textureFormat;
} }
else else
...@@ -1600,345 +1658,394 @@ const TextureFormat &GetTextureFormatInfo(GLenum internalFormat, ...@@ -1600,345 +1658,394 @@ const TextureFormat &GetTextureFormatInfo(GLenum internalFormat,
{ {
static const TextureFormat textureFormat(internalFormat, static const TextureFormat textureFormat(internalFormat,
ANGLE_FORMAT_BC1_UNORM, ANGLE_FORMAT_BC1_UNORM,
nullptr); nullptr,
deviceCaps);
return textureFormat; return textureFormat;
} }
case GL_ETC1_RGB8_OES: case GL_ETC1_RGB8_OES:
{ {
static const TextureFormat textureFormat(internalFormat, static const TextureFormat textureFormat(internalFormat,
ANGLE_FORMAT_R8G8B8A8_UNORM, ANGLE_FORMAT_R8G8B8A8_UNORM,
Initialize4ComponentData<GLubyte, 0x00, 0x00, 0x00, 0xFF>); Initialize4ComponentData<GLubyte, 0x00, 0x00, 0x00, 0xFF>,
deviceCaps);
return textureFormat; return textureFormat;
} }
case GL_LUMINANCE: case GL_LUMINANCE:
{ {
static const TextureFormat textureFormat(internalFormat, static const TextureFormat textureFormat(internalFormat,
ANGLE_FORMAT_R8G8B8A8_UNORM, ANGLE_FORMAT_R8G8B8A8_UNORM,
Initialize4ComponentData<GLubyte, 0x00, 0x00, 0x00, 0xFF>); Initialize4ComponentData<GLubyte, 0x00, 0x00, 0x00, 0xFF>,
deviceCaps);
return textureFormat; return textureFormat;
} }
case GL_LUMINANCE16F_EXT: case GL_LUMINANCE16F_EXT:
{ {
static const TextureFormat textureFormat(internalFormat, static const TextureFormat textureFormat(internalFormat,
ANGLE_FORMAT_R16G16B16A16_FLOAT, ANGLE_FORMAT_R16G16B16A16_FLOAT,
Initialize4ComponentData<GLhalf, 0x0000, 0x0000, 0x0000, gl::Float16One>); Initialize4ComponentData<GLhalf, 0x0000, 0x0000, 0x0000, gl::Float16One>,
deviceCaps);
return textureFormat; return textureFormat;
} }
case GL_LUMINANCE32F_EXT: case GL_LUMINANCE32F_EXT:
{ {
static const TextureFormat textureFormat(internalFormat, static const TextureFormat textureFormat(internalFormat,
ANGLE_FORMAT_R32G32B32A32_FLOAT, ANGLE_FORMAT_R32G32B32A32_FLOAT,
Initialize4ComponentData<GLfloat, 0x00000000, 0x00000000, 0x00000000, gl::Float32One>); Initialize4ComponentData<GLfloat, 0x00000000, 0x00000000, 0x00000000, gl::Float32One>,
deviceCaps);
return textureFormat; return textureFormat;
} }
case GL_LUMINANCE8_ALPHA8_EXT: case GL_LUMINANCE8_ALPHA8_EXT:
{ {
static const TextureFormat textureFormat(internalFormat, static const TextureFormat textureFormat(internalFormat,
ANGLE_FORMAT_R8G8B8A8_UNORM, ANGLE_FORMAT_R8G8B8A8_UNORM,
nullptr); nullptr,
deviceCaps);
return textureFormat; return textureFormat;
} }
case GL_LUMINANCE8_EXT: case GL_LUMINANCE8_EXT:
{ {
static const TextureFormat textureFormat(internalFormat, static const TextureFormat textureFormat(internalFormat,
ANGLE_FORMAT_R8G8B8A8_UNORM, ANGLE_FORMAT_R8G8B8A8_UNORM,
Initialize4ComponentData<GLubyte, 0x00, 0x00, 0x00, 0xFF>); Initialize4ComponentData<GLubyte, 0x00, 0x00, 0x00, 0xFF>,
deviceCaps);
return textureFormat; return textureFormat;
} }
case GL_LUMINANCE_ALPHA: case GL_LUMINANCE_ALPHA:
{ {
static const TextureFormat textureFormat(internalFormat, static const TextureFormat textureFormat(internalFormat,
ANGLE_FORMAT_R8G8B8A8_UNORM, ANGLE_FORMAT_R8G8B8A8_UNORM,
nullptr); nullptr,
deviceCaps);
return textureFormat; return textureFormat;
} }
case GL_LUMINANCE_ALPHA16F_EXT: case GL_LUMINANCE_ALPHA16F_EXT:
{ {
static const TextureFormat textureFormat(internalFormat, static const TextureFormat textureFormat(internalFormat,
ANGLE_FORMAT_R16G16B16A16_FLOAT, ANGLE_FORMAT_R16G16B16A16_FLOAT,
nullptr); nullptr,
deviceCaps);
return textureFormat; return textureFormat;
} }
case GL_LUMINANCE_ALPHA32F_EXT: case GL_LUMINANCE_ALPHA32F_EXT:
{ {
static const TextureFormat textureFormat(internalFormat, static const TextureFormat textureFormat(internalFormat,
ANGLE_FORMAT_R32G32B32A32_FLOAT, ANGLE_FORMAT_R32G32B32A32_FLOAT,
nullptr); nullptr,
deviceCaps);
return textureFormat; return textureFormat;
} }
case GL_NONE: case GL_NONE:
{ {
static const TextureFormat textureFormat(internalFormat, static const TextureFormat textureFormat(internalFormat,
ANGLE_FORMAT_NONE, ANGLE_FORMAT_NONE,
nullptr); nullptr,
deviceCaps);
return textureFormat; return textureFormat;
} }
case GL_R11F_G11F_B10F: case GL_R11F_G11F_B10F:
{ {
static const TextureFormat textureFormat(internalFormat, static const TextureFormat textureFormat(internalFormat,
ANGLE_FORMAT_R11G11B10_FLOAT, ANGLE_FORMAT_R11G11B10_FLOAT,
nullptr); nullptr,
deviceCaps);
return textureFormat; return textureFormat;
} }
case GL_R16F: case GL_R16F:
{ {
static const TextureFormat textureFormat(internalFormat, static const TextureFormat textureFormat(internalFormat,
ANGLE_FORMAT_R16_FLOAT, ANGLE_FORMAT_R16_FLOAT,
nullptr); nullptr,
deviceCaps);
return textureFormat; return textureFormat;
} }
case GL_R16I: case GL_R16I:
{ {
static const TextureFormat textureFormat(internalFormat, static const TextureFormat textureFormat(internalFormat,
ANGLE_FORMAT_R16_SINT, ANGLE_FORMAT_R16_SINT,
nullptr); nullptr,
deviceCaps);
return textureFormat; return textureFormat;
} }
case GL_R16UI: case GL_R16UI:
{ {
static const TextureFormat textureFormat(internalFormat, static const TextureFormat textureFormat(internalFormat,
ANGLE_FORMAT_R16_UINT, ANGLE_FORMAT_R16_UINT,
nullptr); nullptr,
deviceCaps);
return textureFormat; return textureFormat;
} }
case GL_R16_EXT: case GL_R16_EXT:
{ {
static const TextureFormat textureFormat(internalFormat, static const TextureFormat textureFormat(internalFormat,
ANGLE_FORMAT_R16_UNORM, ANGLE_FORMAT_R16_UNORM,
nullptr); nullptr,
deviceCaps);
return textureFormat; return textureFormat;
} }
case GL_R16_SNORM_EXT: case GL_R16_SNORM_EXT:
{ {
static const TextureFormat textureFormat(internalFormat, static const TextureFormat textureFormat(internalFormat,
ANGLE_FORMAT_R16_SNORM, ANGLE_FORMAT_R16_SNORM,
nullptr); nullptr,
deviceCaps);
return textureFormat; return textureFormat;
} }
case GL_R32F: case GL_R32F:
{ {
static const TextureFormat textureFormat(internalFormat, static const TextureFormat textureFormat(internalFormat,
ANGLE_FORMAT_R32_FLOAT, ANGLE_FORMAT_R32_FLOAT,
nullptr); nullptr,
deviceCaps);
return textureFormat; return textureFormat;
} }
case GL_R32I: case GL_R32I:
{ {
static const TextureFormat textureFormat(internalFormat, static const TextureFormat textureFormat(internalFormat,
ANGLE_FORMAT_R32_SINT, ANGLE_FORMAT_R32_SINT,
nullptr); nullptr,
deviceCaps);
return textureFormat; return textureFormat;
} }
case GL_R32UI: case GL_R32UI:
{ {
static const TextureFormat textureFormat(internalFormat, static const TextureFormat textureFormat(internalFormat,
ANGLE_FORMAT_R32_UINT, ANGLE_FORMAT_R32_UINT,
nullptr); nullptr,
deviceCaps);
return textureFormat; return textureFormat;
} }
case GL_R8: case GL_R8:
{ {
static const TextureFormat textureFormat(internalFormat, static const TextureFormat textureFormat(internalFormat,
ANGLE_FORMAT_R8_UNORM, ANGLE_FORMAT_R8_UNORM,
nullptr); nullptr,
deviceCaps);
return textureFormat; return textureFormat;
} }
case GL_R8I: case GL_R8I:
{ {
static const TextureFormat textureFormat(internalFormat, static const TextureFormat textureFormat(internalFormat,
ANGLE_FORMAT_R8_SINT, ANGLE_FORMAT_R8_SINT,
nullptr); nullptr,
deviceCaps);
return textureFormat; return textureFormat;
} }
case GL_R8UI: case GL_R8UI:
{ {
static const TextureFormat textureFormat(internalFormat, static const TextureFormat textureFormat(internalFormat,
ANGLE_FORMAT_R8_UINT, ANGLE_FORMAT_R8_UINT,
nullptr); nullptr,
deviceCaps);
return textureFormat; return textureFormat;
} }
case GL_R8_SNORM: case GL_R8_SNORM:
{ {
static const TextureFormat textureFormat(internalFormat, static const TextureFormat textureFormat(internalFormat,
ANGLE_FORMAT_R8_SNORM, ANGLE_FORMAT_R8_SNORM,
nullptr); nullptr,
deviceCaps);
return textureFormat; return textureFormat;
} }
case GL_RG16F: case GL_RG16F:
{ {
static const TextureFormat textureFormat(internalFormat, static const TextureFormat textureFormat(internalFormat,
ANGLE_FORMAT_R16G16_FLOAT, ANGLE_FORMAT_R16G16_FLOAT,
nullptr); nullptr,
deviceCaps);
return textureFormat; return textureFormat;
} }
case GL_RG16I: case GL_RG16I:
{ {
static const TextureFormat textureFormat(internalFormat, static const TextureFormat textureFormat(internalFormat,
ANGLE_FORMAT_R16G16_SINT, ANGLE_FORMAT_R16G16_SINT,
nullptr); nullptr,
deviceCaps);
return textureFormat; return textureFormat;
} }
case GL_RG16UI: case GL_RG16UI:
{ {
static const TextureFormat textureFormat(internalFormat, static const TextureFormat textureFormat(internalFormat,
ANGLE_FORMAT_R16G16_UINT, ANGLE_FORMAT_R16G16_UINT,
nullptr); nullptr,
deviceCaps);
return textureFormat; return textureFormat;
} }
case GL_RG16_EXT: case GL_RG16_EXT:
{ {
static const TextureFormat textureFormat(internalFormat, static const TextureFormat textureFormat(internalFormat,
ANGLE_FORMAT_R16G16_UNORM, ANGLE_FORMAT_R16G16_UNORM,
nullptr); nullptr,
deviceCaps);
return textureFormat; return textureFormat;
} }
case GL_RG16_SNORM_EXT: case GL_RG16_SNORM_EXT:
{ {
static const TextureFormat textureFormat(internalFormat, static const TextureFormat textureFormat(internalFormat,
ANGLE_FORMAT_R16G16_SNORM, ANGLE_FORMAT_R16G16_SNORM,
nullptr); nullptr,
deviceCaps);
return textureFormat; return textureFormat;
} }
case GL_RG32F: case GL_RG32F:
{ {
static const TextureFormat textureFormat(internalFormat, static const TextureFormat textureFormat(internalFormat,
ANGLE_FORMAT_R32G32_FLOAT, ANGLE_FORMAT_R32G32_FLOAT,
nullptr); nullptr,
deviceCaps);
return textureFormat; return textureFormat;
} }
case GL_RG32I: case GL_RG32I:
{ {
static const TextureFormat textureFormat(internalFormat, static const TextureFormat textureFormat(internalFormat,
ANGLE_FORMAT_R32G32_SINT, ANGLE_FORMAT_R32G32_SINT,
nullptr); nullptr,
deviceCaps);
return textureFormat; return textureFormat;
} }
case GL_RG32UI: case GL_RG32UI:
{ {
static const TextureFormat textureFormat(internalFormat, static const TextureFormat textureFormat(internalFormat,
ANGLE_FORMAT_R32G32_UINT, ANGLE_FORMAT_R32G32_UINT,
nullptr); nullptr,
deviceCaps);
return textureFormat; return textureFormat;
} }
case GL_RG8: case GL_RG8:
{ {
static const TextureFormat textureFormat(internalFormat, static const TextureFormat textureFormat(internalFormat,
ANGLE_FORMAT_R8G8_UNORM, ANGLE_FORMAT_R8G8_UNORM,
nullptr); nullptr,
deviceCaps);
return textureFormat; return textureFormat;
} }
case GL_RG8I: case GL_RG8I:
{ {
static const TextureFormat textureFormat(internalFormat, static const TextureFormat textureFormat(internalFormat,
ANGLE_FORMAT_R8G8_SINT, ANGLE_FORMAT_R8G8_SINT,
nullptr); nullptr,
deviceCaps);
return textureFormat; return textureFormat;
} }
case GL_RG8UI: case GL_RG8UI:
{ {
static const TextureFormat textureFormat(internalFormat, static const TextureFormat textureFormat(internalFormat,
ANGLE_FORMAT_R8G8_UINT, ANGLE_FORMAT_R8G8_UINT,
nullptr); nullptr,
deviceCaps);
return textureFormat; return textureFormat;
} }
case GL_RG8_SNORM: case GL_RG8_SNORM:
{ {
static const TextureFormat textureFormat(internalFormat, static const TextureFormat textureFormat(internalFormat,
ANGLE_FORMAT_R8G8_SNORM, ANGLE_FORMAT_R8G8_SNORM,
nullptr); nullptr,
deviceCaps);
return textureFormat; return textureFormat;
} }
case GL_RGB: case GL_RGB:
{ {
static const TextureFormat textureFormat(internalFormat, static const TextureFormat textureFormat(internalFormat,
ANGLE_FORMAT_R8G8B8A8_UNORM, ANGLE_FORMAT_R8G8B8A8_UNORM,
Initialize4ComponentData<GLubyte, 0x00, 0x00, 0x00, 0xFF>); Initialize4ComponentData<GLubyte, 0x00, 0x00, 0x00, 0xFF>,
deviceCaps);
return textureFormat; return textureFormat;
} }
case GL_RGB10_A2: case GL_RGB10_A2:
{ {
static const TextureFormat textureFormat(internalFormat, static const TextureFormat textureFormat(internalFormat,
ANGLE_FORMAT_R10G10B10A2_UNORM, ANGLE_FORMAT_R10G10B10A2_UNORM,
nullptr); nullptr,
deviceCaps);
return textureFormat; return textureFormat;
} }
case GL_RGB10_A2UI: case GL_RGB10_A2UI:
{ {
static const TextureFormat textureFormat(internalFormat, static const TextureFormat textureFormat(internalFormat,
ANGLE_FORMAT_R10G10B10A2_UINT, ANGLE_FORMAT_R10G10B10A2_UINT,
nullptr); nullptr,
deviceCaps);
return textureFormat; return textureFormat;
} }
case GL_RGB16F: case GL_RGB16F:
{ {
static const TextureFormat textureFormat(internalFormat, static const TextureFormat textureFormat(internalFormat,
ANGLE_FORMAT_R16G16B16A16_FLOAT, ANGLE_FORMAT_R16G16B16A16_FLOAT,
Initialize4ComponentData<GLhalf, 0x0000, 0x0000, 0x0000, gl::Float16One>); Initialize4ComponentData<GLhalf, 0x0000, 0x0000, 0x0000, gl::Float16One>,
deviceCaps);
return textureFormat; return textureFormat;
} }
case GL_RGB16I: case GL_RGB16I:
{ {
static const TextureFormat textureFormat(internalFormat, static const TextureFormat textureFormat(internalFormat,
ANGLE_FORMAT_R16G16B16A16_SINT, ANGLE_FORMAT_R16G16B16A16_SINT,
Initialize4ComponentData<GLshort, 0x0000, 0x0000, 0x0000, 0x0001>); Initialize4ComponentData<GLshort, 0x0000, 0x0000, 0x0000, 0x0001>,
deviceCaps);
return textureFormat; return textureFormat;
} }
case GL_RGB16UI: case GL_RGB16UI:
{ {
static const TextureFormat textureFormat(internalFormat, static const TextureFormat textureFormat(internalFormat,
ANGLE_FORMAT_R16G16B16A16_UINT, ANGLE_FORMAT_R16G16B16A16_UINT,
Initialize4ComponentData<GLushort, 0x0000, 0x0000, 0x0000, 0x0001>); Initialize4ComponentData<GLushort, 0x0000, 0x0000, 0x0000, 0x0001>,
deviceCaps);
return textureFormat; return textureFormat;
} }
case GL_RGB16_EXT: case GL_RGB16_EXT:
{ {
static const TextureFormat textureFormat(internalFormat, static const TextureFormat textureFormat(internalFormat,
ANGLE_FORMAT_R16G16B16A16_UNORM, ANGLE_FORMAT_R16G16B16A16_UNORM,
Initialize4ComponentData<GLubyte, 0x0000, 0x0000, 0x0000, 0xFFFF>); Initialize4ComponentData<GLubyte, 0x0000, 0x0000, 0x0000, 0xFFFF>,
deviceCaps);
return textureFormat; return textureFormat;
} }
case GL_RGB16_SNORM_EXT: case GL_RGB16_SNORM_EXT:
{ {
static const TextureFormat textureFormat(internalFormat, static const TextureFormat textureFormat(internalFormat,
ANGLE_FORMAT_R16G16B16A16_SNORM, ANGLE_FORMAT_R16G16B16A16_SNORM,
Initialize4ComponentData<GLushort, 0x0000, 0x0000, 0x0000, 0x7FFF>); Initialize4ComponentData<GLushort, 0x0000, 0x0000, 0x0000, 0x7FFF>,
deviceCaps);
return textureFormat; return textureFormat;
} }
case GL_RGB32F: case GL_RGB32F:
{ {
static const TextureFormat textureFormat(internalFormat, static const TextureFormat textureFormat(internalFormat,
ANGLE_FORMAT_R32G32B32A32_FLOAT, ANGLE_FORMAT_R32G32B32A32_FLOAT,
Initialize4ComponentData<GLfloat, 0x00000000, 0x00000000, 0x00000000, gl::Float32One>); Initialize4ComponentData<GLfloat, 0x00000000, 0x00000000, 0x00000000, gl::Float32One>,
deviceCaps);
return textureFormat; return textureFormat;
} }
case GL_RGB32I: case GL_RGB32I:
{ {
static const TextureFormat textureFormat(internalFormat, static const TextureFormat textureFormat(internalFormat,
ANGLE_FORMAT_R32G32B32A32_SINT, ANGLE_FORMAT_R32G32B32A32_SINT,
Initialize4ComponentData<GLint, 0x00000000, 0x00000000, 0x00000000, 0x00000001>); Initialize4ComponentData<GLint, 0x00000000, 0x00000000, 0x00000000, 0x00000001>,
deviceCaps);
return textureFormat; return textureFormat;
} }
case GL_RGB32UI: case GL_RGB32UI:
{ {
static const TextureFormat textureFormat(internalFormat, static const TextureFormat textureFormat(internalFormat,
ANGLE_FORMAT_R32G32B32A32_UINT, ANGLE_FORMAT_R32G32B32A32_UINT,
Initialize4ComponentData<GLuint, 0x00000000, 0x00000000, 0x00000000, 0x00000001>); Initialize4ComponentData<GLuint, 0x00000000, 0x00000000, 0x00000000, 0x00000001>,
deviceCaps);
return textureFormat; return textureFormat;
} }
case GL_RGB565: case GL_RGB565:
{ {
if (SupportsFormat<DXGI_FORMAT_B5G6R5_UNORM,false>(renderer11DeviceCaps)) if (SupportsFormat<DXGI_FORMAT_B5G6R5_UNORM,false>(deviceCaps))
{ {
static const TextureFormat textureFormat(internalFormat, static const TextureFormat textureFormat(internalFormat,
ANGLE_FORMAT_R8G8B8A8_UNORM, ANGLE_FORMAT_R8G8B8A8_UNORM,
Initialize4ComponentData<GLubyte, 0x00, 0x00, 0x00, 0xFF>); Initialize4ComponentData<GLubyte, 0x00, 0x00, 0x00, 0xFF>,
deviceCaps);
return textureFormat; return textureFormat;
} }
else if (SupportsFormat<DXGI_FORMAT_B5G6R5_UNORM,true>(renderer11DeviceCaps)) else if (SupportsFormat<DXGI_FORMAT_B5G6R5_UNORM,true>(deviceCaps))
{ {
static const TextureFormat textureFormat(internalFormat, static const TextureFormat textureFormat(internalFormat,
ANGLE_FORMAT_B5G6R5_UNORM, ANGLE_FORMAT_B5G6R5_UNORM,
nullptr); nullptr,
deviceCaps);
return textureFormat; return textureFormat;
} }
else else
...@@ -1948,18 +2055,20 @@ const TextureFormat &GetTextureFormatInfo(GLenum internalFormat, ...@@ -1948,18 +2055,20 @@ const TextureFormat &GetTextureFormatInfo(GLenum internalFormat,
} }
case GL_RGB5_A1: case GL_RGB5_A1:
{ {
if (SupportsFormat<DXGI_FORMAT_B5G5R5A1_UNORM,false>(renderer11DeviceCaps)) if (SupportsFormat<DXGI_FORMAT_B5G5R5A1_UNORM,false>(deviceCaps))
{ {
static const TextureFormat textureFormat(internalFormat, static const TextureFormat textureFormat(internalFormat,
ANGLE_FORMAT_R8G8B8A8_UNORM, ANGLE_FORMAT_R8G8B8A8_UNORM,
nullptr); nullptr,
deviceCaps);
return textureFormat; return textureFormat;
} }
else if (SupportsFormat<DXGI_FORMAT_B5G5R5A1_UNORM,true>(renderer11DeviceCaps)) else if (SupportsFormat<DXGI_FORMAT_B5G5R5A1_UNORM,true>(deviceCaps))
{ {
static const TextureFormat textureFormat(internalFormat, static const TextureFormat textureFormat(internalFormat,
ANGLE_FORMAT_B5G5R5A1_UNORM, ANGLE_FORMAT_B5G5R5A1_UNORM,
nullptr); nullptr,
deviceCaps);
return textureFormat; return textureFormat;
} }
else else
...@@ -1971,114 +2080,130 @@ const TextureFormat &GetTextureFormatInfo(GLenum internalFormat, ...@@ -1971,114 +2080,130 @@ const TextureFormat &GetTextureFormatInfo(GLenum internalFormat,
{ {
static const TextureFormat textureFormat(internalFormat, static const TextureFormat textureFormat(internalFormat,
ANGLE_FORMAT_R8G8B8A8_UNORM, ANGLE_FORMAT_R8G8B8A8_UNORM,
Initialize4ComponentData<GLubyte, 0x00, 0x00, 0x00, 0xFF>); Initialize4ComponentData<GLubyte, 0x00, 0x00, 0x00, 0xFF>,
deviceCaps);
return textureFormat; return textureFormat;
} }
case GL_RGB8I: case GL_RGB8I:
{ {
static const TextureFormat textureFormat(internalFormat, static const TextureFormat textureFormat(internalFormat,
ANGLE_FORMAT_R8G8B8A8_SINT, ANGLE_FORMAT_R8G8B8A8_SINT,
Initialize4ComponentData<GLbyte, 0x00, 0x00, 0x00, 0x01>); Initialize4ComponentData<GLbyte, 0x00, 0x00, 0x00, 0x01>,
deviceCaps);
return textureFormat; return textureFormat;
} }
case GL_RGB8UI: case GL_RGB8UI:
{ {
static const TextureFormat textureFormat(internalFormat, static const TextureFormat textureFormat(internalFormat,
ANGLE_FORMAT_R8G8B8A8_UINT, ANGLE_FORMAT_R8G8B8A8_UINT,
Initialize4ComponentData<GLubyte, 0x00, 0x00, 0x00, 0x01>); Initialize4ComponentData<GLubyte, 0x00, 0x00, 0x00, 0x01>,
deviceCaps);
return textureFormat; return textureFormat;
} }
case GL_RGB8_SNORM: case GL_RGB8_SNORM:
{ {
static const TextureFormat textureFormat(internalFormat, static const TextureFormat textureFormat(internalFormat,
ANGLE_FORMAT_R8G8B8A8_SNORM, ANGLE_FORMAT_R8G8B8A8_SNORM,
Initialize4ComponentData<GLbyte, 0x00, 0x00, 0x00, 0x7F>); Initialize4ComponentData<GLbyte, 0x00, 0x00, 0x00, 0x7F>,
deviceCaps);
return textureFormat; return textureFormat;
} }
case GL_RGB9_E5: case GL_RGB9_E5:
{ {
static const TextureFormat textureFormat(internalFormat, static const TextureFormat textureFormat(internalFormat,
ANGLE_FORMAT_R9G9B9E5_SHAREDEXP, ANGLE_FORMAT_R9G9B9E5_SHAREDEXP,
nullptr); nullptr,
deviceCaps);
return textureFormat; return textureFormat;
} }
case GL_RGBA: case GL_RGBA:
{ {
static const TextureFormat textureFormat(internalFormat, static const TextureFormat textureFormat(internalFormat,
ANGLE_FORMAT_R8G8B8A8_UNORM, ANGLE_FORMAT_R8G8B8A8_UNORM,
nullptr); nullptr,
deviceCaps);
return textureFormat; return textureFormat;
} }
case GL_RGBA16F: case GL_RGBA16F:
{ {
static const TextureFormat textureFormat(internalFormat, static const TextureFormat textureFormat(internalFormat,
ANGLE_FORMAT_R16G16B16A16_FLOAT, ANGLE_FORMAT_R16G16B16A16_FLOAT,
nullptr); nullptr,
deviceCaps);
return textureFormat; return textureFormat;
} }
case GL_RGBA16I: case GL_RGBA16I:
{ {
static const TextureFormat textureFormat(internalFormat, static const TextureFormat textureFormat(internalFormat,
ANGLE_FORMAT_R16G16B16A16_SINT, ANGLE_FORMAT_R16G16B16A16_SINT,
nullptr); nullptr,
deviceCaps);
return textureFormat; return textureFormat;
} }
case GL_RGBA16UI: case GL_RGBA16UI:
{ {
static const TextureFormat textureFormat(internalFormat, static const TextureFormat textureFormat(internalFormat,
ANGLE_FORMAT_R16G16B16A16_UINT, ANGLE_FORMAT_R16G16B16A16_UINT,
nullptr); nullptr,
deviceCaps);
return textureFormat; return textureFormat;
} }
case GL_RGBA16_EXT: case GL_RGBA16_EXT:
{ {
static const TextureFormat textureFormat(internalFormat, static const TextureFormat textureFormat(internalFormat,
ANGLE_FORMAT_R16G16B16A16_UNORM, ANGLE_FORMAT_R16G16B16A16_UNORM,
nullptr); nullptr,
deviceCaps);
return textureFormat; return textureFormat;
} }
case GL_RGBA16_SNORM_EXT: case GL_RGBA16_SNORM_EXT:
{ {
static const TextureFormat textureFormat(internalFormat, static const TextureFormat textureFormat(internalFormat,
ANGLE_FORMAT_R16G16B16A16_SNORM, ANGLE_FORMAT_R16G16B16A16_SNORM,
nullptr); nullptr,
deviceCaps);
return textureFormat; return textureFormat;
} }
case GL_RGBA32F: case GL_RGBA32F:
{ {
static const TextureFormat textureFormat(internalFormat, static const TextureFormat textureFormat(internalFormat,
ANGLE_FORMAT_R32G32B32A32_FLOAT, ANGLE_FORMAT_R32G32B32A32_FLOAT,
nullptr); nullptr,
deviceCaps);
return textureFormat; return textureFormat;
} }
case GL_RGBA32I: case GL_RGBA32I:
{ {
static const TextureFormat textureFormat(internalFormat, static const TextureFormat textureFormat(internalFormat,
ANGLE_FORMAT_R32G32B32A32_SINT, ANGLE_FORMAT_R32G32B32A32_SINT,
nullptr); nullptr,
deviceCaps);
return textureFormat; return textureFormat;
} }
case GL_RGBA32UI: case GL_RGBA32UI:
{ {
static const TextureFormat textureFormat(internalFormat, static const TextureFormat textureFormat(internalFormat,
ANGLE_FORMAT_R32G32B32A32_UINT, ANGLE_FORMAT_R32G32B32A32_UINT,
nullptr); nullptr,
deviceCaps);
return textureFormat; return textureFormat;
} }
case GL_RGBA4: case GL_RGBA4:
{ {
if (SupportsFormat<DXGI_FORMAT_B4G4R4A4_UNORM,false>(renderer11DeviceCaps)) if (SupportsFormat<DXGI_FORMAT_B4G4R4A4_UNORM,false>(deviceCaps))
{ {
static const TextureFormat textureFormat(internalFormat, static const TextureFormat textureFormat(internalFormat,
ANGLE_FORMAT_R8G8B8A8_UNORM, ANGLE_FORMAT_R8G8B8A8_UNORM,
nullptr); nullptr,
deviceCaps);
return textureFormat; return textureFormat;
} }
else if (SupportsFormat<DXGI_FORMAT_B4G4R4A4_UNORM,true>(renderer11DeviceCaps)) else if (SupportsFormat<DXGI_FORMAT_B4G4R4A4_UNORM,true>(deviceCaps))
{ {
static const TextureFormat textureFormat(internalFormat, static const TextureFormat textureFormat(internalFormat,
ANGLE_FORMAT_B4G4R4A4_UNORM, ANGLE_FORMAT_B4G4R4A4_UNORM,
nullptr); nullptr,
deviceCaps);
return textureFormat; return textureFormat;
} }
else else
...@@ -2090,58 +2215,66 @@ const TextureFormat &GetTextureFormatInfo(GLenum internalFormat, ...@@ -2090,58 +2215,66 @@ const TextureFormat &GetTextureFormatInfo(GLenum internalFormat,
{ {
static const TextureFormat textureFormat(internalFormat, static const TextureFormat textureFormat(internalFormat,
ANGLE_FORMAT_R8G8B8A8_UNORM, ANGLE_FORMAT_R8G8B8A8_UNORM,
nullptr); nullptr,
deviceCaps);
return textureFormat; return textureFormat;
} }
case GL_RGBA8I: case GL_RGBA8I:
{ {
static const TextureFormat textureFormat(internalFormat, static const TextureFormat textureFormat(internalFormat,
ANGLE_FORMAT_R8G8B8A8_SINT, ANGLE_FORMAT_R8G8B8A8_SINT,
nullptr); nullptr,
deviceCaps);
return textureFormat; return textureFormat;
} }
case GL_RGBA8UI: case GL_RGBA8UI:
{ {
static const TextureFormat textureFormat(internalFormat, static const TextureFormat textureFormat(internalFormat,
ANGLE_FORMAT_R8G8B8A8_UINT, ANGLE_FORMAT_R8G8B8A8_UINT,
nullptr); nullptr,
deviceCaps);
return textureFormat; return textureFormat;
} }
case GL_RGBA8_SNORM: case GL_RGBA8_SNORM:
{ {
static const TextureFormat textureFormat(internalFormat, static const TextureFormat textureFormat(internalFormat,
ANGLE_FORMAT_R8G8B8A8_SNORM, ANGLE_FORMAT_R8G8B8A8_SNORM,
nullptr); nullptr,
deviceCaps);
return textureFormat; return textureFormat;
} }
case GL_SRGB8: case GL_SRGB8:
{ {
static const TextureFormat textureFormat(internalFormat, static const TextureFormat textureFormat(internalFormat,
ANGLE_FORMAT_R8G8B8A8_UNORM_SRGB, ANGLE_FORMAT_R8G8B8A8_UNORM_SRGB,
Initialize4ComponentData<GLubyte, 0x00, 0x00, 0x00, 0xFF>); Initialize4ComponentData<GLubyte, 0x00, 0x00, 0x00, 0xFF>,
deviceCaps);
return textureFormat; return textureFormat;
} }
case GL_SRGB8_ALPHA8: case GL_SRGB8_ALPHA8:
{ {
static const TextureFormat textureFormat(internalFormat, static const TextureFormat textureFormat(internalFormat,
ANGLE_FORMAT_R8G8B8A8_UNORM_SRGB, ANGLE_FORMAT_R8G8B8A8_UNORM_SRGB,
nullptr); nullptr,
deviceCaps);
return textureFormat; return textureFormat;
} }
case GL_STENCIL_INDEX8: case GL_STENCIL_INDEX8:
{ {
if (OnlyFL10Plus(renderer11DeviceCaps)) if (OnlyFL10Plus(deviceCaps))
{ {
static const TextureFormat textureFormat(internalFormat, static const TextureFormat textureFormat(internalFormat,
ANGLE_FORMAT_D24_UNORM_S8_UINT_FL10, ANGLE_FORMAT_D24_UNORM_S8_UINT,
nullptr); nullptr,
deviceCaps);
return textureFormat; return textureFormat;
} }
else if (OnlyFL9_3(renderer11DeviceCaps)) else if (OnlyFL9_3(deviceCaps))
{ {
static const TextureFormat textureFormat(internalFormat, static const TextureFormat textureFormat(internalFormat,
ANGLE_FORMAT_D24_UNORM_S8_UINT_FL9_3, ANGLE_FORMAT_D24_UNORM_S8_UINT,
nullptr); nullptr,
deviceCaps);
return textureFormat; return textureFormat;
} }
else else
...@@ -2156,7 +2289,7 @@ const TextureFormat &GetTextureFormatInfo(GLenum internalFormat, ...@@ -2156,7 +2289,7 @@ const TextureFormat &GetTextureFormatInfo(GLenum internalFormat,
} }
// clang-format on // clang-format on
static const TextureFormat defaultInfo(GL_NONE, ANGLE_FORMAT_NONE, nullptr); static const TextureFormat defaultInfo(GL_NONE, ANGLE_FORMAT_NONE, nullptr, deviceCaps);
return defaultInfo; return defaultInfo;
} // GetTextureFormatInfo } // GetTextureFormatInfo
......
...@@ -22,12 +22,10 @@ enum ANGLEFormat ...@@ -22,12 +22,10 @@ enum ANGLEFormat
ANGLE_FORMAT_BC1_UNORM, ANGLE_FORMAT_BC1_UNORM,
ANGLE_FORMAT_BC2_UNORM, ANGLE_FORMAT_BC2_UNORM,
ANGLE_FORMAT_BC3_UNORM, ANGLE_FORMAT_BC3_UNORM,
ANGLE_FORMAT_D16_UNORM_FL10, ANGLE_FORMAT_D16_UNORM,
ANGLE_FORMAT_D16_UNORM_FL9_3, ANGLE_FORMAT_D24_UNORM_S8_UINT,
ANGLE_FORMAT_D24_UNORM_S8_UINT_FL10,
ANGLE_FORMAT_D24_UNORM_S8_UINT_FL9_3,
ANGLE_FORMAT_D32_FLOAT, ANGLE_FORMAT_D32_FLOAT,
ANGLE_FORMAT_D32_FLOAT_S8X24_UINT_FL10, ANGLE_FORMAT_D32_FLOAT_S8X24_UINT,
ANGLE_FORMAT_NONE, ANGLE_FORMAT_NONE,
ANGLE_FORMAT_R10G10B10A2_UINT, ANGLE_FORMAT_R10G10B10A2_UINT,
ANGLE_FORMAT_R10G10B10A2_UNORM, ANGLE_FORMAT_R10G10B10A2_UNORM,
......
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