Commit ee769dd2 by Jamie Madill Committed by Commit Bot

GLES2: Auto-generate entry points file.

BUG=angleproject:1309 Change-Id: I7817444c3ea56f932fe769a860f4a70b29262019 Reviewed-on: https://chromium-review.googlesource.com/483427Reviewed-by: 's avatarCorentin Wallez <cwallez@chromium.org> Reviewed-by: 's avatarGeoff Lang <geofflang@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
parent aa7203ef
...@@ -44,10 +44,76 @@ namespace gl ...@@ -44,10 +44,76 @@ namespace gl
#endif // LIBGLESV2_ENTRYPOINTSGLES{major_version}{minor_version}_AUTOGEN_H_ #endif // LIBGLESV2_ENTRYPOINTSGLES{major_version}{minor_version}_AUTOGEN_H_
""" """
template_entry_point_source = """// GENERATED FILE - DO NOT EDIT.
// Generated by {script_name} using data from {data_source_name}.
//
// Copyright {year} The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
// entry_points_gles_{major_version}_{minor_version}_autogen.cpp:
// Defines the GLES {major_version}.{minor_version} entry points.
#include "libGLESv2/entry_points_gles_{major_version}_{minor_version}_autogen.h"
#include "common/debug.h"
#include "libANGLE/Context.h"
#include "libANGLE/validationES2.h"
#include "libGLESv2/global_state.h"
namespace gl
{{
{entry_points}}} // namespace gl
"""
template_entry_points_enum_header = """// GENERATED FILE - DO NOT EDIT.
// Generated by {script_name} using data from {data_source_name}.
//
// Copyright {year} The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
// entry_points_enum_autogen.h:
// Defines the GLES entry points enumeration.
#ifndef LIBGLESV2_ENTRYPOINTSENUM_AUTOGEN_H_
#define LIBGLESV2_ENTRYPOINTSENUM_AUTOGEN_H_
namespace gl
{{
enum class EntryPoint
{{
{entry_points_list}
}};
}} // namespace gl
#endif // LIBGLESV2_ENTRY_POINTS_ENUM_AUTOGEN_H_
"""
template_entry_point_decl = """ANGLE_EXPORT {return_type}GL_APIENTRY {name}({params});""" template_entry_point_decl = """ANGLE_EXPORT {return_type}GL_APIENTRY {name}({params});"""
template_entry_point_def = """{return_type}GL_APIENTRY {name}({params})
{{
EVENT("({format_params})"{comma_if_needed}{pass_params});
Context *context = GetValidGlobalContext();
if (context)
{{
context->gatherParams<EntryPoint::{name}>({pass_params});
if (!context->skipValidation() && !Validate{name}({validate_params}))
{{
return{default_return};
}}
{return_if_needed}context->{name_lower}({pass_params});
}}
{default_return_if_needed}}}
"""
commands = root.find(".//commands[@namespace='GL']") commands = root.find(".//commands[@namespace='GL']")
entry_point_decls_gles_2_0 = [] entry_point_decls_gles_2_0 = []
entry_point_defs_gles_2_0 = []
cmd_names = []
def format_entry_point_decl(cmd_name, proto, params): def format_entry_point_decl(cmd_name, proto, params):
return template_entry_point_decl.format( return template_entry_point_decl.format(
...@@ -55,12 +121,73 @@ def format_entry_point_decl(cmd_name, proto, params): ...@@ -55,12 +121,73 @@ def format_entry_point_decl(cmd_name, proto, params):
return_type = proto[:-len(cmd_name)], return_type = proto[:-len(cmd_name)],
params = ", ".join(params)) params = ", ".join(params))
def type_name_sep_index(param):
space = param.rfind(" ")
pointer = param.rfind("*")
return max(space, pointer)
def just_the_type(param):
return param[:type_name_sep_index(param)]
def just_the_name(param):
return param[type_name_sep_index(param)+1:]
format_dict = {
"GLbitfield": "0x%X",
"GLboolean": "%u",
"GLenum": "0x%X",
"GLfloat": "%f",
"GLint": "%d",
"GLintptr": "%d",
"GLsizei": "%d",
"GLsizeiptr": "%d",
"GLuint": "%d"
}
def param_format_string(param):
if "*" in param:
return param + " = 0x%0.8p"
else:
return param + " = " + format_dict[just_the_type(param)]
def default_return_value(return_type):
if return_type == "void":
return ""
elif return_type == "GLenum" or return_type == "GLint" or return_type == "GLuint":
return "0"
elif return_type == "GLboolean":
return "GL_FALSE"
elif "*" in return_type:
return "nullptr"
else:
print(return_type)
def format_entry_point_def(cmd_name, proto, params):
pass_params = [just_the_name(param) for param in params]
format_params = [param_format_string(param) for param in params]
return_type = proto[:-len(cmd_name)]
default_return = default_return_value(return_type.strip())
return template_entry_point_def.format(
name = cmd_name[2:],
name_lower = cmd_name[2:3].lower() + cmd_name[3:],
return_type = return_type,
params = ", ".join(params),
pass_params = ", ".join(pass_params),
comma_if_needed = ", " if len(params) > 0 else "",
validate_params = ", ".join(["context"] + pass_params),
format_params = ", ".join(format_params),
default_return = "" if default_return == "" else " " + default_return,
return_if_needed = "" if default_return == "" else "return ",
default_return_if_needed = "" if default_return == "" else " return " + default_return + ";\n")
for cmd_name in gles2_commands: for cmd_name in gles2_commands:
command_xpath = "command/proto[name='" + cmd_name + "']/.." command_xpath = "command/proto[name='" + cmd_name + "']/.."
command = commands.find(command_xpath) command = commands.find(command_xpath)
params = ["".join(param.itertext()) for param in command.findall("./param")] params = ["".join(param.itertext()) for param in command.findall("./param")]
proto = "".join(command.find("./proto").itertext()) proto = "".join(command.find("./proto").itertext())
cmd_names += [cmd_name]
entry_point_decls_gles_2_0 += [format_entry_point_decl(cmd_name, proto, params)] entry_point_decls_gles_2_0 += [format_entry_point_decl(cmd_name, proto, params)]
entry_point_defs_gles_2_0 += [format_entry_point_def(cmd_name, proto, params)]
gles_2_0_header = template_entry_point_header.format( gles_2_0_header = template_entry_point_header.format(
script_name = os.path.basename(sys.argv[0]), script_name = os.path.basename(sys.argv[0]),
...@@ -70,11 +197,37 @@ gles_2_0_header = template_entry_point_header.format( ...@@ -70,11 +197,37 @@ gles_2_0_header = template_entry_point_header.format(
minor_version = 0, minor_version = 0,
entry_points = "\n".join(entry_point_decls_gles_2_0)) entry_points = "\n".join(entry_point_decls_gles_2_0))
gles_2_0_source = template_entry_point_source.format(
script_name = os.path.basename(sys.argv[0]),
data_source_name = "gl.xml",
year = date.today().year,
major_version = 2,
minor_version = 0,
entry_points = "\n".join(entry_point_defs_gles_2_0))
# TODO(jmadill): Remove manually added entry points.
manual_cmd_names = ["Invalid"] + [cmd[2:] for cmd in cmd_names] + ["DrawElementsInstanced", "DrawRangeElements", "DrawElementsInstancedANGLE"]
entry_points_enum = template_entry_points_enum_header.format(
script_name = os.path.basename(sys.argv[0]),
data_source_name = "gl.xml",
year = date.today().year,
entry_points_list = ",\n".join([" " + cmd for cmd in manual_cmd_names]))
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)
gles_2_0_header_path = path_to("libGLESv2", "entry_points_gles_2_0_autogen.h") gles_2_0_header_path = path_to("libGLESv2", "entry_points_gles_2_0_autogen.h")
gles_2_0_source_path = path_to("libGLESv2", "entry_points_gles_2_0_autogen.cpp")
entry_points_enum_header_path = path_to("libANGLE", "entry_points_enum_autogen.h")
with open(gles_2_0_header_path, "w") as out: with open(gles_2_0_header_path, "w") as out:
out.write(gles_2_0_header) out.write(gles_2_0_header)
out.close() out.close()
with open(gles_2_0_source_path, "w") as out:
out.write(gles_2_0_source)
out.close()
with open(entry_points_enum_header_path, "w") as out:
out.write(entry_points_enum)
out.close()
\ No newline at end of file
// GENERATED FILE - DO NOT EDIT.
// Generated by generate_entry_points.py using data from gl.xml.
//
// Copyright 2017 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
// entry_points_enum_autogen.h:
// Defines the GLES entry points enumeration.
#ifndef LIBGLESV2_ENTRYPOINTSENUM_AUTOGEN_H_
#define LIBGLESV2_ENTRYPOINTSENUM_AUTOGEN_H_
namespace gl
{
enum class EntryPoint
{
Invalid,
ActiveTexture,
AttachShader,
BindAttribLocation,
BindBuffer,
BindFramebuffer,
BindRenderbuffer,
BindTexture,
BlendColor,
BlendEquation,
BlendEquationSeparate,
BlendFunc,
BlendFuncSeparate,
BufferData,
BufferSubData,
CheckFramebufferStatus,
Clear,
ClearColor,
ClearDepthf,
ClearStencil,
ColorMask,
CompileShader,
CompressedTexImage2D,
CompressedTexSubImage2D,
CopyTexImage2D,
CopyTexSubImage2D,
CreateProgram,
CreateShader,
CullFace,
DeleteBuffers,
DeleteFramebuffers,
DeleteProgram,
DeleteRenderbuffers,
DeleteShader,
DeleteTextures,
DepthFunc,
DepthMask,
DepthRangef,
DetachShader,
Disable,
DisableVertexAttribArray,
DrawArrays,
DrawElements,
Enable,
EnableVertexAttribArray,
Finish,
Flush,
FramebufferRenderbuffer,
FramebufferTexture2D,
FrontFace,
GenBuffers,
GenerateMipmap,
GenFramebuffers,
GenRenderbuffers,
GenTextures,
GetActiveAttrib,
GetActiveUniform,
GetAttachedShaders,
GetAttribLocation,
GetBooleanv,
GetBufferParameteriv,
GetError,
GetFloatv,
GetFramebufferAttachmentParameteriv,
GetIntegerv,
GetProgramiv,
GetProgramInfoLog,
GetRenderbufferParameteriv,
GetShaderiv,
GetShaderInfoLog,
GetShaderPrecisionFormat,
GetShaderSource,
GetString,
GetTexParameterfv,
GetTexParameteriv,
GetUniformfv,
GetUniformiv,
GetUniformLocation,
GetVertexAttribfv,
GetVertexAttribiv,
GetVertexAttribPointerv,
Hint,
IsBuffer,
IsEnabled,
IsFramebuffer,
IsProgram,
IsRenderbuffer,
IsShader,
IsTexture,
LineWidth,
LinkProgram,
PixelStorei,
PolygonOffset,
ReadPixels,
ReleaseShaderCompiler,
RenderbufferStorage,
SampleCoverage,
Scissor,
ShaderBinary,
ShaderSource,
StencilFunc,
StencilFuncSeparate,
StencilMask,
StencilMaskSeparate,
StencilOp,
StencilOpSeparate,
TexImage2D,
TexParameterf,
TexParameterfv,
TexParameteri,
TexParameteriv,
TexSubImage2D,
Uniform1f,
Uniform1fv,
Uniform1i,
Uniform1iv,
Uniform2f,
Uniform2fv,
Uniform2i,
Uniform2iv,
Uniform3f,
Uniform3fv,
Uniform3i,
Uniform3iv,
Uniform4f,
Uniform4fv,
Uniform4i,
Uniform4iv,
UniformMatrix2fv,
UniformMatrix3fv,
UniformMatrix4fv,
UseProgram,
ValidateProgram,
VertexAttrib1f,
VertexAttrib1fv,
VertexAttrib2f,
VertexAttrib2fv,
VertexAttrib3f,
VertexAttrib3fv,
VertexAttrib4f,
VertexAttrib4fv,
VertexAttribPointer,
Viewport,
DrawElementsInstanced,
DrawRangeElements,
DrawElementsInstancedANGLE
};
} // namespace gl
#endif // LIBGLESV2_ENTRY_POINTS_ENUM_AUTOGEN_H_
...@@ -14,21 +14,12 @@ ...@@ -14,21 +14,12 @@
#include "common/Optional.h" #include "common/Optional.h"
#include "common/angleutils.h" #include "common/angleutils.h"
#include "common/mathutil.h" #include "common/mathutil.h"
#include "libANGLE/entry_points_enum_autogen.h"
namespace gl namespace gl
{ {
class Context; class Context;
enum class EntryPoint
{
Invalid,
DrawArrays,
DrawElements,
DrawElementsInstanced,
DrawElementsInstancedANGLE,
DrawRangeElements,
};
template <EntryPoint EP> template <EntryPoint EP>
struct EntryPointParam; struct EntryPointParam;
......
...@@ -202,6 +202,7 @@ ...@@ -202,6 +202,7 @@
'libANGLE/angletypes.cpp', 'libANGLE/angletypes.cpp',
'libANGLE/angletypes.h', 'libANGLE/angletypes.h',
'libANGLE/angletypes.inl', 'libANGLE/angletypes.inl',
'libANGLE/entry_points_enum_autogen.h',
'libANGLE/es3_copy_conversion_table_autogen.cpp', 'libANGLE/es3_copy_conversion_table_autogen.cpp',
'libANGLE/features.h', 'libANGLE/features.h',
'libANGLE/format_map_autogen.cpp', 'libANGLE/format_map_autogen.cpp',
...@@ -748,7 +749,7 @@ ...@@ -748,7 +749,7 @@
'libGLESv2/entry_points_egl.h', 'libGLESv2/entry_points_egl.h',
'libGLESv2/entry_points_egl_ext.cpp', 'libGLESv2/entry_points_egl_ext.cpp',
'libGLESv2/entry_points_egl_ext.h', 'libGLESv2/entry_points_egl_ext.h',
'libGLESv2/entry_points_gles_2_0.cpp', 'libGLESv2/entry_points_gles_2_0_autogen.cpp',
'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',
......
// GENERATED FILE - DO NOT EDIT.
// Generated by generate_entry_points.py using data from gl.xml.
// //
// Copyright(c) 2014 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
// found in the LICENSE file. // found in the LICENSE file.
// //
// entry_points_gles_2_0_autogen.cpp:
// entry_points_gles_2_0.cpp : Implements the GLES 2.0 entry points. // Defines the GLES 2.0 entry points.
#include "libGLESv2/entry_points_gles_2_0_autogen.h" #include "libGLESv2/entry_points_gles_2_0_autogen.h"
...@@ -15,7 +17,6 @@ ...@@ -15,7 +17,6 @@
namespace gl namespace gl
{ {
void GL_APIENTRY ActiveTexture(GLenum texture) void GL_APIENTRY ActiveTexture(GLenum texture)
{ {
EVENT("(GLenum texture = 0x%X)", texture); EVENT("(GLenum texture = 0x%X)", texture);
...@@ -23,6 +24,8 @@ void GL_APIENTRY ActiveTexture(GLenum texture) ...@@ -23,6 +24,8 @@ void GL_APIENTRY ActiveTexture(GLenum texture)
Context *context = GetValidGlobalContext(); Context *context = GetValidGlobalContext();
if (context) if (context)
{ {
context->gatherParams<EntryPoint::ActiveTexture>(texture);
if (!context->skipValidation() && !ValidateActiveTexture(context, texture)) if (!context->skipValidation() && !ValidateActiveTexture(context, texture))
{ {
return; return;
...@@ -39,6 +42,8 @@ void GL_APIENTRY AttachShader(GLuint program, GLuint shader) ...@@ -39,6 +42,8 @@ void GL_APIENTRY AttachShader(GLuint program, GLuint shader)
Context *context = GetValidGlobalContext(); Context *context = GetValidGlobalContext();
if (context) if (context)
{ {
context->gatherParams<EntryPoint::AttachShader>(program, shader);
if (!context->skipValidation() && !ValidateAttachShader(context, program, shader)) if (!context->skipValidation() && !ValidateAttachShader(context, program, shader))
{ {
return; return;
...@@ -50,12 +55,14 @@ void GL_APIENTRY AttachShader(GLuint program, GLuint shader) ...@@ -50,12 +55,14 @@ void GL_APIENTRY AttachShader(GLuint program, GLuint shader)
void GL_APIENTRY BindAttribLocation(GLuint program, GLuint index, const GLchar *name) void GL_APIENTRY BindAttribLocation(GLuint program, GLuint index, const GLchar *name)
{ {
EVENT("(GLuint program = %d, GLuint index = %d, const GLchar* name = 0x%0.8p)", program, index, EVENT("(GLuint program = %d, GLuint index = %d, const GLchar *name = 0x%0.8p)", program, index,
name); name);
Context *context = GetValidGlobalContext(); Context *context = GetValidGlobalContext();
if (context) if (context)
{ {
context->gatherParams<EntryPoint::BindAttribLocation>(program, index, name);
if (!context->skipValidation() && if (!context->skipValidation() &&
!ValidateBindAttribLocation(context, program, index, name)) !ValidateBindAttribLocation(context, program, index, name))
{ {
...@@ -73,6 +80,8 @@ void GL_APIENTRY BindBuffer(GLenum target, GLuint buffer) ...@@ -73,6 +80,8 @@ void GL_APIENTRY BindBuffer(GLenum target, GLuint buffer)
Context *context = GetValidGlobalContext(); Context *context = GetValidGlobalContext();
if (context) if (context)
{ {
context->gatherParams<EntryPoint::BindBuffer>(target, buffer);
if (!context->skipValidation() && !ValidateBindBuffer(context, target, buffer)) if (!context->skipValidation() && !ValidateBindBuffer(context, target, buffer))
{ {
return; return;
...@@ -89,6 +98,8 @@ void GL_APIENTRY BindFramebuffer(GLenum target, GLuint framebuffer) ...@@ -89,6 +98,8 @@ void GL_APIENTRY BindFramebuffer(GLenum target, GLuint framebuffer)
Context *context = GetValidGlobalContext(); Context *context = GetValidGlobalContext();
if (context) if (context)
{ {
context->gatherParams<EntryPoint::BindFramebuffer>(target, framebuffer);
if (!context->skipValidation() && !ValidateBindFramebuffer(context, target, framebuffer)) if (!context->skipValidation() && !ValidateBindFramebuffer(context, target, framebuffer))
{ {
return; return;
...@@ -105,6 +116,8 @@ void GL_APIENTRY BindRenderbuffer(GLenum target, GLuint renderbuffer) ...@@ -105,6 +116,8 @@ void GL_APIENTRY BindRenderbuffer(GLenum target, GLuint renderbuffer)
Context *context = GetValidGlobalContext(); Context *context = GetValidGlobalContext();
if (context) if (context)
{ {
context->gatherParams<EntryPoint::BindRenderbuffer>(target, renderbuffer);
if (!context->skipValidation() && !ValidateBindRenderbuffer(context, target, renderbuffer)) if (!context->skipValidation() && !ValidateBindRenderbuffer(context, target, renderbuffer))
{ {
return; return;
...@@ -121,6 +134,8 @@ void GL_APIENTRY BindTexture(GLenum target, GLuint texture) ...@@ -121,6 +134,8 @@ void GL_APIENTRY BindTexture(GLenum target, GLuint texture)
Context *context = GetValidGlobalContext(); Context *context = GetValidGlobalContext();
if (context) if (context)
{ {
context->gatherParams<EntryPoint::BindTexture>(target, texture);
if (!context->skipValidation() && !ValidateBindTexture(context, target, texture)) if (!context->skipValidation() && !ValidateBindTexture(context, target, texture))
{ {
return; return;
...@@ -138,6 +153,8 @@ void GL_APIENTRY BlendColor(GLfloat red, GLfloat green, GLfloat blue, GLfloat al ...@@ -138,6 +153,8 @@ void GL_APIENTRY BlendColor(GLfloat red, GLfloat green, GLfloat blue, GLfloat al
Context *context = GetValidGlobalContext(); Context *context = GetValidGlobalContext();
if (context) if (context)
{ {
context->gatherParams<EntryPoint::BlendColor>(red, green, blue, alpha);
if (!context->skipValidation() && !ValidateBlendColor(context, red, green, blue, alpha)) if (!context->skipValidation() && !ValidateBlendColor(context, red, green, blue, alpha))
{ {
return; return;
...@@ -154,6 +171,8 @@ void GL_APIENTRY BlendEquation(GLenum mode) ...@@ -154,6 +171,8 @@ void GL_APIENTRY BlendEquation(GLenum mode)
Context *context = GetValidGlobalContext(); Context *context = GetValidGlobalContext();
if (context) if (context)
{ {
context->gatherParams<EntryPoint::BlendEquation>(mode);
if (!context->skipValidation() && !ValidateBlendEquation(context, mode)) if (!context->skipValidation() && !ValidateBlendEquation(context, mode))
{ {
return; return;
...@@ -170,6 +189,8 @@ void GL_APIENTRY BlendEquationSeparate(GLenum modeRGB, GLenum modeAlpha) ...@@ -170,6 +189,8 @@ void GL_APIENTRY BlendEquationSeparate(GLenum modeRGB, GLenum modeAlpha)
Context *context = GetValidGlobalContext(); Context *context = GetValidGlobalContext();
if (context) if (context)
{ {
context->gatherParams<EntryPoint::BlendEquationSeparate>(modeRGB, modeAlpha);
if (!context->skipValidation() && if (!context->skipValidation() &&
!ValidateBlendEquationSeparate(context, modeRGB, modeAlpha)) !ValidateBlendEquationSeparate(context, modeRGB, modeAlpha))
{ {
...@@ -187,6 +208,8 @@ void GL_APIENTRY BlendFunc(GLenum sfactor, GLenum dfactor) ...@@ -187,6 +208,8 @@ void GL_APIENTRY BlendFunc(GLenum sfactor, GLenum dfactor)
Context *context = GetValidGlobalContext(); Context *context = GetValidGlobalContext();
if (context) if (context)
{ {
context->gatherParams<EntryPoint::BlendFunc>(sfactor, dfactor);
if (!context->skipValidation() && !ValidateBlendFunc(context, sfactor, dfactor)) if (!context->skipValidation() && !ValidateBlendFunc(context, sfactor, dfactor))
{ {
return; return;
...@@ -196,36 +219,44 @@ void GL_APIENTRY BlendFunc(GLenum sfactor, GLenum dfactor) ...@@ -196,36 +219,44 @@ void GL_APIENTRY BlendFunc(GLenum sfactor, GLenum dfactor)
} }
} }
void GL_APIENTRY BlendFuncSeparate(GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha) void GL_APIENTRY BlendFuncSeparate(GLenum sfactorRGB,
GLenum dfactorRGB,
GLenum sfactorAlpha,
GLenum dfactorAlpha)
{ {
EVENT( EVENT(
"(GLenum srcRGB = 0x%X, GLenum dstRGB = 0x%X, GLenum srcAlpha = 0x%X, GLenum dstAlpha = " "(GLenum sfactorRGB = 0x%X, GLenum dfactorRGB = 0x%X, GLenum sfactorAlpha = 0x%X, GLenum "
"0x%X)", "dfactorAlpha = 0x%X)",
srcRGB, dstRGB, srcAlpha, dstAlpha); sfactorRGB, dfactorRGB, sfactorAlpha, dfactorAlpha);
Context *context = GetValidGlobalContext(); Context *context = GetValidGlobalContext();
if (context) if (context)
{ {
context->gatherParams<EntryPoint::BlendFuncSeparate>(sfactorRGB, dfactorRGB, sfactorAlpha,
dfactorAlpha);
if (!context->skipValidation() && if (!context->skipValidation() &&
!ValidateBlendFuncSeparate(context, srcRGB, dstRGB, srcAlpha, dstAlpha)) !ValidateBlendFuncSeparate(context, sfactorRGB, dfactorRGB, sfactorAlpha, dfactorAlpha))
{ {
return; return;
} }
context->blendFuncSeparate(srcRGB, dstRGB, srcAlpha, dstAlpha); context->blendFuncSeparate(sfactorRGB, dfactorRGB, sfactorAlpha, dfactorAlpha);
} }
} }
void GL_APIENTRY BufferData(GLenum target, GLsizeiptr size, const void *data, GLenum usage) void GL_APIENTRY BufferData(GLenum target, GLsizeiptr size, const void *data, GLenum usage)
{ {
EVENT( EVENT(
"(GLenum target = 0x%X, GLsizeiptr size = %d, const void* data = 0x%0.8p, GLenum usage = " "(GLenum target = 0x%X, GLsizeiptr size = %d, const void *data = 0x%0.8p, GLenum usage = "
"%d)", "0x%X)",
target, size, data, usage); target, size, data, usage);
Context *context = GetValidGlobalContext(); Context *context = GetValidGlobalContext();
if (context) if (context)
{ {
context->gatherParams<EntryPoint::BufferData>(target, size, data, usage);
if (!context->skipValidation() && !ValidateBufferData(context, target, size, data, usage)) if (!context->skipValidation() && !ValidateBufferData(context, target, size, data, usage))
{ {
return; return;
...@@ -238,13 +269,15 @@ void GL_APIENTRY BufferData(GLenum target, GLsizeiptr size, const void *data, GL ...@@ -238,13 +269,15 @@ void GL_APIENTRY BufferData(GLenum target, GLsizeiptr size, const void *data, GL
void GL_APIENTRY BufferSubData(GLenum target, GLintptr offset, GLsizeiptr size, const void *data) void GL_APIENTRY BufferSubData(GLenum target, GLintptr offset, GLsizeiptr size, const void *data)
{ {
EVENT( EVENT(
"(GLenum target = 0x%X, GLintptr offset = %d, GLsizeiptr size = %d, const void* data = " "(GLenum target = 0x%X, GLintptr offset = %d, GLsizeiptr size = %d, const void *data = "
"0x%0.8p)", "0x%0.8p)",
target, offset, size, data); target, offset, size, data);
Context *context = GetValidGlobalContext(); Context *context = GetValidGlobalContext();
if (context) if (context)
{ {
context->gatherParams<EntryPoint::BufferSubData>(target, offset, size, data);
if (!context->skipValidation() && if (!context->skipValidation() &&
!ValidateBufferSubData(context, target, offset, size, data)) !ValidateBufferSubData(context, target, offset, size, data))
{ {
...@@ -262,6 +295,8 @@ GLenum GL_APIENTRY CheckFramebufferStatus(GLenum target) ...@@ -262,6 +295,8 @@ GLenum GL_APIENTRY CheckFramebufferStatus(GLenum target)
Context *context = GetValidGlobalContext(); Context *context = GetValidGlobalContext();
if (context) if (context)
{ {
context->gatherParams<EntryPoint::CheckFramebufferStatus>(target);
if (!context->skipValidation() && !ValidateCheckFramebufferStatus(context, target)) if (!context->skipValidation() && !ValidateCheckFramebufferStatus(context, target))
{ {
return 0; return 0;
...@@ -269,7 +304,6 @@ GLenum GL_APIENTRY CheckFramebufferStatus(GLenum target) ...@@ -269,7 +304,6 @@ GLenum GL_APIENTRY CheckFramebufferStatus(GLenum target)
return context->checkFramebufferStatus(target); return context->checkFramebufferStatus(target);
} }
return 0; return 0;
} }
...@@ -280,6 +314,8 @@ void GL_APIENTRY Clear(GLbitfield mask) ...@@ -280,6 +314,8 @@ void GL_APIENTRY Clear(GLbitfield mask)
Context *context = GetValidGlobalContext(); Context *context = GetValidGlobalContext();
if (context) if (context)
{ {
context->gatherParams<EntryPoint::Clear>(mask);
if (!context->skipValidation() && !ValidateClear(context, mask)) if (!context->skipValidation() && !ValidateClear(context, mask))
{ {
return; return;
...@@ -297,6 +333,8 @@ void GL_APIENTRY ClearColor(GLfloat red, GLfloat green, GLfloat blue, GLfloat al ...@@ -297,6 +333,8 @@ void GL_APIENTRY ClearColor(GLfloat red, GLfloat green, GLfloat blue, GLfloat al
Context *context = GetValidGlobalContext(); Context *context = GetValidGlobalContext();
if (context) if (context)
{ {
context->gatherParams<EntryPoint::ClearColor>(red, green, blue, alpha);
if (!context->skipValidation() && !ValidateClearColor(context, red, green, blue, alpha)) if (!context->skipValidation() && !ValidateClearColor(context, red, green, blue, alpha))
{ {
return; return;
...@@ -306,19 +344,21 @@ void GL_APIENTRY ClearColor(GLfloat red, GLfloat green, GLfloat blue, GLfloat al ...@@ -306,19 +344,21 @@ void GL_APIENTRY ClearColor(GLfloat red, GLfloat green, GLfloat blue, GLfloat al
} }
} }
void GL_APIENTRY ClearDepthf(GLfloat depth) void GL_APIENTRY ClearDepthf(GLfloat d)
{ {
EVENT("(GLfloat depth = %f)", depth); EVENT("(GLfloat d = %f)", d);
Context *context = GetValidGlobalContext(); Context *context = GetValidGlobalContext();
if (context) if (context)
{ {
if (!context->skipValidation() && !ValidateClearDepthf(context, depth)) context->gatherParams<EntryPoint::ClearDepthf>(d);
if (!context->skipValidation() && !ValidateClearDepthf(context, d))
{ {
return; return;
} }
context->clearDepthf(depth); context->clearDepthf(d);
} }
} }
...@@ -329,6 +369,8 @@ void GL_APIENTRY ClearStencil(GLint s) ...@@ -329,6 +369,8 @@ void GL_APIENTRY ClearStencil(GLint s)
Context *context = GetValidGlobalContext(); Context *context = GetValidGlobalContext();
if (context) if (context)
{ {
context->gatherParams<EntryPoint::ClearStencil>(s);
if (!context->skipValidation() && !ValidateClearStencil(context, s)) if (!context->skipValidation() && !ValidateClearStencil(context, s))
{ {
return; return;
...@@ -340,12 +382,14 @@ void GL_APIENTRY ClearStencil(GLint s) ...@@ -340,12 +382,14 @@ void GL_APIENTRY ClearStencil(GLint s)
void GL_APIENTRY ColorMask(GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha) void GL_APIENTRY ColorMask(GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha)
{ {
EVENT("(GLboolean red = %d, GLboolean green = %u, GLboolean blue = %u, GLboolean alpha = %u)", EVENT("(GLboolean red = %u, GLboolean green = %u, GLboolean blue = %u, GLboolean alpha = %u)",
red, green, blue, alpha); red, green, blue, alpha);
Context *context = GetValidGlobalContext(); Context *context = GetValidGlobalContext();
if (context) if (context)
{ {
context->gatherParams<EntryPoint::ColorMask>(red, green, blue, alpha);
if (!context->skipValidation() && !ValidateColorMask(context, red, green, blue, alpha)) if (!context->skipValidation() && !ValidateColorMask(context, red, green, blue, alpha))
{ {
return; return;
...@@ -362,6 +406,8 @@ void GL_APIENTRY CompileShader(GLuint shader) ...@@ -362,6 +406,8 @@ void GL_APIENTRY CompileShader(GLuint shader)
Context *context = GetValidGlobalContext(); Context *context = GetValidGlobalContext();
if (context) if (context)
{ {
context->gatherParams<EntryPoint::CompileShader>(shader);
if (!context->skipValidation() && !ValidateCompileShader(context, shader)) if (!context->skipValidation() && !ValidateCompileShader(context, shader))
{ {
return; return;
...@@ -382,14 +428,16 @@ void GL_APIENTRY CompressedTexImage2D(GLenum target, ...@@ -382,14 +428,16 @@ void GL_APIENTRY CompressedTexImage2D(GLenum target,
{ {
EVENT( EVENT(
"(GLenum target = 0x%X, GLint level = %d, GLenum internalformat = 0x%X, GLsizei width = " "(GLenum target = 0x%X, GLint level = %d, GLenum internalformat = 0x%X, GLsizei width = "
"%d, " "%d, GLsizei height = %d, GLint border = %d, GLsizei imageSize = %d, const void *data = "
"GLsizei height = %d, GLint border = %d, GLsizei imageSize = %d, const void* data = "
"0x%0.8p)", "0x%0.8p)",
target, level, internalformat, width, height, border, imageSize, data); target, level, internalformat, width, height, border, imageSize, data);
Context *context = GetValidGlobalContext(); Context *context = GetValidGlobalContext();
if (context) if (context)
{ {
context->gatherParams<EntryPoint::CompressedTexImage2D>(
target, level, internalformat, width, height, border, imageSize, data);
if (!context->skipValidation() && if (!context->skipValidation() &&
!ValidateCompressedTexImage2D(context, target, level, internalformat, width, height, !ValidateCompressedTexImage2D(context, target, level, internalformat, width, height,
border, imageSize, data)) border, imageSize, data))
...@@ -413,14 +461,17 @@ void GL_APIENTRY CompressedTexSubImage2D(GLenum target, ...@@ -413,14 +461,17 @@ void GL_APIENTRY CompressedTexSubImage2D(GLenum target,
const void *data) const void *data)
{ {
EVENT( EVENT(
"(GLenum target = 0x%X, GLint level = %d, GLint xoffset = %d, GLint yoffset = %d, " "(GLenum target = 0x%X, GLint level = %d, GLint xoffset = %d, GLint yoffset = %d, GLsizei "
"GLsizei width = %d, GLsizei height = %d, GLenum format = 0x%X, " "width = %d, GLsizei height = %d, GLenum format = 0x%X, GLsizei imageSize = %d, const void "
"GLsizei imageSize = %d, const void* data = 0x%0.8p)", "*data = 0x%0.8p)",
target, level, xoffset, yoffset, width, height, format, imageSize, data); target, level, xoffset, yoffset, width, height, format, imageSize, data);
Context *context = GetValidGlobalContext(); Context *context = GetValidGlobalContext();
if (context) if (context)
{ {
context->gatherParams<EntryPoint::CompressedTexSubImage2D>(
target, level, xoffset, yoffset, width, height, format, imageSize, data);
if (!context->skipValidation() && if (!context->skipValidation() &&
!ValidateCompressedTexSubImage2D(context, target, level, xoffset, yoffset, width, !ValidateCompressedTexSubImage2D(context, target, level, xoffset, yoffset, width,
height, format, imageSize, data)) height, format, imageSize, data))
...@@ -443,19 +494,23 @@ void GL_APIENTRY CopyTexImage2D(GLenum target, ...@@ -443,19 +494,23 @@ void GL_APIENTRY CopyTexImage2D(GLenum target,
GLint border) GLint border)
{ {
EVENT( EVENT(
"(GLenum target = 0x%X, GLint level = %d, GLenum internalformat = 0x%X, " "(GLenum target = 0x%X, GLint level = %d, GLenum internalformat = 0x%X, GLint x = %d, "
"GLint x = %d, GLint y = %d, GLsizei width = %d, GLsizei height = %d, GLint border = %d)", "GLint y = %d, GLsizei width = %d, GLsizei height = %d, GLint border = %d)",
target, level, internalformat, x, y, width, height, border); target, level, internalformat, x, y, width, height, border);
Context *context = GetValidGlobalContext(); Context *context = GetValidGlobalContext();
if (context) if (context)
{ {
context->gatherParams<EntryPoint::CopyTexImage2D>(target, level, internalformat, x, y,
width, height, border);
if (!context->skipValidation() && if (!context->skipValidation() &&
!ValidateCopyTexImage2D(context, target, level, internalformat, x, y, width, height, !ValidateCopyTexImage2D(context, target, level, internalformat, x, y, width, height,
border)) border))
{ {
return; return;
} }
context->copyTexImage2D(target, level, internalformat, x, y, width, height, border); context->copyTexImage2D(target, level, internalformat, x, y, width, height, border);
} }
} }
...@@ -470,13 +525,16 @@ void GL_APIENTRY CopyTexSubImage2D(GLenum target, ...@@ -470,13 +525,16 @@ void GL_APIENTRY CopyTexSubImage2D(GLenum target,
GLsizei height) GLsizei height)
{ {
EVENT( EVENT(
"(GLenum target = 0x%X, GLint level = %d, GLint xoffset = %d, GLint yoffset = %d, " "(GLenum target = 0x%X, GLint level = %d, GLint xoffset = %d, GLint yoffset = %d, GLint x "
"GLint x = %d, GLint y = %d, GLsizei width = %d, GLsizei height = %d)", "= %d, GLint y = %d, GLsizei width = %d, GLsizei height = %d)",
target, level, xoffset, yoffset, x, y, width, height); target, level, xoffset, yoffset, x, y, width, height);
Context *context = GetValidGlobalContext(); Context *context = GetValidGlobalContext();
if (context) if (context)
{ {
context->gatherParams<EntryPoint::CopyTexSubImage2D>(target, level, xoffset, yoffset, x, y,
width, height);
if (!context->skipValidation() && if (!context->skipValidation() &&
!ValidateCopyTexSubImage2D(context, target, level, xoffset, yoffset, x, y, width, !ValidateCopyTexSubImage2D(context, target, level, xoffset, yoffset, x, y, width,
height)) height))
...@@ -488,13 +546,15 @@ void GL_APIENTRY CopyTexSubImage2D(GLenum target, ...@@ -488,13 +546,15 @@ void GL_APIENTRY CopyTexSubImage2D(GLenum target,
} }
} }
GLuint GL_APIENTRY CreateProgram(void) GLuint GL_APIENTRY CreateProgram()
{ {
EVENT("()"); EVENT("()");
Context *context = GetValidGlobalContext(); Context *context = GetValidGlobalContext();
if (context) if (context)
{ {
context->gatherParams<EntryPoint::CreateProgram>();
if (!context->skipValidation() && !ValidateCreateProgram(context)) if (!context->skipValidation() && !ValidateCreateProgram(context))
{ {
return 0; return 0;
...@@ -502,7 +562,6 @@ GLuint GL_APIENTRY CreateProgram(void) ...@@ -502,7 +562,6 @@ GLuint GL_APIENTRY CreateProgram(void)
return context->createProgram(); return context->createProgram();
} }
return 0; return 0;
} }
...@@ -513,10 +572,13 @@ GLuint GL_APIENTRY CreateShader(GLenum type) ...@@ -513,10 +572,13 @@ GLuint GL_APIENTRY CreateShader(GLenum type)
Context *context = GetValidGlobalContext(); Context *context = GetValidGlobalContext();
if (context) if (context)
{ {
context->gatherParams<EntryPoint::CreateShader>(type);
if (!context->skipValidation() && !ValidateCreateShader(context, type)) if (!context->skipValidation() && !ValidateCreateShader(context, type))
{ {
return 0; return 0;
} }
return context->createShader(type); return context->createShader(type);
} }
return 0; return 0;
...@@ -529,6 +591,8 @@ void GL_APIENTRY CullFace(GLenum mode) ...@@ -529,6 +591,8 @@ void GL_APIENTRY CullFace(GLenum mode)
Context *context = GetValidGlobalContext(); Context *context = GetValidGlobalContext();
if (context) if (context)
{ {
context->gatherParams<EntryPoint::CullFace>(mode);
if (!context->skipValidation() && !ValidateCullFace(context, mode)) if (!context->skipValidation() && !ValidateCullFace(context, mode))
{ {
return; return;
...@@ -540,11 +604,13 @@ void GL_APIENTRY CullFace(GLenum mode) ...@@ -540,11 +604,13 @@ void GL_APIENTRY CullFace(GLenum mode)
void GL_APIENTRY DeleteBuffers(GLsizei n, const GLuint *buffers) void GL_APIENTRY DeleteBuffers(GLsizei n, const GLuint *buffers)
{ {
EVENT("(GLsizei n = %d, const GLuint* buffers = 0x%0.8p)", n, buffers); EVENT("(GLsizei n = %d, const GLuint *buffers = 0x%0.8p)", n, buffers);
Context *context = GetValidGlobalContext(); Context *context = GetValidGlobalContext();
if (context) if (context)
{ {
context->gatherParams<EntryPoint::DeleteBuffers>(n, buffers);
if (!context->skipValidation() && !ValidateDeleteBuffers(context, n, buffers)) if (!context->skipValidation() && !ValidateDeleteBuffers(context, n, buffers))
{ {
return; return;
...@@ -556,11 +622,13 @@ void GL_APIENTRY DeleteBuffers(GLsizei n, const GLuint *buffers) ...@@ -556,11 +622,13 @@ void GL_APIENTRY DeleteBuffers(GLsizei n, const GLuint *buffers)
void GL_APIENTRY DeleteFramebuffers(GLsizei n, const GLuint *framebuffers) void GL_APIENTRY DeleteFramebuffers(GLsizei n, const GLuint *framebuffers)
{ {
EVENT("(GLsizei n = %d, const GLuint* framebuffers = 0x%0.8p)", n, framebuffers); EVENT("(GLsizei n = %d, const GLuint *framebuffers = 0x%0.8p)", n, framebuffers);
Context *context = GetValidGlobalContext(); Context *context = GetValidGlobalContext();
if (context) if (context)
{ {
context->gatherParams<EntryPoint::DeleteFramebuffers>(n, framebuffers);
if (!context->skipValidation() && !ValidateDeleteFramebuffers(context, n, framebuffers)) if (!context->skipValidation() && !ValidateDeleteFramebuffers(context, n, framebuffers))
{ {
return; return;
...@@ -577,6 +645,8 @@ void GL_APIENTRY DeleteProgram(GLuint program) ...@@ -577,6 +645,8 @@ void GL_APIENTRY DeleteProgram(GLuint program)
Context *context = GetValidGlobalContext(); Context *context = GetValidGlobalContext();
if (context) if (context)
{ {
context->gatherParams<EntryPoint::DeleteProgram>(program);
if (!context->skipValidation() && !ValidateDeleteProgram(context, program)) if (!context->skipValidation() && !ValidateDeleteProgram(context, program))
{ {
return; return;
...@@ -588,11 +658,13 @@ void GL_APIENTRY DeleteProgram(GLuint program) ...@@ -588,11 +658,13 @@ void GL_APIENTRY DeleteProgram(GLuint program)
void GL_APIENTRY DeleteRenderbuffers(GLsizei n, const GLuint *renderbuffers) void GL_APIENTRY DeleteRenderbuffers(GLsizei n, const GLuint *renderbuffers)
{ {
EVENT("(GLsizei n = %d, const GLuint* renderbuffers = 0x%0.8p)", n, renderbuffers); EVENT("(GLsizei n = %d, const GLuint *renderbuffers = 0x%0.8p)", n, renderbuffers);
Context *context = GetValidGlobalContext(); Context *context = GetValidGlobalContext();
if (context) if (context)
{ {
context->gatherParams<EntryPoint::DeleteRenderbuffers>(n, renderbuffers);
if (!context->skipValidation() && !ValidateDeleteRenderbuffers(context, n, renderbuffers)) if (!context->skipValidation() && !ValidateDeleteRenderbuffers(context, n, renderbuffers))
{ {
return; return;
...@@ -609,6 +681,8 @@ void GL_APIENTRY DeleteShader(GLuint shader) ...@@ -609,6 +681,8 @@ void GL_APIENTRY DeleteShader(GLuint shader)
Context *context = GetValidGlobalContext(); Context *context = GetValidGlobalContext();
if (context) if (context)
{ {
context->gatherParams<EntryPoint::DeleteShader>(shader);
if (!context->skipValidation() && !ValidateDeleteShader(context, shader)) if (!context->skipValidation() && !ValidateDeleteShader(context, shader))
{ {
return; return;
...@@ -620,11 +694,13 @@ void GL_APIENTRY DeleteShader(GLuint shader) ...@@ -620,11 +694,13 @@ void GL_APIENTRY DeleteShader(GLuint shader)
void GL_APIENTRY DeleteTextures(GLsizei n, const GLuint *textures) void GL_APIENTRY DeleteTextures(GLsizei n, const GLuint *textures)
{ {
EVENT("(GLsizei n = %d, const GLuint* textures = 0x%0.8p)", n, textures); EVENT("(GLsizei n = %d, const GLuint *textures = 0x%0.8p)", n, textures);
Context *context = GetValidGlobalContext(); Context *context = GetValidGlobalContext();
if (context) if (context)
{ {
context->gatherParams<EntryPoint::DeleteTextures>(n, textures);
if (!context->skipValidation() && !ValidateDeleteTextures(context, n, textures)) if (!context->skipValidation() && !ValidateDeleteTextures(context, n, textures))
{ {
return; return;
...@@ -641,6 +717,8 @@ void GL_APIENTRY DepthFunc(GLenum func) ...@@ -641,6 +717,8 @@ void GL_APIENTRY DepthFunc(GLenum func)
Context *context = GetValidGlobalContext(); Context *context = GetValidGlobalContext();
if (context) if (context)
{ {
context->gatherParams<EntryPoint::DepthFunc>(func);
if (!context->skipValidation() && !ValidateDepthFunc(context, func)) if (!context->skipValidation() && !ValidateDepthFunc(context, func))
{ {
return; return;
...@@ -657,6 +735,8 @@ void GL_APIENTRY DepthMask(GLboolean flag) ...@@ -657,6 +735,8 @@ void GL_APIENTRY DepthMask(GLboolean flag)
Context *context = GetValidGlobalContext(); Context *context = GetValidGlobalContext();
if (context) if (context)
{ {
context->gatherParams<EntryPoint::DepthMask>(flag);
if (!context->skipValidation() && !ValidateDepthMask(context, flag)) if (!context->skipValidation() && !ValidateDepthMask(context, flag))
{ {
return; return;
...@@ -666,19 +746,21 @@ void GL_APIENTRY DepthMask(GLboolean flag) ...@@ -666,19 +746,21 @@ void GL_APIENTRY DepthMask(GLboolean flag)
} }
} }
void GL_APIENTRY DepthRangef(GLfloat zNear, GLfloat zFar) void GL_APIENTRY DepthRangef(GLfloat n, GLfloat f)
{ {
EVENT("(GLfloat zNear = %f, GLfloat zFar = %f)", zNear, zFar); EVENT("(GLfloat n = %f, GLfloat f = %f)", n, f);
Context *context = GetValidGlobalContext(); Context *context = GetValidGlobalContext();
if (context) if (context)
{ {
if (!context->skipValidation() && !ValidateDepthRangef(context, zNear, zFar)) context->gatherParams<EntryPoint::DepthRangef>(n, f);
if (!context->skipValidation() && !ValidateDepthRangef(context, n, f))
{ {
return; return;
} }
context->depthRangef(zNear, zFar); context->depthRangef(n, f);
} }
} }
...@@ -689,6 +771,8 @@ void GL_APIENTRY DetachShader(GLuint program, GLuint shader) ...@@ -689,6 +771,8 @@ void GL_APIENTRY DetachShader(GLuint program, GLuint shader)
Context *context = GetValidGlobalContext(); Context *context = GetValidGlobalContext();
if (context) if (context)
{ {
context->gatherParams<EntryPoint::DetachShader>(program, shader);
if (!context->skipValidation() && !ValidateDetachShader(context, program, shader)) if (!context->skipValidation() && !ValidateDetachShader(context, program, shader))
{ {
return; return;
...@@ -705,6 +789,8 @@ void GL_APIENTRY Disable(GLenum cap) ...@@ -705,6 +789,8 @@ void GL_APIENTRY Disable(GLenum cap)
Context *context = GetValidGlobalContext(); Context *context = GetValidGlobalContext();
if (context) if (context)
{ {
context->gatherParams<EntryPoint::Disable>(cap);
if (!context->skipValidation() && !ValidateDisable(context, cap)) if (!context->skipValidation() && !ValidateDisable(context, cap))
{ {
return; return;
...@@ -721,6 +807,8 @@ void GL_APIENTRY DisableVertexAttribArray(GLuint index) ...@@ -721,6 +807,8 @@ void GL_APIENTRY DisableVertexAttribArray(GLuint index)
Context *context = GetValidGlobalContext(); Context *context = GetValidGlobalContext();
if (context) if (context)
{ {
context->gatherParams<EntryPoint::DisableVertexAttribArray>(index);
if (!context->skipValidation() && !ValidateDisableVertexAttribArray(context, index)) if (!context->skipValidation() && !ValidateDisableVertexAttribArray(context, index))
{ {
return; return;
...@@ -751,7 +839,7 @@ void GL_APIENTRY DrawArrays(GLenum mode, GLint first, GLsizei count) ...@@ -751,7 +839,7 @@ void GL_APIENTRY DrawArrays(GLenum mode, GLint first, GLsizei count)
void GL_APIENTRY DrawElements(GLenum mode, GLsizei count, GLenum type, const void *indices) void GL_APIENTRY DrawElements(GLenum mode, GLsizei count, GLenum type, const void *indices)
{ {
EVENT( EVENT(
"(GLenum mode = 0x%X, GLsizei count = %d, GLenum type = 0x%X, const void* indices = " "(GLenum mode = 0x%X, GLsizei count = %d, GLenum type = 0x%X, const void *indices = "
"0x%0.8p)", "0x%0.8p)",
mode, count, type, indices); mode, count, type, indices);
...@@ -777,6 +865,8 @@ void GL_APIENTRY Enable(GLenum cap) ...@@ -777,6 +865,8 @@ void GL_APIENTRY Enable(GLenum cap)
Context *context = GetValidGlobalContext(); Context *context = GetValidGlobalContext();
if (context) if (context)
{ {
context->gatherParams<EntryPoint::Enable>(cap);
if (!context->skipValidation() && !ValidateEnable(context, cap)) if (!context->skipValidation() && !ValidateEnable(context, cap))
{ {
return; return;
...@@ -793,6 +883,8 @@ void GL_APIENTRY EnableVertexAttribArray(GLuint index) ...@@ -793,6 +883,8 @@ void GL_APIENTRY EnableVertexAttribArray(GLuint index)
Context *context = GetValidGlobalContext(); Context *context = GetValidGlobalContext();
if (context) if (context)
{ {
context->gatherParams<EntryPoint::EnableVertexAttribArray>(index);
if (!context->skipValidation() && !ValidateEnableVertexAttribArray(context, index)) if (!context->skipValidation() && !ValidateEnableVertexAttribArray(context, index))
{ {
return; return;
...@@ -802,13 +894,15 @@ void GL_APIENTRY EnableVertexAttribArray(GLuint index) ...@@ -802,13 +894,15 @@ void GL_APIENTRY EnableVertexAttribArray(GLuint index)
} }
} }
void GL_APIENTRY Finish(void) void GL_APIENTRY Finish()
{ {
EVENT("()"); EVENT("()");
Context *context = GetValidGlobalContext(); Context *context = GetValidGlobalContext();
if (context) if (context)
{ {
context->gatherParams<EntryPoint::Finish>();
if (!context->skipValidation() && !ValidateFinish(context)) if (!context->skipValidation() && !ValidateFinish(context))
{ {
return; return;
...@@ -818,13 +912,15 @@ void GL_APIENTRY Finish(void) ...@@ -818,13 +912,15 @@ void GL_APIENTRY Finish(void)
} }
} }
void GL_APIENTRY Flush(void) void GL_APIENTRY Flush()
{ {
EVENT("()"); EVENT("()");
Context *context = GetValidGlobalContext(); Context *context = GetValidGlobalContext();
if (context) if (context)
{ {
context->gatherParams<EntryPoint::Flush>();
if (!context->skipValidation() && !ValidateFlush(context)) if (!context->skipValidation() && !ValidateFlush(context))
{ {
return; return;
...@@ -840,13 +936,16 @@ void GL_APIENTRY FramebufferRenderbuffer(GLenum target, ...@@ -840,13 +936,16 @@ void GL_APIENTRY FramebufferRenderbuffer(GLenum target,
GLuint renderbuffer) GLuint renderbuffer)
{ {
EVENT( EVENT(
"(GLenum target = 0x%X, GLenum attachment = 0x%X, GLenum renderbuffertarget = 0x%X, " "(GLenum target = 0x%X, GLenum attachment = 0x%X, GLenum renderbuffertarget = 0x%X, GLuint "
"GLuint renderbuffer = %d)", "renderbuffer = %d)",
target, attachment, renderbuffertarget, renderbuffer); target, attachment, renderbuffertarget, renderbuffer);
Context *context = GetValidGlobalContext(); Context *context = GetValidGlobalContext();
if (context) if (context)
{ {
context->gatherParams<EntryPoint::FramebufferRenderbuffer>(
target, attachment, renderbuffertarget, renderbuffer);
if (!context->skipValidation() && if (!context->skipValidation() &&
!ValidateFramebufferRenderbuffer(context, target, attachment, renderbuffertarget, !ValidateFramebufferRenderbuffer(context, target, attachment, renderbuffertarget,
renderbuffer)) renderbuffer))
...@@ -865,13 +964,16 @@ void GL_APIENTRY FramebufferTexture2D(GLenum target, ...@@ -865,13 +964,16 @@ void GL_APIENTRY FramebufferTexture2D(GLenum target,
GLint level) GLint level)
{ {
EVENT( EVENT(
"(GLenum target = 0x%X, GLenum attachment = 0x%X, GLenum textarget = 0x%X, " "(GLenum target = 0x%X, GLenum attachment = 0x%X, GLenum textarget = 0x%X, GLuint texture "
"GLuint texture = %d, GLint level = %d)", "= %d, GLint level = %d)",
target, attachment, textarget, texture, level); target, attachment, textarget, texture, level);
Context *context = GetValidGlobalContext(); Context *context = GetValidGlobalContext();
if (context) if (context)
{ {
context->gatherParams<EntryPoint::FramebufferTexture2D>(target, attachment, textarget,
texture, level);
if (!context->skipValidation() && if (!context->skipValidation() &&
!ValidateFramebufferTexture2D(context, target, attachment, textarget, texture, level)) !ValidateFramebufferTexture2D(context, target, attachment, textarget, texture, level))
{ {
...@@ -889,6 +991,8 @@ void GL_APIENTRY FrontFace(GLenum mode) ...@@ -889,6 +991,8 @@ void GL_APIENTRY FrontFace(GLenum mode)
Context *context = GetValidGlobalContext(); Context *context = GetValidGlobalContext();
if (context) if (context)
{ {
context->gatherParams<EntryPoint::FrontFace>(mode);
if (!context->skipValidation() && !ValidateFrontFace(context, mode)) if (!context->skipValidation() && !ValidateFrontFace(context, mode))
{ {
return; return;
...@@ -900,11 +1004,13 @@ void GL_APIENTRY FrontFace(GLenum mode) ...@@ -900,11 +1004,13 @@ void GL_APIENTRY FrontFace(GLenum mode)
void GL_APIENTRY GenBuffers(GLsizei n, GLuint *buffers) void GL_APIENTRY GenBuffers(GLsizei n, GLuint *buffers)
{ {
EVENT("(GLsizei n = %d, GLuint* buffers = 0x%0.8p)", n, buffers); EVENT("(GLsizei n = %d, GLuint *buffers = 0x%0.8p)", n, buffers);
Context *context = GetValidGlobalContext(); Context *context = GetValidGlobalContext();
if (context) if (context)
{ {
context->gatherParams<EntryPoint::GenBuffers>(n, buffers);
if (!context->skipValidation() && !ValidateGenBuffers(context, n, buffers)) if (!context->skipValidation() && !ValidateGenBuffers(context, n, buffers))
{ {
return; return;
...@@ -921,6 +1027,8 @@ void GL_APIENTRY GenerateMipmap(GLenum target) ...@@ -921,6 +1027,8 @@ void GL_APIENTRY GenerateMipmap(GLenum target)
Context *context = GetValidGlobalContext(); Context *context = GetValidGlobalContext();
if (context) if (context)
{ {
context->gatherParams<EntryPoint::GenerateMipmap>(target);
if (!context->skipValidation() && !ValidateGenerateMipmap(context, target)) if (!context->skipValidation() && !ValidateGenerateMipmap(context, target))
{ {
return; return;
...@@ -932,11 +1040,13 @@ void GL_APIENTRY GenerateMipmap(GLenum target) ...@@ -932,11 +1040,13 @@ void GL_APIENTRY GenerateMipmap(GLenum target)
void GL_APIENTRY GenFramebuffers(GLsizei n, GLuint *framebuffers) void GL_APIENTRY GenFramebuffers(GLsizei n, GLuint *framebuffers)
{ {
EVENT("(GLsizei n = %d, GLuint* framebuffers = 0x%0.8p)", n, framebuffers); EVENT("(GLsizei n = %d, GLuint *framebuffers = 0x%0.8p)", n, framebuffers);
Context *context = GetValidGlobalContext(); Context *context = GetValidGlobalContext();
if (context) if (context)
{ {
context->gatherParams<EntryPoint::GenFramebuffers>(n, framebuffers);
if (!context->skipValidation() && !ValidateGenFramebuffers(context, n, framebuffers)) if (!context->skipValidation() && !ValidateGenFramebuffers(context, n, framebuffers))
{ {
return; return;
...@@ -948,11 +1058,13 @@ void GL_APIENTRY GenFramebuffers(GLsizei n, GLuint *framebuffers) ...@@ -948,11 +1058,13 @@ void GL_APIENTRY GenFramebuffers(GLsizei n, GLuint *framebuffers)
void GL_APIENTRY GenRenderbuffers(GLsizei n, GLuint *renderbuffers) void GL_APIENTRY GenRenderbuffers(GLsizei n, GLuint *renderbuffers)
{ {
EVENT("(GLsizei n = %d, GLuint* renderbuffers = 0x%0.8p)", n, renderbuffers); EVENT("(GLsizei n = %d, GLuint *renderbuffers = 0x%0.8p)", n, renderbuffers);
Context *context = GetValidGlobalContext(); Context *context = GetValidGlobalContext();
if (context) if (context)
{ {
context->gatherParams<EntryPoint::GenRenderbuffers>(n, renderbuffers);
if (!context->skipValidation() && !ValidateGenRenderbuffers(context, n, renderbuffers)) if (!context->skipValidation() && !ValidateGenRenderbuffers(context, n, renderbuffers))
{ {
return; return;
...@@ -964,11 +1076,13 @@ void GL_APIENTRY GenRenderbuffers(GLsizei n, GLuint *renderbuffers) ...@@ -964,11 +1076,13 @@ void GL_APIENTRY GenRenderbuffers(GLsizei n, GLuint *renderbuffers)
void GL_APIENTRY GenTextures(GLsizei n, GLuint *textures) void GL_APIENTRY GenTextures(GLsizei n, GLuint *textures)
{ {
EVENT("(GLsizei n = %d, GLuint* textures = 0x%0.8p)", n, textures); EVENT("(GLsizei n = %d, GLuint *textures = 0x%0.8p)", n, textures);
Context *context = GetValidGlobalContext(); Context *context = GetValidGlobalContext();
if (context) if (context)
{ {
context->gatherParams<EntryPoint::GenTextures>(n, textures);
if (!context->skipValidation() && !ValidateGenTextures(context, n, textures)) if (!context->skipValidation() && !ValidateGenTextures(context, n, textures))
{ {
return; return;
...@@ -980,122 +1094,134 @@ void GL_APIENTRY GenTextures(GLsizei n, GLuint *textures) ...@@ -980,122 +1094,134 @@ void GL_APIENTRY GenTextures(GLsizei n, GLuint *textures)
void GL_APIENTRY GetActiveAttrib(GLuint program, void GL_APIENTRY GetActiveAttrib(GLuint program,
GLuint index, GLuint index,
GLsizei bufsize, GLsizei bufSize,
GLsizei *length, GLsizei *length,
GLint *size, GLint *size,
GLenum *type, GLenum *type,
GLchar *name) GLchar *name)
{ {
EVENT( EVENT(
"(GLuint program = %d, GLuint index = %d, GLsizei bufsize = %d, GLsizei *length = 0x%0.8p, " "(GLuint program = %d, GLuint index = %d, GLsizei bufSize = %d, GLsizei *length = 0x%0.8p, "
"GLint *size = 0x%0.8p, GLenum *type = %0.8p, GLchar *name = %0.8p)", "GLint *size = 0x%0.8p, GLenum *type = 0x%0.8p, GLchar *name = 0x%0.8p)",
program, index, bufsize, length, size, type, name); program, index, bufSize, length, size, type, name);
Context *context = GetValidGlobalContext(); Context *context = GetValidGlobalContext();
if (context) if (context)
{ {
context->gatherParams<EntryPoint::GetActiveAttrib>(program, index, bufSize, length, size,
type, name);
if (!context->skipValidation() && if (!context->skipValidation() &&
!ValidateGetActiveAttrib(context, program, index, bufsize, length, size, type, name)) !ValidateGetActiveAttrib(context, program, index, bufSize, length, size, type, name))
{ {
return; return;
} }
context->getActiveAttrib(program, index, bufsize, length, size, type, name); context->getActiveAttrib(program, index, bufSize, length, size, type, name);
} }
} }
void GL_APIENTRY GetActiveUniform(GLuint program, void GL_APIENTRY GetActiveUniform(GLuint program,
GLuint index, GLuint index,
GLsizei bufsize, GLsizei bufSize,
GLsizei *length, GLsizei *length,
GLint *size, GLint *size,
GLenum *type, GLenum *type,
GLchar *name) GLchar *name)
{ {
EVENT( EVENT(
"(GLuint program = %d, GLuint index = %d, GLsizei bufsize = %d, " "(GLuint program = %d, GLuint index = %d, GLsizei bufSize = %d, GLsizei *length = 0x%0.8p, "
"GLsizei* length = 0x%0.8p, GLint* size = 0x%0.8p, GLenum* type = 0x%0.8p, GLchar* name = " "GLint *size = 0x%0.8p, GLenum *type = 0x%0.8p, GLchar *name = 0x%0.8p)",
"0x%0.8p)", program, index, bufSize, length, size, type, name);
program, index, bufsize, length, size, type, name);
Context *context = GetValidGlobalContext(); Context *context = GetValidGlobalContext();
if (context) if (context)
{ {
context->gatherParams<EntryPoint::GetActiveUniform>(program, index, bufSize, length, size,
type, name);
if (!context->skipValidation() && if (!context->skipValidation() &&
!ValidateGetActiveUniform(context, program, index, bufsize, length, size, type, name)) !ValidateGetActiveUniform(context, program, index, bufSize, length, size, type, name))
{ {
return; return;
} }
context->getActiveUniform(program, index, bufsize, length, size, type, name); context->getActiveUniform(program, index, bufSize, length, size, type, name);
} }
} }
void GL_APIENTRY GetAttachedShaders(GLuint program, void GL_APIENTRY GetAttachedShaders(GLuint program,
GLsizei maxcount, GLsizei maxCount,
GLsizei *count, GLsizei *count,
GLuint *shaders) GLuint *shaders)
{ {
EVENT( EVENT(
"(GLuint program = %d, GLsizei maxcount = %d, GLsizei* count = 0x%0.8p, GLuint* shaders = " "(GLuint program = %d, GLsizei maxCount = %d, GLsizei *count = 0x%0.8p, GLuint *shaders = "
"0x%0.8p)", "0x%0.8p)",
program, maxcount, count, shaders); program, maxCount, count, shaders);
Context *context = GetValidGlobalContext(); Context *context = GetValidGlobalContext();
if (context) if (context)
{ {
context->gatherParams<EntryPoint::GetAttachedShaders>(program, maxCount, count, shaders);
if (!context->skipValidation() && if (!context->skipValidation() &&
!ValidateGetAttachedShaders(context, program, maxcount, count, shaders)) !ValidateGetAttachedShaders(context, program, maxCount, count, shaders))
{ {
return; return;
} }
context->getAttachedShaders(program, maxcount, count, shaders); context->getAttachedShaders(program, maxCount, count, shaders);
} }
} }
GLint GL_APIENTRY GetAttribLocation(GLuint program, const GLchar *name) GLint GL_APIENTRY GetAttribLocation(GLuint program, const GLchar *name)
{ {
EVENT("(GLuint program = %d, const GLchar* name = %s)", program, name); EVENT("(GLuint program = %d, const GLchar *name = 0x%0.8p)", program, name);
Context *context = GetValidGlobalContext(); Context *context = GetValidGlobalContext();
if (context) if (context)
{ {
context->gatherParams<EntryPoint::GetAttribLocation>(program, name);
if (!context->skipValidation() && !ValidateGetAttribLocation(context, program, name)) if (!context->skipValidation() && !ValidateGetAttribLocation(context, program, name))
{ {
return -1; return 0;
} }
return context->getAttribLocation(program, name); return context->getAttribLocation(program, name);
} }
return 0;
return -1;
} }
void GL_APIENTRY GetBooleanv(GLenum pname, GLboolean *params) void GL_APIENTRY GetBooleanv(GLenum pname, GLboolean *data)
{ {
EVENT("(GLenum pname = 0x%X, GLboolean* params = 0x%0.8p)", pname, params); EVENT("(GLenum pname = 0x%X, GLboolean *data = 0x%0.8p)", pname, data);
Context *context = GetValidGlobalContext(); Context *context = GetValidGlobalContext();
if (context) if (context)
{ {
if (!context->skipValidation() && !ValidateGetBooleanv(context, pname, params)) context->gatherParams<EntryPoint::GetBooleanv>(pname, data);
if (!context->skipValidation() && !ValidateGetBooleanv(context, pname, data))
{ {
return; return;
} }
context->getBooleanv(pname, params); context->getBooleanv(pname, data);
} }
} }
void GL_APIENTRY GetBufferParameteriv(GLenum target, GLenum pname, GLint *params) void GL_APIENTRY GetBufferParameteriv(GLenum target, GLenum pname, GLint *params)
{ {
EVENT("(GLenum target = 0x%X, GLenum pname = 0x%X, GLint* params = 0x%0.8p)", target, pname, EVENT("(GLenum target = 0x%X, GLenum pname = 0x%X, GLint *params = 0x%0.8p)", target, pname,
params); params);
Context *context = GetValidGlobalContext(); Context *context = GetValidGlobalContext();
if (context) if (context)
{ {
context->gatherParams<EntryPoint::GetBufferParameteriv>(target, pname, params);
if (!context->skipValidation() && if (!context->skipValidation() &&
!ValidateGetBufferParameteriv(context, target, pname, params)) !ValidateGetBufferParameteriv(context, target, pname, params))
{ {
...@@ -1106,38 +1232,40 @@ void GL_APIENTRY GetBufferParameteriv(GLenum target, GLenum pname, GLint *params ...@@ -1106,38 +1232,40 @@ void GL_APIENTRY GetBufferParameteriv(GLenum target, GLenum pname, GLint *params
} }
} }
GLenum GL_APIENTRY GetError(void) GLenum GL_APIENTRY GetError()
{ {
EVENT("()"); EVENT("()");
Context *context = GetGlobalContext(); Context *context = GetValidGlobalContext();
if (context) if (context)
{ {
context->gatherParams<EntryPoint::GetError>();
if (!context->skipValidation() && !ValidateGetError(context)) if (!context->skipValidation() && !ValidateGetError(context))
{ {
return GL_NO_ERROR; return 0;
} }
return context->getError(); return context->getError();
} }
return 0;
return GL_NO_ERROR;
} }
void GL_APIENTRY GetFloatv(GLenum pname, GLfloat *params) void GL_APIENTRY GetFloatv(GLenum pname, GLfloat *data)
{ {
EVENT("(GLenum pname = 0x%X, GLfloat* params = 0x%0.8p)", pname, params); EVENT("(GLenum pname = 0x%X, GLfloat *data = 0x%0.8p)", pname, data);
Context *context = GetValidGlobalContext(); Context *context = GetValidGlobalContext();
if (context) if (context)
{ {
if (!context->skipValidation() && !ValidateGetFloatv(context, pname, params)) context->gatherParams<EntryPoint::GetFloatv>(pname, data);
if (!context->skipValidation() && !ValidateGetFloatv(context, pname, data))
{ {
return; return;
} }
context->getFloatv(pname, params); context->getFloatv(pname, data);
} }
} }
...@@ -1147,13 +1275,16 @@ void GL_APIENTRY GetFramebufferAttachmentParameteriv(GLenum target, ...@@ -1147,13 +1275,16 @@ void GL_APIENTRY GetFramebufferAttachmentParameteriv(GLenum target,
GLint *params) GLint *params)
{ {
EVENT( EVENT(
"(GLenum target = 0x%X, GLenum attachment = 0x%X, GLenum pname = 0x%X, GLint* params = " "(GLenum target = 0x%X, GLenum attachment = 0x%X, GLenum pname = 0x%X, GLint *params = "
"0x%0.8p)", "0x%0.8p)",
target, attachment, pname, params); target, attachment, pname, params);
Context *context = GetValidGlobalContext(); Context *context = GetValidGlobalContext();
if (context) if (context)
{ {
context->gatherParams<EntryPoint::GetFramebufferAttachmentParameteriv>(target, attachment,
pname, params);
if (!context->skipValidation() && !ValidateGetFramebufferAttachmentParameteriv( if (!context->skipValidation() && !ValidateGetFramebufferAttachmentParameteriv(
context, target, attachment, pname, params)) context, target, attachment, pname, params))
{ {
...@@ -1164,30 +1295,34 @@ void GL_APIENTRY GetFramebufferAttachmentParameteriv(GLenum target, ...@@ -1164,30 +1295,34 @@ void GL_APIENTRY GetFramebufferAttachmentParameteriv(GLenum target,
} }
} }
void GL_APIENTRY GetIntegerv(GLenum pname, GLint *params) void GL_APIENTRY GetIntegerv(GLenum pname, GLint *data)
{ {
EVENT("(GLenum pname = 0x%X, GLint* params = 0x%0.8p)", pname, params); EVENT("(GLenum pname = 0x%X, GLint *data = 0x%0.8p)", pname, data);
Context *context = GetValidGlobalContext(); Context *context = GetValidGlobalContext();
if (context) if (context)
{ {
if (!context->skipValidation() && !ValidateGetIntegerv(context, pname, params)) context->gatherParams<EntryPoint::GetIntegerv>(pname, data);
if (!context->skipValidation() && !ValidateGetIntegerv(context, pname, data))
{ {
return; return;
} }
context->getIntegerv(pname, params); context->getIntegerv(pname, data);
} }
} }
void GL_APIENTRY GetProgramiv(GLuint program, GLenum pname, GLint *params) void GL_APIENTRY GetProgramiv(GLuint program, GLenum pname, GLint *params)
{ {
EVENT("(GLuint program = %d, GLenum pname = %d, GLint* params = 0x%0.8p)", program, pname, EVENT("(GLuint program = %d, GLenum pname = 0x%X, GLint *params = 0x%0.8p)", program, pname,
params); params);
Context *context = GetValidGlobalContext(); Context *context = GetValidGlobalContext();
if (context) if (context)
{ {
context->gatherParams<EntryPoint::GetProgramiv>(program, pname, params);
if (!context->skipValidation() && !ValidateGetProgramiv(context, program, pname, params)) if (!context->skipValidation() && !ValidateGetProgramiv(context, program, pname, params))
{ {
return; return;
...@@ -1198,36 +1333,40 @@ void GL_APIENTRY GetProgramiv(GLuint program, GLenum pname, GLint *params) ...@@ -1198,36 +1333,40 @@ void GL_APIENTRY GetProgramiv(GLuint program, GLenum pname, GLint *params)
} }
void GL_APIENTRY GetProgramInfoLog(GLuint program, void GL_APIENTRY GetProgramInfoLog(GLuint program,
GLsizei bufsize, GLsizei bufSize,
GLsizei *length, GLsizei *length,
GLchar *infolog) GLchar *infoLog)
{ {
EVENT( EVENT(
"(GLuint program = %d, GLsizei bufsize = %d, GLsizei* length = 0x%0.8p, GLchar* infolog = " "(GLuint program = %d, GLsizei bufSize = %d, GLsizei *length = 0x%0.8p, GLchar *infoLog = "
"0x%0.8p)", "0x%0.8p)",
program, bufsize, length, infolog); program, bufSize, length, infoLog);
Context *context = GetValidGlobalContext(); Context *context = GetValidGlobalContext();
if (context) if (context)
{ {
context->gatherParams<EntryPoint::GetProgramInfoLog>(program, bufSize, length, infoLog);
if (!context->skipValidation() && if (!context->skipValidation() &&
!ValidateGetProgramInfoLog(context, program, bufsize, length, infolog)) !ValidateGetProgramInfoLog(context, program, bufSize, length, infoLog))
{ {
return; return;
} }
context->getProgramInfoLog(program, bufsize, length, infolog); context->getProgramInfoLog(program, bufSize, length, infoLog);
} }
} }
void GL_APIENTRY GetRenderbufferParameteriv(GLenum target, GLenum pname, GLint *params) void GL_APIENTRY GetRenderbufferParameteriv(GLenum target, GLenum pname, GLint *params)
{ {
EVENT("(GLenum target = 0x%X, GLenum pname = 0x%X, GLint* params = 0x%0.8p)", target, pname, EVENT("(GLenum target = 0x%X, GLenum pname = 0x%X, GLint *params = 0x%0.8p)", target, pname,
params); params);
Context *context = GetValidGlobalContext(); Context *context = GetValidGlobalContext();
if (context) if (context)
{ {
context->gatherParams<EntryPoint::GetRenderbufferParameteriv>(target, pname, params);
if (!context->skipValidation() && if (!context->skipValidation() &&
!ValidateGetRenderbufferParameteriv(context, target, pname, params)) !ValidateGetRenderbufferParameteriv(context, target, pname, params))
{ {
...@@ -1240,12 +1379,14 @@ void GL_APIENTRY GetRenderbufferParameteriv(GLenum target, GLenum pname, GLint * ...@@ -1240,12 +1379,14 @@ void GL_APIENTRY GetRenderbufferParameteriv(GLenum target, GLenum pname, GLint *
void GL_APIENTRY GetShaderiv(GLuint shader, GLenum pname, GLint *params) void GL_APIENTRY GetShaderiv(GLuint shader, GLenum pname, GLint *params)
{ {
EVENT("(GLuint shader = %d, GLenum pname = %d, GLint* params = 0x%0.8p)", shader, pname, EVENT("(GLuint shader = %d, GLenum pname = 0x%X, GLint *params = 0x%0.8p)", shader, pname,
params); params);
Context *context = GetValidGlobalContext(); Context *context = GetValidGlobalContext();
if (context) if (context)
{ {
context->gatherParams<EntryPoint::GetShaderiv>(shader, pname, params);
if (!context->skipValidation() && !ValidateGetShaderiv(context, shader, pname, params)) if (!context->skipValidation() && !ValidateGetShaderiv(context, shader, pname, params))
{ {
return; return;
...@@ -1255,23 +1396,25 @@ void GL_APIENTRY GetShaderiv(GLuint shader, GLenum pname, GLint *params) ...@@ -1255,23 +1396,25 @@ void GL_APIENTRY GetShaderiv(GLuint shader, GLenum pname, GLint *params)
} }
} }
void GL_APIENTRY GetShaderInfoLog(GLuint shader, GLsizei bufsize, GLsizei *length, GLchar *infolog) void GL_APIENTRY GetShaderInfoLog(GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *infoLog)
{ {
EVENT( EVENT(
"(GLuint shader = %d, GLsizei bufsize = %d, GLsizei* length = 0x%0.8p, GLchar* infolog = " "(GLuint shader = %d, GLsizei bufSize = %d, GLsizei *length = 0x%0.8p, GLchar *infoLog = "
"0x%0.8p)", "0x%0.8p)",
shader, bufsize, length, infolog); shader, bufSize, length, infoLog);
Context *context = GetValidGlobalContext(); Context *context = GetValidGlobalContext();
if (context) if (context)
{ {
context->gatherParams<EntryPoint::GetShaderInfoLog>(shader, bufSize, length, infoLog);
if (!context->skipValidation() && if (!context->skipValidation() &&
!ValidateGetShaderInfoLog(context, shader, bufsize, length, infolog)) !ValidateGetShaderInfoLog(context, shader, bufSize, length, infoLog))
{ {
return; return;
} }
context->getShaderInfoLog(shader, bufsize, length, infolog); context->getShaderInfoLog(shader, bufSize, length, infoLog);
} }
} }
...@@ -1281,13 +1424,16 @@ void GL_APIENTRY GetShaderPrecisionFormat(GLenum shadertype, ...@@ -1281,13 +1424,16 @@ void GL_APIENTRY GetShaderPrecisionFormat(GLenum shadertype,
GLint *precision) GLint *precision)
{ {
EVENT( EVENT(
"(GLenum shadertype = 0x%X, GLenum precisiontype = 0x%X, GLint* range = 0x%0.8p, GLint* " "(GLenum shadertype = 0x%X, GLenum precisiontype = 0x%X, GLint *range = 0x%0.8p, GLint "
"precision = 0x%0.8p)", "*precision = 0x%0.8p)",
shadertype, precisiontype, range, precision); shadertype, precisiontype, range, precision);
Context *context = GetValidGlobalContext(); Context *context = GetValidGlobalContext();
if (context) if (context)
{ {
context->gatherParams<EntryPoint::GetShaderPrecisionFormat>(shadertype, precisiontype,
range, precision);
if (!context->skipValidation() && if (!context->skipValidation() &&
!ValidateGetShaderPrecisionFormat(context, shadertype, precisiontype, range, precision)) !ValidateGetShaderPrecisionFormat(context, shadertype, precisiontype, range, precision))
{ {
...@@ -1298,23 +1444,25 @@ void GL_APIENTRY GetShaderPrecisionFormat(GLenum shadertype, ...@@ -1298,23 +1444,25 @@ void GL_APIENTRY GetShaderPrecisionFormat(GLenum shadertype,
} }
} }
void GL_APIENTRY GetShaderSource(GLuint shader, GLsizei bufsize, GLsizei *length, GLchar *source) void GL_APIENTRY GetShaderSource(GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *source)
{ {
EVENT( EVENT(
"(GLuint shader = %d, GLsizei bufsize = %d, GLsizei* length = 0x%0.8p, GLchar* source = " "(GLuint shader = %d, GLsizei bufSize = %d, GLsizei *length = 0x%0.8p, GLchar *source = "
"0x%0.8p)", "0x%0.8p)",
shader, bufsize, length, source); shader, bufSize, length, source);
Context *context = GetValidGlobalContext(); Context *context = GetValidGlobalContext();
if (context) if (context)
{ {
context->gatherParams<EntryPoint::GetShaderSource>(shader, bufSize, length, source);
if (!context->skipValidation() && if (!context->skipValidation() &&
!ValidateGetShaderSource(context, shader, bufsize, length, source)) !ValidateGetShaderSource(context, shader, bufSize, length, source))
{ {
return; return;
} }
context->getShaderSource(shader, bufsize, length, source); context->getShaderSource(shader, bufSize, length, source);
} }
} }
...@@ -1323,9 +1471,10 @@ const GLubyte *GL_APIENTRY GetString(GLenum name) ...@@ -1323,9 +1471,10 @@ const GLubyte *GL_APIENTRY GetString(GLenum name)
EVENT("(GLenum name = 0x%X)", name); EVENT("(GLenum name = 0x%X)", name);
Context *context = GetValidGlobalContext(); Context *context = GetValidGlobalContext();
if (context) if (context)
{ {
context->gatherParams<EntryPoint::GetString>(name);
if (!context->skipValidation() && !ValidateGetString(context, name)) if (!context->skipValidation() && !ValidateGetString(context, name))
{ {
return nullptr; return nullptr;
...@@ -1333,18 +1482,19 @@ const GLubyte *GL_APIENTRY GetString(GLenum name) ...@@ -1333,18 +1482,19 @@ const GLubyte *GL_APIENTRY GetString(GLenum name)
return context->getString(name); return context->getString(name);
} }
return nullptr; return nullptr;
} }
void GL_APIENTRY GetTexParameterfv(GLenum target, GLenum pname, GLfloat *params) void GL_APIENTRY GetTexParameterfv(GLenum target, GLenum pname, GLfloat *params)
{ {
EVENT("(GLenum target = 0x%X, GLenum pname = 0x%X, GLfloat* params = 0x%0.8p)", target, pname, EVENT("(GLenum target = 0x%X, GLenum pname = 0x%X, GLfloat *params = 0x%0.8p)", target, pname,
params); params);
Context *context = GetValidGlobalContext(); Context *context = GetValidGlobalContext();
if (context) if (context)
{ {
context->gatherParams<EntryPoint::GetTexParameterfv>(target, pname, params);
if (!context->skipValidation() && if (!context->skipValidation() &&
!ValidateGetTexParameterfv(context, target, pname, params)) !ValidateGetTexParameterfv(context, target, pname, params))
{ {
...@@ -1357,12 +1507,14 @@ void GL_APIENTRY GetTexParameterfv(GLenum target, GLenum pname, GLfloat *params) ...@@ -1357,12 +1507,14 @@ void GL_APIENTRY GetTexParameterfv(GLenum target, GLenum pname, GLfloat *params)
void GL_APIENTRY GetTexParameteriv(GLenum target, GLenum pname, GLint *params) void GL_APIENTRY GetTexParameteriv(GLenum target, GLenum pname, GLint *params)
{ {
EVENT("(GLenum target = 0x%X, GLenum pname = 0x%X, GLint* params = 0x%0.8p)", target, pname, EVENT("(GLenum target = 0x%X, GLenum pname = 0x%X, GLint *params = 0x%0.8p)", target, pname,
params); params);
Context *context = GetValidGlobalContext(); Context *context = GetValidGlobalContext();
if (context) if (context)
{ {
context->gatherParams<EntryPoint::GetTexParameteriv>(target, pname, params);
if (!context->skipValidation() && if (!context->skipValidation() &&
!ValidateGetTexParameteriv(context, target, pname, params)) !ValidateGetTexParameteriv(context, target, pname, params))
{ {
...@@ -1375,12 +1527,14 @@ void GL_APIENTRY GetTexParameteriv(GLenum target, GLenum pname, GLint *params) ...@@ -1375,12 +1527,14 @@ void GL_APIENTRY GetTexParameteriv(GLenum target, GLenum pname, GLint *params)
void GL_APIENTRY GetUniformfv(GLuint program, GLint location, GLfloat *params) void GL_APIENTRY GetUniformfv(GLuint program, GLint location, GLfloat *params)
{ {
EVENT("(GLuint program = %d, GLint location = %d, GLfloat* params = 0x%0.8p)", program, EVENT("(GLuint program = %d, GLint location = %d, GLfloat *params = 0x%0.8p)", program,
location, params); location, params);
Context *context = GetValidGlobalContext(); Context *context = GetValidGlobalContext();
if (context) if (context)
{ {
context->gatherParams<EntryPoint::GetUniformfv>(program, location, params);
if (!context->skipValidation() && !ValidateGetUniformfv(context, program, location, params)) if (!context->skipValidation() && !ValidateGetUniformfv(context, program, location, params))
{ {
return; return;
...@@ -1392,12 +1546,14 @@ void GL_APIENTRY GetUniformfv(GLuint program, GLint location, GLfloat *params) ...@@ -1392,12 +1546,14 @@ void GL_APIENTRY GetUniformfv(GLuint program, GLint location, GLfloat *params)
void GL_APIENTRY GetUniformiv(GLuint program, GLint location, GLint *params) void GL_APIENTRY GetUniformiv(GLuint program, GLint location, GLint *params)
{ {
EVENT("(GLuint program = %d, GLint location = %d, GLint* params = 0x%0.8p)", program, location, EVENT("(GLuint program = %d, GLint location = %d, GLint *params = 0x%0.8p)", program, location,
params); params);
Context *context = GetValidGlobalContext(); Context *context = GetValidGlobalContext();
if (context) if (context)
{ {
context->gatherParams<EntryPoint::GetUniformiv>(program, location, params);
if (!context->skipValidation() && !ValidateGetUniformiv(context, program, location, params)) if (!context->skipValidation() && !ValidateGetUniformiv(context, program, location, params))
{ {
return; return;
...@@ -1409,30 +1565,33 @@ void GL_APIENTRY GetUniformiv(GLuint program, GLint location, GLint *params) ...@@ -1409,30 +1565,33 @@ void GL_APIENTRY GetUniformiv(GLuint program, GLint location, GLint *params)
GLint GL_APIENTRY GetUniformLocation(GLuint program, const GLchar *name) GLint GL_APIENTRY GetUniformLocation(GLuint program, const GLchar *name)
{ {
EVENT("(GLuint program = %d, const GLchar* name = 0x%0.8p)", program, name); EVENT("(GLuint program = %d, const GLchar *name = 0x%0.8p)", program, name);
Context *context = GetValidGlobalContext(); Context *context = GetValidGlobalContext();
if (context) if (context)
{ {
context->gatherParams<EntryPoint::GetUniformLocation>(program, name);
if (!context->skipValidation() && !ValidateGetUniformLocation(context, program, name)) if (!context->skipValidation() && !ValidateGetUniformLocation(context, program, name))
{ {
return -1; return 0;
} }
return context->getUniformLocation(program, name); return context->getUniformLocation(program, name);
} }
return 0;
return -1;
} }
void GL_APIENTRY GetVertexAttribfv(GLuint index, GLenum pname, GLfloat *params) void GL_APIENTRY GetVertexAttribfv(GLuint index, GLenum pname, GLfloat *params)
{ {
EVENT("(GLuint index = %d, GLenum pname = 0x%X, GLfloat* params = 0x%0.8p)", index, pname, EVENT("(GLuint index = %d, GLenum pname = 0x%X, GLfloat *params = 0x%0.8p)", index, pname,
params); params);
Context *context = GetValidGlobalContext(); Context *context = GetValidGlobalContext();
if (context) if (context)
{ {
context->gatherParams<EntryPoint::GetVertexAttribfv>(index, pname, params);
if (!context->skipValidation() && !ValidateGetVertexAttribfv(context, index, pname, params)) if (!context->skipValidation() && !ValidateGetVertexAttribfv(context, index, pname, params))
{ {
return; return;
...@@ -1444,12 +1603,14 @@ void GL_APIENTRY GetVertexAttribfv(GLuint index, GLenum pname, GLfloat *params) ...@@ -1444,12 +1603,14 @@ void GL_APIENTRY GetVertexAttribfv(GLuint index, GLenum pname, GLfloat *params)
void GL_APIENTRY GetVertexAttribiv(GLuint index, GLenum pname, GLint *params) void GL_APIENTRY GetVertexAttribiv(GLuint index, GLenum pname, GLint *params)
{ {
EVENT("(GLuint index = %d, GLenum pname = 0x%X, GLint* params = 0x%0.8p)", index, pname, EVENT("(GLuint index = %d, GLenum pname = 0x%X, GLint *params = 0x%0.8p)", index, pname,
params); params);
Context *context = GetValidGlobalContext(); Context *context = GetValidGlobalContext();
if (context) if (context)
{ {
context->gatherParams<EntryPoint::GetVertexAttribiv>(index, pname, params);
if (!context->skipValidation() && !ValidateGetVertexAttribiv(context, index, pname, params)) if (!context->skipValidation() && !ValidateGetVertexAttribiv(context, index, pname, params))
{ {
return; return;
...@@ -1461,12 +1622,14 @@ void GL_APIENTRY GetVertexAttribiv(GLuint index, GLenum pname, GLint *params) ...@@ -1461,12 +1622,14 @@ void GL_APIENTRY GetVertexAttribiv(GLuint index, GLenum pname, GLint *params)
void GL_APIENTRY GetVertexAttribPointerv(GLuint index, GLenum pname, void **pointer) void GL_APIENTRY GetVertexAttribPointerv(GLuint index, GLenum pname, void **pointer)
{ {
EVENT("(GLuint index = %d, GLenum pname = 0x%X, void** pointer = 0x%0.8p)", index, pname, EVENT("(GLuint index = %d, GLenum pname = 0x%X, void **pointer = 0x%0.8p)", index, pname,
pointer); pointer);
Context *context = GetValidGlobalContext(); Context *context = GetValidGlobalContext();
if (context) if (context)
{ {
context->gatherParams<EntryPoint::GetVertexAttribPointerv>(index, pname, pointer);
if (!context->skipValidation() && if (!context->skipValidation() &&
!ValidateGetVertexAttribPointerv(context, index, pname, pointer)) !ValidateGetVertexAttribPointerv(context, index, pname, pointer))
{ {
...@@ -1484,6 +1647,8 @@ void GL_APIENTRY Hint(GLenum target, GLenum mode) ...@@ -1484,6 +1647,8 @@ void GL_APIENTRY Hint(GLenum target, GLenum mode)
Context *context = GetValidGlobalContext(); Context *context = GetValidGlobalContext();
if (context) if (context)
{ {
context->gatherParams<EntryPoint::Hint>(target, mode);
if (!context->skipValidation() && !ValidateHint(context, target, mode)) if (!context->skipValidation() && !ValidateHint(context, target, mode))
{ {
return; return;
...@@ -1500,6 +1665,8 @@ GLboolean GL_APIENTRY IsBuffer(GLuint buffer) ...@@ -1500,6 +1665,8 @@ GLboolean GL_APIENTRY IsBuffer(GLuint buffer)
Context *context = GetValidGlobalContext(); Context *context = GetValidGlobalContext();
if (context) if (context)
{ {
context->gatherParams<EntryPoint::IsBuffer>(buffer);
if (!context->skipValidation() && !ValidateIsBuffer(context, buffer)) if (!context->skipValidation() && !ValidateIsBuffer(context, buffer))
{ {
return GL_FALSE; return GL_FALSE;
...@@ -1507,7 +1674,6 @@ GLboolean GL_APIENTRY IsBuffer(GLuint buffer) ...@@ -1507,7 +1674,6 @@ GLboolean GL_APIENTRY IsBuffer(GLuint buffer)
return context->isBuffer(buffer); return context->isBuffer(buffer);
} }
return GL_FALSE; return GL_FALSE;
} }
...@@ -1518,6 +1684,8 @@ GLboolean GL_APIENTRY IsEnabled(GLenum cap) ...@@ -1518,6 +1684,8 @@ GLboolean GL_APIENTRY IsEnabled(GLenum cap)
Context *context = GetValidGlobalContext(); Context *context = GetValidGlobalContext();
if (context) if (context)
{ {
context->gatherParams<EntryPoint::IsEnabled>(cap);
if (!context->skipValidation() && !ValidateIsEnabled(context, cap)) if (!context->skipValidation() && !ValidateIsEnabled(context, cap))
{ {
return GL_FALSE; return GL_FALSE;
...@@ -1525,7 +1693,6 @@ GLboolean GL_APIENTRY IsEnabled(GLenum cap) ...@@ -1525,7 +1693,6 @@ GLboolean GL_APIENTRY IsEnabled(GLenum cap)
return context->isEnabled(cap); return context->isEnabled(cap);
} }
return GL_FALSE; return GL_FALSE;
} }
...@@ -1536,6 +1703,8 @@ GLboolean GL_APIENTRY IsFramebuffer(GLuint framebuffer) ...@@ -1536,6 +1703,8 @@ GLboolean GL_APIENTRY IsFramebuffer(GLuint framebuffer)
Context *context = GetValidGlobalContext(); Context *context = GetValidGlobalContext();
if (context) if (context)
{ {
context->gatherParams<EntryPoint::IsFramebuffer>(framebuffer);
if (!context->skipValidation() && !ValidateIsFramebuffer(context, framebuffer)) if (!context->skipValidation() && !ValidateIsFramebuffer(context, framebuffer))
{ {
return GL_FALSE; return GL_FALSE;
...@@ -1543,7 +1712,6 @@ GLboolean GL_APIENTRY IsFramebuffer(GLuint framebuffer) ...@@ -1543,7 +1712,6 @@ GLboolean GL_APIENTRY IsFramebuffer(GLuint framebuffer)
return context->isFramebuffer(framebuffer); return context->isFramebuffer(framebuffer);
} }
return GL_FALSE; return GL_FALSE;
} }
...@@ -1554,6 +1722,8 @@ GLboolean GL_APIENTRY IsProgram(GLuint program) ...@@ -1554,6 +1722,8 @@ GLboolean GL_APIENTRY IsProgram(GLuint program)
Context *context = GetValidGlobalContext(); Context *context = GetValidGlobalContext();
if (context) if (context)
{ {
context->gatherParams<EntryPoint::IsProgram>(program);
if (!context->skipValidation() && !ValidateIsProgram(context, program)) if (!context->skipValidation() && !ValidateIsProgram(context, program))
{ {
return GL_FALSE; return GL_FALSE;
...@@ -1561,7 +1731,6 @@ GLboolean GL_APIENTRY IsProgram(GLuint program) ...@@ -1561,7 +1731,6 @@ GLboolean GL_APIENTRY IsProgram(GLuint program)
return context->isProgram(program); return context->isProgram(program);
} }
return GL_FALSE; return GL_FALSE;
} }
...@@ -1572,6 +1741,8 @@ GLboolean GL_APIENTRY IsRenderbuffer(GLuint renderbuffer) ...@@ -1572,6 +1741,8 @@ GLboolean GL_APIENTRY IsRenderbuffer(GLuint renderbuffer)
Context *context = GetValidGlobalContext(); Context *context = GetValidGlobalContext();
if (context) if (context)
{ {
context->gatherParams<EntryPoint::IsRenderbuffer>(renderbuffer);
if (!context->skipValidation() && !ValidateIsRenderbuffer(context, renderbuffer)) if (!context->skipValidation() && !ValidateIsRenderbuffer(context, renderbuffer))
{ {
return GL_FALSE; return GL_FALSE;
...@@ -1579,7 +1750,6 @@ GLboolean GL_APIENTRY IsRenderbuffer(GLuint renderbuffer) ...@@ -1579,7 +1750,6 @@ GLboolean GL_APIENTRY IsRenderbuffer(GLuint renderbuffer)
return context->isRenderbuffer(renderbuffer); return context->isRenderbuffer(renderbuffer);
} }
return GL_FALSE; return GL_FALSE;
} }
...@@ -1590,6 +1760,8 @@ GLboolean GL_APIENTRY IsShader(GLuint shader) ...@@ -1590,6 +1760,8 @@ GLboolean GL_APIENTRY IsShader(GLuint shader)
Context *context = GetValidGlobalContext(); Context *context = GetValidGlobalContext();
if (context) if (context)
{ {
context->gatherParams<EntryPoint::IsShader>(shader);
if (!context->skipValidation() && !ValidateIsShader(context, shader)) if (!context->skipValidation() && !ValidateIsShader(context, shader))
{ {
return GL_FALSE; return GL_FALSE;
...@@ -1597,7 +1769,6 @@ GLboolean GL_APIENTRY IsShader(GLuint shader) ...@@ -1597,7 +1769,6 @@ GLboolean GL_APIENTRY IsShader(GLuint shader)
return context->isShader(shader); return context->isShader(shader);
} }
return GL_FALSE; return GL_FALSE;
} }
...@@ -1608,6 +1779,8 @@ GLboolean GL_APIENTRY IsTexture(GLuint texture) ...@@ -1608,6 +1779,8 @@ GLboolean GL_APIENTRY IsTexture(GLuint texture)
Context *context = GetValidGlobalContext(); Context *context = GetValidGlobalContext();
if (context) if (context)
{ {
context->gatherParams<EntryPoint::IsTexture>(texture);
if (!context->skipValidation() && !ValidateIsTexture(context, texture)) if (!context->skipValidation() && !ValidateIsTexture(context, texture))
{ {
return GL_FALSE; return GL_FALSE;
...@@ -1615,7 +1788,6 @@ GLboolean GL_APIENTRY IsTexture(GLuint texture) ...@@ -1615,7 +1788,6 @@ GLboolean GL_APIENTRY IsTexture(GLuint texture)
return context->isTexture(texture); return context->isTexture(texture);
} }
return GL_FALSE; return GL_FALSE;
} }
...@@ -1626,6 +1798,8 @@ void GL_APIENTRY LineWidth(GLfloat width) ...@@ -1626,6 +1798,8 @@ void GL_APIENTRY LineWidth(GLfloat width)
Context *context = GetValidGlobalContext(); Context *context = GetValidGlobalContext();
if (context) if (context)
{ {
context->gatherParams<EntryPoint::LineWidth>(width);
if (!context->skipValidation() && !ValidateLineWidth(context, width)) if (!context->skipValidation() && !ValidateLineWidth(context, width))
{ {
return; return;
...@@ -1642,6 +1816,8 @@ void GL_APIENTRY LinkProgram(GLuint program) ...@@ -1642,6 +1816,8 @@ void GL_APIENTRY LinkProgram(GLuint program)
Context *context = GetValidGlobalContext(); Context *context = GetValidGlobalContext();
if (context) if (context)
{ {
context->gatherParams<EntryPoint::LinkProgram>(program);
if (!context->skipValidation() && !ValidateLinkProgram(context, program)) if (!context->skipValidation() && !ValidateLinkProgram(context, program))
{ {
return; return;
...@@ -1658,6 +1834,8 @@ void GL_APIENTRY PixelStorei(GLenum pname, GLint param) ...@@ -1658,6 +1834,8 @@ void GL_APIENTRY PixelStorei(GLenum pname, GLint param)
Context *context = GetValidGlobalContext(); Context *context = GetValidGlobalContext();
if (context) if (context)
{ {
context->gatherParams<EntryPoint::PixelStorei>(pname, param);
if (!context->skipValidation() && !ValidatePixelStorei(context, pname, param)) if (!context->skipValidation() && !ValidatePixelStorei(context, pname, param))
{ {
return; return;
...@@ -1674,6 +1852,8 @@ void GL_APIENTRY PolygonOffset(GLfloat factor, GLfloat units) ...@@ -1674,6 +1852,8 @@ void GL_APIENTRY PolygonOffset(GLfloat factor, GLfloat units)
Context *context = GetValidGlobalContext(); Context *context = GetValidGlobalContext();
if (context) if (context)
{ {
context->gatherParams<EntryPoint::PolygonOffset>(factor, units);
if (!context->skipValidation() && !ValidatePolygonOffset(context, factor, units)) if (!context->skipValidation() && !ValidatePolygonOffset(context, factor, units))
{ {
return; return;
...@@ -1692,13 +1872,15 @@ void GL_APIENTRY ReadPixels(GLint x, ...@@ -1692,13 +1872,15 @@ void GL_APIENTRY ReadPixels(GLint x,
void *pixels) void *pixels)
{ {
EVENT( EVENT(
"(GLint x = %d, GLint y = %d, GLsizei width = %d, GLsizei height = %d, " "(GLint x = %d, GLint y = %d, GLsizei width = %d, GLsizei height = %d, GLenum format = "
"GLenum format = 0x%X, GLenum type = 0x%X, void* pixels = 0x%0.8p)", "0x%X, GLenum type = 0x%X, void *pixels = 0x%0.8p)",
x, y, width, height, format, type, pixels); x, y, width, height, format, type, pixels);
Context *context = GetValidGlobalContext(); Context *context = GetValidGlobalContext();
if (context) if (context)
{ {
context->gatherParams<EntryPoint::ReadPixels>(x, y, width, height, format, type, pixels);
if (!context->skipValidation() && if (!context->skipValidation() &&
!ValidateReadPixels(context, x, y, width, height, format, type, pixels)) !ValidateReadPixels(context, x, y, width, height, format, type, pixels))
{ {
...@@ -1709,14 +1891,15 @@ void GL_APIENTRY ReadPixels(GLint x, ...@@ -1709,14 +1891,15 @@ void GL_APIENTRY ReadPixels(GLint x,
} }
} }
void GL_APIENTRY ReleaseShaderCompiler(void) void GL_APIENTRY ReleaseShaderCompiler()
{ {
EVENT("()"); EVENT("()");
Context *context = GetValidGlobalContext(); Context *context = GetValidGlobalContext();
if (context) if (context)
{ {
context->gatherParams<EntryPoint::ReleaseShaderCompiler>();
if (!context->skipValidation() && !ValidateReleaseShaderCompiler(context)) if (!context->skipValidation() && !ValidateReleaseShaderCompiler(context))
{ {
return; return;
...@@ -1739,6 +1922,9 @@ void GL_APIENTRY RenderbufferStorage(GLenum target, ...@@ -1739,6 +1922,9 @@ void GL_APIENTRY RenderbufferStorage(GLenum target,
Context *context = GetValidGlobalContext(); Context *context = GetValidGlobalContext();
if (context) if (context)
{ {
context->gatherParams<EntryPoint::RenderbufferStorage>(target, internalformat, width,
height);
if (!context->skipValidation() && if (!context->skipValidation() &&
!ValidateRenderbufferStorage(context, target, internalformat, width, height)) !ValidateRenderbufferStorage(context, target, internalformat, width, height))
{ {
...@@ -1754,9 +1940,10 @@ void GL_APIENTRY SampleCoverage(GLfloat value, GLboolean invert) ...@@ -1754,9 +1940,10 @@ void GL_APIENTRY SampleCoverage(GLfloat value, GLboolean invert)
EVENT("(GLfloat value = %f, GLboolean invert = %u)", value, invert); EVENT("(GLfloat value = %f, GLboolean invert = %u)", value, invert);
Context *context = GetValidGlobalContext(); Context *context = GetValidGlobalContext();
if (context) if (context)
{ {
context->gatherParams<EntryPoint::SampleCoverage>(value, invert);
if (!context->skipValidation() && !ValidateSampleCoverage(context, value, invert)) if (!context->skipValidation() && !ValidateSampleCoverage(context, value, invert))
{ {
return; return;
...@@ -1774,6 +1961,8 @@ void GL_APIENTRY Scissor(GLint x, GLint y, GLsizei width, GLsizei height) ...@@ -1774,6 +1961,8 @@ void GL_APIENTRY Scissor(GLint x, GLint y, GLsizei width, GLsizei height)
Context *context = GetValidGlobalContext(); Context *context = GetValidGlobalContext();
if (context) if (context)
{ {
context->gatherParams<EntryPoint::Scissor>(x, y, width, height);
if (!context->skipValidation() && !ValidateScissor(context, x, y, width, height)) if (!context->skipValidation() && !ValidateScissor(context, x, y, width, height))
{ {
return; return;
...@@ -1783,27 +1972,30 @@ void GL_APIENTRY Scissor(GLint x, GLint y, GLsizei width, GLsizei height) ...@@ -1783,27 +1972,30 @@ void GL_APIENTRY Scissor(GLint x, GLint y, GLsizei width, GLsizei height)
} }
} }
void GL_APIENTRY ShaderBinary(GLsizei n, void GL_APIENTRY ShaderBinary(GLsizei count,
const GLuint *shaders, const GLuint *shaders,
GLenum binaryformat, GLenum binaryformat,
const void *binary, const void *binary,
GLsizei length) GLsizei length)
{ {
EVENT( EVENT(
"(GLsizei n = %d, const GLuint* shaders = 0x%0.8p, GLenum binaryformat = 0x%X, " "(GLsizei count = %d, const GLuint *shaders = 0x%0.8p, GLenum binaryformat = 0x%X, const "
"const void* binary = 0x%0.8p, GLsizei length = %d)", "void *binary = 0x%0.8p, GLsizei length = %d)",
n, shaders, binaryformat, binary, length); count, shaders, binaryformat, binary, length);
Context *context = GetValidGlobalContext(); Context *context = GetValidGlobalContext();
if (context) if (context)
{ {
context->gatherParams<EntryPoint::ShaderBinary>(count, shaders, binaryformat, binary,
length);
if (!context->skipValidation() && if (!context->skipValidation() &&
!ValidateShaderBinary(context, n, shaders, binaryformat, binary, length)) !ValidateShaderBinary(context, count, shaders, binaryformat, binary, length))
{ {
return; return;
} }
context->shaderBinary(n, shaders, binaryformat, binary, length); context->shaderBinary(count, shaders, binaryformat, binary, length);
} }
} }
...@@ -1813,13 +2005,15 @@ void GL_APIENTRY ShaderSource(GLuint shader, ...@@ -1813,13 +2005,15 @@ void GL_APIENTRY ShaderSource(GLuint shader,
const GLint *length) const GLint *length)
{ {
EVENT( EVENT(
"(GLuint shader = %d, GLsizei count = %d, const GLchar** string = 0x%0.8p, const GLint* " "(GLuint shader = %d, GLsizei count = %d, const GLchar *const*string = 0x%0.8p, const "
"length = 0x%0.8p)", "GLint *length = 0x%0.8p)",
shader, count, string, length); shader, count, string, length);
Context *context = GetValidGlobalContext(); Context *context = GetValidGlobalContext();
if (context) if (context)
{ {
context->gatherParams<EntryPoint::ShaderSource>(shader, count, string, length);
if (!context->skipValidation() && if (!context->skipValidation() &&
!ValidateShaderSource(context, shader, count, string, length)) !ValidateShaderSource(context, shader, count, string, length))
{ {
...@@ -1837,6 +2031,8 @@ void GL_APIENTRY StencilFunc(GLenum func, GLint ref, GLuint mask) ...@@ -1837,6 +2031,8 @@ void GL_APIENTRY StencilFunc(GLenum func, GLint ref, GLuint mask)
Context *context = GetValidGlobalContext(); Context *context = GetValidGlobalContext();
if (context) if (context)
{ {
context->gatherParams<EntryPoint::StencilFunc>(func, ref, mask);
if (!context->skipValidation() && !ValidateStencilFunc(context, func, ref, mask)) if (!context->skipValidation() && !ValidateStencilFunc(context, func, ref, mask))
{ {
return; return;
...@@ -1854,6 +2050,8 @@ void GL_APIENTRY StencilFuncSeparate(GLenum face, GLenum func, GLint ref, GLuint ...@@ -1854,6 +2050,8 @@ void GL_APIENTRY StencilFuncSeparate(GLenum face, GLenum func, GLint ref, GLuint
Context *context = GetValidGlobalContext(); Context *context = GetValidGlobalContext();
if (context) if (context)
{ {
context->gatherParams<EntryPoint::StencilFuncSeparate>(face, func, ref, mask);
if (!context->skipValidation() && if (!context->skipValidation() &&
!ValidateStencilFuncSeparate(context, face, func, ref, mask)) !ValidateStencilFuncSeparate(context, face, func, ref, mask))
{ {
...@@ -1871,6 +2069,8 @@ void GL_APIENTRY StencilMask(GLuint mask) ...@@ -1871,6 +2069,8 @@ void GL_APIENTRY StencilMask(GLuint mask)
Context *context = GetValidGlobalContext(); Context *context = GetValidGlobalContext();
if (context) if (context)
{ {
context->gatherParams<EntryPoint::StencilMask>(mask);
if (!context->skipValidation() && !ValidateStencilMask(context, mask)) if (!context->skipValidation() && !ValidateStencilMask(context, mask))
{ {
return; return;
...@@ -1887,6 +2087,8 @@ void GL_APIENTRY StencilMaskSeparate(GLenum face, GLuint mask) ...@@ -1887,6 +2087,8 @@ void GL_APIENTRY StencilMaskSeparate(GLenum face, GLuint mask)
Context *context = GetValidGlobalContext(); Context *context = GetValidGlobalContext();
if (context) if (context)
{ {
context->gatherParams<EntryPoint::StencilMaskSeparate>(face, mask);
if (!context->skipValidation() && !ValidateStencilMaskSeparate(context, face, mask)) if (!context->skipValidation() && !ValidateStencilMaskSeparate(context, face, mask))
{ {
return; return;
...@@ -1898,11 +2100,13 @@ void GL_APIENTRY StencilMaskSeparate(GLenum face, GLuint mask) ...@@ -1898,11 +2100,13 @@ void GL_APIENTRY StencilMaskSeparate(GLenum face, GLuint mask)
void GL_APIENTRY StencilOp(GLenum fail, GLenum zfail, GLenum zpass) void GL_APIENTRY StencilOp(GLenum fail, GLenum zfail, GLenum zpass)
{ {
EVENT("(GLenum fail = 0x%X, GLenum zfail = 0x%X, GLenum zpas = 0x%Xs)", fail, zfail, zpass); EVENT("(GLenum fail = 0x%X, GLenum zfail = 0x%X, GLenum zpass = 0x%X)", fail, zfail, zpass);
Context *context = GetValidGlobalContext(); Context *context = GetValidGlobalContext();
if (context) if (context)
{ {
context->gatherParams<EntryPoint::StencilOp>(fail, zfail, zpass);
if (!context->skipValidation() && !ValidateStencilOp(context, fail, zfail, zpass)) if (!context->skipValidation() && !ValidateStencilOp(context, fail, zfail, zpass))
{ {
return; return;
...@@ -1912,21 +2116,23 @@ void GL_APIENTRY StencilOp(GLenum fail, GLenum zfail, GLenum zpass) ...@@ -1912,21 +2116,23 @@ void GL_APIENTRY StencilOp(GLenum fail, GLenum zfail, GLenum zpass)
} }
} }
void GL_APIENTRY StencilOpSeparate(GLenum face, GLenum fail, GLenum zfail, GLenum zpass) void GL_APIENTRY StencilOpSeparate(GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass)
{ {
EVENT("(GLenum face = 0x%X, GLenum fail = 0x%X, GLenum zfail = 0x%X, GLenum zpas = 0x%Xs)", EVENT("(GLenum face = 0x%X, GLenum sfail = 0x%X, GLenum dpfail = 0x%X, GLenum dppass = 0x%X)",
face, fail, zfail, zpass); face, sfail, dpfail, dppass);
Context *context = GetValidGlobalContext(); Context *context = GetValidGlobalContext();
if (context) if (context)
{ {
context->gatherParams<EntryPoint::StencilOpSeparate>(face, sfail, dpfail, dppass);
if (!context->skipValidation() && if (!context->skipValidation() &&
!ValidateStencilOpSeparate(context, face, fail, zfail, zpass)) !ValidateStencilOpSeparate(context, face, sfail, dpfail, dppass))
{ {
return; return;
} }
context->stencilOpSeparate(face, fail, zfail, zpass); context->stencilOpSeparate(face, sfail, dpfail, dppass);
} }
} }
...@@ -1942,14 +2148,16 @@ void GL_APIENTRY TexImage2D(GLenum target, ...@@ -1942,14 +2148,16 @@ void GL_APIENTRY TexImage2D(GLenum target,
{ {
EVENT( EVENT(
"(GLenum target = 0x%X, GLint level = %d, GLint internalformat = %d, GLsizei width = %d, " "(GLenum target = 0x%X, GLint level = %d, GLint internalformat = %d, GLsizei width = %d, "
"GLsizei height = %d, " "GLsizei height = %d, GLint border = %d, GLenum format = 0x%X, GLenum type = 0x%X, const "
"GLint border = %d, GLenum format = 0x%X, GLenum type = 0x%X, const void* pixels = " "void *pixels = 0x%0.8p)",
"0x%0.8p)",
target, level, internalformat, width, height, border, format, type, pixels); target, level, internalformat, width, height, border, format, type, pixels);
Context *context = GetValidGlobalContext(); Context *context = GetValidGlobalContext();
if (context) if (context)
{ {
context->gatherParams<EntryPoint::TexImage2D>(target, level, internalformat, width, height,
border, format, type, pixels);
if (!context->skipValidation() && if (!context->skipValidation() &&
!ValidateTexImage2D(context, target, level, internalformat, width, height, border, !ValidateTexImage2D(context, target, level, internalformat, width, height, border,
format, type, pixels)) format, type, pixels))
...@@ -1964,11 +2172,13 @@ void GL_APIENTRY TexImage2D(GLenum target, ...@@ -1964,11 +2172,13 @@ void GL_APIENTRY TexImage2D(GLenum target,
void GL_APIENTRY TexParameterf(GLenum target, GLenum pname, GLfloat param) void GL_APIENTRY TexParameterf(GLenum target, GLenum pname, GLfloat param)
{ {
EVENT("(GLenum target = 0x%X, GLenum pname = 0x%X, GLint param = %f)", target, pname, param); EVENT("(GLenum target = 0x%X, GLenum pname = 0x%X, GLfloat param = %f)", target, pname, param);
Context *context = GetValidGlobalContext(); Context *context = GetValidGlobalContext();
if (context) if (context)
{ {
context->gatherParams<EntryPoint::TexParameterf>(target, pname, param);
if (!context->skipValidation() && !ValidateTexParameterf(context, target, pname, param)) if (!context->skipValidation() && !ValidateTexParameterf(context, target, pname, param))
{ {
return; return;
...@@ -1980,12 +2190,14 @@ void GL_APIENTRY TexParameterf(GLenum target, GLenum pname, GLfloat param) ...@@ -1980,12 +2190,14 @@ void GL_APIENTRY TexParameterf(GLenum target, GLenum pname, GLfloat param)
void GL_APIENTRY TexParameterfv(GLenum target, GLenum pname, const GLfloat *params) void GL_APIENTRY TexParameterfv(GLenum target, GLenum pname, const GLfloat *params)
{ {
EVENT("(GLenum target = 0x%X, GLenum pname = 0x%X, const GLfloat* params = 0x%0.8p)", target, EVENT("(GLenum target = 0x%X, GLenum pname = 0x%X, const GLfloat *params = 0x%0.8p)", target,
pname, params); pname, params);
Context *context = GetValidGlobalContext(); Context *context = GetValidGlobalContext();
if (context) if (context)
{ {
context->gatherParams<EntryPoint::TexParameterfv>(target, pname, params);
if (!context->skipValidation() && !ValidateTexParameterfv(context, target, pname, params)) if (!context->skipValidation() && !ValidateTexParameterfv(context, target, pname, params))
{ {
return; return;
...@@ -2002,6 +2214,8 @@ void GL_APIENTRY TexParameteri(GLenum target, GLenum pname, GLint param) ...@@ -2002,6 +2214,8 @@ void GL_APIENTRY TexParameteri(GLenum target, GLenum pname, GLint param)
Context *context = GetValidGlobalContext(); Context *context = GetValidGlobalContext();
if (context) if (context)
{ {
context->gatherParams<EntryPoint::TexParameteri>(target, pname, param);
if (!context->skipValidation() && !ValidateTexParameteri(context, target, pname, param)) if (!context->skipValidation() && !ValidateTexParameteri(context, target, pname, param))
{ {
return; return;
...@@ -2013,12 +2227,14 @@ void GL_APIENTRY TexParameteri(GLenum target, GLenum pname, GLint param) ...@@ -2013,12 +2227,14 @@ void GL_APIENTRY TexParameteri(GLenum target, GLenum pname, GLint param)
void GL_APIENTRY TexParameteriv(GLenum target, GLenum pname, const GLint *params) void GL_APIENTRY TexParameteriv(GLenum target, GLenum pname, const GLint *params)
{ {
EVENT("(GLenum target = 0x%X, GLenum pname = 0x%X, const GLint* params = 0x%0.8p)", target, EVENT("(GLenum target = 0x%X, GLenum pname = 0x%X, const GLint *params = 0x%0.8p)", target,
pname, params); pname, params);
Context *context = GetValidGlobalContext(); Context *context = GetValidGlobalContext();
if (context) if (context)
{ {
context->gatherParams<EntryPoint::TexParameteriv>(target, pname, params);
if (!context->skipValidation() && !ValidateTexParameteriv(context, target, pname, params)) if (!context->skipValidation() && !ValidateTexParameteriv(context, target, pname, params))
{ {
return; return;
...@@ -2039,14 +2255,17 @@ void GL_APIENTRY TexSubImage2D(GLenum target, ...@@ -2039,14 +2255,17 @@ void GL_APIENTRY TexSubImage2D(GLenum target,
const void *pixels) const void *pixels)
{ {
EVENT( EVENT(
"(GLenum target = 0x%X, GLint level = %d, GLint xoffset = %d, GLint yoffset = %d, " "(GLenum target = 0x%X, GLint level = %d, GLint xoffset = %d, GLint yoffset = %d, GLsizei "
"GLsizei width = %d, GLsizei height = %d, GLenum format = 0x%X, GLenum type = 0x%X, " "width = %d, GLsizei height = %d, GLenum format = 0x%X, GLenum type = 0x%X, const void "
"const void* pixels = 0x%0.8p)", "*pixels = 0x%0.8p)",
target, level, xoffset, yoffset, width, height, format, type, pixels); target, level, xoffset, yoffset, width, height, format, type, pixels);
Context *context = GetValidGlobalContext(); Context *context = GetValidGlobalContext();
if (context) if (context)
{ {
context->gatherParams<EntryPoint::TexSubImage2D>(target, level, xoffset, yoffset, width,
height, format, type, pixels);
if (!context->skipValidation() && if (!context->skipValidation() &&
!ValidateTexSubImage2D(context, target, level, xoffset, yoffset, width, height, format, !ValidateTexSubImage2D(context, target, level, xoffset, yoffset, width, height, format,
type, pixels)) type, pixels))
...@@ -2059,270 +2278,304 @@ void GL_APIENTRY TexSubImage2D(GLenum target, ...@@ -2059,270 +2278,304 @@ void GL_APIENTRY TexSubImage2D(GLenum target,
} }
} }
void GL_APIENTRY Uniform1f(GLint location, GLfloat x) void GL_APIENTRY Uniform1f(GLint location, GLfloat v0)
{ {
EVENT("(GLint location = %d, GLfloat x = %f)", location, x); EVENT("(GLint location = %d, GLfloat v0 = %f)", location, v0);
Context *context = GetValidGlobalContext(); Context *context = GetValidGlobalContext();
if (context) if (context)
{ {
if (!context->skipValidation() && !ValidateUniform1f(context, location, x)) context->gatherParams<EntryPoint::Uniform1f>(location, v0);
if (!context->skipValidation() && !ValidateUniform1f(context, location, v0))
{ {
return; return;
} }
context->uniform1f(location, x); context->uniform1f(location, v0);
} }
} }
void GL_APIENTRY Uniform1fv(GLint location, GLsizei count, const GLfloat *v) void GL_APIENTRY Uniform1fv(GLint location, GLsizei count, const GLfloat *value)
{ {
EVENT("(GLint location = %d, GLsizei count = %d, const GLfloat* v = 0x%0.8p)", location, count, EVENT("(GLint location = %d, GLsizei count = %d, const GLfloat *value = 0x%0.8p)", location,
v); count, value);
Context *context = GetValidGlobalContext(); Context *context = GetValidGlobalContext();
if (context) if (context)
{ {
if (!context->skipValidation() && !ValidateUniform1fv(context, location, count, v)) context->gatherParams<EntryPoint::Uniform1fv>(location, count, value);
if (!context->skipValidation() && !ValidateUniform1fv(context, location, count, value))
{ {
return; return;
} }
context->uniform1fv(location, count, v); context->uniform1fv(location, count, value);
} }
} }
void GL_APIENTRY Uniform1i(GLint location, GLint x) void GL_APIENTRY Uniform1i(GLint location, GLint v0)
{ {
EVENT("(GLint location = %d, GLint x = %d)", location, x); EVENT("(GLint location = %d, GLint v0 = %d)", location, v0);
Context *context = GetValidGlobalContext(); Context *context = GetValidGlobalContext();
if (context) if (context)
{ {
if (!context->skipValidation() && !ValidateUniform1i(context, location, x)) context->gatherParams<EntryPoint::Uniform1i>(location, v0);
if (!context->skipValidation() && !ValidateUniform1i(context, location, v0))
{ {
return; return;
} }
context->uniform1i(location, x); context->uniform1i(location, v0);
} }
} }
void GL_APIENTRY Uniform1iv(GLint location, GLsizei count, const GLint *v) void GL_APIENTRY Uniform1iv(GLint location, GLsizei count, const GLint *value)
{ {
EVENT("(GLint location = %d, GLsizei count = %d, const GLint* v = 0x%0.8p)", location, count, EVENT("(GLint location = %d, GLsizei count = %d, const GLint *value = 0x%0.8p)", location,
v); count, value);
Context *context = GetValidGlobalContext(); Context *context = GetValidGlobalContext();
if (context) if (context)
{ {
if (!context->skipValidation() && !ValidateUniform1iv(context, location, count, v)) context->gatherParams<EntryPoint::Uniform1iv>(location, count, value);
if (!context->skipValidation() && !ValidateUniform1iv(context, location, count, value))
{ {
return; return;
} }
context->uniform1iv(location, count, v); context->uniform1iv(location, count, value);
} }
} }
void GL_APIENTRY Uniform2f(GLint location, GLfloat x, GLfloat y) void GL_APIENTRY Uniform2f(GLint location, GLfloat v0, GLfloat v1)
{ {
EVENT("(GLint location = %d, GLfloat x = %f, GLfloat y = %f)", location, x, y); EVENT("(GLint location = %d, GLfloat v0 = %f, GLfloat v1 = %f)", location, v0, v1);
Context *context = GetValidGlobalContext(); Context *context = GetValidGlobalContext();
if (context) if (context)
{ {
if (!context->skipValidation() && !ValidateUniform2f(context, location, x, y)) context->gatherParams<EntryPoint::Uniform2f>(location, v0, v1);
if (!context->skipValidation() && !ValidateUniform2f(context, location, v0, v1))
{ {
return; return;
} }
context->uniform2f(location, x, y); context->uniform2f(location, v0, v1);
} }
} }
void GL_APIENTRY Uniform2fv(GLint location, GLsizei count, const GLfloat *v) void GL_APIENTRY Uniform2fv(GLint location, GLsizei count, const GLfloat *value)
{ {
EVENT("(GLint location = %d, GLsizei count = %d, const GLfloat* v = 0x%0.8p)", location, count, EVENT("(GLint location = %d, GLsizei count = %d, const GLfloat *value = 0x%0.8p)", location,
v); count, value);
Context *context = GetValidGlobalContext(); Context *context = GetValidGlobalContext();
if (context) if (context)
{ {
if (!context->skipValidation() && !ValidateUniform2fv(context, location, count, v)) context->gatherParams<EntryPoint::Uniform2fv>(location, count, value);
if (!context->skipValidation() && !ValidateUniform2fv(context, location, count, value))
{ {
return; return;
} }
context->uniform2fv(location, count, v); context->uniform2fv(location, count, value);
} }
} }
void GL_APIENTRY Uniform2i(GLint location, GLint x, GLint y) void GL_APIENTRY Uniform2i(GLint location, GLint v0, GLint v1)
{ {
EVENT("(GLint location = %d, GLint x = %d, GLint y = %d)", location, x, y); EVENT("(GLint location = %d, GLint v0 = %d, GLint v1 = %d)", location, v0, v1);
Context *context = GetValidGlobalContext(); Context *context = GetValidGlobalContext();
if (context) if (context)
{ {
if (!context->skipValidation() && !ValidateUniform2i(context, location, x, y)) context->gatherParams<EntryPoint::Uniform2i>(location, v0, v1);
if (!context->skipValidation() && !ValidateUniform2i(context, location, v0, v1))
{ {
return; return;
} }
context->uniform2i(location, x, y); context->uniform2i(location, v0, v1);
} }
} }
void GL_APIENTRY Uniform2iv(GLint location, GLsizei count, const GLint *v) void GL_APIENTRY Uniform2iv(GLint location, GLsizei count, const GLint *value)
{ {
EVENT("(GLint location = %d, GLsizei count = %d, const GLint* v = 0x%0.8p)", location, count, EVENT("(GLint location = %d, GLsizei count = %d, const GLint *value = 0x%0.8p)", location,
v); count, value);
Context *context = GetValidGlobalContext(); Context *context = GetValidGlobalContext();
if (context) if (context)
{ {
if (!context->skipValidation() && !ValidateUniform2iv(context, location, count, v)) context->gatherParams<EntryPoint::Uniform2iv>(location, count, value);
if (!context->skipValidation() && !ValidateUniform2iv(context, location, count, value))
{ {
return; return;
} }
context->uniform2iv(location, count, v); context->uniform2iv(location, count, value);
} }
} }
void GL_APIENTRY Uniform3f(GLint location, GLfloat x, GLfloat y, GLfloat z) void GL_APIENTRY Uniform3f(GLint location, GLfloat v0, GLfloat v1, GLfloat v2)
{ {
EVENT("(GLint location = %d, GLfloat x = %f, GLfloat y = %f, GLfloat z = %f)", location, x, y, EVENT("(GLint location = %d, GLfloat v0 = %f, GLfloat v1 = %f, GLfloat v2 = %f)", location, v0,
z); v1, v2);
Context *context = GetValidGlobalContext(); Context *context = GetValidGlobalContext();
if (context) if (context)
{ {
if (!context->skipValidation() && !ValidateUniform3f(context, location, x, y, z)) context->gatherParams<EntryPoint::Uniform3f>(location, v0, v1, v2);
if (!context->skipValidation() && !ValidateUniform3f(context, location, v0, v1, v2))
{ {
return; return;
} }
context->uniform3f(location, x, y, z); context->uniform3f(location, v0, v1, v2);
} }
} }
void GL_APIENTRY Uniform3fv(GLint location, GLsizei count, const GLfloat *v) void GL_APIENTRY Uniform3fv(GLint location, GLsizei count, const GLfloat *value)
{ {
EVENT("(GLint location = %d, GLsizei count = %d, const GLfloat* v = 0x%0.8p)", location, count, EVENT("(GLint location = %d, GLsizei count = %d, const GLfloat *value = 0x%0.8p)", location,
v); count, value);
Context *context = GetValidGlobalContext(); Context *context = GetValidGlobalContext();
if (context) if (context)
{ {
if (!context->skipValidation() && !ValidateUniform3fv(context, location, count, v)) context->gatherParams<EntryPoint::Uniform3fv>(location, count, value);
if (!context->skipValidation() && !ValidateUniform3fv(context, location, count, value))
{ {
return; return;
} }
context->uniform3fv(location, count, v); context->uniform3fv(location, count, value);
} }
} }
void GL_APIENTRY Uniform3i(GLint location, GLint x, GLint y, GLint z) void GL_APIENTRY Uniform3i(GLint location, GLint v0, GLint v1, GLint v2)
{ {
EVENT("(GLint location = %d, GLint x = %d, GLint y = %d, GLint z = %d)", location, x, y, z); EVENT("(GLint location = %d, GLint v0 = %d, GLint v1 = %d, GLint v2 = %d)", location, v0, v1,
v2);
Context *context = GetValidGlobalContext(); Context *context = GetValidGlobalContext();
if (context) if (context)
{ {
if (!context->skipValidation() && !ValidateUniform3i(context, location, x, y, z)) context->gatherParams<EntryPoint::Uniform3i>(location, v0, v1, v2);
if (!context->skipValidation() && !ValidateUniform3i(context, location, v0, v1, v2))
{ {
return; return;
} }
context->uniform3i(location, x, y, z); context->uniform3i(location, v0, v1, v2);
} }
} }
void GL_APIENTRY Uniform3iv(GLint location, GLsizei count, const GLint *v) void GL_APIENTRY Uniform3iv(GLint location, GLsizei count, const GLint *value)
{ {
EVENT("(GLint location = %d, GLsizei count = %d, const GLint* v = 0x%0.8p)", location, count, EVENT("(GLint location = %d, GLsizei count = %d, const GLint *value = 0x%0.8p)", location,
v); count, value);
Context *context = GetValidGlobalContext(); Context *context = GetValidGlobalContext();
if (context) if (context)
{ {
if (!context->skipValidation() && !ValidateUniform3iv(context, location, count, v)) context->gatherParams<EntryPoint::Uniform3iv>(location, count, value);
if (!context->skipValidation() && !ValidateUniform3iv(context, location, count, value))
{ {
return; return;
} }
context->uniform3iv(location, count, v); context->uniform3iv(location, count, value);
} }
} }
void GL_APIENTRY Uniform4f(GLint location, GLfloat x, GLfloat y, GLfloat z, GLfloat w) void GL_APIENTRY Uniform4f(GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3)
{ {
EVENT("(GLint location = %d, GLfloat x = %f, GLfloat y = %f, GLfloat z = %f, GLfloat w = %f)", EVENT(
location, x, y, z, w); "(GLint location = %d, GLfloat v0 = %f, GLfloat v1 = %f, GLfloat v2 = %f, GLfloat v3 = %f)",
location, v0, v1, v2, v3);
Context *context = GetValidGlobalContext(); Context *context = GetValidGlobalContext();
if (context) if (context)
{ {
if (!context->skipValidation() && !ValidateUniform4f(context, location, x, y, z, w)) context->gatherParams<EntryPoint::Uniform4f>(location, v0, v1, v2, v3);
if (!context->skipValidation() && !ValidateUniform4f(context, location, v0, v1, v2, v3))
{ {
return; return;
} }
context->uniform4f(location, x, y, z, w); context->uniform4f(location, v0, v1, v2, v3);
} }
} }
void GL_APIENTRY Uniform4fv(GLint location, GLsizei count, const GLfloat *v) void GL_APIENTRY Uniform4fv(GLint location, GLsizei count, const GLfloat *value)
{ {
EVENT("(GLint location = %d, GLsizei count = %d, const GLfloat* v = 0x%0.8p)", location, count, EVENT("(GLint location = %d, GLsizei count = %d, const GLfloat *value = 0x%0.8p)", location,
v); count, value);
Context *context = GetValidGlobalContext(); Context *context = GetValidGlobalContext();
if (context) if (context)
{ {
if (!context->skipValidation() && !ValidateUniform4fv(context, location, count, v)) context->gatherParams<EntryPoint::Uniform4fv>(location, count, value);
if (!context->skipValidation() && !ValidateUniform4fv(context, location, count, value))
{ {
return; return;
} }
context->uniform4fv(location, count, v); context->uniform4fv(location, count, value);
} }
} }
void GL_APIENTRY Uniform4i(GLint location, GLint x, GLint y, GLint z, GLint w) void GL_APIENTRY Uniform4i(GLint location, GLint v0, GLint v1, GLint v2, GLint v3)
{ {
EVENT("(GLint location = %d, GLint x = %d, GLint y = %d, GLint z = %d, GLint w = %d)", location, EVENT("(GLint location = %d, GLint v0 = %d, GLint v1 = %d, GLint v2 = %d, GLint v3 = %d)",
x, y, z, w); location, v0, v1, v2, v3);
Context *context = GetValidGlobalContext(); Context *context = GetValidGlobalContext();
if (context) if (context)
{ {
if (!context->skipValidation() && !ValidateUniform4i(context, location, x, y, z, w)) context->gatherParams<EntryPoint::Uniform4i>(location, v0, v1, v2, v3);
if (!context->skipValidation() && !ValidateUniform4i(context, location, v0, v1, v2, v3))
{ {
return; return;
} }
context->uniform4i(location, x, y, z, w); context->uniform4i(location, v0, v1, v2, v3);
} }
} }
void GL_APIENTRY Uniform4iv(GLint location, GLsizei count, const GLint *v) void GL_APIENTRY Uniform4iv(GLint location, GLsizei count, const GLint *value)
{ {
EVENT("(GLint location = %d, GLsizei count = %d, const GLint* v = 0x%0.8p)", location, count, EVENT("(GLint location = %d, GLsizei count = %d, const GLint *value = 0x%0.8p)", location,
v); count, value);
Context *context = GetValidGlobalContext(); Context *context = GetValidGlobalContext();
if (context) if (context)
{ {
if (!context->skipValidation() && !ValidateUniform4iv(context, location, count, v)) context->gatherParams<EntryPoint::Uniform4iv>(location, count, value);
if (!context->skipValidation() && !ValidateUniform4iv(context, location, count, value))
{ {
return; return;
} }
context->uniform4iv(location, count, v); context->uniform4iv(location, count, value);
} }
} }
...@@ -2332,13 +2585,15 @@ void GL_APIENTRY UniformMatrix2fv(GLint location, ...@@ -2332,13 +2585,15 @@ void GL_APIENTRY UniformMatrix2fv(GLint location,
const GLfloat *value) const GLfloat *value)
{ {
EVENT( EVENT(
"(GLint location = %d, GLsizei count = %d, GLboolean transpose = %u, const GLfloat* value " "(GLint location = %d, GLsizei count = %d, GLboolean transpose = %u, const GLfloat *value "
"= 0x%0.8p)", "= 0x%0.8p)",
location, count, transpose, value); location, count, transpose, value);
Context *context = GetValidGlobalContext(); Context *context = GetValidGlobalContext();
if (context) if (context)
{ {
context->gatherParams<EntryPoint::UniformMatrix2fv>(location, count, transpose, value);
if (!context->skipValidation() && if (!context->skipValidation() &&
!ValidateUniformMatrix2fv(context, location, count, transpose, value)) !ValidateUniformMatrix2fv(context, location, count, transpose, value))
{ {
...@@ -2355,13 +2610,15 @@ void GL_APIENTRY UniformMatrix3fv(GLint location, ...@@ -2355,13 +2610,15 @@ void GL_APIENTRY UniformMatrix3fv(GLint location,
const GLfloat *value) const GLfloat *value)
{ {
EVENT( EVENT(
"(GLint location = %d, GLsizei count = %d, GLboolean transpose = %u, const GLfloat* value " "(GLint location = %d, GLsizei count = %d, GLboolean transpose = %u, const GLfloat *value "
"= 0x%0.8p)", "= 0x%0.8p)",
location, count, transpose, value); location, count, transpose, value);
Context *context = GetValidGlobalContext(); Context *context = GetValidGlobalContext();
if (context) if (context)
{ {
context->gatherParams<EntryPoint::UniformMatrix3fv>(location, count, transpose, value);
if (!context->skipValidation() && if (!context->skipValidation() &&
!ValidateUniformMatrix3fv(context, location, count, transpose, value)) !ValidateUniformMatrix3fv(context, location, count, transpose, value))
{ {
...@@ -2378,13 +2635,15 @@ void GL_APIENTRY UniformMatrix4fv(GLint location, ...@@ -2378,13 +2635,15 @@ void GL_APIENTRY UniformMatrix4fv(GLint location,
const GLfloat *value) const GLfloat *value)
{ {
EVENT( EVENT(
"(GLint location = %d, GLsizei count = %d, GLboolean transpose = %u, const GLfloat* value " "(GLint location = %d, GLsizei count = %d, GLboolean transpose = %u, const GLfloat *value "
"= 0x%0.8p)", "= 0x%0.8p)",
location, count, transpose, value); location, count, transpose, value);
Context *context = GetValidGlobalContext(); Context *context = GetValidGlobalContext();
if (context) if (context)
{ {
context->gatherParams<EntryPoint::UniformMatrix4fv>(location, count, transpose, value);
if (!context->skipValidation() && if (!context->skipValidation() &&
!ValidateUniformMatrix4fv(context, location, count, transpose, value)) !ValidateUniformMatrix4fv(context, location, count, transpose, value))
{ {
...@@ -2402,6 +2661,8 @@ void GL_APIENTRY UseProgram(GLuint program) ...@@ -2402,6 +2661,8 @@ void GL_APIENTRY UseProgram(GLuint program)
Context *context = GetValidGlobalContext(); Context *context = GetValidGlobalContext();
if (context) if (context)
{ {
context->gatherParams<EntryPoint::UseProgram>(program);
if (!context->skipValidation() && !ValidateUseProgram(context, program)) if (!context->skipValidation() && !ValidateUseProgram(context, program))
{ {
return; return;
...@@ -2418,6 +2679,8 @@ void GL_APIENTRY ValidateProgram(GLuint program) ...@@ -2418,6 +2679,8 @@ void GL_APIENTRY ValidateProgram(GLuint program)
Context *context = GetValidGlobalContext(); Context *context = GetValidGlobalContext();
if (context) if (context)
{ {
context->gatherParams<EntryPoint::ValidateProgram>(program);
if (!context->skipValidation() && !ValidateValidateProgram(context, program)) if (!context->skipValidation() && !ValidateValidateProgram(context, program))
{ {
return; return;
...@@ -2434,6 +2697,8 @@ void GL_APIENTRY VertexAttrib1f(GLuint index, GLfloat x) ...@@ -2434,6 +2697,8 @@ void GL_APIENTRY VertexAttrib1f(GLuint index, GLfloat x)
Context *context = GetValidGlobalContext(); Context *context = GetValidGlobalContext();
if (context) if (context)
{ {
context->gatherParams<EntryPoint::VertexAttrib1f>(index, x);
if (!context->skipValidation() && !ValidateVertexAttrib1f(context, index, x)) if (!context->skipValidation() && !ValidateVertexAttrib1f(context, index, x))
{ {
return; return;
...@@ -2443,19 +2708,21 @@ void GL_APIENTRY VertexAttrib1f(GLuint index, GLfloat x) ...@@ -2443,19 +2708,21 @@ void GL_APIENTRY VertexAttrib1f(GLuint index, GLfloat x)
} }
} }
void GL_APIENTRY VertexAttrib1fv(GLuint index, const GLfloat *values) void GL_APIENTRY VertexAttrib1fv(GLuint index, const GLfloat *v)
{ {
EVENT("(GLuint index = %d, const GLfloat* values = 0x%0.8p)", index, values); EVENT("(GLuint index = %d, const GLfloat *v = 0x%0.8p)", index, v);
Context *context = GetValidGlobalContext(); Context *context = GetValidGlobalContext();
if (context) if (context)
{ {
if (!context->skipValidation() && !ValidateVertexAttrib1fv(context, index, values)) context->gatherParams<EntryPoint::VertexAttrib1fv>(index, v);
if (!context->skipValidation() && !ValidateVertexAttrib1fv(context, index, v))
{ {
return; return;
} }
context->vertexAttrib1fv(index, values); context->vertexAttrib1fv(index, v);
} }
} }
...@@ -2466,6 +2733,8 @@ void GL_APIENTRY VertexAttrib2f(GLuint index, GLfloat x, GLfloat y) ...@@ -2466,6 +2733,8 @@ void GL_APIENTRY VertexAttrib2f(GLuint index, GLfloat x, GLfloat y)
Context *context = GetValidGlobalContext(); Context *context = GetValidGlobalContext();
if (context) if (context)
{ {
context->gatherParams<EntryPoint::VertexAttrib2f>(index, x, y);
if (!context->skipValidation() && !ValidateVertexAttrib2f(context, index, x, y)) if (!context->skipValidation() && !ValidateVertexAttrib2f(context, index, x, y))
{ {
return; return;
...@@ -2475,19 +2744,21 @@ void GL_APIENTRY VertexAttrib2f(GLuint index, GLfloat x, GLfloat y) ...@@ -2475,19 +2744,21 @@ void GL_APIENTRY VertexAttrib2f(GLuint index, GLfloat x, GLfloat y)
} }
} }
void GL_APIENTRY VertexAttrib2fv(GLuint index, const GLfloat *values) void GL_APIENTRY VertexAttrib2fv(GLuint index, const GLfloat *v)
{ {
EVENT("(GLuint index = %d, const GLfloat* values = 0x%0.8p)", index, values); EVENT("(GLuint index = %d, const GLfloat *v = 0x%0.8p)", index, v);
Context *context = GetValidGlobalContext(); Context *context = GetValidGlobalContext();
if (context) if (context)
{ {
if (!context->skipValidation() && !ValidateVertexAttrib2fv(context, index, values)) context->gatherParams<EntryPoint::VertexAttrib2fv>(index, v);
if (!context->skipValidation() && !ValidateVertexAttrib2fv(context, index, v))
{ {
return; return;
} }
context->vertexAttrib2fv(index, values); context->vertexAttrib2fv(index, v);
} }
} }
...@@ -2498,6 +2769,8 @@ void GL_APIENTRY VertexAttrib3f(GLuint index, GLfloat x, GLfloat y, GLfloat z) ...@@ -2498,6 +2769,8 @@ void GL_APIENTRY VertexAttrib3f(GLuint index, GLfloat x, GLfloat y, GLfloat z)
Context *context = GetValidGlobalContext(); Context *context = GetValidGlobalContext();
if (context) if (context)
{ {
context->gatherParams<EntryPoint::VertexAttrib3f>(index, x, y, z);
if (!context->skipValidation() && !ValidateVertexAttrib3f(context, index, x, y, z)) if (!context->skipValidation() && !ValidateVertexAttrib3f(context, index, x, y, z))
{ {
return; return;
...@@ -2507,19 +2780,21 @@ void GL_APIENTRY VertexAttrib3f(GLuint index, GLfloat x, GLfloat y, GLfloat z) ...@@ -2507,19 +2780,21 @@ void GL_APIENTRY VertexAttrib3f(GLuint index, GLfloat x, GLfloat y, GLfloat z)
} }
} }
void GL_APIENTRY VertexAttrib3fv(GLuint index, const GLfloat *values) void GL_APIENTRY VertexAttrib3fv(GLuint index, const GLfloat *v)
{ {
EVENT("(GLuint index = %d, const GLfloat* values = 0x%0.8p)", index, values); EVENT("(GLuint index = %d, const GLfloat *v = 0x%0.8p)", index, v);
Context *context = GetValidGlobalContext(); Context *context = GetValidGlobalContext();
if (context) if (context)
{ {
if (!context->skipValidation() && !ValidateVertexAttrib3fv(context, index, values)) context->gatherParams<EntryPoint::VertexAttrib3fv>(index, v);
if (!context->skipValidation() && !ValidateVertexAttrib3fv(context, index, v))
{ {
return; return;
} }
context->vertexAttrib3fv(index, values); context->vertexAttrib3fv(index, v);
} }
} }
...@@ -2531,6 +2806,8 @@ void GL_APIENTRY VertexAttrib4f(GLuint index, GLfloat x, GLfloat y, GLfloat z, G ...@@ -2531,6 +2806,8 @@ void GL_APIENTRY VertexAttrib4f(GLuint index, GLfloat x, GLfloat y, GLfloat z, G
Context *context = GetValidGlobalContext(); Context *context = GetValidGlobalContext();
if (context) if (context)
{ {
context->gatherParams<EntryPoint::VertexAttrib4f>(index, x, y, z, w);
if (!context->skipValidation() && !ValidateVertexAttrib4f(context, index, x, y, z, w)) if (!context->skipValidation() && !ValidateVertexAttrib4f(context, index, x, y, z, w))
{ {
return; return;
...@@ -2540,19 +2817,21 @@ void GL_APIENTRY VertexAttrib4f(GLuint index, GLfloat x, GLfloat y, GLfloat z, G ...@@ -2540,19 +2817,21 @@ void GL_APIENTRY VertexAttrib4f(GLuint index, GLfloat x, GLfloat y, GLfloat z, G
} }
} }
void GL_APIENTRY VertexAttrib4fv(GLuint index, const GLfloat *values) void GL_APIENTRY VertexAttrib4fv(GLuint index, const GLfloat *v)
{ {
EVENT("(GLuint index = %d, const GLfloat* values = 0x%0.8p)", index, values); EVENT("(GLuint index = %d, const GLfloat *v = 0x%0.8p)", index, v);
Context *context = GetValidGlobalContext(); Context *context = GetValidGlobalContext();
if (context) if (context)
{ {
if (!context->skipValidation() && !ValidateVertexAttrib4fv(context, index, values)) context->gatherParams<EntryPoint::VertexAttrib4fv>(index, v);
if (!context->skipValidation() && !ValidateVertexAttrib4fv(context, index, v))
{ {
return; return;
} }
context->vertexAttrib4fv(index, values); context->vertexAttrib4fv(index, v);
} }
} }
...@@ -2561,23 +2840,26 @@ void GL_APIENTRY VertexAttribPointer(GLuint index, ...@@ -2561,23 +2840,26 @@ void GL_APIENTRY VertexAttribPointer(GLuint index,
GLenum type, GLenum type,
GLboolean normalized, GLboolean normalized,
GLsizei stride, GLsizei stride,
const void *ptr) const void *pointer)
{ {
EVENT( EVENT(
"(GLuint index = %d, GLint size = %d, GLenum type = 0x%X, " "(GLuint index = %d, GLint size = %d, GLenum type = 0x%X, GLboolean normalized = %u, "
"GLboolean normalized = %u, GLsizei stride = %d, const void* ptr = 0x%0.8p)", "GLsizei stride = %d, const void *pointer = 0x%0.8p)",
index, size, type, normalized, stride, ptr); index, size, type, normalized, stride, pointer);
Context *context = GetValidGlobalContext(); Context *context = GetValidGlobalContext();
if (context) if (context)
{ {
context->gatherParams<EntryPoint::VertexAttribPointer>(index, size, type, normalized,
stride, pointer);
if (!context->skipValidation() && if (!context->skipValidation() &&
!ValidateVertexAttribPointer(context, index, size, type, normalized, stride, ptr)) !ValidateVertexAttribPointer(context, index, size, type, normalized, stride, pointer))
{ {
return; return;
} }
context->vertexAttribPointer(index, size, type, normalized, stride, ptr); context->vertexAttribPointer(index, size, type, normalized, stride, pointer);
} }
} }
...@@ -2589,6 +2871,8 @@ void GL_APIENTRY Viewport(GLint x, GLint y, GLsizei width, GLsizei height) ...@@ -2589,6 +2871,8 @@ void GL_APIENTRY Viewport(GLint x, GLint y, GLsizei width, GLsizei height)
Context *context = GetValidGlobalContext(); Context *context = GetValidGlobalContext();
if (context) if (context)
{ {
context->gatherParams<EntryPoint::Viewport>(x, y, width, height);
if (!context->skipValidation() && !ValidateViewport(context, x, y, width, height)) if (!context->skipValidation() && !ValidateViewport(context, x, y, width, height))
{ {
return; return;
...@@ -2597,5 +2881,4 @@ void GL_APIENTRY Viewport(GLint x, GLint y, GLsizei width, GLsizei height) ...@@ -2597,5 +2881,4 @@ void GL_APIENTRY Viewport(GLint x, GLint y, GLsizei width, GLsizei height)
context->viewport(x, y, width, height); context->viewport(x, y, width, height);
} }
} }
} // namespace gl } // namespace gl
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