Commit fa920ebb by Jamie Madill Committed by Commit Bot

Entry Points: Auto-generate extensions EPs.

This is partially complete - it is missing the auto-gen for custom ANGLE and Chromium extensions that aren't present in gl.xml. We can upstream some of these extensions, but will also need to make custom handling for some extensions that are too volatile or under- specced to upstream to Khronos. This also tweaks some of the Context method names to match what the auto-generator expects. It also updates some TexStorage entry points. Also includes a specialized error return value for glTestFenceNV. Also removes the TexImage3DOES entry point which was neither used nor accessible to the application. Bug: angleproject:2263 Change-Id: I3667c22b1b15f84ab4c7dfecb5745aaf73d11e76 Reviewed-on: https://chromium-review.googlesource.com/846420 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: 's avatarCorentin Wallez <cwallez@chromium.org>
parent c71862aa
...@@ -11,6 +11,41 @@ import sys, os, pprint, json ...@@ -11,6 +11,41 @@ import sys, os, pprint, json
import xml.etree.ElementTree as etree import xml.etree.ElementTree as etree
from datetime import date from datetime import date
# List of supported extensions. Add to this list to enable new extensions
# available in gl.xml.
# TODO(jmadill): Support extensions not in gl.xml.
supported_extensions = sorted([
"GL_ANGLE_framebuffer_blit",
"GL_ANGLE_framebuffer_multisample",
"GL_ANGLE_instanced_arrays",
"GL_ANGLE_translated_shader_source",
"GL_EXT_debug_marker",
"GL_EXT_discard_framebuffer",
"GL_EXT_disjoint_timer_query",
"GL_EXT_draw_buffers",
"GL_EXT_map_buffer_range",
"GL_EXT_occlusion_query_boolean",
"GL_EXT_robustness",
"GL_EXT_texture_storage",
"GL_KHR_debug",
"GL_NV_fence",
"GL_OES_EGL_image",
"GL_OES_get_program_binary",
"GL_OES_mapbuffer",
"GL_OES_vertex_array_object",
])
# This is a list of exceptions for entry points which don't want to have
# the EVENT macro. This is required for some debug marker entry points.
no_event_marker_exceptions_list = sorted([
"glPushGroupMarkerEXT",
"glPopGroupMarkerEXT",
"glInsertEventMarkerEXT",
])
# Strip these suffixes from Context entry point names. NV is excluded (for now).
strip_suffixes = ["ANGLE", "EXT", "KHR", "OES"]
template_entry_point_header = """// GENERATED FILE - DO NOT EDIT. template_entry_point_header = """// GENERATED FILE - DO NOT EDIT.
// Generated by {script_name} using data from {data_source_name}. // Generated by {script_name} using data from {data_source_name}.
// //
...@@ -78,7 +113,7 @@ template_entry_point_decl = """ANGLE_EXPORT {return_type}GL_APIENTRY {name}({par ...@@ -78,7 +113,7 @@ template_entry_point_decl = """ANGLE_EXPORT {return_type}GL_APIENTRY {name}({par
template_entry_point_def = """{return_type}GL_APIENTRY {name}({params}) template_entry_point_def = """{return_type}GL_APIENTRY {name}({params})
{{ {{
EVENT("({format_params})"{comma_if_needed}{pass_params}); {event_comment}EVENT("({format_params})"{comma_if_needed}{pass_params});
Context *context = {context_getter}(); Context *context = {context_getter}();
if (context) if (context)
...@@ -138,7 +173,10 @@ format_dict = { ...@@ -138,7 +173,10 @@ format_dict = {
"GLsizeiptr": "%d", "GLsizeiptr": "%d",
"GLsync": "0x%0.8p", "GLsync": "0x%0.8p",
"GLuint": "%u", "GLuint": "%u",
"GLuint64": "%llu" "GLuint64": "%llu",
"GLDEBUGPROC": "0x%0.8p",
"GLDEBUGPROCKHR": "0x%0.8p",
"GLeglImageOES": "0x%0.8p",
} }
def param_format_string(param): def param_format_string(param):
...@@ -162,6 +200,10 @@ def get_context_getter_function(cmd_name): ...@@ -162,6 +200,10 @@ def get_context_getter_function(cmd_name):
else: else:
return "GetValidGlobalContext" return "GetValidGlobalContext"
template_event_comment = """// Don't run an EVENT() macro on the EXT_debug_marker entry points.
// It can interfere with the debug events being set by the caller.
// """
def format_entry_point_def(cmd_name, proto, params): def format_entry_point_def(cmd_name, proto, params):
packed_gl_enums = cmd_packed_gl_enums.get(cmd_name, {}) packed_gl_enums = cmd_packed_gl_enums.get(cmd_name, {})
internal_params = [just_the_name_packed(param, packed_gl_enums) for param in params] internal_params = [just_the_name_packed(param, packed_gl_enums) for param in params]
...@@ -178,8 +220,13 @@ def format_entry_point_def(cmd_name, proto, params): ...@@ -178,8 +220,13 @@ def format_entry_point_def(cmd_name, proto, params):
format_params = [param_format_string(param) for param in params] format_params = [param_format_string(param) for param in params]
return_type = proto[:-len(cmd_name)] return_type = proto[:-len(cmd_name)]
default_return = default_return_value(cmd_name, return_type.strip()) default_return = default_return_value(cmd_name, return_type.strip())
event_comment = template_event_comment if cmd_name in no_event_marker_exceptions_list else ""
name_lower_no_suffix = cmd_name[2:3].lower() + cmd_name[3:] name_lower_no_suffix = cmd_name[2:3].lower() + cmd_name[3:]
for suffix in strip_suffixes:
if name_lower_no_suffix.endswith(suffix):
name_lower_no_suffix = name_lower_no_suffix[0:-len(suffix)]
return template_entry_point_def.format( return template_entry_point_def.format(
name = cmd_name[2:], name = cmd_name[2:],
name_lower_no_suffix = name_lower_no_suffix, name_lower_no_suffix = name_lower_no_suffix,
...@@ -193,16 +240,15 @@ def format_entry_point_def(cmd_name, proto, params): ...@@ -193,16 +240,15 @@ def format_entry_point_def(cmd_name, proto, params):
format_params = ", ".join(format_params), format_params = ", ".join(format_params),
return_if_needed = "" if default_return == "" else "return ", return_if_needed = "" if default_return == "" else "return ",
default_return_if_needed = "" if default_return == "" else "\n return " + default_return + ";\n", default_return_if_needed = "" if default_return == "" else "\n return " + default_return + ";\n",
context_getter = get_context_getter_function(cmd_name)) context_getter = get_context_getter_function(cmd_name),
event_comment = event_comment)
def path_to(folder, file): def path_to(folder, file):
return os.path.join(script_relative(".."), "src", folder, file) return os.path.join(script_relative(".."), "src", folder, file)
def get_entry_points(all_commands, gles_commands): def get_entry_points(all_commands, gles_commands):
decls = [] decls = []
defs = [] defs = []
for command in all_commands: for command in all_commands:
proto = command.find('proto') proto = command.find('proto')
cmd_name = proto.find('name').text cmd_name = proto.find('name').text
...@@ -212,7 +258,6 @@ def get_entry_points(all_commands, gles_commands): ...@@ -212,7 +258,6 @@ def get_entry_points(all_commands, gles_commands):
param_text = ["".join(param.itertext()) for param in command.findall('param')] param_text = ["".join(param.itertext()) for param in command.findall('param')]
proto_text = "".join(proto.itertext()) proto_text = "".join(proto.itertext())
decls.append(format_entry_point_decl(cmd_name, proto_text, param_text)) decls.append(format_entry_point_decl(cmd_name, proto_text, param_text))
defs.append(format_entry_point_def(cmd_name, proto_text, param_text)) defs.append(format_entry_point_def(cmd_name, proto_text, param_text))
...@@ -274,8 +319,79 @@ for major_version, minor_version in [[2, 0], [3, 0], [3, 1]]: ...@@ -274,8 +319,79 @@ for major_version, minor_version in [[2, 0], [3, 0], [3, 1]]:
write_file(annotation, comment, template_entry_point_source, write_file(annotation, comment, template_entry_point_source,
"\n".join(defs), "cpp", source_includes) "\n".join(defs), "cpp", source_includes)
# TODO(jmadill): Remove manually added entry points once we auto-gen them. # After we finish with the main entry points, we process the extensions.
all_cmd_names += ["glDrawElementsInstancedANGLE"] extension_defs = []
extension_decls = []
# Use a first step to run through the extensions so we can generate them
# in sorted order.
ext_data = {}
for extension in root.findall("extensions/extension"):
extension_name = extension.attrib['name']
if not extension_name in supported_extensions:
continue
ext_cmd_names = []
# There's an extra step here to filter out 'api=gl' extensions. This
# is necessary for handling KHR extensions, which have separate entry
# point signatures (without the suffix) for desktop GL. Note that this
# extra step is necessary because of Etree's limited Xpath support.
for require in extension.findall('require'):
if 'api' in require.attrib and require.attrib['api'] != 'gles2':
continue
# Another special case for EXT_texture_storage
filter_out_comment = "Supported only if GL_EXT_direct_state_access is supported"
if 'comment' in require.attrib and require.attrib['comment'] == filter_out_comment:
continue
extension_commands = require.findall('command')
ext_cmd_names += [command.attrib['name'] for command in extension_commands]
ext_data[extension_name] = sorted(ext_cmd_names)
for extension_name, ext_cmd_names in sorted(ext_data.iteritems()):
# Detect and filter duplicate extensions.
dupes = []
for ext_cmd in ext_cmd_names:
if ext_cmd in all_cmd_names:
dupes.append(ext_cmd)
for dupe in dupes:
ext_cmd_names.remove(dupe)
all_cmd_names += ext_cmd_names
decls, defs = get_entry_points(all_commands, ext_cmd_names)
# Avoid writing out entry points defined by a prior extension.
for dupe in dupes:
msg = "// {} is already defined.\n".format(dupe[2:])
defs.append(msg)
# Write the extension name as a comment before the first EP.
comment = "\n// {}".format(extension_name)
defs.insert(0, comment)
decls.insert(0, comment)
extension_defs += defs
extension_decls += decls
header_includes = template_header_includes.format(2, 2, "")
source_includes = template_sources_includes.format(2, "")
source_includes += """#include "libANGLE/validationES.h"
#include "libANGLE/validationES3.h"
#include "libANGLE/validationES31.h"
"""
write_file("2_0_EXT", "extension", template_entry_point_header,
"\n".join([item for item in extension_decls]), "h", header_includes)
write_file("2_0_EXT", "extension", template_entry_point_source,
"\n".join([item for item in extension_defs]), "cpp", source_includes)
sorted_cmd_names = ["Invalid"] + [cmd[2:] for cmd in sorted(all_cmd_names)] sorted_cmd_names = ["Invalid"] + [cmd[2:] for cmd in sorted(all_cmd_names)]
......
...@@ -2196,7 +2196,7 @@ bool Context::isContextLost() ...@@ -2196,7 +2196,7 @@ bool Context::isContextLost()
return mContextLost; return mContextLost;
} }
GLenum Context::getResetStatus() GLenum Context::getGraphicsResetStatus()
{ {
// Even if the application doesn't want to know about resets, we want to know // Even if the application doesn't want to know about resets, we want to know
// as it will allow us to skip all the calls. // as it will allow us to skip all the calls.
...@@ -5799,18 +5799,23 @@ GLboolean Context::testFenceNV(GLuint fence) ...@@ -5799,18 +5799,23 @@ GLboolean Context::testFenceNV(GLuint fence)
return result; return result;
} }
void Context::eGLImageTargetTexture2DOES(GLenum target, GLeglImageOES image) void Context::eGLImageTargetTexture2D(GLenum target, GLeglImageOES image)
{ {
Texture *texture = getTargetTexture(target); Texture *texture = getTargetTexture(target);
egl::Image *imageObject = reinterpret_cast<egl::Image *>(image); egl::Image *imageObject = reinterpret_cast<egl::Image *>(image);
handleError(texture->setEGLImageTarget(this, target, imageObject)); handleError(texture->setEGLImageTarget(this, target, imageObject));
} }
void Context::eGLImageTargetRenderbufferStorageOES(GLenum target, GLeglImageOES image) void Context::eGLImageTargetRenderbufferStorage(GLenum target, GLeglImageOES image)
{ {
Renderbuffer *renderbuffer = mGLState.getCurrentRenderbuffer(); Renderbuffer *renderbuffer = mGLState.getCurrentRenderbuffer();
egl::Image *imageObject = reinterpret_cast<egl::Image *>(image); egl::Image *imageObject = reinterpret_cast<egl::Image *>(image);
handleError(renderbuffer->setStorageEGLImageTarget(this, imageObject)); handleError(renderbuffer->setStorageEGLImageTarget(this, imageObject));
} }
void Context::texStorage1D(GLenum target, GLsizei levels, GLenum internalformat, GLsizei width)
{
UNIMPLEMENTED();
}
} // namespace gl } // namespace gl
...@@ -983,8 +983,30 @@ class Context final : public ValidationContext ...@@ -983,8 +983,30 @@ class Context final : public ValidationContext
GLenum type, GLenum type,
GLsizei bufSize, GLsizei bufSize,
void *data); void *data);
void eGLImageTargetTexture2DOES(GLenum target, GLeglImageOES image); void eGLImageTargetTexture2D(GLenum target, GLeglImageOES image);
void eGLImageTargetRenderbufferStorageOES(GLenum target, GLeglImageOES image); void eGLImageTargetRenderbufferStorage(GLenum target, GLeglImageOES image);
void getFramebufferParameteriv(GLenum target, GLenum pname, GLint *params);
void framebufferParameteri(GLenum target, GLenum pname, GLint param);
void dispatchCompute(GLuint numGroupsX, GLuint numGroupsY, GLuint numGroupsZ);
void dispatchComputeIndirect(GLintptr indirect);
void texStorage1D(GLenum target, GLsizei levels, GLenum internalformat, GLsizei width);
void texStorage2D(GLenum target,
GLsizei levels,
GLenum internalFormat,
GLsizei width,
GLsizei height);
void texStorage3D(GLenum target,
GLsizei levels,
GLenum internalFormat,
GLsizei width,
GLsizei height,
GLsizei depth);
void memoryBarrier(GLbitfield barriers);
void memoryBarrierByRegion(GLbitfield barriers);
// Consumes the error. // Consumes the error.
void handleError(const Error &error) override; void handleError(const Error &error) override;
...@@ -992,7 +1014,7 @@ class Context final : public ValidationContext ...@@ -992,7 +1014,7 @@ class Context final : public ValidationContext
GLenum getError(); GLenum getError();
void markContextLost(); void markContextLost();
bool isContextLost(); bool isContextLost();
GLenum getResetStatus(); GLenum getGraphicsResetStatus();
bool isResetNotificationEnabled(); bool isResetNotificationEnabled();
const egl::Config *getConfig() const; const egl::Config *getConfig() const;
...@@ -1011,36 +1033,16 @@ class Context final : public ValidationContext ...@@ -1011,36 +1033,16 @@ class Context final : public ValidationContext
rx::ContextImpl *getImplementation() const { return mImplementation.get(); } rx::ContextImpl *getImplementation() const { return mImplementation.get(); }
const Workarounds &getWorkarounds() const; const Workarounds &getWorkarounds() const;
void getFramebufferParameteriv(GLenum target, GLenum pname, GLint *params);
void framebufferParameteri(GLenum target, GLenum pname, GLint param);
Error getScratchBuffer(size_t requestedSizeBytes, angle::MemoryBuffer **scratchBufferOut) const; Error getScratchBuffer(size_t requestedSizeBytes, angle::MemoryBuffer **scratchBufferOut) const;
Error getZeroFilledBuffer(size_t requstedSizeBytes, angle::MemoryBuffer **zeroBufferOut) const; Error getZeroFilledBuffer(size_t requstedSizeBytes, angle::MemoryBuffer **zeroBufferOut) const;
Error prepareForDispatch(); Error prepareForDispatch();
void dispatchCompute(GLuint numGroupsX, GLuint numGroupsY, GLuint numGroupsZ);
void dispatchComputeIndirect(GLintptr indirect);
MemoryProgramCache *getMemoryProgramCache() const { return mMemoryProgramCache; } MemoryProgramCache *getMemoryProgramCache() const { return mMemoryProgramCache; }
template <EntryPoint EP, typename... ParamsT> template <EntryPoint EP, typename... ParamsT>
void gatherParams(ParamsT &&... params); void gatherParams(ParamsT &&... params);
void texStorage2D(GLenum target,
GLsizei levels,
GLenum internalFormat,
GLsizei width,
GLsizei height);
void texStorage3D(GLenum target,
GLsizei levels,
GLenum internalFormat,
GLsizei width,
GLsizei height,
GLsizei depth);
void memoryBarrier(GLbitfield barriers);
void memoryBarrierByRegion(GLbitfield barriers);
// Notification for a state change in a Texture. // Notification for a state change in a Texture.
void onTextureChange(const Texture *texture); void onTextureChange(const Texture *texture);
......
...@@ -20,6 +20,7 @@ enum class EntryPoint ...@@ -20,6 +20,7 @@ enum class EntryPoint
ActiveTexture, ActiveTexture,
AttachShader, AttachShader,
BeginQuery, BeginQuery,
BeginQueryEXT,
BeginTransformFeedback, BeginTransformFeedback,
BindAttribLocation, BindAttribLocation,
BindBuffer, BindBuffer,
...@@ -33,6 +34,7 @@ enum class EntryPoint ...@@ -33,6 +34,7 @@ enum class EntryPoint
BindTexture, BindTexture,
BindTransformFeedback, BindTransformFeedback,
BindVertexArray, BindVertexArray,
BindVertexArrayOES,
BindVertexBuffer, BindVertexBuffer,
BlendColor, BlendColor,
BlendEquation, BlendEquation,
...@@ -40,6 +42,7 @@ enum class EntryPoint ...@@ -40,6 +42,7 @@ enum class EntryPoint
BlendFunc, BlendFunc,
BlendFuncSeparate, BlendFuncSeparate,
BlitFramebuffer, BlitFramebuffer,
BlitFramebufferANGLE,
BufferData, BufferData,
BufferSubData, BufferSubData,
CheckFramebufferStatus, CheckFramebufferStatus,
...@@ -66,11 +69,16 @@ enum class EntryPoint ...@@ -66,11 +69,16 @@ enum class EntryPoint
CreateShader, CreateShader,
CreateShaderProgramv, CreateShaderProgramv,
CullFace, CullFace,
DebugMessageCallbackKHR,
DebugMessageControlKHR,
DebugMessageInsertKHR,
DeleteBuffers, DeleteBuffers,
DeleteFencesNV,
DeleteFramebuffers, DeleteFramebuffers,
DeleteProgram, DeleteProgram,
DeleteProgramPipelines, DeleteProgramPipelines,
DeleteQueries, DeleteQueries,
DeleteQueriesEXT,
DeleteRenderbuffers, DeleteRenderbuffers,
DeleteSamplers, DeleteSamplers,
DeleteShader, DeleteShader,
...@@ -78,45 +86,57 @@ enum class EntryPoint ...@@ -78,45 +86,57 @@ enum class EntryPoint
DeleteTextures, DeleteTextures,
DeleteTransformFeedbacks, DeleteTransformFeedbacks,
DeleteVertexArrays, DeleteVertexArrays,
DeleteVertexArraysOES,
DepthFunc, DepthFunc,
DepthMask, DepthMask,
DepthRangef, DepthRangef,
DetachShader, DetachShader,
Disable, Disable,
DisableVertexAttribArray, DisableVertexAttribArray,
DiscardFramebufferEXT,
DispatchCompute, DispatchCompute,
DispatchComputeIndirect, DispatchComputeIndirect,
DrawArrays, DrawArrays,
DrawArraysIndirect, DrawArraysIndirect,
DrawArraysInstanced, DrawArraysInstanced,
DrawArraysInstancedANGLE,
DrawBuffers, DrawBuffers,
DrawBuffersEXT,
DrawElements, DrawElements,
DrawElementsIndirect, DrawElementsIndirect,
DrawElementsInstanced, DrawElementsInstanced,
DrawElementsInstancedANGLE, DrawElementsInstancedANGLE,
DrawRangeElements, DrawRangeElements,
EGLImageTargetRenderbufferStorageOES,
EGLImageTargetTexture2DOES,
Enable, Enable,
EnableVertexAttribArray, EnableVertexAttribArray,
EndQuery, EndQuery,
EndQueryEXT,
EndTransformFeedback, EndTransformFeedback,
FenceSync, FenceSync,
Finish, Finish,
FinishFenceNV,
Flush, Flush,
FlushMappedBufferRange, FlushMappedBufferRange,
FlushMappedBufferRangeEXT,
FramebufferParameteri, FramebufferParameteri,
FramebufferRenderbuffer, FramebufferRenderbuffer,
FramebufferTexture2D, FramebufferTexture2D,
FramebufferTextureLayer, FramebufferTextureLayer,
FrontFace, FrontFace,
GenBuffers, GenBuffers,
GenFencesNV,
GenFramebuffers, GenFramebuffers,
GenProgramPipelines, GenProgramPipelines,
GenQueries, GenQueries,
GenQueriesEXT,
GenRenderbuffers, GenRenderbuffers,
GenSamplers, GenSamplers,
GenTextures, GenTextures,
GenTransformFeedbacks, GenTransformFeedbacks,
GenVertexArrays, GenVertexArrays,
GenVertexArraysOES,
GenerateMipmap, GenerateMipmap,
GetActiveAttrib, GetActiveAttrib,
GetActiveUniform, GetActiveUniform,
...@@ -130,18 +150,26 @@ enum class EntryPoint ...@@ -130,18 +150,26 @@ enum class EntryPoint
GetBufferParameteri64v, GetBufferParameteri64v,
GetBufferParameteriv, GetBufferParameteriv,
GetBufferPointerv, GetBufferPointerv,
GetBufferPointervOES,
GetDebugMessageLogKHR,
GetError, GetError,
GetFenceivNV,
GetFloatv, GetFloatv,
GetFragDataLocation, GetFragDataLocation,
GetFramebufferAttachmentParameteriv, GetFramebufferAttachmentParameteriv,
GetFramebufferParameteriv, GetFramebufferParameteriv,
GetGraphicsResetStatusEXT,
GetInteger64i_v, GetInteger64i_v,
GetInteger64v, GetInteger64v,
GetIntegeri_v, GetIntegeri_v,
GetIntegerv, GetIntegerv,
GetInternalformativ, GetInternalformativ,
GetMultisamplefv, GetMultisamplefv,
GetObjectLabelKHR,
GetObjectPtrLabelKHR,
GetPointervKHR,
GetProgramBinary, GetProgramBinary,
GetProgramBinaryOES,
GetProgramInfoLog, GetProgramInfoLog,
GetProgramInterfaceiv, GetProgramInterfaceiv,
GetProgramPipelineInfoLog, GetProgramPipelineInfoLog,
...@@ -151,8 +179,13 @@ enum class EntryPoint ...@@ -151,8 +179,13 @@ enum class EntryPoint
GetProgramResourceName, GetProgramResourceName,
GetProgramResourceiv, GetProgramResourceiv,
GetProgramiv, GetProgramiv,
GetQueryObjecti64vEXT,
GetQueryObjectivEXT,
GetQueryObjectui64vEXT,
GetQueryObjectuiv, GetQueryObjectuiv,
GetQueryObjectuivEXT,
GetQueryiv, GetQueryiv,
GetQueryivEXT,
GetRenderbufferParameteriv, GetRenderbufferParameteriv,
GetSamplerParameterfv, GetSamplerParameterfv,
GetSamplerParameteriv, GetSamplerParameteriv,
...@@ -168,6 +201,7 @@ enum class EntryPoint ...@@ -168,6 +201,7 @@ enum class EntryPoint
GetTexParameterfv, GetTexParameterfv,
GetTexParameteriv, GetTexParameteriv,
GetTransformFeedbackVarying, GetTransformFeedbackVarying,
GetTranslatedShaderSourceANGLE,
GetUniformBlockIndex, GetUniformBlockIndex,
GetUniformIndices, GetUniformIndices,
GetUniformLocation, GetUniformLocation,
...@@ -179,15 +213,20 @@ enum class EntryPoint ...@@ -179,15 +213,20 @@ enum class EntryPoint
GetVertexAttribPointerv, GetVertexAttribPointerv,
GetVertexAttribfv, GetVertexAttribfv,
GetVertexAttribiv, GetVertexAttribiv,
GetnUniformfvEXT,
GetnUniformivEXT,
Hint, Hint,
InsertEventMarkerEXT,
InvalidateFramebuffer, InvalidateFramebuffer,
InvalidateSubFramebuffer, InvalidateSubFramebuffer,
IsBuffer, IsBuffer,
IsEnabled, IsEnabled,
IsFenceNV,
IsFramebuffer, IsFramebuffer,
IsProgram, IsProgram,
IsProgramPipeline, IsProgramPipeline,
IsQuery, IsQuery,
IsQueryEXT,
IsRenderbuffer, IsRenderbuffer,
IsSampler, IsSampler,
IsShader, IsShader,
...@@ -195,15 +234,23 @@ enum class EntryPoint ...@@ -195,15 +234,23 @@ enum class EntryPoint
IsTexture, IsTexture,
IsTransformFeedback, IsTransformFeedback,
IsVertexArray, IsVertexArray,
IsVertexArrayOES,
LineWidth, LineWidth,
LinkProgram, LinkProgram,
MapBufferOES,
MapBufferRange, MapBufferRange,
MapBufferRangeEXT,
MemoryBarrier, MemoryBarrier,
MemoryBarrierByRegion, MemoryBarrierByRegion,
ObjectLabelKHR,
ObjectPtrLabelKHR,
PauseTransformFeedback, PauseTransformFeedback,
PixelStorei, PixelStorei,
PolygonOffset, PolygonOffset,
PopDebugGroupKHR,
PopGroupMarkerEXT,
ProgramBinary, ProgramBinary,
ProgramBinaryOES,
ProgramParameteri, ProgramParameteri,
ProgramUniform1f, ProgramUniform1f,
ProgramUniform1fv, ProgramUniform1fv,
...@@ -238,11 +285,16 @@ enum class EntryPoint ...@@ -238,11 +285,16 @@ enum class EntryPoint
ProgramUniformMatrix4fv, ProgramUniformMatrix4fv,
ProgramUniformMatrix4x2fv, ProgramUniformMatrix4x2fv,
ProgramUniformMatrix4x3fv, ProgramUniformMatrix4x3fv,
PushDebugGroupKHR,
PushGroupMarkerEXT,
QueryCounterEXT,
ReadBuffer, ReadBuffer,
ReadPixels, ReadPixels,
ReadnPixelsEXT,
ReleaseShaderCompiler, ReleaseShaderCompiler,
RenderbufferStorage, RenderbufferStorage,
RenderbufferStorageMultisample, RenderbufferStorageMultisample,
RenderbufferStorageMultisampleANGLE,
ResumeTransformFeedback, ResumeTransformFeedback,
SampleCoverage, SampleCoverage,
SampleMaski, SampleMaski,
...@@ -251,6 +303,7 @@ enum class EntryPoint ...@@ -251,6 +303,7 @@ enum class EntryPoint
SamplerParameteri, SamplerParameteri,
SamplerParameteriv, SamplerParameteriv,
Scissor, Scissor,
SetFenceNV,
ShaderBinary, ShaderBinary,
ShaderSource, ShaderSource,
StencilFunc, StencilFunc,
...@@ -259,15 +312,19 @@ enum class EntryPoint ...@@ -259,15 +312,19 @@ enum class EntryPoint
StencilMaskSeparate, StencilMaskSeparate,
StencilOp, StencilOp,
StencilOpSeparate, StencilOpSeparate,
TestFenceNV,
TexImage2D, TexImage2D,
TexImage3D, TexImage3D,
TexParameterf, TexParameterf,
TexParameterfv, TexParameterfv,
TexParameteri, TexParameteri,
TexParameteriv, TexParameteriv,
TexStorage1DEXT,
TexStorage2D, TexStorage2D,
TexStorage2DEXT,
TexStorage2DMultisample, TexStorage2DMultisample,
TexStorage3D, TexStorage3D,
TexStorage3DEXT,
TexSubImage2D, TexSubImage2D,
TexSubImage3D, TexSubImage3D,
TransformFeedbackVaryings, TransformFeedbackVaryings,
...@@ -306,6 +363,7 @@ enum class EntryPoint ...@@ -306,6 +363,7 @@ enum class EntryPoint
UniformMatrix4x2fv, UniformMatrix4x2fv,
UniformMatrix4x3fv, UniformMatrix4x3fv,
UnmapBuffer, UnmapBuffer,
UnmapBufferOES,
UseProgram, UseProgram,
UseProgramStages, UseProgramStages,
ValidateProgram, ValidateProgram,
...@@ -320,6 +378,7 @@ enum class EntryPoint ...@@ -320,6 +378,7 @@ enum class EntryPoint
VertexAttrib4fv, VertexAttrib4fv,
VertexAttribBinding, VertexAttribBinding,
VertexAttribDivisor, VertexAttribDivisor,
VertexAttribDivisorANGLE,
VertexAttribFormat, VertexAttribFormat,
VertexAttribI4i, VertexAttribI4i,
VertexAttribI4iv, VertexAttribI4iv,
......
...@@ -217,6 +217,13 @@ struct DefaultReturnValue<EntryPoint::ClientWaitSync, GLenum> ...@@ -217,6 +217,13 @@ struct DefaultReturnValue<EntryPoint::ClientWaitSync, GLenum>
static constexpr GLenum kValue = GL_WAIT_FAILED; static constexpr GLenum kValue = GL_WAIT_FAILED;
}; };
// glTestFenceNV should still return TRUE for an invalid fence.
template <>
struct DefaultReturnValue<EntryPoint::TestFenceNV, GLboolean>
{
static constexpr GLboolean kValue = GL_TRUE;
};
template <EntryPoint EP, typename ReturnType> template <EntryPoint EP, typename ReturnType>
constexpr ANGLE_INLINE ReturnType GetDefaultReturnValue() constexpr ANGLE_INLINE ReturnType GetDefaultReturnValue()
{ {
......
...@@ -6646,4 +6646,39 @@ bool ValidatePopGroupMarkerEXT(Context *context) ...@@ -6646,4 +6646,39 @@ bool ValidatePopGroupMarkerEXT(Context *context)
return true; return true;
} }
bool ValidateTexStorage1DEXT(Context *context,
GLenum target,
GLsizei levels,
GLenum internalformat,
GLsizei width)
{
UNIMPLEMENTED();
ANGLE_VALIDATION_ERR(context, InvalidOperation(), ExtensionNotEnabled);
return false;
}
bool ValidateTexStorage3DEXT(Context *context,
GLenum target,
GLsizei levels,
GLenum internalformat,
GLsizei width,
GLsizei height,
GLsizei depth)
{
if (!context->getExtensions().textureStorage)
{
ANGLE_VALIDATION_ERR(context, InvalidOperation(), ExtensionNotEnabled);
return false;
}
if (context->getClientMajorVersion() < 3)
{
ANGLE_VALIDATION_ERR(context, InvalidOperation(), ExtensionNotEnabled);
return false;
}
return ValidateES3TexStorage3DParameters(context, target, levels, internalformat, width, height,
depth);
}
} // namespace gl } // namespace gl
...@@ -720,6 +720,18 @@ bool ValidateTexImage3DOES(Context *context, ...@@ -720,6 +720,18 @@ bool ValidateTexImage3DOES(Context *context,
GLenum type, GLenum type,
const void *pixels); const void *pixels);
bool ValidatePopGroupMarkerEXT(Context *context); bool ValidatePopGroupMarkerEXT(Context *context);
bool ValidateTexStorage1DEXT(Context *context,
GLenum target,
GLsizei levels,
GLenum internalformat,
GLsizei width);
bool ValidateTexStorage3DEXT(Context *context,
GLenum target,
GLsizei levels,
GLenum internalformat,
GLsizei width,
GLsizei height,
GLsizei depth);
} // namespace gl } // namespace gl
......
...@@ -826,6 +826,8 @@ ...@@ -826,6 +826,8 @@
'libGLESv2/entry_points_gles_2_0_autogen.h', 'libGLESv2/entry_points_gles_2_0_autogen.h',
'libGLESv2/entry_points_gles_2_0_ext.cpp', 'libGLESv2/entry_points_gles_2_0_ext.cpp',
'libGLESv2/entry_points_gles_2_0_ext.h', 'libGLESv2/entry_points_gles_2_0_ext.h',
'libGLESv2/entry_points_gles_2_0_ext_autogen.cpp',
'libGLESv2/entry_points_gles_2_0_ext_autogen.h',
'libGLESv2/entry_points_gles_3_0_autogen.cpp', 'libGLESv2/entry_points_gles_3_0_autogen.cpp',
'libGLESv2/entry_points_gles_3_0_autogen.h', 'libGLESv2/entry_points_gles_3_0_autogen.h',
'libGLESv2/entry_points_gles_3_1_autogen.cpp', 'libGLESv2/entry_points_gles_3_1_autogen.cpp',
......
...@@ -31,6 +31,7 @@ template_cpp = """// GENERATED FILE - DO NOT EDIT. ...@@ -31,6 +31,7 @@ template_cpp = """// GENERATED FILE - DO NOT EDIT.
#include "libGLESv2/entry_points_egl_ext.h" #include "libGLESv2/entry_points_egl_ext.h"
#include "libGLESv2/entry_points_gles_2_0_autogen.h" #include "libGLESv2/entry_points_gles_2_0_autogen.h"
#include "libGLESv2/entry_points_gles_2_0_ext.h" #include "libGLESv2/entry_points_gles_2_0_ext.h"
#include "libGLESv2/entry_points_gles_2_0_ext_autogen.h"
#include "libGLESv2/entry_points_gles_3_0_autogen.h" #include "libGLESv2/entry_points_gles_3_0_autogen.h"
#include "libGLESv2/entry_points_gles_3_1_autogen.h" #include "libGLESv2/entry_points_gles_3_1_autogen.h"
#include "platform/Platform.h" #include "platform/Platform.h"
......
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
#include "libGLESv2/entry_points_gles_2_0_autogen.h" #include "libGLESv2/entry_points_gles_2_0_autogen.h"
#include "libGLESv2/entry_points_gles_2_0_ext.h" #include "libGLESv2/entry_points_gles_2_0_ext.h"
#include "libGLESv2/entry_points_gles_2_0_ext_autogen.h"
#include "libGLESv2/entry_points_gles_3_0_autogen.h" #include "libGLESv2/entry_points_gles_3_0_autogen.h"
#include "libGLESv2/entry_points_gles_3_1_autogen.h" #include "libGLESv2/entry_points_gles_3_1_autogen.h"
......
// GENERATED FILE - DO NOT EDIT. // GENERATED FILE - DO NOT EDIT.
// Generated by ./gen_proc_table.py using data from proc_table_data.json. // Generated by gen_proc_table.py using data from proc_table_data.json.
// //
// Copyright 2017 The ANGLE Project Authors. All rights reserved. // Copyright 2017 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
#include "libGLESv2/entry_points_egl_ext.h" #include "libGLESv2/entry_points_egl_ext.h"
#include "libGLESv2/entry_points_gles_2_0_autogen.h" #include "libGLESv2/entry_points_gles_2_0_autogen.h"
#include "libGLESv2/entry_points_gles_2_0_ext.h" #include "libGLESv2/entry_points_gles_2_0_ext.h"
#include "libGLESv2/entry_points_gles_2_0_ext_autogen.h"
#include "libGLESv2/entry_points_gles_3_0_autogen.h" #include "libGLESv2/entry_points_gles_3_0_autogen.h"
#include "libGLESv2/entry_points_gles_3_1_autogen.h" #include "libGLESv2/entry_points_gles_3_1_autogen.h"
#include "platform/Platform.h" #include "platform/Platform.h"
......
...@@ -70,8 +70,8 @@ TEST_P(FenceNVTest, Errors) ...@@ -70,8 +70,8 @@ TEST_P(FenceNVTest, Errors)
return; return;
} }
// glTestFenceNV should still return TRUE for an invalid fence and generate an INVALID_OPERATION EXPECT_GL_TRUE(glTestFenceNV(10)) << "glTestFenceNV should still return TRUE for an invalid "
EXPECT_GL_TRUE(glTestFenceNV(10)); "fence and generate an INVALID_OPERATION";
EXPECT_GL_ERROR(GL_INVALID_OPERATION); EXPECT_GL_ERROR(GL_INVALID_OPERATION);
GLuint fence = 20; GLuint fence = 20;
...@@ -85,8 +85,8 @@ TEST_P(FenceNVTest, Errors) ...@@ -85,8 +85,8 @@ TEST_P(FenceNVTest, Errors)
glGenFencesNV(1, &fence); glGenFencesNV(1, &fence);
EXPECT_GL_NO_ERROR(); EXPECT_GL_NO_ERROR();
// glTestFenceNV should still return TRUE for a fence that is not started and generate an INVALID_OPERATION EXPECT_GL_TRUE(glTestFenceNV(fence)) << "glTestFenceNV should still return TRUE for a fence "
EXPECT_GL_TRUE(glTestFenceNV(fence)); "that is not started and generate an INVALID_OPERATION";
EXPECT_GL_ERROR(GL_INVALID_OPERATION); EXPECT_GL_ERROR(GL_INVALID_OPERATION);
// glGetFenceivNV should generate an INVALID_OPERATION for an invalid or unstarted fence and not modify the params // glGetFenceivNV should generate an INVALID_OPERATION for an invalid or unstarted fence and not modify the params
......
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