Skip to content

Commit

Permalink
Add OES_draw_buffers_indexed WebGL extension support
Browse files Browse the repository at this point in the history
Implement OES_draw_buffers_indexed WebGL extension for Angle Passthrough.
Not implemented for the validating command decoder.

Corresponding WebGL CTS is already rolled in.

Bug: 1058744
Change-Id: I69ffef0065b5b5789dce78fb92b249d5dd79d0a6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2173593
Reviewed-by: Bill Budge <bbudge@chromium.org>
Reviewed-by: James Darpinian <jdarpinian@chromium.org>
Reviewed-by: Kenneth Russell <kbr@chromium.org>
Commit-Queue: Shrek Shao <shrekshao@google.com>
Cr-Commit-Position: refs/heads/master@{#771238}
  • Loading branch information
shrekshao authored and Commit Bot committed May 21, 2020
1 parent 1820cbc commit 7b1d035
Show file tree
Hide file tree
Showing 59 changed files with 2,986 additions and 334 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
[ android qualcomm ] WebglExtension_EXT_texture_compression_bptc [ Skip ]
[ android qualcomm ] WebglExtension_EXT_texture_compression_rgtc [ Skip ]
crbug.com/776222 [ android ] WebglExtension_WEBGL_video_texture [ Skip ]
crbug.com/1058744 [ no-passthrough ] WebglExtension_OES_draw_buffers_indexed [ Skip ]

# Disabling all multiview checks temporarily while ANGLE side changes
# get merged in.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,7 @@ def _GetExtensionList(cls):
'EXT_texture_filter_anisotropic',
'EXT_texture_norm16',
'KHR_parallel_shader_compile',
'OES_draw_buffers_indexed',
'OES_texture_float_linear',
'OVR_multiview2',
'WEBGL_compressed_texture_astc',
Expand Down
9 changes: 9 additions & 0 deletions gpu/GLES2/gl2chromium_autogen.h
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@
#define glGetAttachedShaders GLES2_GET_FUN(GetAttachedShaders)
#define glGetAttribLocation GLES2_GET_FUN(GetAttribLocation)
#define glGetBooleanv GLES2_GET_FUN(GetBooleanv)
#define glGetBooleani_v GLES2_GET_FUN(GetBooleani_v)
#define glGetBufferParameteri64v GLES2_GET_FUN(GetBufferParameteri64v)
#define glGetBufferParameteriv GLES2_GET_FUN(GetBufferParameteriv)
#define glGetError GLES2_GET_FUN(GetError)
Expand Down Expand Up @@ -406,5 +407,13 @@
GLES2_GET_FUN(BeginBatchReadAccessSharedImageCHROMIUM)
#define glEndBatchReadAccessSharedImageCHROMIUM \
GLES2_GET_FUN(EndBatchReadAccessSharedImageCHROMIUM)
#define glEnableiOES GLES2_GET_FUN(EnableiOES)
#define glDisableiOES GLES2_GET_FUN(DisableiOES)
#define glBlendEquationiOES GLES2_GET_FUN(BlendEquationiOES)
#define glBlendEquationSeparateiOES GLES2_GET_FUN(BlendEquationSeparateiOES)
#define glBlendFunciOES GLES2_GET_FUN(BlendFunciOES)
#define glBlendFuncSeparateiOES GLES2_GET_FUN(BlendFuncSeparateiOES)
#define glColorMaskiOES GLES2_GET_FUN(ColorMaskiOES)
#define glIsEnablediOES GLES2_GET_FUN(IsEnablediOES)

#endif // GPU_GLES2_GL2CHROMIUM_AUTOGEN_H_
66 changes: 66 additions & 0 deletions gpu/command_buffer/build_gles2_cmd_buffer.py
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,13 @@
'GL_UNPACK_SKIP_IMAGES',
'GL_UNPACK_SKIP_PIXELS',
'GL_UNPACK_SKIP_ROWS',
'GL_BLEND_EQUATION_RGB',
'GL_BLEND_EQUATION_ALPHA',
'GL_BLEND_SRC_RGB',
'GL_BLEND_SRC_ALPHA',
'GL_BLEND_DST_RGB',
'GL_BLEND_DST_ALPHA',
'GL_COLOR_WRITEMASK',
# GL_VERTEX_ARRAY_BINDING is the same as GL_VERTEX_ARRAY_BINDING_OES
# 'GL_VERTEX_ARRAY_BINDING',
],
Expand All @@ -324,6 +331,13 @@
'GL_UNIFORM_BUFFER_BINDING',
'GL_UNIFORM_BUFFER_SIZE',
'GL_UNIFORM_BUFFER_START',
'GL_BLEND_EQUATION_RGB',
'GL_BLEND_EQUATION_ALPHA',
'GL_BLEND_SRC_RGB',
'GL_BLEND_SRC_ALPHA',
'GL_BLEND_DST_RGB',
'GL_BLEND_DST_ALPHA',
'GL_COLOR_WRITEMASK',
],
'invalid': [
'GL_FOG_HINT',
Expand Down Expand Up @@ -1828,6 +1842,9 @@
'no_gl': True,
'expectation': False,
},
'ColorMaskiOES': {
'extension': 'OES_draw_buffers_indexed',
},
'ContextVisibilityHintCHROMIUM': {
'decoder_func': 'DoContextVisibilityHintCHROMIUM',
'extension': 'CHROMIUM_context_visibility_hint',
Expand Down Expand Up @@ -1954,21 +1971,41 @@
'0': 'GL_FUNC_SUBTRACT'
},
},
'BlendEquationiOES': {
'extension': 'OES_draw_buffers_indexed',
'valid_args': {
'1': 'GL_FUNC_SUBTRACT',
'2': 'GL_FUNC_SUBTRACT'
},
},
'BlendEquationSeparate': {
'type': 'StateSet',
'state': 'BlendEquation',
'valid_args': {
'0': 'GL_FUNC_SUBTRACT'
},
},
'BlendEquationSeparateiOES': {
'extension': 'OES_draw_buffers_indexed',
'valid_args': {
'1': 'GL_FUNC_SUBTRACT',
'2': 'GL_FUNC_SUBTRACT'
},
},
'BlendFunc': {
'type': 'StateSetRGBAlpha',
'state': 'BlendFunc',
},
'BlendFunciOES': {
'extension': 'OES_draw_buffers_indexed',
},
'BlendFuncSeparate': {
'type': 'StateSet',
'state': 'BlendFunc',
},
'BlendFuncSeparateiOES': {
'extension': 'OES_draw_buffers_indexed',
},
'BlendBarrierKHR': {
'gl_test_func': 'glBlendBarrierKHR',
'extension': 'KHR_blend_equation_advanced',
Expand Down Expand Up @@ -2079,6 +2116,12 @@
'impl_func': False,
'client_test': False,
},
'DisableiOES': {
'extension': 'OES_draw_buffers_indexed',
'decoder_func': 'DoDisableiOES',
'impl_func': False,
'unit_test': False,
},
'DisableVertexAttribArray': {
'decoder_func': 'DoDisableVertexAttribArray',
'impl_func': False,
Expand Down Expand Up @@ -2139,6 +2182,12 @@
'impl_func': False,
'client_test': False,
},
'EnableiOES': {
'extension': 'OES_draw_buffers_indexed',
'decoder_func': 'DoEnableiOES',
'impl_func': False,
'unit_test': False,
},
'EnableVertexAttribArray': {
'decoder_func': 'DoEnableVertexAttribArray',
'impl_func': False,
Expand Down Expand Up @@ -2325,6 +2374,15 @@
'decoder_func': 'DoGetBooleanv',
'gl_test_func': 'glGetIntegerv',
},
'GetBooleani_v': {
'type': 'GETn',
'result': ['SizedResult<GLboolean>'],
'decoder_func': 'DoGetBooleani_v',
'shadowed': True,
'client_test': False,
'unit_test': False,
'es3': True
},
'GetBufferParameteri64v': {
'type': 'GETn',
'result': ['SizedResult<GLint64>'],
Expand Down Expand Up @@ -2721,6 +2779,14 @@
'impl_func': False,
'expectation': False,
},
'IsEnablediOES': {
'extension': 'OES_draw_buffers_indexed',
'type': 'Is',
'decoder_func': 'DoIsEnablediOES',
'client_test': False,
'impl_func': False,
'expectation': False,
},
'IsFramebuffer': {
'type': 'Is',
'decoder_func': 'DoIsFramebuffer',
Expand Down
76 changes: 76 additions & 0 deletions gpu/command_buffer/client/gles2_c_lib_autogen.h
Original file line number Diff line number Diff line change
Expand Up @@ -423,6 +423,11 @@ GLint GL_APIENTRY GLES2GetAttribLocation(GLuint program, const char* name) {
void GL_APIENTRY GLES2GetBooleanv(GLenum pname, GLboolean* params) {
gles2::GetGLContext()->GetBooleanv(pname, params);
}
void GL_APIENTRY GLES2GetBooleani_v(GLenum pname,
GLuint index,
GLboolean* data) {
gles2::GetGLContext()->GetBooleani_v(pname, index, data);
}
void GL_APIENTRY GLES2GetBufferParameteri64v(GLenum target,
GLenum pname,
GLint64* params) {
Expand Down Expand Up @@ -1832,6 +1837,41 @@ void GL_APIENTRY GLES2BeginBatchReadAccessSharedImageCHROMIUM() {
void GL_APIENTRY GLES2EndBatchReadAccessSharedImageCHROMIUM() {
gles2::GetGLContext()->EndBatchReadAccessSharedImageCHROMIUM();
}
void GL_APIENTRY GLES2EnableiOES(GLenum target, GLuint index) {
gles2::GetGLContext()->EnableiOES(target, index);
}
void GL_APIENTRY GLES2DisableiOES(GLenum target, GLuint index) {
gles2::GetGLContext()->DisableiOES(target, index);
}
void GL_APIENTRY GLES2BlendEquationiOES(GLuint buf, GLenum mode) {
gles2::GetGLContext()->BlendEquationiOES(buf, mode);
}
void GL_APIENTRY GLES2BlendEquationSeparateiOES(GLuint buf,
GLenum modeRGB,
GLenum modeAlpha) {
gles2::GetGLContext()->BlendEquationSeparateiOES(buf, modeRGB, modeAlpha);
}
void GL_APIENTRY GLES2BlendFunciOES(GLuint buf, GLenum src, GLenum dst) {
gles2::GetGLContext()->BlendFunciOES(buf, src, dst);
}
void GL_APIENTRY GLES2BlendFuncSeparateiOES(GLuint buf,
GLenum srcRGB,
GLenum dstRGB,
GLenum srcAlpha,
GLenum dstAlpha) {
gles2::GetGLContext()->BlendFuncSeparateiOES(buf, srcRGB, dstRGB, srcAlpha,
dstAlpha);
}
void GL_APIENTRY GLES2ColorMaskiOES(GLuint buf,
GLboolean r,
GLboolean g,
GLboolean b,
GLboolean a) {
gles2::GetGLContext()->ColorMaskiOES(buf, r, g, b, a);
}
GLboolean GL_APIENTRY GLES2IsEnablediOES(GLenum target, GLuint index) {
return gles2::GetGLContext()->IsEnablediOES(target, index);
}

namespace gles2 {

Expand Down Expand Up @@ -2168,6 +2208,10 @@ extern const NameToFunc g_gles2_function_table[] = {
"glGetBooleanv",
reinterpret_cast<GLES2FunctionPointer>(glGetBooleanv),
},
{
"glGetBooleani_v",
reinterpret_cast<GLES2FunctionPointer>(glGetBooleani_v),
},
{
"glGetBufferParameteri64v",
reinterpret_cast<GLES2FunctionPointer>(glGetBufferParameteri64v),
Expand Down Expand Up @@ -3276,6 +3320,38 @@ extern const NameToFunc g_gles2_function_table[] = {
reinterpret_cast<GLES2FunctionPointer>(
glEndBatchReadAccessSharedImageCHROMIUM),
},
{
"glEnableiOES",
reinterpret_cast<GLES2FunctionPointer>(glEnableiOES),
},
{
"glDisableiOES",
reinterpret_cast<GLES2FunctionPointer>(glDisableiOES),
},
{
"glBlendEquationiOES",
reinterpret_cast<GLES2FunctionPointer>(glBlendEquationiOES),
},
{
"glBlendEquationSeparateiOES",
reinterpret_cast<GLES2FunctionPointer>(glBlendEquationSeparateiOES),
},
{
"glBlendFunciOES",
reinterpret_cast<GLES2FunctionPointer>(glBlendFunciOES),
},
{
"glBlendFuncSeparateiOES",
reinterpret_cast<GLES2FunctionPointer>(glBlendFuncSeparateiOES),
},
{
"glColorMaskiOES",
reinterpret_cast<GLES2FunctionPointer>(glColorMaskiOES),
},
{
"glIsEnablediOES",
reinterpret_cast<GLES2FunctionPointer>(glIsEnablediOES),
},
{
nullptr,
nullptr,
Expand Down
80 changes: 80 additions & 0 deletions gpu/command_buffer/client/gles2_cmd_helper_autogen.h
Original file line number Diff line number Diff line change
Expand Up @@ -851,6 +851,16 @@ void GetBooleanv(GLenum pname,
}
}

void GetBooleani_v(GLenum pname,
GLuint index,
uint32_t data_shm_id,
uint32_t data_shm_offset) {
gles2::cmds::GetBooleani_v* c = GetCmdSpace<gles2::cmds::GetBooleani_v>();
if (c) {
c->Init(pname, index, data_shm_id, data_shm_offset);
}
}

void GetBufferParameteri64v(GLenum target,
GLenum pname,
uint32_t params_shm_id,
Expand Down Expand Up @@ -3415,4 +3425,74 @@ void EndBatchReadAccessSharedImageCHROMIUM() {
}
}

void EnableiOES(GLenum target, GLuint index) {
gles2::cmds::EnableiOES* c = GetCmdSpace<gles2::cmds::EnableiOES>();
if (c) {
c->Init(target, index);
}
}

void DisableiOES(GLenum target, GLuint index) {
gles2::cmds::DisableiOES* c = GetCmdSpace<gles2::cmds::DisableiOES>();
if (c) {
c->Init(target, index);
}
}

void BlendEquationiOES(GLuint buf, GLenum mode) {
gles2::cmds::BlendEquationiOES* c =
GetCmdSpace<gles2::cmds::BlendEquationiOES>();
if (c) {
c->Init(buf, mode);
}
}

void BlendEquationSeparateiOES(GLuint buf, GLenum modeRGB, GLenum modeAlpha) {
gles2::cmds::BlendEquationSeparateiOES* c =
GetCmdSpace<gles2::cmds::BlendEquationSeparateiOES>();
if (c) {
c->Init(buf, modeRGB, modeAlpha);
}
}

void BlendFunciOES(GLuint buf, GLenum src, GLenum dst) {
gles2::cmds::BlendFunciOES* c = GetCmdSpace<gles2::cmds::BlendFunciOES>();
if (c) {
c->Init(buf, src, dst);
}
}

void BlendFuncSeparateiOES(GLuint buf,
GLenum srcRGB,
GLenum dstRGB,
GLenum srcAlpha,
GLenum dstAlpha) {
gles2::cmds::BlendFuncSeparateiOES* c =
GetCmdSpace<gles2::cmds::BlendFuncSeparateiOES>();
if (c) {
c->Init(buf, srcRGB, dstRGB, srcAlpha, dstAlpha);
}
}

void ColorMaskiOES(GLuint buf,
GLboolean r,
GLboolean g,
GLboolean b,
GLboolean a) {
gles2::cmds::ColorMaskiOES* c = GetCmdSpace<gles2::cmds::ColorMaskiOES>();
if (c) {
c->Init(buf, r, g, b, a);
}
}

void IsEnablediOES(GLenum target,
GLuint index,
uint32_t result_shm_id,
uint32_t result_shm_offset) {
gles2::cmds::IsEnablediOES* c = GetCmdSpace<gles2::cmds::IsEnablediOES>();
if (c) {
c->Init(target, index, result_shm_id, result_shm_offset);
}
}

#endif // GPU_COMMAND_BUFFER_CLIENT_GLES2_CMD_HELPER_AUTOGEN_H_
Loading

0 comments on commit 7b1d035

Please sign in to comment.