Commit d43d24bb by Jamie Madill Committed by Commit Bot

Capture/Replay: Refactor entry points.

This change does two things: * only call validation functions once per entry point. * move the capture call after the entry point call. Moving the capure after the call allows us to process the results of the call. Also we can clean up the validation double call by doing a bit of entry point refactoring. The code changes shouldn't impact the resulting code size when capture is disabled. Bug: angleproject:3611 Change-Id: I9e74ba0a8266903d3e9d1f2eac6acdd2932e5743 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1706561 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: 's avatarGeoff Lang <geofflang@chromium.org> Reviewed-by: 's avatarTim Van Patten <timvp@google.com>
parent a0d010ab
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
"scripts/entry_point_packed_gl_enums.json": "scripts/entry_point_packed_gl_enums.json":
"e5282bdef690f0ec652fed0e0723d1e8", "e5282bdef690f0ec652fed0e0723d1e8",
"scripts/generate_entry_points.py": "scripts/generate_entry_points.py":
"19bd27c4c931f63ebbd9cc8f08508fe0", "bd83bd0337b8f2680ac4520dd7525d54",
"scripts/gl.xml": "scripts/gl.xml":
"b470cb06b06cbbe7adb2c8129ec85708", "b470cb06b06cbbe7adb2c8129ec85708",
"scripts/gl_angle_ext.xml": "scripts/gl_angle_ext.xml":
...@@ -138,79 +138,79 @@ ...@@ -138,79 +138,79 @@
"src/libANGLE/validationGL4_autogen.h": "src/libANGLE/validationGL4_autogen.h":
"ebbde7f5154a4d1736330d1fc53b3af7", "ebbde7f5154a4d1736330d1fc53b3af7",
"src/libGL/entry_points_gl_1_0_autogen.cpp": "src/libGL/entry_points_gl_1_0_autogen.cpp":
"dcdd4bbdce1df4acb557e1f1a2c823e4", "8675197f5d355e7200c74b8d69d5856a",
"src/libGL/entry_points_gl_1_0_autogen.h": "src/libGL/entry_points_gl_1_0_autogen.h":
"a2372719bd7fbc4a6b070ecae7d9247a", "a2372719bd7fbc4a6b070ecae7d9247a",
"src/libGL/entry_points_gl_1_1_autogen.cpp": "src/libGL/entry_points_gl_1_1_autogen.cpp":
"329dcb04aa96b22bca411aa3f09afe65", "09e4dcc25ef814230bbe2ee82a7e5f70",
"src/libGL/entry_points_gl_1_1_autogen.h": "src/libGL/entry_points_gl_1_1_autogen.h":
"29ff203c0d402f78d020525a5e5ee447", "29ff203c0d402f78d020525a5e5ee447",
"src/libGL/entry_points_gl_1_2_autogen.cpp": "src/libGL/entry_points_gl_1_2_autogen.cpp":
"247f0973fb17a46cf02d97fe3647ff86", "fa23f2e3db0b11b4b0c33600d06f34ea",
"src/libGL/entry_points_gl_1_2_autogen.h": "src/libGL/entry_points_gl_1_2_autogen.h":
"db041e9b37eaaf1c31a4b4e2e4e987f4", "db041e9b37eaaf1c31a4b4e2e4e987f4",
"src/libGL/entry_points_gl_1_3_autogen.cpp": "src/libGL/entry_points_gl_1_3_autogen.cpp":
"fdbffcd6b9bc4e6765cfa027c0645564", "f46addc37d4bfcd5d3467ad36afd879c",
"src/libGL/entry_points_gl_1_3_autogen.h": "src/libGL/entry_points_gl_1_3_autogen.h":
"0c30cbdd3d5b10e9217a049cc2794317", "0c30cbdd3d5b10e9217a049cc2794317",
"src/libGL/entry_points_gl_1_4_autogen.cpp": "src/libGL/entry_points_gl_1_4_autogen.cpp":
"8a4db0a0dd18a3d43bff54d77aa5d56e", "0adacc49ef7b546cc9ee45944b327be6",
"src/libGL/entry_points_gl_1_4_autogen.h": "src/libGL/entry_points_gl_1_4_autogen.h":
"6f3dcfd98c18cd53f32e61ee01eabad6", "6f3dcfd98c18cd53f32e61ee01eabad6",
"src/libGL/entry_points_gl_1_5_autogen.cpp": "src/libGL/entry_points_gl_1_5_autogen.cpp":
"449488e01b02f47d6c3201d7fb83135e", "d02777ef8d8e576102225c0cad9f0f04",
"src/libGL/entry_points_gl_1_5_autogen.h": "src/libGL/entry_points_gl_1_5_autogen.h":
"8caacff247caecb833b065afaf6e90ef", "8caacff247caecb833b065afaf6e90ef",
"src/libGL/entry_points_gl_2_0_autogen.cpp": "src/libGL/entry_points_gl_2_0_autogen.cpp":
"2e030c84c5641132148ccc6a14f610d6", "fcd8aaa21c0904eee7eb1440efcacfde",
"src/libGL/entry_points_gl_2_0_autogen.h": "src/libGL/entry_points_gl_2_0_autogen.h":
"f0f58f83717148d58b735af5c435f2ef", "f0f58f83717148d58b735af5c435f2ef",
"src/libGL/entry_points_gl_2_1_autogen.cpp": "src/libGL/entry_points_gl_2_1_autogen.cpp":
"c1e596d66b764e76cccbd4f726312d9b", "4fb669499e04560153871472b61cd99c",
"src/libGL/entry_points_gl_2_1_autogen.h": "src/libGL/entry_points_gl_2_1_autogen.h":
"87cd6d513a5852c56eed9b58484fbe19", "87cd6d513a5852c56eed9b58484fbe19",
"src/libGL/entry_points_gl_3_0_autogen.cpp": "src/libGL/entry_points_gl_3_0_autogen.cpp":
"2b6c993f7ffb95443275b74c1813d50f", "34b8bacf473099b044f295503421056c",
"src/libGL/entry_points_gl_3_0_autogen.h": "src/libGL/entry_points_gl_3_0_autogen.h":
"47396290a846f808e598acdbca56e9b3", "47396290a846f808e598acdbca56e9b3",
"src/libGL/entry_points_gl_3_1_autogen.cpp": "src/libGL/entry_points_gl_3_1_autogen.cpp":
"5d70e221458d11925b23db302a722360", "eb0fd508bcdf029318e06da669882b39",
"src/libGL/entry_points_gl_3_1_autogen.h": "src/libGL/entry_points_gl_3_1_autogen.h":
"6ee6613c0206d99c6afdcd3faddb52a3", "6ee6613c0206d99c6afdcd3faddb52a3",
"src/libGL/entry_points_gl_3_2_autogen.cpp": "src/libGL/entry_points_gl_3_2_autogen.cpp":
"d527d0e8e243c1e5d2df32ae19cbef98", "1429a40be35222720fb46232bd6d820d",
"src/libGL/entry_points_gl_3_2_autogen.h": "src/libGL/entry_points_gl_3_2_autogen.h":
"347e40b5c9fd08a693bf4ffe713c61e6", "347e40b5c9fd08a693bf4ffe713c61e6",
"src/libGL/entry_points_gl_3_3_autogen.cpp": "src/libGL/entry_points_gl_3_3_autogen.cpp":
"c0d6ea9b2ee721f6055c7c48b4730d24", "11ae40f3e6219293bd78a09d3c19a79d",
"src/libGL/entry_points_gl_3_3_autogen.h": "src/libGL/entry_points_gl_3_3_autogen.h":
"2151c64b03364111ad1455609243caba", "2151c64b03364111ad1455609243caba",
"src/libGL/entry_points_gl_4_0_autogen.cpp": "src/libGL/entry_points_gl_4_0_autogen.cpp":
"39b494b6dfd3b190471a1c6bcfbf941a", "dee720d9d09d9267b09df08b42ae584a",
"src/libGL/entry_points_gl_4_0_autogen.h": "src/libGL/entry_points_gl_4_0_autogen.h":
"c5a258322ee6de37ffdbb6f40d5703a2", "c5a258322ee6de37ffdbb6f40d5703a2",
"src/libGL/entry_points_gl_4_1_autogen.cpp": "src/libGL/entry_points_gl_4_1_autogen.cpp":
"38a38de5fd85c89b1a1648e56ac1a0e7", "fda20bd6490b54b1458ae983705f65dc",
"src/libGL/entry_points_gl_4_1_autogen.h": "src/libGL/entry_points_gl_4_1_autogen.h":
"ea1e18bf5ed2bd1063c940bd793cb50c", "ea1e18bf5ed2bd1063c940bd793cb50c",
"src/libGL/entry_points_gl_4_2_autogen.cpp": "src/libGL/entry_points_gl_4_2_autogen.cpp":
"791b42f35e8c735d3e770d01db50b50f", "2516ffcc36b84f02e557d8b517f14516",
"src/libGL/entry_points_gl_4_2_autogen.h": "src/libGL/entry_points_gl_4_2_autogen.h":
"e6b93e1c3028230ebf5ba8a09f5f4aca", "e6b93e1c3028230ebf5ba8a09f5f4aca",
"src/libGL/entry_points_gl_4_3_autogen.cpp": "src/libGL/entry_points_gl_4_3_autogen.cpp":
"a801fff83bef138a801591397edbe9a8", "763e905ebbefbd053357e9fea897e713",
"src/libGL/entry_points_gl_4_3_autogen.h": "src/libGL/entry_points_gl_4_3_autogen.h":
"60bf8a8337129670875de694386a0a9d", "60bf8a8337129670875de694386a0a9d",
"src/libGL/entry_points_gl_4_4_autogen.cpp": "src/libGL/entry_points_gl_4_4_autogen.cpp":
"5b85e74385d49e79fb6ea506fe1ec7af", "f8b38d30ca005adb08858bfe02935c1b",
"src/libGL/entry_points_gl_4_4_autogen.h": "src/libGL/entry_points_gl_4_4_autogen.h":
"d0a8c556ffb1c9d4519a66b2868c68b2", "d0a8c556ffb1c9d4519a66b2868c68b2",
"src/libGL/entry_points_gl_4_5_autogen.cpp": "src/libGL/entry_points_gl_4_5_autogen.cpp":
"70c0019d8f4e2140192ecd15c4c42b1f", "72881f8916e9018b96fcdd60dd921db3",
"src/libGL/entry_points_gl_4_5_autogen.h": "src/libGL/entry_points_gl_4_5_autogen.h":
"0cc66bfbe40b1120e38ba977c2c95cc1", "0cc66bfbe40b1120e38ba977c2c95cc1",
"src/libGL/entry_points_gl_4_6_autogen.cpp": "src/libGL/entry_points_gl_4_6_autogen.cpp":
"680f5e4a356b1801b1f1c52f287c1961", "da6e469e201b6a2d3874003ddbc6d721",
"src/libGL/entry_points_gl_4_6_autogen.h": "src/libGL/entry_points_gl_4_6_autogen.h":
"d659e18d8caffa8d0729fc1a8bdd79f2", "d659e18d8caffa8d0729fc1a8bdd79f2",
"src/libGL/libGL_autogen.cpp": "src/libGL/libGL_autogen.cpp":
...@@ -218,23 +218,23 @@ ...@@ -218,23 +218,23 @@
"src/libGL/libGL_autogen.def": "src/libGL/libGL_autogen.def":
"b372327de868ff8eaa4f837b7e434f72", "b372327de868ff8eaa4f837b7e434f72",
"src/libGLESv2/entry_points_gles_1_0_autogen.cpp": "src/libGLESv2/entry_points_gles_1_0_autogen.cpp":
"d9882eb5eb7002955c0e6969288dc595", "fdafba03f5765871d763fa649b7c0dd7",
"src/libGLESv2/entry_points_gles_1_0_autogen.h": "src/libGLESv2/entry_points_gles_1_0_autogen.h":
"77fa8d307ebf839838f8812786cddc1a", "77fa8d307ebf839838f8812786cddc1a",
"src/libGLESv2/entry_points_gles_2_0_autogen.cpp": "src/libGLESv2/entry_points_gles_2_0_autogen.cpp":
"dfc1fefe1fc6f6c819c516da146c006f", "e96d34a714d8e39e106d157a79ca00a2",
"src/libGLESv2/entry_points_gles_2_0_autogen.h": "src/libGLESv2/entry_points_gles_2_0_autogen.h":
"3bbaf1cf42fba5d675e5b54cd1d14df7", "3bbaf1cf42fba5d675e5b54cd1d14df7",
"src/libGLESv2/entry_points_gles_3_0_autogen.cpp": "src/libGLESv2/entry_points_gles_3_0_autogen.cpp":
"8d019c6c5cf340dc495ad70f582c0a81", "af18e9219bffb1933a82e3303e1990bd",
"src/libGLESv2/entry_points_gles_3_0_autogen.h": "src/libGLESv2/entry_points_gles_3_0_autogen.h":
"395f6978219abd5182bbe80cc367e40c", "395f6978219abd5182bbe80cc367e40c",
"src/libGLESv2/entry_points_gles_3_1_autogen.cpp": "src/libGLESv2/entry_points_gles_3_1_autogen.cpp":
"064d77bbecbbac2b4632d77742715465", "488a9fd26a35a625eb85c8f090f6fca0",
"src/libGLESv2/entry_points_gles_3_1_autogen.h": "src/libGLESv2/entry_points_gles_3_1_autogen.h":
"043d09a964c740067bf4279e0b544aed", "043d09a964c740067bf4279e0b544aed",
"src/libGLESv2/entry_points_gles_ext_autogen.cpp": "src/libGLESv2/entry_points_gles_ext_autogen.cpp":
"5a30a605e237647a8257a9ebd2829e4a", "b1eaca4d41edcf445af8e17f8ba12f19",
"src/libGLESv2/entry_points_gles_ext_autogen.h": "src/libGLESv2/entry_points_gles_ext_autogen.h":
"294cc52579b3439e99914c11bb7cd9f6", "294cc52579b3439e99914c11bb7cd9f6",
"src/libGLESv2/libGLESv2_autogen.cpp": "src/libGLESv2/libGLESv2_autogen.cpp":
......
...@@ -121,11 +121,12 @@ template_entry_point_no_return = """void GL_APIENTRY {name}{explicit_context_suf ...@@ -121,11 +121,12 @@ template_entry_point_no_return = """void GL_APIENTRY {name}{explicit_context_suf
Context *context = {context_getter}; Context *context = {context_getter};
if (context) if (context)
{{{assert_explicit_context}{packed_gl_enum_conversions} {{{assert_explicit_context}{packed_gl_enum_conversions}
ANGLE_CAPTURE({name}, {validate_params}); bool isCallValid = (context->skipValidation() || Validate{name}({validate_params}));
if (context->skipValidation() || Validate{name}({validate_params})) if (isCallValid)
{{ {{
context->{name_lower_no_suffix}({internal_params}); context->{name_lower_no_suffix}({internal_params});
}} }}
ANGLE_CAPTURE({name}, isCallValid, {validate_params});
}} }}
}} }}
""" """
...@@ -138,8 +139,8 @@ template_entry_point_with_return = """{return_type}GL_APIENTRY {name}{explicit_c ...@@ -138,8 +139,8 @@ template_entry_point_with_return = """{return_type}GL_APIENTRY {name}{explicit_c
{return_type} returnValue; {return_type} returnValue;
if (context) if (context)
{{{assert_explicit_context}{packed_gl_enum_conversions} {{{assert_explicit_context}{packed_gl_enum_conversions}
ANGLE_CAPTURE({name}, {validate_params}); bool isCallValid = (context->skipValidation() || Validate{name}({validate_params}));
if (context->skipValidation() || Validate{name}({validate_params})) if (isCallValid)
{{ {{
returnValue = context->{name_lower_no_suffix}({internal_params}); returnValue = context->{name_lower_no_suffix}({internal_params});
}} }}
...@@ -147,6 +148,7 @@ template_entry_point_with_return = """{return_type}GL_APIENTRY {name}{explicit_c ...@@ -147,6 +148,7 @@ template_entry_point_with_return = """{return_type}GL_APIENTRY {name}{explicit_c
{{ {{
returnValue = GetDefaultReturnValue<EntryPoint::{name}, {return_type}>(); returnValue = GetDefaultReturnValue<EntryPoint::{name}, {return_type}>();
}} }}
ANGLE_CAPTURE({name}, isCallValid, {validate_params});
}} }}
else else
{{ {{
......
...@@ -110,10 +110,10 @@ class FrameCapture final : angle::NonCopyable ...@@ -110,10 +110,10 @@ class FrameCapture final : angle::NonCopyable
size_t mReadBufferSize; size_t mReadBufferSize;
}; };
template <typename CaptureFuncT, typename ValidationFuncT, typename... ArgsT> template <typename CaptureFuncT, typename... ArgsT>
void CaptureCallToFrameCapture(const char *entryPointName, void CaptureCallToFrameCapture(const char *entryPointName,
CaptureFuncT captureFunc, CaptureFuncT captureFunc,
ValidationFuncT validationFunc, bool isCallValid,
gl::Context *context, gl::Context *context,
ArgsT... captureParams) ArgsT... captureParams)
{ {
...@@ -121,7 +121,6 @@ void CaptureCallToFrameCapture(const char *entryPointName, ...@@ -121,7 +121,6 @@ void CaptureCallToFrameCapture(const char *entryPointName,
if (!frameCapture->enabled()) if (!frameCapture->enabled())
return; return;
bool isCallValid = validationFunc(context, captureParams...);
CallCapture call = captureFunc(context, isCallValid, captureParams...); CallCapture call = captureFunc(context, isCallValid, captureParams...);
frameCapture->captureCall(context, std::move(call)); frameCapture->captureCall(context, std::move(call));
} }
......
...@@ -83,9 +83,8 @@ constexpr ANGLE_INLINE ReturnType GetDefaultReturnValue() ...@@ -83,9 +83,8 @@ constexpr ANGLE_INLINE ReturnType GetDefaultReturnValue()
} }
#if ANGLE_CAPTURE_ENABLED #if ANGLE_CAPTURE_ENABLED
# define ANGLE_CAPTURE(Func, ...) \ # define ANGLE_CAPTURE(Func, ...) \
CaptureCallToFrameCapture("gl" ANGLE_STRINGIFY(Func), Capture##Func, Validate##Func, \ CaptureCallToFrameCapture("gl" ANGLE_STRINGIFY(Func), Capture##Func, __VA_ARGS__)
__VA_ARGS__)
#else #else
# define ANGLE_CAPTURE(...) # define ANGLE_CAPTURE(...)
#endif // ANGLE_CAPTURE_ENABLED #endif // ANGLE_CAPTURE_ENABLED
......
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -44,15 +44,16 @@ void GL_APIENTRY CopyTexSubImage3D(GLenum target, ...@@ -44,15 +44,16 @@ void GL_APIENTRY CopyTexSubImage3D(GLenum target,
if (context) if (context)
{ {
TextureTarget targetPacked = FromGLenum<TextureTarget>(target); TextureTarget targetPacked = FromGLenum<TextureTarget>(target);
ANGLE_CAPTURE(CopyTexSubImage3D, context, targetPacked, level, xoffset, yoffset, zoffset, x, bool isCallValid = (context->skipValidation() ||
y, width, height); ValidateCopyTexSubImage3D(context, targetPacked, level, xoffset,
if (context->skipValidation() || yoffset, zoffset, x, y, width, height));
ValidateCopyTexSubImage3D(context, targetPacked, level, xoffset, yoffset, zoffset, x, y, if (isCallValid)
width, height))
{ {
context->copyTexSubImage3D(targetPacked, level, xoffset, yoffset, zoffset, x, y, width, context->copyTexSubImage3D(targetPacked, level, xoffset, yoffset, zoffset, x, y, width,
height); height);
} }
ANGLE_CAPTURE(CopyTexSubImage3D, isCallValid, context, targetPacked, level, xoffset,
yoffset, zoffset, x, y, width, height);
} }
} }
...@@ -73,13 +74,15 @@ void GL_APIENTRY DrawRangeElements(GLenum mode, ...@@ -73,13 +74,15 @@ void GL_APIENTRY DrawRangeElements(GLenum mode,
{ {
PrimitiveMode modePacked = FromGLenum<PrimitiveMode>(mode); PrimitiveMode modePacked = FromGLenum<PrimitiveMode>(mode);
DrawElementsType typePacked = FromGLenum<DrawElementsType>(type); DrawElementsType typePacked = FromGLenum<DrawElementsType>(type);
ANGLE_CAPTURE(DrawRangeElements, context, modePacked, start, end, count, typePacked, bool isCallValid =
indices); (context->skipValidation() || ValidateDrawRangeElements(context, modePacked, start, end,
if (context->skipValidation() || count, typePacked, indices));
ValidateDrawRangeElements(context, modePacked, start, end, count, typePacked, indices)) if (isCallValid)
{ {
context->drawRangeElements(modePacked, start, end, count, typePacked, indices); context->drawRangeElements(modePacked, start, end, count, typePacked, indices);
} }
ANGLE_CAPTURE(DrawRangeElements, isCallValid, context, modePacked, start, end, count,
typePacked, indices);
} }
} }
...@@ -105,15 +108,16 @@ void GL_APIENTRY TexImage3D(GLenum target, ...@@ -105,15 +108,16 @@ void GL_APIENTRY TexImage3D(GLenum target,
if (context) if (context)
{ {
TextureTarget targetPacked = FromGLenum<TextureTarget>(target); TextureTarget targetPacked = FromGLenum<TextureTarget>(target);
ANGLE_CAPTURE(TexImage3D, context, targetPacked, level, internalformat, width, height, bool isCallValid = (context->skipValidation() ||
depth, border, format, type, pixels); ValidateTexImage3D(context, targetPacked, level, internalformat, width,
if (context->skipValidation() || height, depth, border, format, type, pixels));
ValidateTexImage3D(context, targetPacked, level, internalformat, width, height, depth, if (isCallValid)
border, format, type, pixels))
{ {
context->texImage3D(targetPacked, level, internalformat, width, height, depth, border, context->texImage3D(targetPacked, level, internalformat, width, height, depth, border,
format, type, pixels); format, type, pixels);
} }
ANGLE_CAPTURE(TexImage3D, isCallValid, context, targetPacked, level, internalformat, width,
height, depth, border, format, type, pixels);
} }
} }
...@@ -140,15 +144,17 @@ void GL_APIENTRY TexSubImage3D(GLenum target, ...@@ -140,15 +144,17 @@ void GL_APIENTRY TexSubImage3D(GLenum target,
if (context) if (context)
{ {
TextureTarget targetPacked = FromGLenum<TextureTarget>(target); TextureTarget targetPacked = FromGLenum<TextureTarget>(target);
ANGLE_CAPTURE(TexSubImage3D, context, targetPacked, level, xoffset, yoffset, zoffset, width, bool isCallValid =
height, depth, format, type, pixels); (context->skipValidation() ||
if (context->skipValidation() || ValidateTexSubImage3D(context, targetPacked, level, xoffset, yoffset, zoffset, width,
ValidateTexSubImage3D(context, targetPacked, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels));
height, depth, format, type, pixels)) if (isCallValid)
{ {
context->texSubImage3D(targetPacked, level, xoffset, yoffset, zoffset, width, height, context->texSubImage3D(targetPacked, level, xoffset, yoffset, zoffset, width, height,
depth, format, type, pixels); depth, format, type, pixels);
} }
ANGLE_CAPTURE(TexSubImage3D, isCallValid, context, targetPacked, level, xoffset, yoffset,
zoffset, width, height, depth, format, type, pixels);
} }
} }
} // namespace gl } // namespace gl
...@@ -38,12 +38,13 @@ void GL_APIENTRY UniformMatrix2x3fv(GLint location, ...@@ -38,12 +38,13 @@ void GL_APIENTRY UniformMatrix2x3fv(GLint location,
Context *context = GetValidGlobalContext(); Context *context = GetValidGlobalContext();
if (context) if (context)
{ {
ANGLE_CAPTURE(UniformMatrix2x3fv, context, location, count, transpose, value); bool isCallValid = (context->skipValidation() ||
if (context->skipValidation() || ValidateUniformMatrix2x3fv(context, location, count, transpose, value));
ValidateUniformMatrix2x3fv(context, location, count, transpose, value)) if (isCallValid)
{ {
context->uniformMatrix2x3fv(location, count, transpose, value); context->uniformMatrix2x3fv(location, count, transpose, value);
} }
ANGLE_CAPTURE(UniformMatrix2x3fv, isCallValid, context, location, count, transpose, value);
} }
} }
...@@ -60,12 +61,13 @@ void GL_APIENTRY UniformMatrix2x4fv(GLint location, ...@@ -60,12 +61,13 @@ void GL_APIENTRY UniformMatrix2x4fv(GLint location,
Context *context = GetValidGlobalContext(); Context *context = GetValidGlobalContext();
if (context) if (context)
{ {
ANGLE_CAPTURE(UniformMatrix2x4fv, context, location, count, transpose, value); bool isCallValid = (context->skipValidation() ||
if (context->skipValidation() || ValidateUniformMatrix2x4fv(context, location, count, transpose, value));
ValidateUniformMatrix2x4fv(context, location, count, transpose, value)) if (isCallValid)
{ {
context->uniformMatrix2x4fv(location, count, transpose, value); context->uniformMatrix2x4fv(location, count, transpose, value);
} }
ANGLE_CAPTURE(UniformMatrix2x4fv, isCallValid, context, location, count, transpose, value);
} }
} }
...@@ -82,12 +84,13 @@ void GL_APIENTRY UniformMatrix3x2fv(GLint location, ...@@ -82,12 +84,13 @@ void GL_APIENTRY UniformMatrix3x2fv(GLint location,
Context *context = GetValidGlobalContext(); Context *context = GetValidGlobalContext();
if (context) if (context)
{ {
ANGLE_CAPTURE(UniformMatrix3x2fv, context, location, count, transpose, value); bool isCallValid = (context->skipValidation() ||
if (context->skipValidation() || ValidateUniformMatrix3x2fv(context, location, count, transpose, value));
ValidateUniformMatrix3x2fv(context, location, count, transpose, value)) if (isCallValid)
{ {
context->uniformMatrix3x2fv(location, count, transpose, value); context->uniformMatrix3x2fv(location, count, transpose, value);
} }
ANGLE_CAPTURE(UniformMatrix3x2fv, isCallValid, context, location, count, transpose, value);
} }
} }
...@@ -104,12 +107,13 @@ void GL_APIENTRY UniformMatrix3x4fv(GLint location, ...@@ -104,12 +107,13 @@ void GL_APIENTRY UniformMatrix3x4fv(GLint location,
Context *context = GetValidGlobalContext(); Context *context = GetValidGlobalContext();
if (context) if (context)
{ {
ANGLE_CAPTURE(UniformMatrix3x4fv, context, location, count, transpose, value); bool isCallValid = (context->skipValidation() ||
if (context->skipValidation() || ValidateUniformMatrix3x4fv(context, location, count, transpose, value));
ValidateUniformMatrix3x4fv(context, location, count, transpose, value)) if (isCallValid)
{ {
context->uniformMatrix3x4fv(location, count, transpose, value); context->uniformMatrix3x4fv(location, count, transpose, value);
} }
ANGLE_CAPTURE(UniformMatrix3x4fv, isCallValid, context, location, count, transpose, value);
} }
} }
...@@ -126,12 +130,13 @@ void GL_APIENTRY UniformMatrix4x2fv(GLint location, ...@@ -126,12 +130,13 @@ void GL_APIENTRY UniformMatrix4x2fv(GLint location,
Context *context = GetValidGlobalContext(); Context *context = GetValidGlobalContext();
if (context) if (context)
{ {
ANGLE_CAPTURE(UniformMatrix4x2fv, context, location, count, transpose, value); bool isCallValid = (context->skipValidation() ||
if (context->skipValidation() || ValidateUniformMatrix4x2fv(context, location, count, transpose, value));
ValidateUniformMatrix4x2fv(context, location, count, transpose, value)) if (isCallValid)
{ {
context->uniformMatrix4x2fv(location, count, transpose, value); context->uniformMatrix4x2fv(location, count, transpose, value);
} }
ANGLE_CAPTURE(UniformMatrix4x2fv, isCallValid, context, location, count, transpose, value);
} }
} }
...@@ -148,12 +153,13 @@ void GL_APIENTRY UniformMatrix4x3fv(GLint location, ...@@ -148,12 +153,13 @@ void GL_APIENTRY UniformMatrix4x3fv(GLint location,
Context *context = GetValidGlobalContext(); Context *context = GetValidGlobalContext();
if (context) if (context)
{ {
ANGLE_CAPTURE(UniformMatrix4x3fv, context, location, count, transpose, value); bool isCallValid = (context->skipValidation() ||
if (context->skipValidation() || ValidateUniformMatrix4x3fv(context, location, count, transpose, value));
ValidateUniformMatrix4x3fv(context, location, count, transpose, value)) if (isCallValid)
{ {
context->uniformMatrix4x3fv(location, count, transpose, value); context->uniformMatrix4x3fv(location, count, transpose, value);
} }
ANGLE_CAPTURE(UniformMatrix4x3fv, isCallValid, context, location, count, transpose, value);
} }
} }
} // namespace gl } // namespace gl
...@@ -35,12 +35,13 @@ void GL_APIENTRY BindBuffersBase(GLenum target, GLuint first, GLsizei count, con ...@@ -35,12 +35,13 @@ void GL_APIENTRY BindBuffersBase(GLenum target, GLuint first, GLsizei count, con
Context *context = GetValidGlobalContext(); Context *context = GetValidGlobalContext();
if (context) if (context)
{ {
ANGLE_CAPTURE(BindBuffersBase, context, target, first, count, buffers); bool isCallValid = (context->skipValidation() ||
if (context->skipValidation() || ValidateBindBuffersBase(context, target, first, count, buffers));
ValidateBindBuffersBase(context, target, first, count, buffers)) if (isCallValid)
{ {
context->bindBuffersBase(target, first, count, buffers); context->bindBuffersBase(target, first, count, buffers);
} }
ANGLE_CAPTURE(BindBuffersBase, isCallValid, context, target, first, count, buffers);
} }
} }
...@@ -60,12 +61,15 @@ void GL_APIENTRY BindBuffersRange(GLenum target, ...@@ -60,12 +61,15 @@ void GL_APIENTRY BindBuffersRange(GLenum target,
Context *context = GetValidGlobalContext(); Context *context = GetValidGlobalContext();
if (context) if (context)
{ {
ANGLE_CAPTURE(BindBuffersRange, context, target, first, count, buffers, offsets, sizes); bool isCallValid =
if (context->skipValidation() || (context->skipValidation() ||
ValidateBindBuffersRange(context, target, first, count, buffers, offsets, sizes)) ValidateBindBuffersRange(context, target, first, count, buffers, offsets, sizes));
if (isCallValid)
{ {
context->bindBuffersRange(target, first, count, buffers, offsets, sizes); context->bindBuffersRange(target, first, count, buffers, offsets, sizes);
} }
ANGLE_CAPTURE(BindBuffersRange, isCallValid, context, target, first, count, buffers,
offsets, sizes);
} }
} }
...@@ -77,11 +81,13 @@ void GL_APIENTRY BindImageTextures(GLuint first, GLsizei count, const GLuint *te ...@@ -77,11 +81,13 @@ void GL_APIENTRY BindImageTextures(GLuint first, GLsizei count, const GLuint *te
Context *context = GetValidGlobalContext(); Context *context = GetValidGlobalContext();
if (context) if (context)
{ {
ANGLE_CAPTURE(BindImageTextures, context, first, count, textures); bool isCallValid = (context->skipValidation() ||
if (context->skipValidation() || ValidateBindImageTextures(context, first, count, textures)) ValidateBindImageTextures(context, first, count, textures));
if (isCallValid)
{ {
context->bindImageTextures(first, count, textures); context->bindImageTextures(first, count, textures);
} }
ANGLE_CAPTURE(BindImageTextures, isCallValid, context, first, count, textures);
} }
} }
...@@ -93,11 +99,13 @@ void GL_APIENTRY BindSamplers(GLuint first, GLsizei count, const GLuint *sampler ...@@ -93,11 +99,13 @@ void GL_APIENTRY BindSamplers(GLuint first, GLsizei count, const GLuint *sampler
Context *context = GetValidGlobalContext(); Context *context = GetValidGlobalContext();
if (context) if (context)
{ {
ANGLE_CAPTURE(BindSamplers, context, first, count, samplers); bool isCallValid =
if (context->skipValidation() || ValidateBindSamplers(context, first, count, samplers)) (context->skipValidation() || ValidateBindSamplers(context, first, count, samplers));
if (isCallValid)
{ {
context->bindSamplers(first, count, samplers); context->bindSamplers(first, count, samplers);
} }
ANGLE_CAPTURE(BindSamplers, isCallValid, context, first, count, samplers);
} }
} }
...@@ -109,11 +117,13 @@ void GL_APIENTRY BindTextures(GLuint first, GLsizei count, const GLuint *texture ...@@ -109,11 +117,13 @@ void GL_APIENTRY BindTextures(GLuint first, GLsizei count, const GLuint *texture
Context *context = GetValidGlobalContext(); Context *context = GetValidGlobalContext();
if (context) if (context)
{ {
ANGLE_CAPTURE(BindTextures, context, first, count, textures); bool isCallValid =
if (context->skipValidation() || ValidateBindTextures(context, first, count, textures)) (context->skipValidation() || ValidateBindTextures(context, first, count, textures));
if (isCallValid)
{ {
context->bindTextures(first, count, textures); context->bindTextures(first, count, textures);
} }
ANGLE_CAPTURE(BindTextures, isCallValid, context, first, count, textures);
} }
} }
...@@ -131,12 +141,15 @@ void GL_APIENTRY BindVertexBuffers(GLuint first, ...@@ -131,12 +141,15 @@ void GL_APIENTRY BindVertexBuffers(GLuint first,
Context *context = GetValidGlobalContext(); Context *context = GetValidGlobalContext();
if (context) if (context)
{ {
ANGLE_CAPTURE(BindVertexBuffers, context, first, count, buffers, offsets, strides); bool isCallValid =
if (context->skipValidation() || (context->skipValidation() ||
ValidateBindVertexBuffers(context, first, count, buffers, offsets, strides)) ValidateBindVertexBuffers(context, first, count, buffers, offsets, strides));
if (isCallValid)
{ {
context->bindVertexBuffers(first, count, buffers, offsets, strides); context->bindVertexBuffers(first, count, buffers, offsets, strides);
} }
ANGLE_CAPTURE(BindVertexBuffers, isCallValid, context, first, count, buffers, offsets,
strides);
} }
} }
...@@ -149,11 +162,13 @@ void GL_APIENTRY BufferStorage(GLenum target, GLsizeiptr size, const void *data, ...@@ -149,11 +162,13 @@ void GL_APIENTRY BufferStorage(GLenum target, GLsizeiptr size, const void *data,
Context *context = GetValidGlobalContext(); Context *context = GetValidGlobalContext();
if (context) if (context)
{ {
ANGLE_CAPTURE(BufferStorage, context, target, size, data, flags); bool isCallValid = (context->skipValidation() ||
if (context->skipValidation() || ValidateBufferStorage(context, target, size, data, flags)) ValidateBufferStorage(context, target, size, data, flags));
if (isCallValid)
{ {
context->bufferStorage(target, size, data, flags); context->bufferStorage(target, size, data, flags);
} }
ANGLE_CAPTURE(BufferStorage, isCallValid, context, target, size, data, flags);
} }
} }
...@@ -168,12 +183,13 @@ ClearTexImage(GLuint texture, GLint level, GLenum format, GLenum type, const voi ...@@ -168,12 +183,13 @@ ClearTexImage(GLuint texture, GLint level, GLenum format, GLenum type, const voi
Context *context = GetValidGlobalContext(); Context *context = GetValidGlobalContext();
if (context) if (context)
{ {
ANGLE_CAPTURE(ClearTexImage, context, texture, level, format, type, data); bool isCallValid = (context->skipValidation() ||
if (context->skipValidation() || ValidateClearTexImage(context, texture, level, format, type, data));
ValidateClearTexImage(context, texture, level, format, type, data)) if (isCallValid)
{ {
context->clearTexImage(texture, level, format, type, data); context->clearTexImage(texture, level, format, type, data);
} }
ANGLE_CAPTURE(ClearTexImage, isCallValid, context, texture, level, format, type, data);
} }
} }
...@@ -199,15 +215,17 @@ void GL_APIENTRY ClearTexSubImage(GLuint texture, ...@@ -199,15 +215,17 @@ void GL_APIENTRY ClearTexSubImage(GLuint texture,
Context *context = GetValidGlobalContext(); Context *context = GetValidGlobalContext();
if (context) if (context)
{ {
ANGLE_CAPTURE(ClearTexSubImage, context, texture, level, xoffset, yoffset, zoffset, width, bool isCallValid =
height, depth, format, type, data); (context->skipValidation() ||
if (context->skipValidation() || ValidateClearTexSubImage(context, texture, level, xoffset, yoffset, zoffset, width,
ValidateClearTexSubImage(context, texture, level, xoffset, yoffset, zoffset, width, height, depth, format, type, data));
height, depth, format, type, data)) if (isCallValid)
{ {
context->clearTexSubImage(texture, level, xoffset, yoffset, zoffset, width, height, context->clearTexSubImage(texture, level, xoffset, yoffset, zoffset, width, height,
depth, format, type, data); depth, format, type, data);
} }
ANGLE_CAPTURE(ClearTexSubImage, isCallValid, context, texture, level, xoffset, yoffset,
zoffset, width, height, depth, format, type, data);
} }
} }
} // namespace gl } // namespace gl
...@@ -39,14 +39,15 @@ void GL_APIENTRY MultiDrawArraysIndirectCount(GLenum mode, ...@@ -39,14 +39,15 @@ void GL_APIENTRY MultiDrawArraysIndirectCount(GLenum mode,
Context *context = GetValidGlobalContext(); Context *context = GetValidGlobalContext();
if (context) if (context)
{ {
ANGLE_CAPTURE(MultiDrawArraysIndirectCount, context, mode, indirect, drawcount, bool isCallValid = (context->skipValidation() ||
maxdrawcount, stride); ValidateMultiDrawArraysIndirectCount(context, mode, indirect, drawcount,
if (context->skipValidation() || maxdrawcount, stride));
ValidateMultiDrawArraysIndirectCount(context, mode, indirect, drawcount, maxdrawcount, if (isCallValid)
stride))
{ {
context->multiDrawArraysIndirectCount(mode, indirect, drawcount, maxdrawcount, stride); context->multiDrawArraysIndirectCount(mode, indirect, drawcount, maxdrawcount, stride);
} }
ANGLE_CAPTURE(MultiDrawArraysIndirectCount, isCallValid, context, mode, indirect, drawcount,
maxdrawcount, stride);
} }
} }
...@@ -65,15 +66,16 @@ void GL_APIENTRY MultiDrawElementsIndirectCount(GLenum mode, ...@@ -65,15 +66,16 @@ void GL_APIENTRY MultiDrawElementsIndirectCount(GLenum mode,
Context *context = GetValidGlobalContext(); Context *context = GetValidGlobalContext();
if (context) if (context)
{ {
ANGLE_CAPTURE(MultiDrawElementsIndirectCount, context, mode, type, indirect, drawcount, bool isCallValid = (context->skipValidation() ||
maxdrawcount, stride); ValidateMultiDrawElementsIndirectCount(
if (context->skipValidation() || context, mode, type, indirect, drawcount, maxdrawcount, stride));
ValidateMultiDrawElementsIndirectCount(context, mode, type, indirect, drawcount, if (isCallValid)
maxdrawcount, stride))
{ {
context->multiDrawElementsIndirectCount(mode, type, indirect, drawcount, maxdrawcount, context->multiDrawElementsIndirectCount(mode, type, indirect, drawcount, maxdrawcount,
stride); stride);
} }
ANGLE_CAPTURE(MultiDrawElementsIndirectCount, isCallValid, context, mode, type, indirect,
drawcount, maxdrawcount, stride);
} }
} }
...@@ -84,11 +86,13 @@ void GL_APIENTRY PolygonOffsetClamp(GLfloat factor, GLfloat units, GLfloat clamp ...@@ -84,11 +86,13 @@ void GL_APIENTRY PolygonOffsetClamp(GLfloat factor, GLfloat units, GLfloat clamp
Context *context = GetValidGlobalContext(); Context *context = GetValidGlobalContext();
if (context) if (context)
{ {
ANGLE_CAPTURE(PolygonOffsetClamp, context, factor, units, clamp); bool isCallValid = (context->skipValidation() ||
if (context->skipValidation() || ValidatePolygonOffsetClamp(context, factor, units, clamp)) ValidatePolygonOffsetClamp(context, factor, units, clamp));
if (isCallValid)
{ {
context->polygonOffsetClamp(factor, units, clamp); context->polygonOffsetClamp(factor, units, clamp);
} }
ANGLE_CAPTURE(PolygonOffsetClamp, isCallValid, context, factor, units, clamp);
} }
} }
...@@ -107,15 +111,17 @@ void GL_APIENTRY SpecializeShader(GLuint shader, ...@@ -107,15 +111,17 @@ void GL_APIENTRY SpecializeShader(GLuint shader,
Context *context = GetValidGlobalContext(); Context *context = GetValidGlobalContext();
if (context) if (context)
{ {
ANGLE_CAPTURE(SpecializeShader, context, shader, pEntryPoint, numSpecializationConstants, bool isCallValid =
pConstantIndex, pConstantValue); (context->skipValidation() ||
if (context->skipValidation() || ValidateSpecializeShader(context, shader, pEntryPoint, numSpecializationConstants,
ValidateSpecializeShader(context, shader, pEntryPoint, numSpecializationConstants, pConstantIndex, pConstantValue));
pConstantIndex, pConstantValue)) if (isCallValid)
{ {
context->specializeShader(shader, pEntryPoint, numSpecializationConstants, context->specializeShader(shader, pEntryPoint, numSpecializationConstants,
pConstantIndex, pConstantValue); pConstantIndex, pConstantValue);
} }
ANGLE_CAPTURE(SpecializeShader, isCallValid, context, shader, pEntryPoint,
numSpecializationConstants, pConstantIndex, pConstantValue);
} }
} }
} // namespace gl } // namespace gl
This source diff could not be displayed because it is too large. You can view the blob instead.
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