Commit 9f26c232 authored by sievers's avatar sievers Committed by Commit bot

Fix incorrect binding spec for multisampled_render_to_texture APIs

The extensions with implicit vs. explicit resolve are already
treated differently at the cmdbuffer level. The incorrect
specification of glRenderbufferStorageMultisampleEXT
(multisampled_render_to_texture) with
glRenderbufferStorageMultisample (core MSAA with explicit resolve)
causes an incorrect binding (see removed TODO which says the
same thing).

Also remove glRenderbufferStorageMultisampleANGLE alternative with
the core name.

BUG=454816,438742,325668

Review URL: https://codereview.chromium.org/887113003

Cr-Commit-Position: refs/heads/master@{#314422}
parent 1677c01e
......@@ -817,18 +817,6 @@ GL_FUNCTIONS = [
{ 'return_type': 'void',
'names': ['glReleaseShaderCompiler'],
'arguments': 'void', },
# Multisampling API is different in different GL versions, some require an
# explicit resolve step for renderbuffers and/or FBO texture attachments and
# some do not. Multiple alternatives might be present in a single
# implementation, which require different use of the API and may have
# different performance (explicit resolve performing worse, for example).
# So even though the function signature is the same across versions, we split
# their definitions so that the function to use can be chosen correctly at a
# higher level.
# TODO(oetuaho@nvidia.com): Some of these might still be possible to combine.
# This could also fix weirdness in the mock bindings that's caused by the same
# function name appearing multiple times.
# This is the ES3 function, which requires explicit resolve:
{ 'return_type': 'void',
'names': ['glRenderbufferStorageEXT', 'glRenderbufferStorage'],
'arguments':
......@@ -838,18 +826,11 @@ GL_FUNCTIONS = [
'arguments': 'GLenum target, GLsizei samples, GLenum internalformat, '
'GLsizei width, GLsizei height', },
{ 'return_type': 'void',
'names': ['glRenderbufferStorageMultisampleANGLE',
'glRenderbufferStorageMultisample'],
'names': ['glRenderbufferStorageMultisampleANGLE'],
'arguments': 'GLenum target, GLsizei samples, GLenum internalformat, '
'GLsizei width, GLsizei height', },
# In desktop GL, EXT and core versions both have an explicit resolve step,
# though desktop core GL implicitly resolves when drawing to a window.
# TODO(oetuaho@nvidia.com): Right now this function also doubles as ES2 EXT
# function, which has implicit resolve, and for which the fallback is wrong.
# Fix this.
{ 'return_type': 'void',
'names': ['glRenderbufferStorageMultisampleEXT',
'glRenderbufferStorageMultisample'],
{ 'return_type': 'void',
'names': ['glRenderbufferStorageMultisampleEXT'],
'arguments': 'GLenum target, GLsizei samples, GLenum internalformat, '
'GLsizei width, GLsizei height', },
{ 'return_type': 'void',
......
......@@ -1692,12 +1692,7 @@ void DriverGL::InitializeDynamicBindings(GLContext* context) {
}
debug_fn.glRenderbufferStorageMultisampleANGLEFn = 0;
if (ver->IsAtLeastGL(3u, 0u) || ver->IsAtLeastGLES(3u, 0u)) {
fn.glRenderbufferStorageMultisampleANGLEFn =
reinterpret_cast<glRenderbufferStorageMultisampleANGLEProc>(
GetGLProcAddress("glRenderbufferStorageMultisample"));
DCHECK(fn.glRenderbufferStorageMultisampleANGLEFn);
} else if (ext.b_GL_ANGLE_framebuffer_multisample) {
if (ext.b_GL_ANGLE_framebuffer_multisample) {
fn.glRenderbufferStorageMultisampleANGLEFn =
reinterpret_cast<glRenderbufferStorageMultisampleANGLEProc>(
GetGLProcAddress("glRenderbufferStorageMultisampleANGLE"));
......@@ -1705,13 +1700,8 @@ void DriverGL::InitializeDynamicBindings(GLContext* context) {
}
debug_fn.glRenderbufferStorageMultisampleEXTFn = 0;
if (ver->IsAtLeastGL(3u, 0u) || ver->IsAtLeastGLES(3u, 0u)) {
fn.glRenderbufferStorageMultisampleEXTFn =
reinterpret_cast<glRenderbufferStorageMultisampleEXTProc>(
GetGLProcAddress("glRenderbufferStorageMultisample"));
DCHECK(fn.glRenderbufferStorageMultisampleEXTFn);
} else if (ext.b_GL_EXT_multisampled_render_to_texture ||
ext.b_GL_EXT_framebuffer_multisample) {
if (ext.b_GL_EXT_multisampled_render_to_texture ||
ext.b_GL_EXT_framebuffer_multisample) {
fn.glRenderbufferStorageMultisampleEXTFn =
reinterpret_cast<glRenderbufferStorageMultisampleEXTProc>(
GetGLProcAddress("glRenderbufferStorageMultisampleEXT"));
......
......@@ -1829,8 +1829,8 @@ MockGLInterface::Mock_glRenderbufferStorageMultisample(GLenum target,
GLsizei width,
GLsizei height) {
MakeFunctionUnique("glRenderbufferStorageMultisample");
interface_->RenderbufferStorageMultisampleEXT(target, samples, internalformat,
width, height);
interface_->RenderbufferStorageMultisample(target, samples, internalformat,
width, height);
}
void GL_BINDING_CALL
......
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