Commit 4b254ce7 by Geoff Lang Committed by Geoff Lang

Generate CONTEXT_LOST errors on every GL call.

The robustness spec states that all GL calls should generate context lost errors when the context is lost. This behaviour was lost due to some context lookup optimizations but can be re-added at no cost by updating the autogenerated entry points. Updated the ContextLostTest to cover the repeated error generation behaviour. Bug: chromium:1137241 Change-Id: I0b8d1cf4d2a37f13c466c8dd0e66edfe852f7e59 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2488180Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org> (cherry picked from commit d8529380) Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2518169Reviewed-by: 's avatarGeoff Lang <geofflang@chromium.org>
parent ac18d9c8
......@@ -6,7 +6,7 @@
"scripts/entry_point_packed_gl_enums.json":
"2d46a38023361f8e95af71042626667c",
"scripts/generate_entry_points.py":
"16da95ef4313d62c580112c65660d82e",
"d3db7e3324326d25e90f98f8e9b9dda5",
"scripts/gl.xml":
"e74a595068cbdd6064300be1e71b7cc9",
"scripts/gl_angle_ext.xml":
......@@ -150,79 +150,79 @@
"src/libANGLE/validationGL4_autogen.h":
"cbe3f917024a93a3adcbd2806f3e951f",
"src/libGL/entry_points_gl_1_0_autogen.cpp":
"f23f3b0c50511fd2157da3db17a9aff4",
"925b9d8fb9b7b5a31cea2e42be55977a",
"src/libGL/entry_points_gl_1_0_autogen.h":
"4ff00afc21780bc6c138b5431a2d067c",
"src/libGL/entry_points_gl_1_1_autogen.cpp":
"fdba6bafa021aa0574827adb360684f3",
"8126de39d664a78199531f152fd10a0f",
"src/libGL/entry_points_gl_1_1_autogen.h":
"570a839bb336d8f5f83d3b50fe49411a",
"src/libGL/entry_points_gl_1_2_autogen.cpp":
"e89a87545b9fb2cc398a20cc27047945",
"2ebf92844642a358700ac1faa1839d08",
"src/libGL/entry_points_gl_1_2_autogen.h":
"3f52187f299fe96672384e1646f4a1cb",
"src/libGL/entry_points_gl_1_3_autogen.cpp":
"e3ead2456cc9ec15f1b3d103294690cb",
"ecbce375ec337cba0fd913169cd62573",
"src/libGL/entry_points_gl_1_3_autogen.h":
"5ea36d869b82a824d5f290625c4ea052",
"src/libGL/entry_points_gl_1_4_autogen.cpp":
"e92444a3923333859259015956faf98a",
"3d5b17a5f607d0524d9ae7887d0914c0",
"src/libGL/entry_points_gl_1_4_autogen.h":
"2c5d31ca248507a024e4724c74283ec4",
"src/libGL/entry_points_gl_1_5_autogen.cpp":
"aa54e56cba33b02f59c5957cd9c24261",
"d52266614198e7932022134dea8f596c",
"src/libGL/entry_points_gl_1_5_autogen.h":
"978457aa9a40e427846b6dea24608903",
"src/libGL/entry_points_gl_2_0_autogen.cpp":
"afcfb2d402124bddd31326ac196bed71",
"4671cbf319484fa9be8d59ff0e8c316e",
"src/libGL/entry_points_gl_2_0_autogen.h":
"41b0cd064167fac84bcdb1896a275b1b",
"src/libGL/entry_points_gl_2_1_autogen.cpp":
"bde895812b7339665671447fd73d52e0",
"4dc98ca201c19021413a83f2f9f9bc3d",
"src/libGL/entry_points_gl_2_1_autogen.h":
"1da48dec560ea5ff8cadf4d0b6bfde1c",
"src/libGL/entry_points_gl_3_0_autogen.cpp":
"3fbd9e5daff828faddd68dbe451444f6",
"da2b2f8eefd812d02c0f9fe417f18675",
"src/libGL/entry_points_gl_3_0_autogen.h":
"0fad8005f23815beb8ee9b3797c00b83",
"src/libGL/entry_points_gl_3_1_autogen.cpp":
"aa2a5a02d780733e1e447563bef95553",
"05992a041ed6405293e941e52b336cdd",
"src/libGL/entry_points_gl_3_1_autogen.h":
"a68ff6c69f0ce95d9730e22bb4c63366",
"src/libGL/entry_points_gl_3_2_autogen.cpp":
"ab1b0676394018164400b32f5dacda9b",
"673f96a154f18c3b50db81e30c2e04af",
"src/libGL/entry_points_gl_3_2_autogen.h":
"f162c4e93a64ab2e43048a0937f7c46f",
"src/libGL/entry_points_gl_3_3_autogen.cpp":
"03c57cc42c9acce54245dadaae48733c",
"d7dd06ccabde43095ccfcec64adbc8cf",
"src/libGL/entry_points_gl_3_3_autogen.h":
"51c0e4f074c85447f5d910c63b9ea61c",
"src/libGL/entry_points_gl_4_0_autogen.cpp":
"e16628740f0a06219f3ae3e37287de06",
"587b158677d194867b51d3c6363b6be2",
"src/libGL/entry_points_gl_4_0_autogen.h":
"35d611138951cebc29db99c9bf3a9e5f",
"src/libGL/entry_points_gl_4_1_autogen.cpp":
"7c72e40d3fa6ff6db894d5f6d48b43d2",
"32ae4a7cedeaabb595d1eca83d20f975",
"src/libGL/entry_points_gl_4_1_autogen.h":
"beec6659a3a77695dad66df90717c6ba",
"src/libGL/entry_points_gl_4_2_autogen.cpp":
"6ef3dad75ba220f2fd2a612214ed6ac9",
"7e057bc3340d009496ea2d921c9ddb19",
"src/libGL/entry_points_gl_4_2_autogen.h":
"a2cb2a48cceaf6131f96bf8ec556aa55",
"src/libGL/entry_points_gl_4_3_autogen.cpp":
"4f47179fde663d5033693b1fae13f306",
"09150b8e6a67e1393badf39a3c646d12",
"src/libGL/entry_points_gl_4_3_autogen.h":
"abfa431742a2b643db21220944e10ab0",
"src/libGL/entry_points_gl_4_4_autogen.cpp":
"0659139235221d4fe6879834e69ea7cb",
"1152c196dc69bee8b780cd8941892b50",
"src/libGL/entry_points_gl_4_4_autogen.h":
"cdf1651f00d26db547b153afc09acc1c",
"src/libGL/entry_points_gl_4_5_autogen.cpp":
"85ce4ad4ae18fc20cfa0d367e88c34f0",
"ab8bcdd329ba81a5f24501f9661c1317",
"src/libGL/entry_points_gl_4_5_autogen.h":
"9f5de9513c06b82aca60856860f7b716",
"src/libGL/entry_points_gl_4_6_autogen.cpp":
"09c3ccac53be47eeaaa5882af07c27ed",
"1cd516361c0ad896f5ef09316eff7538",
"src/libGL/entry_points_gl_4_6_autogen.h":
"ee3150d4a8d267271a02e38e8feb923a",
"src/libGL/libGL_autogen.cpp":
......@@ -230,27 +230,27 @@
"src/libGL/libGL_autogen.def":
"2789d87b05eea9f53d52e2aff499b785",
"src/libGLESv2/entry_points_gles_1_0_autogen.cpp":
"22887bfd29d481e34514bf02cfdf8841",
"44e4989ed328e0c646b3eeb60d03f999",
"src/libGLESv2/entry_points_gles_1_0_autogen.h":
"899dcff9383465380f94fbdfe5bcf0a0",
"src/libGLESv2/entry_points_gles_2_0_autogen.cpp":
"9fc4466d31b35a37b436328107f87d92",
"e4929b3a274290064d4724a8d6f380db",
"src/libGLESv2/entry_points_gles_2_0_autogen.h":
"26387e27cbddf5e34d6cd9f850cb8b64",
"src/libGLESv2/entry_points_gles_3_0_autogen.cpp":
"1d095828b01116f9992a7bfa95283ba7",
"eb0dbdf103f69f5f4fe2d949864c3f30",
"src/libGLESv2/entry_points_gles_3_0_autogen.h":
"0d246024379fbf55b87204db5d6a37e3",
"src/libGLESv2/entry_points_gles_3_1_autogen.cpp":
"0ba581778fce9d7e1a54231fc494b9d5",
"c3f6b12daef593051f3e35902027e39f",
"src/libGLESv2/entry_points_gles_3_1_autogen.h":
"69bae5c94ed4665836a8464b6c353f9a",
"src/libGLESv2/entry_points_gles_3_2_autogen.cpp":
"a6898b35e7bd1dc60b3e1e1b97c4388d",
"9588ecd5ec35e761c629e656ea01e554",
"src/libGLESv2/entry_points_gles_3_2_autogen.h":
"5798aa0a73af1d4ba5dfe99b6217a247",
"src/libGLESv2/entry_points_gles_ext_autogen.cpp":
"d474603d5950bbfc42dae4a1d91c9c2b",
"f6686acc3bbc87b5c49267b3e11f0309",
"src/libGLESv2/entry_points_gles_ext_autogen.h":
"6d115fefeb5f3ceb605d7525d8b55be2",
"src/libGLESv2/libGLESv2_autogen.cpp":
......
......@@ -159,7 +159,7 @@ template_entry_point_no_return = """void GL_APIENTRY {name}{explicit_context_suf
Context *context = {context_getter};
{event_comment}EVENT(context, "gl{name}", "context = %d{comma_if_needed}{format_params}", CID(context){comma_if_needed}{pass_params});
if (context)
if ({valid_context_check})
{{{assert_explicit_context}{packed_gl_enum_conversions}
std::unique_lock<angle::GlobalMutex> shareContextLock = GetShareGroupLock(context);
bool isCallValid = (context->skipValidation() || Validate{name}({validate_params}));
......@@ -169,6 +169,10 @@ template_entry_point_no_return = """void GL_APIENTRY {name}{explicit_context_suf
}}
ANGLE_CAPTURE({name}, isCallValid, {validate_params});
}}
else
{{
{constext_lost_error_generator}
}}
}}
"""
......@@ -178,7 +182,7 @@ template_entry_point_with_return = """{return_type}GL_APIENTRY {name}{explicit_c
{event_comment}EVENT(context, "gl{name}", "context = %d{comma_if_needed}{format_params}", CID(context){comma_if_needed}{pass_params});
{return_type} returnValue;
if (context)
if ({valid_context_check})
{{{assert_explicit_context}{packed_gl_enum_conversions}
std::unique_lock<angle::GlobalMutex> shareContextLock = GetShareGroupLock(context);
bool isCallValid = (context->skipValidation() || Validate{name}({validate_params}));
......@@ -194,6 +198,7 @@ template_entry_point_with_return = """{return_type}GL_APIENTRY {name}{explicit_c
}}
else
{{
{constext_lost_error_generator}
returnValue = GetDefaultReturnValue<EntryPoint::{name}, {return_type}>();
}}
return returnValue;
......@@ -791,10 +796,7 @@ def default_return_value(cmd_name, return_type):
return "GetDefaultReturnValue<EntryPoint::" + cmd_name[2:] + ", " + return_type + ">()"
def get_context_getter_function(cmd_name, is_explicit_context):
if is_explicit_context:
return "static_cast<gl::Context *>(ctx)"
def is_context_lost_acceptable_cmd(cmd_name):
lost_context_acceptable_cmds = [
"glGetError",
"glGetSync",
......@@ -803,12 +805,44 @@ def get_context_getter_function(cmd_name, is_explicit_context):
"glGetGraphicsResetStatus",
"glGetShaderiv",
]
for context_lost_entry_pont in lost_context_acceptable_cmds:
if cmd_name.startswith(context_lost_entry_pont):
return "GetGlobalContext()"
return True
return False
def get_context_getter_function(cmd_name, is_explicit_context):
if is_explicit_context:
return "static_cast<gl::Context *>(ctx)"
if is_context_lost_acceptable_cmd(cmd_name):
return "GetGlobalContext()"
return "GetValidGlobalContext()"
def get_valid_context_check(cmd_name, is_explicit_context):
if is_explicit_context:
if is_context_lost_acceptable_cmd(cmd_name):
return "context"
else:
return "context && !context->isContextLost()"
return "context"
def get_constext_lost_error_generator(cmd_name, is_explicit_context):
# Don't generate context lost errors on commands that accept lost contexts
if is_context_lost_acceptable_cmd(cmd_name):
return ""
if is_explicit_context:
return "GenerateContextLostErrorOnContext(context);"
else:
return "GenerateContextLostErrorOnCurrentGlobalContext();"
def strip_suffix(name, is_gles):
# For commands where aliasing is excepted, keep the suffix
if is_aliasing_excepted(name, is_gles):
......@@ -883,6 +917,10 @@ def format_entry_point_def(command_node, cmd_name, proto, params, is_explicit_co
", ".join(format_params),
"context_getter":
get_context_getter_function(cmd_name, is_explicit_context),
"valid_context_check":
get_valid_context_check(cmd_name, is_explicit_context),
"constext_lost_error_generator":
get_constext_lost_error_generator(cmd_name, is_explicit_context),
"event_comment":
event_comment,
"explicit_context_suffix":
......
......@@ -54,6 +54,7 @@ GLboolean GL_APIENTRY AreTexturesResident(GLsizei n, const GLuint *textures, GLb
}
else
{
GenerateContextLostErrorOnCurrentGlobalContext();
returnValue = GetDefaultReturnValue<EntryPoint::AreTexturesResident, GLboolean>();
}
return returnValue;
......@@ -74,6 +75,10 @@ void GL_APIENTRY ArrayElement(GLint i)
}
ANGLE_CAPTURE(ArrayElement, isCallValid, context, i);
}
else
{
GenerateContextLostErrorOnCurrentGlobalContext();
}
}
void GL_APIENTRY BindTexture(GLenum target, GLuint texture)
......@@ -95,6 +100,10 @@ void GL_APIENTRY BindTexture(GLenum target, GLuint texture)
}
ANGLE_CAPTURE(BindTexture, isCallValid, context, targetPacked, texturePacked);
}
else
{
GenerateContextLostErrorOnCurrentGlobalContext();
}
}
void GL_APIENTRY ColorPointer(GLint size, GLenum type, GLsizei stride, const void *pointer)
......@@ -118,6 +127,10 @@ void GL_APIENTRY ColorPointer(GLint size, GLenum type, GLsizei stride, const voi
}
ANGLE_CAPTURE(ColorPointer, isCallValid, context, size, typePacked, stride, pointer);
}
else
{
GenerateContextLostErrorOnCurrentGlobalContext();
}
}
void GL_APIENTRY CopyTexImage1D(GLenum target,
......@@ -148,6 +161,10 @@ void GL_APIENTRY CopyTexImage1D(GLenum target,
ANGLE_CAPTURE(CopyTexImage1D, isCallValid, context, target, level, internalformat, x, y,
width, border);
}
else
{
GenerateContextLostErrorOnCurrentGlobalContext();
}
}
void GL_APIENTRY CopyTexImage2D(GLenum target,
......@@ -181,6 +198,10 @@ void GL_APIENTRY CopyTexImage2D(GLenum target,
ANGLE_CAPTURE(CopyTexImage2D, isCallValid, context, targetPacked, level, internalformat, x,
y, width, height, border);
}
else
{
GenerateContextLostErrorOnCurrentGlobalContext();
}
}
void GL_APIENTRY
......@@ -205,6 +226,10 @@ CopyTexSubImage1D(GLenum target, GLint level, GLint xoffset, GLint x, GLint y, G
}
ANGLE_CAPTURE(CopyTexSubImage1D, isCallValid, context, target, level, xoffset, x, y, width);
}
else
{
GenerateContextLostErrorOnCurrentGlobalContext();
}
}
void GL_APIENTRY CopyTexSubImage2D(GLenum target,
......@@ -237,6 +262,10 @@ void GL_APIENTRY CopyTexSubImage2D(GLenum target,
ANGLE_CAPTURE(CopyTexSubImage2D, isCallValid, context, targetPacked, level, xoffset,
yoffset, x, y, width, height);
}
else
{
GenerateContextLostErrorOnCurrentGlobalContext();
}
}
void GL_APIENTRY DeleteTextures(GLsizei n, const GLuint *textures)
......@@ -258,6 +287,10 @@ void GL_APIENTRY DeleteTextures(GLsizei n, const GLuint *textures)
}
ANGLE_CAPTURE(DeleteTextures, isCallValid, context, n, texturesPacked);
}
else
{
GenerateContextLostErrorOnCurrentGlobalContext();
}
}
void GL_APIENTRY DisableClientState(GLenum array)
......@@ -278,6 +311,10 @@ void GL_APIENTRY DisableClientState(GLenum array)
}
ANGLE_CAPTURE(DisableClientState, isCallValid, context, arrayPacked);
}
else
{
GenerateContextLostErrorOnCurrentGlobalContext();
}
}
void GL_APIENTRY DrawArrays(GLenum mode, GLint first, GLsizei count)
......@@ -299,6 +336,10 @@ void GL_APIENTRY DrawArrays(GLenum mode, GLint first, GLsizei count)
}
ANGLE_CAPTURE(DrawArrays, isCallValid, context, modePacked, first, count);
}
else
{
GenerateContextLostErrorOnCurrentGlobalContext();
}
}
void GL_APIENTRY DrawElements(GLenum mode, GLsizei count, GLenum type, const void *indices)
......@@ -323,6 +364,10 @@ void GL_APIENTRY DrawElements(GLenum mode, GLsizei count, GLenum type, const voi
}
ANGLE_CAPTURE(DrawElements, isCallValid, context, modePacked, count, typePacked, indices);
}
else
{
GenerateContextLostErrorOnCurrentGlobalContext();
}
}
void GL_APIENTRY EdgeFlagPointer(GLsizei stride, const void *pointer)
......@@ -343,6 +388,10 @@ void GL_APIENTRY EdgeFlagPointer(GLsizei stride, const void *pointer)
}
ANGLE_CAPTURE(EdgeFlagPointer, isCallValid, context, stride, pointer);
}
else
{
GenerateContextLostErrorOnCurrentGlobalContext();
}
}
void GL_APIENTRY EnableClientState(GLenum array)
......@@ -363,6 +412,10 @@ void GL_APIENTRY EnableClientState(GLenum array)
}
ANGLE_CAPTURE(EnableClientState, isCallValid, context, arrayPacked);
}
else
{
GenerateContextLostErrorOnCurrentGlobalContext();
}
}
void GL_APIENTRY GenTextures(GLsizei n, GLuint *textures)
......@@ -384,6 +437,10 @@ void GL_APIENTRY GenTextures(GLsizei n, GLuint *textures)
}
ANGLE_CAPTURE(GenTextures, isCallValid, context, n, texturesPacked);
}
else
{
GenerateContextLostErrorOnCurrentGlobalContext();
}
}
void GL_APIENTRY GetPointerv(GLenum pname, void **params)
......@@ -404,6 +461,10 @@ void GL_APIENTRY GetPointerv(GLenum pname, void **params)
}
ANGLE_CAPTURE(GetPointerv, isCallValid, context, pname, params);
}
else
{
GenerateContextLostErrorOnCurrentGlobalContext();
}
}
void GL_APIENTRY IndexPointer(GLenum type, GLsizei stride, const void *pointer)
......@@ -427,6 +488,10 @@ void GL_APIENTRY IndexPointer(GLenum type, GLsizei stride, const void *pointer)
}
ANGLE_CAPTURE(IndexPointer, isCallValid, context, type, stride, pointer);
}
else
{
GenerateContextLostErrorOnCurrentGlobalContext();
}
}
void GL_APIENTRY Indexub(GLubyte c)
......@@ -444,6 +509,10 @@ void GL_APIENTRY Indexub(GLubyte c)
}
ANGLE_CAPTURE(Indexub, isCallValid, context, c);
}
else
{
GenerateContextLostErrorOnCurrentGlobalContext();
}
}
void GL_APIENTRY Indexubv(const GLubyte *c)
......@@ -462,6 +531,10 @@ void GL_APIENTRY Indexubv(const GLubyte *c)
}
ANGLE_CAPTURE(Indexubv, isCallValid, context, c);
}
else
{
GenerateContextLostErrorOnCurrentGlobalContext();
}
}
void GL_APIENTRY InterleavedArrays(GLenum format, GLsizei stride, const void *pointer)
......@@ -484,6 +557,10 @@ void GL_APIENTRY InterleavedArrays(GLenum format, GLsizei stride, const void *po
}
ANGLE_CAPTURE(InterleavedArrays, isCallValid, context, format, stride, pointer);
}
else
{
GenerateContextLostErrorOnCurrentGlobalContext();
}
}
GLboolean GL_APIENTRY IsTexture(GLuint texture)
......@@ -509,6 +586,7 @@ GLboolean GL_APIENTRY IsTexture(GLuint texture)
}
else
{
GenerateContextLostErrorOnCurrentGlobalContext();
returnValue = GetDefaultReturnValue<EntryPoint::IsTexture, GLboolean>();
}
return returnValue;
......@@ -536,6 +614,10 @@ void GL_APIENTRY NormalPointer(GLenum type, GLsizei stride, const void *pointer)
}
ANGLE_CAPTURE(NormalPointer, isCallValid, context, typePacked, stride, pointer);
}
else
{
GenerateContextLostErrorOnCurrentGlobalContext();
}
}
void GL_APIENTRY PolygonOffset(GLfloat factor, GLfloat units)
......@@ -555,6 +637,10 @@ void GL_APIENTRY PolygonOffset(GLfloat factor, GLfloat units)
}
ANGLE_CAPTURE(PolygonOffset, isCallValid, context, factor, units);
}
else
{
GenerateContextLostErrorOnCurrentGlobalContext();
}
}
void GL_APIENTRY PopClientAttrib()
......@@ -572,6 +658,10 @@ void GL_APIENTRY PopClientAttrib()
}
ANGLE_CAPTURE(PopClientAttrib, isCallValid, context);
}
else
{
GenerateContextLostErrorOnCurrentGlobalContext();
}
}
void GL_APIENTRY PrioritizeTextures(GLsizei n, const GLuint *textures, const GLfloat *priorities)
......@@ -593,6 +683,10 @@ void GL_APIENTRY PrioritizeTextures(GLsizei n, const GLuint *textures, const GLf
}
ANGLE_CAPTURE(PrioritizeTextures, isCallValid, context, n, textures, priorities);
}
else
{
GenerateContextLostErrorOnCurrentGlobalContext();
}
}
void GL_APIENTRY PushClientAttrib(GLbitfield mask)
......@@ -611,6 +705,10 @@ void GL_APIENTRY PushClientAttrib(GLbitfield mask)
}
ANGLE_CAPTURE(PushClientAttrib, isCallValid, context, mask);
}
else
{
GenerateContextLostErrorOnCurrentGlobalContext();
}
}
void GL_APIENTRY TexCoordPointer(GLint size, GLenum type, GLsizei stride, const void *pointer)
......@@ -634,6 +732,10 @@ void GL_APIENTRY TexCoordPointer(GLint size, GLenum type, GLsizei stride, const
}
ANGLE_CAPTURE(TexCoordPointer, isCallValid, context, size, typePacked, stride, pointer);
}
else
{
GenerateContextLostErrorOnCurrentGlobalContext();
}
}
void GL_APIENTRY TexSubImage1D(GLenum target,
......@@ -665,6 +767,10 @@ void GL_APIENTRY TexSubImage1D(GLenum target,
ANGLE_CAPTURE(TexSubImage1D, isCallValid, context, target, level, xoffset, width, format,
type, pixels);
}
else
{
GenerateContextLostErrorOnCurrentGlobalContext();
}
}
void GL_APIENTRY TexSubImage2D(GLenum target,
......@@ -701,6 +807,10 @@ void GL_APIENTRY TexSubImage2D(GLenum target,
ANGLE_CAPTURE(TexSubImage2D, isCallValid, context, targetPacked, level, xoffset, yoffset,
width, height, format, type, pixels);
}
else
{
GenerateContextLostErrorOnCurrentGlobalContext();
}
}
void GL_APIENTRY VertexPointer(GLint size, GLenum type, GLsizei stride, const void *pointer)
......@@ -724,5 +834,9 @@ void GL_APIENTRY VertexPointer(GLint size, GLenum type, GLsizei stride, const vo
}
ANGLE_CAPTURE(VertexPointer, isCallValid, context, size, typePacked, stride, pointer);
}
else
{
GenerateContextLostErrorOnCurrentGlobalContext();
}
}
} // namespace gl
......@@ -60,6 +60,10 @@ void GL_APIENTRY CopyTexSubImage3D(GLenum target,
ANGLE_CAPTURE(CopyTexSubImage3D, isCallValid, context, targetPacked, level, xoffset,
yoffset, zoffset, x, y, width, height);
}
else
{
GenerateContextLostErrorOnCurrentGlobalContext();
}
}
void GL_APIENTRY DrawRangeElements(GLenum mode,
......@@ -91,6 +95,10 @@ void GL_APIENTRY DrawRangeElements(GLenum mode,
ANGLE_CAPTURE(DrawRangeElements, isCallValid, context, modePacked, start, end, count,
typePacked, indices);
}
else
{
GenerateContextLostErrorOnCurrentGlobalContext();
}
}
void GL_APIENTRY TexImage3D(GLenum target,
......@@ -128,6 +136,10 @@ void GL_APIENTRY TexImage3D(GLenum target,
ANGLE_CAPTURE(TexImage3D, isCallValid, context, targetPacked, level, internalformat, width,
height, depth, border, format, type, pixels);
}
else
{
GenerateContextLostErrorOnCurrentGlobalContext();
}
}
void GL_APIENTRY TexSubImage3D(GLenum target,
......@@ -167,5 +179,9 @@ void GL_APIENTRY TexSubImage3D(GLenum target,
ANGLE_CAPTURE(TexSubImage3D, isCallValid, context, targetPacked, level, xoffset, yoffset,
zoffset, width, height, depth, format, type, pixels);
}
else
{
GenerateContextLostErrorOnCurrentGlobalContext();
}
}
} // namespace gl
......@@ -46,6 +46,10 @@ void GL_APIENTRY BeginQuery(GLenum target, GLuint id)
}
ANGLE_CAPTURE(BeginQuery, isCallValid, context, targetPacked, idPacked);
}
else
{
GenerateContextLostErrorOnCurrentGlobalContext();
}
}
void GL_APIENTRY BindBuffer(GLenum target, GLuint buffer)
......@@ -67,6 +71,10 @@ void GL_APIENTRY BindBuffer(GLenum target, GLuint buffer)
}
ANGLE_CAPTURE(BindBuffer, isCallValid, context, targetPacked, bufferPacked);
}
else
{
GenerateContextLostErrorOnCurrentGlobalContext();
}
}
void GL_APIENTRY BufferData(GLenum target, GLsizeiptr size, const void *data, GLenum usage)
......@@ -92,6 +100,10 @@ void GL_APIENTRY BufferData(GLenum target, GLsizeiptr size, const void *data, GL
}
ANGLE_CAPTURE(BufferData, isCallValid, context, targetPacked, size, data, usagePacked);
}
else
{
GenerateContextLostErrorOnCurrentGlobalContext();
}
}
void GL_APIENTRY BufferSubData(GLenum target, GLintptr offset, GLsizeiptr size, const void *data)
......@@ -116,6 +128,10 @@ void GL_APIENTRY BufferSubData(GLenum target, GLintptr offset, GLsizeiptr size,
}
ANGLE_CAPTURE(BufferSubData, isCallValid, context, targetPacked, offset, size, data);
}
else
{
GenerateContextLostErrorOnCurrentGlobalContext();
}
}
void GL_APIENTRY DeleteBuffers(GLsizei n, const GLuint *buffers)
......@@ -137,6 +153,10 @@ void GL_APIENTRY DeleteBuffers(GLsizei n, const GLuint *buffers)
}
ANGLE_CAPTURE(DeleteBuffers, isCallValid, context, n, buffersPacked);
}
else
{
GenerateContextLostErrorOnCurrentGlobalContext();
}
}
void GL_APIENTRY DeleteQueries(GLsizei n, const GLuint *ids)
......@@ -158,6 +178,10 @@ void GL_APIENTRY DeleteQueries(GLsizei n, const GLuint *ids)
}
ANGLE_CAPTURE(DeleteQueries, isCallValid, context, n, idsPacked);
}
else
{
GenerateContextLostErrorOnCurrentGlobalContext();
}
}
void GL_APIENTRY EndQuery(GLenum target)
......@@ -177,6 +201,10 @@ void GL_APIENTRY EndQuery(GLenum target)
}
ANGLE_CAPTURE(EndQuery, isCallValid, context, targetPacked);
}
else
{
GenerateContextLostErrorOnCurrentGlobalContext();
}
}
void GL_APIENTRY GenBuffers(GLsizei n, GLuint *buffers)
......@@ -198,6 +226,10 @@ void GL_APIENTRY GenBuffers(GLsizei n, GLuint *buffers)
}
ANGLE_CAPTURE(GenBuffers, isCallValid, context, n, buffersPacked);
}
else
{
GenerateContextLostErrorOnCurrentGlobalContext();
}
}
void GL_APIENTRY GenQueries(GLsizei n, GLuint *ids)
......@@ -217,6 +249,10 @@ void GL_APIENTRY GenQueries(GLsizei n, GLuint *ids)
}
ANGLE_CAPTURE(GenQueries, isCallValid, context, n, idsPacked);
}
else
{
GenerateContextLostErrorOnCurrentGlobalContext();
}
}
void GL_APIENTRY GetBufferParameteriv(GLenum target, GLenum pname, GLint *params)
......@@ -239,6 +275,10 @@ void GL_APIENTRY GetBufferParameteriv(GLenum target, GLenum pname, GLint *params
}
ANGLE_CAPTURE(GetBufferParameteriv, isCallValid, context, targetPacked, pname, params);
}
else
{
GenerateContextLostErrorOnCurrentGlobalContext();
}
}
void GL_APIENTRY GetBufferPointerv(GLenum target, GLenum pname, void **params)
......@@ -261,6 +301,10 @@ void GL_APIENTRY GetBufferPointerv(GLenum target, GLenum pname, void **params)
}
ANGLE_CAPTURE(GetBufferPointerv, isCallValid, context, targetPacked, pname, params);
}
else
{
GenerateContextLostErrorOnCurrentGlobalContext();
}
}
void GL_APIENTRY GetBufferSubData(GLenum target, GLintptr offset, GLsizeiptr size, void *data)
......@@ -284,6 +328,10 @@ void GL_APIENTRY GetBufferSubData(GLenum target, GLintptr offset, GLsizeiptr siz
}
ANGLE_CAPTURE(GetBufferSubData, isCallValid, context, target, offset, size, data);
}
else
{
GenerateContextLostErrorOnCurrentGlobalContext();
}
}
void GL_APIENTRY GetQueryObjectiv(GLuint id, GLenum pname, GLint *params)
......@@ -306,6 +354,8 @@ void GL_APIENTRY GetQueryObjectiv(GLuint id, GLenum pname, GLint *params)
}
ANGLE_CAPTURE(GetQueryObjectiv, isCallValid, context, idPacked, pname, params);
}
else
{}
}
void GL_APIENTRY GetQueryObjectuiv(GLuint id, GLenum pname, GLuint *params)
......@@ -328,6 +378,10 @@ void GL_APIENTRY GetQueryObjectuiv(GLuint id, GLenum pname, GLuint *params)
}
ANGLE_CAPTURE(GetQueryObjectuiv, isCallValid, context, idPacked, pname, params);
}
else
{
GenerateContextLostErrorOnCurrentGlobalContext();
}
}
void GL_APIENTRY GetQueryiv(GLenum target, GLenum pname, GLint *params)
......@@ -350,6 +404,10 @@ void GL_APIENTRY GetQueryiv(GLenum target, GLenum pname, GLint *params)
}
ANGLE_CAPTURE(GetQueryiv, isCallValid, context, targetPacked, pname, params);
}
else
{
GenerateContextLostErrorOnCurrentGlobalContext();
}
}
GLboolean GL_APIENTRY IsBuffer(GLuint buffer)
......@@ -375,6 +433,7 @@ GLboolean GL_APIENTRY IsBuffer(GLuint buffer)
}
else
{
GenerateContextLostErrorOnCurrentGlobalContext();
returnValue = GetDefaultReturnValue<EntryPoint::IsBuffer, GLboolean>();
}
return returnValue;
......@@ -403,6 +462,7 @@ GLboolean GL_APIENTRY IsQuery(GLuint id)
}
else
{
GenerateContextLostErrorOnCurrentGlobalContext();
returnValue = GetDefaultReturnValue<EntryPoint::IsQuery, GLboolean>();
}
return returnValue;
......@@ -434,6 +494,7 @@ void *GL_APIENTRY MapBuffer(GLenum target, GLenum access)
}
else
{
GenerateContextLostErrorOnCurrentGlobalContext();
returnValue = GetDefaultReturnValue<EntryPoint::MapBuffer, void *>();
}
return returnValue;
......@@ -464,6 +525,7 @@ GLboolean GL_APIENTRY UnmapBuffer(GLenum target)
}
else
{
GenerateContextLostErrorOnCurrentGlobalContext();
returnValue = GetDefaultReturnValue<EntryPoint::UnmapBuffer, GLboolean>();
}
return returnValue;
......
......@@ -52,6 +52,10 @@ void GL_APIENTRY UniformMatrix2x3fv(GLint location,
ANGLE_CAPTURE(UniformMatrix2x3fv, isCallValid, context, locationPacked, count, transpose,
value);
}
else
{
GenerateContextLostErrorOnCurrentGlobalContext();
}
}
void GL_APIENTRY UniformMatrix2x4fv(GLint location,
......@@ -79,6 +83,10 @@ void GL_APIENTRY UniformMatrix2x4fv(GLint location,
ANGLE_CAPTURE(UniformMatrix2x4fv, isCallValid, context, locationPacked, count, transpose,
value);
}
else
{
GenerateContextLostErrorOnCurrentGlobalContext();
}
}
void GL_APIENTRY UniformMatrix3x2fv(GLint location,
......@@ -106,6 +114,10 @@ void GL_APIENTRY UniformMatrix3x2fv(GLint location,
ANGLE_CAPTURE(UniformMatrix3x2fv, isCallValid, context, locationPacked, count, transpose,
value);
}
else
{
GenerateContextLostErrorOnCurrentGlobalContext();
}
}
void GL_APIENTRY UniformMatrix3x4fv(GLint location,
......@@ -133,6 +145,10 @@ void GL_APIENTRY UniformMatrix3x4fv(GLint location,
ANGLE_CAPTURE(UniformMatrix3x4fv, isCallValid, context, locationPacked, count, transpose,
value);
}
else
{
GenerateContextLostErrorOnCurrentGlobalContext();
}
}
void GL_APIENTRY UniformMatrix4x2fv(GLint location,
......@@ -160,6 +176,10 @@ void GL_APIENTRY UniformMatrix4x2fv(GLint location,
ANGLE_CAPTURE(UniformMatrix4x2fv, isCallValid, context, locationPacked, count, transpose,
value);
}
else
{
GenerateContextLostErrorOnCurrentGlobalContext();
}
}
void GL_APIENTRY UniformMatrix4x3fv(GLint location,
......@@ -187,5 +207,9 @@ void GL_APIENTRY UniformMatrix4x3fv(GLint location,
ANGLE_CAPTURE(UniformMatrix4x3fv, isCallValid, context, locationPacked, count, transpose,
value);
}
else
{
GenerateContextLostErrorOnCurrentGlobalContext();
}
}
} // namespace gl
......@@ -58,6 +58,10 @@ void GL_APIENTRY CopyBufferSubData(GLenum readTarget,
ANGLE_CAPTURE(CopyBufferSubData, isCallValid, context, readTargetPacked, writeTargetPacked,
readOffset, writeOffset, size);
}
else
{
GenerateContextLostErrorOnCurrentGlobalContext();
}
}
void GL_APIENTRY DrawArraysInstanced(GLenum mode, GLint first, GLsizei count, GLsizei instancecount)
......@@ -83,6 +87,10 @@ void GL_APIENTRY DrawArraysInstanced(GLenum mode, GLint first, GLsizei count, GL
ANGLE_CAPTURE(DrawArraysInstanced, isCallValid, context, modePacked, first, count,
instancecount);
}
else
{
GenerateContextLostErrorOnCurrentGlobalContext();
}
}
void GL_APIENTRY DrawElementsInstanced(GLenum mode,
......@@ -113,6 +121,10 @@ void GL_APIENTRY DrawElementsInstanced(GLenum mode,
ANGLE_CAPTURE(DrawElementsInstanced, isCallValid, context, modePacked, count, typePacked,
indices, instancecount);
}
else
{
GenerateContextLostErrorOnCurrentGlobalContext();
}
}
void GL_APIENTRY GetActiveUniformBlockName(GLuint program,
......@@ -144,6 +156,10 @@ void GL_APIENTRY GetActiveUniformBlockName(GLuint program,
ANGLE_CAPTURE(GetActiveUniformBlockName, isCallValid, context, programPacked,
uniformBlockIndex, bufSize, length, uniformBlockName);
}
else
{
GenerateContextLostErrorOnCurrentGlobalContext();
}
}
void GL_APIENTRY GetActiveUniformBlockiv(GLuint program,
......@@ -172,6 +188,10 @@ void GL_APIENTRY GetActiveUniformBlockiv(GLuint program,
ANGLE_CAPTURE(GetActiveUniformBlockiv, isCallValid, context, programPacked,
uniformBlockIndex, pname, params);
}
else
{
GenerateContextLostErrorOnCurrentGlobalContext();
}
}
void GL_APIENTRY GetActiveUniformName(GLuint program,
......@@ -201,6 +221,10 @@ void GL_APIENTRY GetActiveUniformName(GLuint program,
ANGLE_CAPTURE(GetActiveUniformName, isCallValid, context, programPacked, uniformIndex,
bufSize, length, uniformName);
}
else
{
GenerateContextLostErrorOnCurrentGlobalContext();
}
}
void GL_APIENTRY GetActiveUniformsiv(GLuint program,
......@@ -232,6 +256,10 @@ void GL_APIENTRY GetActiveUniformsiv(GLuint program,
ANGLE_CAPTURE(GetActiveUniformsiv, isCallValid, context, programPacked, uniformCount,
uniformIndices, pname, params);
}
else
{
GenerateContextLostErrorOnCurrentGlobalContext();
}
}
GLuint GL_APIENTRY GetUniformBlockIndex(GLuint program, const GLchar *uniformBlockName)
......@@ -261,6 +289,7 @@ GLuint GL_APIENTRY GetUniformBlockIndex(GLuint program, const GLchar *uniformBlo
}
else
{
GenerateContextLostErrorOnCurrentGlobalContext();
returnValue = GetDefaultReturnValue<EntryPoint::GetUniformBlockIndex, GLuint>();
}
return returnValue;
......@@ -291,6 +320,10 @@ void GL_APIENTRY GetUniformIndices(GLuint program,
ANGLE_CAPTURE(GetUniformIndices, isCallValid, context, programPacked, uniformCount,
uniformNames, uniformIndices);
}
else
{
GenerateContextLostErrorOnCurrentGlobalContext();
}
}
void GL_APIENTRY PrimitiveRestartIndex(GLuint index)
......@@ -310,6 +343,10 @@ void GL_APIENTRY PrimitiveRestartIndex(GLuint index)
}
ANGLE_CAPTURE(PrimitiveRestartIndex, isCallValid, context, index);
}
else
{
GenerateContextLostErrorOnCurrentGlobalContext();
}
}
void GL_APIENTRY TexBuffer(GLenum target, GLenum internalformat, GLuint buffer)
......@@ -333,6 +370,10 @@ void GL_APIENTRY TexBuffer(GLenum target, GLenum internalformat, GLuint buffer)
}
ANGLE_CAPTURE(TexBuffer, isCallValid, context, targetPacked, internalformat, bufferPacked);
}
else
{
GenerateContextLostErrorOnCurrentGlobalContext();
}
}
void GL_APIENTRY UniformBlockBinding(GLuint program,
......@@ -359,5 +400,9 @@ void GL_APIENTRY UniformBlockBinding(GLuint program,
ANGLE_CAPTURE(UniformBlockBinding, isCallValid, context, programPacked, uniformBlockIndex,
uniformBlockBinding);
}
else
{
GenerateContextLostErrorOnCurrentGlobalContext();
}
}
} // namespace gl
......@@ -55,6 +55,7 @@ GLenum GL_APIENTRY ClientWaitSync(GLsync sync, GLbitfield flags, GLuint64 timeou
}
else
{
GenerateContextLostErrorOnCurrentGlobalContext();
returnValue = GetDefaultReturnValue<EntryPoint::ClientWaitSync, GLenum>();
}
return returnValue;
......@@ -76,6 +77,10 @@ void GL_APIENTRY DeleteSync(GLsync sync)
}
ANGLE_CAPTURE(DeleteSync, isCallValid, context, sync);
}
else
{
GenerateContextLostErrorOnCurrentGlobalContext();
}
}
void GL_APIENTRY DrawElementsBaseVertex(GLenum mode,
......@@ -106,6 +111,10 @@ void GL_APIENTRY DrawElementsBaseVertex(GLenum mode,
ANGLE_CAPTURE(DrawElementsBaseVertex, isCallValid, context, modePacked, count, typePacked,
indices, basevertex);
}
else
{
GenerateContextLostErrorOnCurrentGlobalContext();
}
}
void GL_APIENTRY DrawElementsInstancedBaseVertex(GLenum mode,
......@@ -139,6 +148,10 @@ void GL_APIENTRY DrawElementsInstancedBaseVertex(GLenum mode,
ANGLE_CAPTURE(DrawElementsInstancedBaseVertex, isCallValid, context, modePacked, count,
typePacked, indices, instancecount, basevertex);
}
else
{
GenerateContextLostErrorOnCurrentGlobalContext();
}
}
void GL_APIENTRY DrawRangeElementsBaseVertex(GLenum mode,
......@@ -172,6 +185,10 @@ void GL_APIENTRY DrawRangeElementsBaseVertex(GLenum mode,
ANGLE_CAPTURE(DrawRangeElementsBaseVertex, isCallValid, context, modePacked, start, end,
count, typePacked, indices, basevertex);
}
else
{
GenerateContextLostErrorOnCurrentGlobalContext();
}
}
GLsync GL_APIENTRY FenceSync(GLenum condition, GLbitfield flags)
......@@ -199,6 +216,7 @@ GLsync GL_APIENTRY FenceSync(GLenum condition, GLbitfield flags)
}
else
{
GenerateContextLostErrorOnCurrentGlobalContext();
returnValue = GetDefaultReturnValue<EntryPoint::FenceSync, GLsync>();
}
return returnValue;
......@@ -227,6 +245,10 @@ void GL_APIENTRY FramebufferTexture(GLenum target, GLenum attachment, GLuint tex
ANGLE_CAPTURE(FramebufferTexture, isCallValid, context, target, attachment, texturePacked,
level);
}
else
{
GenerateContextLostErrorOnCurrentGlobalContext();
}
}
void GL_APIENTRY GetBufferParameteri64v(GLenum target, GLenum pname, GLint64 *params)
......@@ -250,6 +272,10 @@ void GL_APIENTRY GetBufferParameteri64v(GLenum target, GLenum pname, GLint64 *pa
}
ANGLE_CAPTURE(GetBufferParameteri64v, isCallValid, context, targetPacked, pname, params);
}
else
{
GenerateContextLostErrorOnCurrentGlobalContext();
}
}
void GL_APIENTRY GetInteger64i_v(GLenum target, GLuint index, GLint64 *data)
......@@ -270,6 +296,10 @@ void GL_APIENTRY GetInteger64i_v(GLenum target, GLuint index, GLint64 *data)
}
ANGLE_CAPTURE(GetInteger64i_v, isCallValid, context, target, index, data);
}
else
{
GenerateContextLostErrorOnCurrentGlobalContext();
}
}
void GL_APIENTRY GetInteger64v(GLenum pname, GLint64 *data)
......@@ -290,6 +320,10 @@ void GL_APIENTRY GetInteger64v(GLenum pname, GLint64 *data)
}
ANGLE_CAPTURE(GetInteger64v, isCallValid, context, pname, data);
}
else
{
GenerateContextLostErrorOnCurrentGlobalContext();
}
}
void GL_APIENTRY GetMultisamplefv(GLenum pname, GLuint index, GLfloat *val)
......@@ -310,6 +344,10 @@ void GL_APIENTRY GetMultisamplefv(GLenum pname, GLuint index, GLfloat *val)
}
ANGLE_CAPTURE(GetMultisamplefv, isCallValid, context, pname, index, val);
}
else
{
GenerateContextLostErrorOnCurrentGlobalContext();
}
}
void GL_APIENTRY
......@@ -334,6 +372,8 @@ GetSynciv(GLsync sync, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *va
}
ANGLE_CAPTURE(GetSynciv, isCallValid, context, sync, pname, bufSize, length, values);
}
else
{}
}
GLboolean GL_APIENTRY IsSync(GLsync sync)
......@@ -359,6 +399,7 @@ GLboolean GL_APIENTRY IsSync(GLsync sync)
}
else
{
GenerateContextLostErrorOnCurrentGlobalContext();
returnValue = GetDefaultReturnValue<EntryPoint::IsSync, GLboolean>();
}
return returnValue;
......@@ -396,6 +437,10 @@ void GL_APIENTRY MultiDrawElementsBaseVertex(GLenum mode,
ANGLE_CAPTURE(MultiDrawElementsBaseVertex, isCallValid, context, modePacked, count,
typePacked, indices, drawcount, basevertex);
}
else
{
GenerateContextLostErrorOnCurrentGlobalContext();
}
}
void GL_APIENTRY ProvokingVertex(GLenum mode)
......@@ -416,6 +461,10 @@ void GL_APIENTRY ProvokingVertex(GLenum mode)
}
ANGLE_CAPTURE(ProvokingVertex, isCallValid, context, modePacked);
}
else
{
GenerateContextLostErrorOnCurrentGlobalContext();
}
}
void GL_APIENTRY SampleMaski(GLuint maskNumber, GLbitfield mask)
......@@ -435,6 +484,10 @@ void GL_APIENTRY SampleMaski(GLuint maskNumber, GLbitfield mask)
}
ANGLE_CAPTURE(SampleMaski, isCallValid, context, maskNumber, mask);
}
else
{
GenerateContextLostErrorOnCurrentGlobalContext();
}
}
void GL_APIENTRY TexImage2DMultisample(GLenum target,
......@@ -466,6 +519,10 @@ void GL_APIENTRY TexImage2DMultisample(GLenum target,
ANGLE_CAPTURE(TexImage2DMultisample, isCallValid, context, target, samples, internalformat,
width, height, fixedsamplelocations);
}
else
{
GenerateContextLostErrorOnCurrentGlobalContext();
}
}
void GL_APIENTRY TexImage3DMultisample(GLenum target,
......@@ -500,6 +557,10 @@ void GL_APIENTRY TexImage3DMultisample(GLenum target,
ANGLE_CAPTURE(TexImage3DMultisample, isCallValid, context, target, samples, internalformat,
width, height, depth, fixedsamplelocations);
}
else
{
GenerateContextLostErrorOnCurrentGlobalContext();
}
}
void GL_APIENTRY WaitSync(GLsync sync, GLbitfield flags, GLuint64 timeout)
......@@ -523,5 +584,9 @@ void GL_APIENTRY WaitSync(GLsync sync, GLbitfield flags, GLuint64 timeout)
}
ANGLE_CAPTURE(WaitSync, isCallValid, context, sync, flags, timeout);
}
else
{
GenerateContextLostErrorOnCurrentGlobalContext();
}
}
} // namespace gl
......@@ -57,6 +57,10 @@ void GL_APIENTRY BindImageTexture(GLuint unit,
ANGLE_CAPTURE(BindImageTexture, isCallValid, context, unit, texturePacked, level, layered,
layer, access, format);
}
else
{
GenerateContextLostErrorOnCurrentGlobalContext();
}
}
void GL_APIENTRY DrawArraysInstancedBaseInstance(GLenum mode,
......@@ -87,6 +91,10 @@ void GL_APIENTRY DrawArraysInstancedBaseInstance(GLenum mode,
ANGLE_CAPTURE(DrawArraysInstancedBaseInstance, isCallValid, context, modePacked, first,
count, instancecount, baseinstance);
}
else
{
GenerateContextLostErrorOnCurrentGlobalContext();
}
}
void GL_APIENTRY DrawElementsInstancedBaseInstance(GLenum mode,
......@@ -118,6 +126,10 @@ void GL_APIENTRY DrawElementsInstancedBaseInstance(GLenum mode,
ANGLE_CAPTURE(DrawElementsInstancedBaseInstance, isCallValid, context, mode, count, type,
indices, instancecount, baseinstance);
}
else
{
GenerateContextLostErrorOnCurrentGlobalContext();
}
}
void GL_APIENTRY DrawElementsInstancedBaseVertexBaseInstance(GLenum mode,
......@@ -154,6 +166,10 @@ void GL_APIENTRY DrawElementsInstancedBaseVertexBaseInstance(GLenum mode,
ANGLE_CAPTURE(DrawElementsInstancedBaseVertexBaseInstance, isCallValid, context, modePacked,
count, typePacked, indices, instancecount, basevertex, baseinstance);
}
else
{
GenerateContextLostErrorOnCurrentGlobalContext();
}
}
void GL_APIENTRY DrawTransformFeedbackInstanced(GLenum mode, GLuint id, GLsizei instancecount)
......@@ -177,6 +193,10 @@ void GL_APIENTRY DrawTransformFeedbackInstanced(GLenum mode, GLuint id, GLsizei
ANGLE_CAPTURE(DrawTransformFeedbackInstanced, isCallValid, context, mode, idPacked,
instancecount);
}
else
{
GenerateContextLostErrorOnCurrentGlobalContext();
}
}
void GL_APIENTRY DrawTransformFeedbackStreamInstanced(GLenum mode,
......@@ -205,6 +225,10 @@ void GL_APIENTRY DrawTransformFeedbackStreamInstanced(GLenum mode,
ANGLE_CAPTURE(DrawTransformFeedbackStreamInstanced, isCallValid, context, mode, idPacked,
stream, instancecount);
}
else
{
GenerateContextLostErrorOnCurrentGlobalContext();
}
}
void GL_APIENTRY GetActiveAtomicCounterBufferiv(GLuint program,
......@@ -233,6 +257,10 @@ void GL_APIENTRY GetActiveAtomicCounterBufferiv(GLuint program,
ANGLE_CAPTURE(GetActiveAtomicCounterBufferiv, isCallValid, context, programPacked,
bufferIndex, pname, params);
}
else
{
GenerateContextLostErrorOnCurrentGlobalContext();
}
}
void GL_APIENTRY GetInternalformativ(GLenum target,
......@@ -262,6 +290,10 @@ void GL_APIENTRY GetInternalformativ(GLenum target,
ANGLE_CAPTURE(GetInternalformativ, isCallValid, context, target, internalformat, pname,
bufSize, params);
}
else
{
GenerateContextLostErrorOnCurrentGlobalContext();
}
}
void GL_APIENTRY MemoryBarrier(GLbitfield barriers)
......@@ -280,6 +312,10 @@ void GL_APIENTRY MemoryBarrier(GLbitfield barriers)
}
ANGLE_CAPTURE(MemoryBarrier, isCallValid, context, barriers);
}
else
{
GenerateContextLostErrorOnCurrentGlobalContext();
}
}
void GL_APIENTRY TexStorage1D(GLenum target, GLsizei levels, GLenum internalformat, GLsizei width)
......@@ -302,6 +338,10 @@ void GL_APIENTRY TexStorage1D(GLenum target, GLsizei levels, GLenum internalform
}
ANGLE_CAPTURE(TexStorage1D, isCallValid, context, target, levels, internalformat, width);
}
else
{
GenerateContextLostErrorOnCurrentGlobalContext();
}
}
void GL_APIENTRY
......@@ -328,6 +368,10 @@ TexStorage2D(GLenum target, GLsizei levels, GLenum internalformat, GLsizei width
ANGLE_CAPTURE(TexStorage2D, isCallValid, context, targetPacked, levels, internalformat,
width, height);
}
else
{
GenerateContextLostErrorOnCurrentGlobalContext();
}
}
void GL_APIENTRY TexStorage3D(GLenum target,
......@@ -358,5 +402,9 @@ void GL_APIENTRY TexStorage3D(GLenum target,
ANGLE_CAPTURE(TexStorage3D, isCallValid, context, targetPacked, levels, internalformat,
width, height, depth);
}
else
{
GenerateContextLostErrorOnCurrentGlobalContext();
}
}
} // namespace gl
......@@ -48,6 +48,10 @@ void GL_APIENTRY BindBuffersBase(GLenum target, GLuint first, GLsizei count, con
}
ANGLE_CAPTURE(BindBuffersBase, isCallValid, context, target, first, count, buffersPacked);
}
else
{
GenerateContextLostErrorOnCurrentGlobalContext();
}
}
void GL_APIENTRY BindBuffersRange(GLenum target,
......@@ -79,6 +83,10 @@ void GL_APIENTRY BindBuffersRange(GLenum target,
ANGLE_CAPTURE(BindBuffersRange, isCallValid, context, target, first, count, buffersPacked,
offsets, sizes);
}
else
{
GenerateContextLostErrorOnCurrentGlobalContext();
}
}
void GL_APIENTRY BindImageTextures(GLuint first, GLsizei count, const GLuint *textures)
......@@ -100,6 +108,10 @@ void GL_APIENTRY BindImageTextures(GLuint first, GLsizei count, const GLuint *te
}
ANGLE_CAPTURE(BindImageTextures, isCallValid, context, first, count, textures);
}
else
{
GenerateContextLostErrorOnCurrentGlobalContext();
}
}
void GL_APIENTRY BindSamplers(GLuint first, GLsizei count, const GLuint *samplers)
......@@ -121,6 +133,10 @@ void GL_APIENTRY BindSamplers(GLuint first, GLsizei count, const GLuint *sampler
}
ANGLE_CAPTURE(BindSamplers, isCallValid, context, first, count, samplers);
}
else
{
GenerateContextLostErrorOnCurrentGlobalContext();
}
}
void GL_APIENTRY BindTextures(GLuint first, GLsizei count, const GLuint *textures)
......@@ -142,6 +158,10 @@ void GL_APIENTRY BindTextures(GLuint first, GLsizei count, const GLuint *texture
}
ANGLE_CAPTURE(BindTextures, isCallValid, context, first, count, textures);
}
else
{
GenerateContextLostErrorOnCurrentGlobalContext();
}
}
void GL_APIENTRY BindVertexBuffers(GLuint first,
......@@ -171,6 +191,10 @@ void GL_APIENTRY BindVertexBuffers(GLuint first,
ANGLE_CAPTURE(BindVertexBuffers, isCallValid, context, first, count, buffersPacked, offsets,
strides);
}
else
{
GenerateContextLostErrorOnCurrentGlobalContext();
}
}
void GL_APIENTRY BufferStorage(GLenum target, GLsizeiptr size, const void *data, GLbitfield flags)
......@@ -195,6 +219,10 @@ void GL_APIENTRY BufferStorage(GLenum target, GLsizeiptr size, const void *data,
}
ANGLE_CAPTURE(BufferStorage, isCallValid, context, targetPacked, size, data, flags);
}
else
{
GenerateContextLostErrorOnCurrentGlobalContext();
}
}
void GL_APIENTRY
......@@ -221,6 +249,10 @@ ClearTexImage(GLuint texture, GLint level, GLenum format, GLenum type, const voi
ANGLE_CAPTURE(ClearTexImage, isCallValid, context, texturePacked, level, format, type,
data);
}
else
{
GenerateContextLostErrorOnCurrentGlobalContext();
}
}
void GL_APIENTRY ClearTexSubImage(GLuint texture,
......@@ -260,5 +292,9 @@ void GL_APIENTRY ClearTexSubImage(GLuint texture,
ANGLE_CAPTURE(ClearTexSubImage, isCallValid, context, texturePacked, level, xoffset,
yoffset, zoffset, width, height, depth, format, type, data);
}
else
{
GenerateContextLostErrorOnCurrentGlobalContext();
}
}
} // namespace gl
......@@ -53,6 +53,10 @@ void GL_APIENTRY MultiDrawArraysIndirectCount(GLenum mode,
ANGLE_CAPTURE(MultiDrawArraysIndirectCount, isCallValid, context, mode, indirect, drawcount,
maxdrawcount, stride);
}
else
{
GenerateContextLostErrorOnCurrentGlobalContext();
}
}
void GL_APIENTRY MultiDrawElementsIndirectCount(GLenum mode,
......@@ -84,6 +88,10 @@ void GL_APIENTRY MultiDrawElementsIndirectCount(GLenum mode,
ANGLE_CAPTURE(MultiDrawElementsIndirectCount, isCallValid, context, mode, type, indirect,
drawcount, maxdrawcount, stride);
}
else
{
GenerateContextLostErrorOnCurrentGlobalContext();
}
}
void GL_APIENTRY PolygonOffsetClamp(GLfloat factor, GLfloat units, GLfloat clamp)
......@@ -104,6 +112,10 @@ void GL_APIENTRY PolygonOffsetClamp(GLfloat factor, GLfloat units, GLfloat clamp
}
ANGLE_CAPTURE(PolygonOffsetClamp, isCallValid, context, factor, units, clamp);
}
else
{
GenerateContextLostErrorOnCurrentGlobalContext();
}
}
void GL_APIENTRY SpecializeShader(GLuint shader,
......@@ -135,5 +147,9 @@ void GL_APIENTRY SpecializeShader(GLuint shader,
ANGLE_CAPTURE(SpecializeShader, isCallValid, context, shader, pEntryPoint,
numSpecializationConstants, pConstantIndex, pConstantValue);
}
else
{
GenerateContextLostErrorOnCurrentGlobalContext();
}
}
} // namespace gl
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -11,6 +11,7 @@
#include "common/debug.h"
#include "common/platform.h"
#include "common/system_utils.h"
#include "libANGLE/ErrorStrings.h"
#include "libGLESv2/resource.h"
#include <atomic>
......@@ -99,6 +100,22 @@ void SetContextCurrent(Thread *thread, gl::Context *context)
}
} // namespace egl
namespace gl
{
void GenerateContextLostErrorOnContext(Context *context)
{
if (context && context->isContextLost())
{
context->validationError(GL_CONTEXT_LOST, err::kContextLost);
}
}
void GenerateContextLostErrorOnCurrentGlobalContext()
{
GenerateContextLostErrorOnContext(GetGlobalContext());
}
} // namespace gl
#ifdef ANGLE_PLATFORM_WINDOWS
namespace egl
{
......
......@@ -134,11 +134,16 @@ ANGLE_INLINE Context *GetValidGlobalContext()
return gCurrentValidContext;
}
// Generate a context lost error on the context if it is non-null and lost.
void GenerateContextLostErrorOnContext(Context *context);
void GenerateContextLostErrorOnCurrentGlobalContext();
ANGLE_INLINE std::unique_lock<angle::GlobalMutex> GetShareGroupLock(const Context *context)
{
return context->isShared() ? std::unique_lock<angle::GlobalMutex>(egl::GetGlobalMutex())
: std::unique_lock<angle::GlobalMutex>();
}
} // namespace gl
#endif // LIBGLESV2_GLOBALSTATE_H_
......@@ -43,8 +43,12 @@ TEST_P(ContextLostTest, BasicUsage)
EXPECT_GL_NO_ERROR();
EXPECT_GLENUM_EQ(glGetGraphicsResetStatusEXT(), GL_GUILTY_CONTEXT_RESET);
glBindTexture(GL_TEXTURE_2D, 0);
EXPECT_GL_ERROR(GL_OUT_OF_MEMORY);
// Errors should be continually generated
for (size_t i = 0; i < 10; i++)
{
glBindTexture(GL_TEXTURE_2D, 0);
EXPECT_GL_ERROR(GL_CONTEXT_LOST);
}
}
// When context is lost, polling queries such as glGetSynciv with GL_SYNC_STATUS should always
......
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