Commit 3c6b2e16 by Jamie Madill Committed by Commit Bot

More improvements to trace logging.

- output 'glDrawArrays' instead of 'DrawArrays' - output context IDs for multithreaded scenarios - output to trace even when platform logging is on - fix newlines in trace file output Bug: angleproject:3815 Change-Id: Ie07c5c91d9eae6204aaf6f6319ef318b88d292aa Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1761163 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: 's avatarCourtney Goeltzenleuchter <courtneygo@google.com>
parent 83a369bb
......@@ -6,7 +6,7 @@
"scripts/entry_point_packed_gl_enums.json":
"0e8c03c12c36ba8a3009108a543daa6f",
"scripts/generate_entry_points.py":
"4f2df44653e2b16f63fca29a14311dd5",
"0e171ae96ddf02733e37acc8942e3e0d",
"scripts/gl.xml":
"b470cb06b06cbbe7adb2c8129ec85708",
"scripts/gl_angle_ext.xml":
......@@ -140,79 +140,79 @@
"src/libANGLE/validationGL4_autogen.h":
"ebbde7f5154a4d1736330d1fc53b3af7",
"src/libGL/entry_points_gl_1_0_autogen.cpp":
"d78521b904e4f33d058cfbb9f955846c",
"bf3679cbb617daced44bca2f8ca011a0",
"src/libGL/entry_points_gl_1_0_autogen.h":
"a2372719bd7fbc4a6b070ecae7d9247a",
"src/libGL/entry_points_gl_1_1_autogen.cpp":
"359d8bcd794a53beda0b01445a2d87a0",
"2d7627df3ea7401fdc22cbe9f8050ee0",
"src/libGL/entry_points_gl_1_1_autogen.h":
"29ff203c0d402f78d020525a5e5ee447",
"src/libGL/entry_points_gl_1_2_autogen.cpp":
"3ae724a3ea3d16bdaaf2d5f079eb10e8",
"3bc8d09c02fc5973202bb6aedd78b524",
"src/libGL/entry_points_gl_1_2_autogen.h":
"db041e9b37eaaf1c31a4b4e2e4e987f4",
"src/libGL/entry_points_gl_1_3_autogen.cpp":
"4113982882328037b41390f9c8916418",
"889bdd0c2f55cc9bf54279394e5dcb4c",
"src/libGL/entry_points_gl_1_3_autogen.h":
"0c30cbdd3d5b10e9217a049cc2794317",
"src/libGL/entry_points_gl_1_4_autogen.cpp":
"44a146542f17d737fdb5a6ff840985b0",
"b1d7db2f2f5dce0d9ba1bd4734eb131c",
"src/libGL/entry_points_gl_1_4_autogen.h":
"6f3dcfd98c18cd53f32e61ee01eabad6",
"src/libGL/entry_points_gl_1_5_autogen.cpp":
"5e6ad15dd05aaaae31ac27148c59d524",
"6cac711f9a38e657f6a84d8ff6962d8d",
"src/libGL/entry_points_gl_1_5_autogen.h":
"8caacff247caecb833b065afaf6e90ef",
"src/libGL/entry_points_gl_2_0_autogen.cpp":
"c396e7934bc8c2fe86cf5a1c535ca908",
"8224f59e6224fd2e54c487677b823072",
"src/libGL/entry_points_gl_2_0_autogen.h":
"f0f58f83717148d58b735af5c435f2ef",
"src/libGL/entry_points_gl_2_1_autogen.cpp":
"2fd1e63292a28acea2e9ffece36eecfa",
"6ab1017a2f0f1189be5c8a2aca2302eb",
"src/libGL/entry_points_gl_2_1_autogen.h":
"87cd6d513a5852c56eed9b58484fbe19",
"src/libGL/entry_points_gl_3_0_autogen.cpp":
"c25c8d4fd7abf4232d6fd3d8ddfa032c",
"44c7e87e69d8bc42ec2ff79d8229043a",
"src/libGL/entry_points_gl_3_0_autogen.h":
"47396290a846f808e598acdbca56e9b3",
"src/libGL/entry_points_gl_3_1_autogen.cpp":
"4376b64bef93c4d42e7a00be8f555eaf",
"62eec39fd417b4abca7dc7c7ccae8bbf",
"src/libGL/entry_points_gl_3_1_autogen.h":
"6ee6613c0206d99c6afdcd3faddb52a3",
"src/libGL/entry_points_gl_3_2_autogen.cpp":
"86c42d318bc89ee41172f9bbed009f0c",
"26a177a8e8cfc105514467d94e45b877",
"src/libGL/entry_points_gl_3_2_autogen.h":
"347e40b5c9fd08a693bf4ffe713c61e6",
"src/libGL/entry_points_gl_3_3_autogen.cpp":
"4c0b2a79e16f66d29652aff6b92815fb",
"fd71a4114364ba23ed83f87c158b3c61",
"src/libGL/entry_points_gl_3_3_autogen.h":
"2151c64b03364111ad1455609243caba",
"src/libGL/entry_points_gl_4_0_autogen.cpp":
"a96c569803d09672dbb20475e758736b",
"1356c2414286d4a65bacb135517c394c",
"src/libGL/entry_points_gl_4_0_autogen.h":
"c5a258322ee6de37ffdbb6f40d5703a2",
"src/libGL/entry_points_gl_4_1_autogen.cpp":
"94688234fea1be3745294c84dc71f5ca",
"58a7970a1e31ffe9cba38b1d42edf2bf",
"src/libGL/entry_points_gl_4_1_autogen.h":
"ea1e18bf5ed2bd1063c940bd793cb50c",
"src/libGL/entry_points_gl_4_2_autogen.cpp":
"1b6b6c2f9b86af818c4f557806080626",
"64787dccb88cf0c72317094bedd87add",
"src/libGL/entry_points_gl_4_2_autogen.h":
"e6b93e1c3028230ebf5ba8a09f5f4aca",
"src/libGL/entry_points_gl_4_3_autogen.cpp":
"b80d1d45566931d64686b1468213d0d0",
"9bbd9f6762c7f549ab58ff1424e950c1",
"src/libGL/entry_points_gl_4_3_autogen.h":
"60bf8a8337129670875de694386a0a9d",
"src/libGL/entry_points_gl_4_4_autogen.cpp":
"1797f4b0e6e2ad9370a133e360e0c232",
"2663074ea807794a901db99735a2b89d",
"src/libGL/entry_points_gl_4_4_autogen.h":
"d0a8c556ffb1c9d4519a66b2868c68b2",
"src/libGL/entry_points_gl_4_5_autogen.cpp":
"e16fd2c90e6c0d6abd4346425e79ff9e",
"4d15a0800d9340ddff2f92c5892cc84a",
"src/libGL/entry_points_gl_4_5_autogen.h":
"0cc66bfbe40b1120e38ba977c2c95cc1",
"src/libGL/entry_points_gl_4_6_autogen.cpp":
"4320353152d44e242b306ced8e41063b",
"c82f9199bb9ff4a40c73cb71f5bb3ad2",
"src/libGL/entry_points_gl_4_6_autogen.h":
"d659e18d8caffa8d0729fc1a8bdd79f2",
"src/libGL/libGL_autogen.cpp":
......@@ -220,23 +220,23 @@
"src/libGL/libGL_autogen.def":
"b372327de868ff8eaa4f837b7e434f72",
"src/libGLESv2/entry_points_gles_1_0_autogen.cpp":
"fd74939207b2576b4295a0abc6620076",
"1c4815e0405a20fad1b8b5e3d839a584",
"src/libGLESv2/entry_points_gles_1_0_autogen.h":
"77fa8d307ebf839838f8812786cddc1a",
"src/libGLESv2/entry_points_gles_2_0_autogen.cpp":
"c361d24df4609a4869a3f3f75f8d9907",
"8d4929ae35a40eb96571162fa30719b8",
"src/libGLESv2/entry_points_gles_2_0_autogen.h":
"3bbaf1cf42fba5d675e5b54cd1d14df7",
"src/libGLESv2/entry_points_gles_3_0_autogen.cpp":
"aa85edeca5431a99bacfba466e609757",
"935e405960248799897a0e03df879d56",
"src/libGLESv2/entry_points_gles_3_0_autogen.h":
"395f6978219abd5182bbe80cc367e40c",
"src/libGLESv2/entry_points_gles_3_1_autogen.cpp":
"9029353eeb68025ff87e84d67e26f859",
"bfbf9be87816b7568fc7fc12683126b1",
"src/libGLESv2/entry_points_gles_3_1_autogen.h":
"043d09a964c740067bf4279e0b544aed",
"src/libGLESv2/entry_points_gles_ext_autogen.cpp":
"92860d34bc1d847bec010d9dab9e77e9",
"ee9aaf2f80354f712d3a6189ea4f60dc",
"src/libGLESv2/entry_points_gles_ext_autogen.h":
"fea36fa137e55dd2f244dbb49d31cc41",
"src/libGLESv2/libGLESv2_autogen.cpp":
......
......@@ -150,9 +150,9 @@ template_entry_point_decl = """ANGLE_EXPORT {return_type}GL_APIENTRY {name}{expl
template_entry_point_no_return = """void GL_APIENTRY {name}{explicit_context_suffix}({explicit_context_param}{explicit_context_comma}{params})
{{
{event_comment}EVENT("({format_params})"{comma_if_needed}{pass_params});
Context *context = {context_getter};
{event_comment}EVENT("gl{name}", "context = %d{comma_if_needed}{format_params}", CID(context){comma_if_needed}{pass_params});
if (context)
{{{assert_explicit_context}{packed_gl_enum_conversions}
std::unique_lock<std::mutex> shareContextLock = GetShareGroupLock(context);
......@@ -168,9 +168,9 @@ template_entry_point_no_return = """void GL_APIENTRY {name}{explicit_context_suf
template_entry_point_with_return = """{return_type}GL_APIENTRY {name}{explicit_context_suffix}({explicit_context_param}{explicit_context_comma}{params})
{{
{event_comment}EVENT("({format_params})"{comma_if_needed}{pass_params});
Context *context = {context_getter};
{event_comment}EVENT("gl{name}", "context = %d{comma_if_needed}{format_params}", CID(context){comma_if_needed}{pass_params});
{return_type} returnValue;
if (context)
{{{assert_explicit_context}{packed_gl_enum_conversions}
......@@ -438,7 +438,7 @@ template_sources_includes_gl32 = """#include "libGL/entry_points_{}_autogen.h"
#include "libGLESv2/global_state.h"
"""
template_event_comment = """// Don't run an EVENT() macro on the EXT_debug_marker entry points.
template_event_comment = """// Don't run the EVENT() macro on the EXT_debug_marker entry points.
// It can interfere with the debug events being set by the caller.
// """
......
......@@ -259,7 +259,7 @@ void Trace(LogSeverity severity, const char *message)
{
*file << LogSeverityName(severity) << ": ";
}
*file << str;
*file << str << "\n";
file->flush();
}
#endif // defined(ANGLE_ENABLE_DEBUG_TRACE)
......
......@@ -241,12 +241,12 @@ std::ostream &FmtHex(std::ostream &os, T value)
// A macro to log a performance event around a scope.
#if defined(ANGLE_TRACE_ENABLED)
# if defined(_MSC_VER)
# define EVENT(message, ...) \
gl::ScopedPerfEventHelper scopedPerfEventHelper##__LINE__("%s" message "\n", \
__FUNCTION__, __VA_ARGS__)
# define EVENT(function, message, ...) \
gl::ScopedPerfEventHelper scopedPerfEventHelper##__LINE__("%s(" message ")", function, \
__VA_ARGS__)
# else
# define EVENT(message, ...) \
gl::ScopedPerfEventHelper scopedPerfEventHelper("%s" message "\n", __FUNCTION__, \
# define EVENT(function, message, ...) \
gl::ScopedPerfEventHelper scopedPerfEventHelper("%s(" message ")", function, \
##__VA_ARGS__)
# endif // _MSC_VER
#else
......
......@@ -335,6 +335,9 @@ class Context final : public egl::LabeledObject, angle::NonCopyable, public angl
const egl::DisplayExtensions &displayExtensions,
const egl::ClientExtensions &clientExtensions);
// Use for debugging.
int id() const { return mState.mID; }
egl::Error onDestroy(const egl::Display *display);
~Context() override;
......
......@@ -54,10 +54,7 @@ void LoggingAnnotator::logMessage(const gl::LogMessage &msg) const
UNREACHABLE();
}
}
else
{
gl::Trace(msg.getSeverity(), msg.getMessage().c_str());
}
gl::Trace(msg.getSeverity(), msg.getMessage().c_str());
}
} // namespace angle
......@@ -108,6 +108,8 @@ TextureManager *AllocateOrGetSharedTextureManager(const State *shareContextState
return new TextureManager();
}
}
int gIDCounter = 1;
} // namespace
template <typename BindingT, typename... ArgsT>
......@@ -241,7 +243,8 @@ State::State(ContextID contextIn,
bool clientArraysEnabled,
bool robustResourceInit,
bool programBinaryCacheEnabled)
: mClientType(clientType),
: mID(gIDCounter++),
mClientType(clientType),
mClientVersion(clientVersion),
mContext(contextIn),
mBufferManager(AllocateOrGetSharedResourceManager(shareContextState, &State::mBufferManager)),
......
......@@ -67,6 +67,8 @@ class State : angle::NonCopyable
bool programBinaryCacheEnabled);
~State();
int id() const { return mID; }
void initialize(Context *context);
void reset(const Context *context);
......@@ -726,6 +728,8 @@ class State : angle::NonCopyable
// Dispatch table for buffer update functions.
static const angle::PackedEnumMap<BufferBinding, BufferBindingSetter> kBufferSetters;
int mID;
EGLenum mClientType;
Version mClientVersion;
ContextID mContext;
......
......@@ -88,6 +88,20 @@ constexpr ANGLE_INLINE ReturnType GetDefaultReturnValue()
# define ANGLE_CAPTURE(...)
#endif // ANGLE_CAPTURE_ENABLED
#define FUNC_EVENT(format, ...) EVENT(__FUNCTION__, format, __VA_ARGS__)
inline int CID(const Context *context)
{
return context != nullptr ? context->id() : 0;
}
} // namespace gl
namespace egl
{
inline int CID(EGLContext context)
{
return gl::CID(reinterpret_cast<const gl::Context *>(context));
}
} // namespace egl
#endif // LIBANGLE_ENTRY_POINT_UTILS_H_
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -36,13 +36,14 @@ void GL_APIENTRY CopyTexSubImage3D(GLenum target,
GLsizei width,
GLsizei height)
{
EVENT(
"(GLenum target = %s, GLint level = %d, GLint xoffset = %d, GLint yoffset = %d, GLint "
"zoffset = %d, GLint x = %d, GLint y = %d, GLsizei width = %d, GLsizei height = %d)",
GLenumToString(GLenumGroup::TextureTarget, target), level, xoffset, yoffset, zoffset, x, y,
width, height);
Context *context = GetValidGlobalContext();
EVENT("glCopyTexSubImage3D",
"context = %d, GLenum target = %s, GLint level = %d, GLint xoffset = %d, GLint yoffset = "
"%d, GLint zoffset = %d, GLint x = %d, GLint y = %d, GLsizei width = %d, GLsizei height "
"= %d",
CID(context), GLenumToString(GLenumGroup::TextureTarget, target), level, xoffset, yoffset,
zoffset, x, y, width, height);
if (context)
{
TextureTarget targetPacked = FromGL<TextureTarget>(target);
......@@ -67,13 +68,13 @@ void GL_APIENTRY DrawRangeElements(GLenum mode,
GLenum type,
const void *indices)
{
EVENT(
"(GLenum mode = %s, GLuint start = %u, GLuint end = %u, GLsizei count = %d, GLenum type = "
"%s, const void *indices = 0x%016" PRIxPTR ")",
GLenumToString(GLenumGroup::PrimitiveType, mode), start, end, count,
GLenumToString(GLenumGroup::DrawElementsType, type), (uintptr_t)indices);
Context *context = GetValidGlobalContext();
EVENT("glDrawRangeElements",
"context = %d, GLenum mode = %s, GLuint start = %u, GLuint end = %u, GLsizei count = %d, "
"GLenum type = %s, const void *indices = 0x%016" PRIxPTR "",
CID(context), GLenumToString(GLenumGroup::PrimitiveType, mode), start, end, count,
GLenumToString(GLenumGroup::DrawElementsType, type), (uintptr_t)indices);
if (context)
{
PrimitiveMode modePacked = FromGL<PrimitiveMode>(mode);
......@@ -102,15 +103,15 @@ void GL_APIENTRY TexImage3D(GLenum target,
GLenum type,
const void *pixels)
{
EVENT(
"(GLenum target = %s, GLint level = %d, GLint internalformat = %d, GLsizei width = %d, "
"GLsizei height = %d, GLsizei depth = %d, GLint border = %d, GLenum format = %s, GLenum "
"type = %s, const void *pixels = 0x%016" PRIxPTR ")",
GLenumToString(GLenumGroup::TextureTarget, target), level, internalformat, width, height,
depth, border, GLenumToString(GLenumGroup::PixelFormat, format),
GLenumToString(GLenumGroup::PixelType, type), (uintptr_t)pixels);
Context *context = GetValidGlobalContext();
EVENT("glTexImage3D",
"context = %d, GLenum target = %s, GLint level = %d, GLint internalformat = %d, GLsizei "
"width = %d, GLsizei height = %d, GLsizei depth = %d, GLint border = %d, GLenum format = "
"%s, GLenum type = %s, const void *pixels = 0x%016" PRIxPTR "",
CID(context), GLenumToString(GLenumGroup::TextureTarget, target), level, internalformat,
width, height, depth, border, GLenumToString(GLenumGroup::PixelFormat, format),
GLenumToString(GLenumGroup::PixelType, type), (uintptr_t)pixels);
if (context)
{
TextureTarget targetPacked = FromGL<TextureTarget>(target);
......@@ -140,15 +141,15 @@ void GL_APIENTRY TexSubImage3D(GLenum target,
GLenum type,
const void *pixels)
{
EVENT(
"(GLenum target = %s, GLint level = %d, GLint xoffset = %d, GLint yoffset = %d, GLint "
"zoffset = %d, GLsizei width = %d, GLsizei height = %d, GLsizei depth = %d, GLenum format "
"= %s, GLenum type = %s, const void *pixels = 0x%016" PRIxPTR ")",
GLenumToString(GLenumGroup::TextureTarget, target), level, xoffset, yoffset, zoffset, width,
height, depth, GLenumToString(GLenumGroup::PixelFormat, format),
GLenumToString(GLenumGroup::PixelType, type), (uintptr_t)pixels);
Context *context = GetValidGlobalContext();
EVENT("glTexSubImage3D",
"context = %d, GLenum target = %s, GLint level = %d, GLint xoffset = %d, GLint yoffset = "
"%d, GLint zoffset = %d, GLsizei width = %d, GLsizei height = %d, GLsizei depth = %d, "
"GLenum format = %s, GLenum type = %s, const void *pixels = 0x%016" PRIxPTR "",
CID(context), GLenumToString(GLenumGroup::TextureTarget, target), level, xoffset, yoffset,
zoffset, width, height, depth, GLenumToString(GLenumGroup::PixelFormat, format),
GLenumToString(GLenumGroup::PixelType, type), (uintptr_t)pixels);
if (context)
{
TextureTarget targetPacked = FromGL<TextureTarget>(target);
......
......@@ -31,12 +31,12 @@ void GL_APIENTRY UniformMatrix2x3fv(GLint location,
GLboolean transpose,
const GLfloat *value)
{
EVENT(
"(GLint location = %d, GLsizei count = %d, GLboolean transpose = %s, const GLfloat *value "
"= 0x%016" PRIxPTR ")",
location, count, GLbooleanToString(transpose), (uintptr_t)value);
Context *context = GetValidGlobalContext();
EVENT("glUniformMatrix2x3fv",
"context = %d, GLint location = %d, GLsizei count = %d, GLboolean transpose = %s, const "
"GLfloat *value = 0x%016" PRIxPTR "",
CID(context), location, count, GLbooleanToString(transpose), (uintptr_t)value);
if (context)
{
std::unique_lock<std::mutex> shareContextLock = GetShareGroupLock(context);
......@@ -55,12 +55,12 @@ void GL_APIENTRY UniformMatrix2x4fv(GLint location,
GLboolean transpose,
const GLfloat *value)
{
EVENT(
"(GLint location = %d, GLsizei count = %d, GLboolean transpose = %s, const GLfloat *value "
"= 0x%016" PRIxPTR ")",
location, count, GLbooleanToString(transpose), (uintptr_t)value);
Context *context = GetValidGlobalContext();
EVENT("glUniformMatrix2x4fv",
"context = %d, GLint location = %d, GLsizei count = %d, GLboolean transpose = %s, const "
"GLfloat *value = 0x%016" PRIxPTR "",
CID(context), location, count, GLbooleanToString(transpose), (uintptr_t)value);
if (context)
{
std::unique_lock<std::mutex> shareContextLock = GetShareGroupLock(context);
......@@ -79,12 +79,12 @@ void GL_APIENTRY UniformMatrix3x2fv(GLint location,
GLboolean transpose,
const GLfloat *value)
{
EVENT(
"(GLint location = %d, GLsizei count = %d, GLboolean transpose = %s, const GLfloat *value "
"= 0x%016" PRIxPTR ")",
location, count, GLbooleanToString(transpose), (uintptr_t)value);
Context *context = GetValidGlobalContext();
EVENT("glUniformMatrix3x2fv",
"context = %d, GLint location = %d, GLsizei count = %d, GLboolean transpose = %s, const "
"GLfloat *value = 0x%016" PRIxPTR "",
CID(context), location, count, GLbooleanToString(transpose), (uintptr_t)value);
if (context)
{
std::unique_lock<std::mutex> shareContextLock = GetShareGroupLock(context);
......@@ -103,12 +103,12 @@ void GL_APIENTRY UniformMatrix3x4fv(GLint location,
GLboolean transpose,
const GLfloat *value)
{
EVENT(
"(GLint location = %d, GLsizei count = %d, GLboolean transpose = %s, const GLfloat *value "
"= 0x%016" PRIxPTR ")",
location, count, GLbooleanToString(transpose), (uintptr_t)value);
Context *context = GetValidGlobalContext();
EVENT("glUniformMatrix3x4fv",
"context = %d, GLint location = %d, GLsizei count = %d, GLboolean transpose = %s, const "
"GLfloat *value = 0x%016" PRIxPTR "",
CID(context), location, count, GLbooleanToString(transpose), (uintptr_t)value);
if (context)
{
std::unique_lock<std::mutex> shareContextLock = GetShareGroupLock(context);
......@@ -127,12 +127,12 @@ void GL_APIENTRY UniformMatrix4x2fv(GLint location,
GLboolean transpose,
const GLfloat *value)
{
EVENT(
"(GLint location = %d, GLsizei count = %d, GLboolean transpose = %s, const GLfloat *value "
"= 0x%016" PRIxPTR ")",
location, count, GLbooleanToString(transpose), (uintptr_t)value);
Context *context = GetValidGlobalContext();
EVENT("glUniformMatrix4x2fv",
"context = %d, GLint location = %d, GLsizei count = %d, GLboolean transpose = %s, const "
"GLfloat *value = 0x%016" PRIxPTR "",
CID(context), location, count, GLbooleanToString(transpose), (uintptr_t)value);
if (context)
{
std::unique_lock<std::mutex> shareContextLock = GetShareGroupLock(context);
......@@ -151,12 +151,12 @@ void GL_APIENTRY UniformMatrix4x3fv(GLint location,
GLboolean transpose,
const GLfloat *value)
{
EVENT(
"(GLint location = %d, GLsizei count = %d, GLboolean transpose = %s, const GLfloat *value "
"= 0x%016" PRIxPTR ")",
location, count, GLbooleanToString(transpose), (uintptr_t)value);
Context *context = GetValidGlobalContext();
EVENT("glUniformMatrix4x3fv",
"context = %d, GLint location = %d, GLsizei count = %d, GLboolean transpose = %s, const "
"GLfloat *value = 0x%016" PRIxPTR "",
CID(context), location, count, GLbooleanToString(transpose), (uintptr_t)value);
if (context)
{
std::unique_lock<std::mutex> shareContextLock = GetShareGroupLock(context);
......
......@@ -28,12 +28,13 @@ namespace gl
{
void GL_APIENTRY BindBuffersBase(GLenum target, GLuint first, GLsizei count, const GLuint *buffers)
{
EVENT(
"(GLenum target = %s, GLuint first = %u, GLsizei count = %d, const GLuint *buffers = "
"0x%016" PRIxPTR ")",
GLenumToString(GLenumGroup::BufferTargetARB, target), first, count, (uintptr_t)buffers);
Context *context = GetValidGlobalContext();
EVENT("glBindBuffersBase",
"context = %d, GLenum target = %s, GLuint first = %u, GLsizei count = %d, const GLuint "
"*buffers = 0x%016" PRIxPTR "",
CID(context), GLenumToString(GLenumGroup::BufferTargetARB, target), first, count,
(uintptr_t)buffers);
if (context)
{
const BufferID *buffersPacked = FromGL<const BufferID *>(buffers);
......@@ -55,14 +56,14 @@ void GL_APIENTRY BindBuffersRange(GLenum target,
const GLintptr *offsets,
const GLsizeiptr *sizes)
{
EVENT(
"(GLenum target = %s, GLuint first = %u, GLsizei count = %d, const GLuint *buffers = "
"0x%016" PRIxPTR ", const GLintptr *offsets = 0x%016" PRIxPTR
", const GLsizeiptr *sizes = 0x%016" PRIxPTR ")",
GLenumToString(GLenumGroup::BufferTargetARB, target), first, count, (uintptr_t)buffers,
(uintptr_t)offsets, (uintptr_t)sizes);
Context *context = GetValidGlobalContext();
EVENT("glBindBuffersRange",
"context = %d, GLenum target = %s, GLuint first = %u, GLsizei count = %d, const GLuint "
"*buffers = 0x%016" PRIxPTR ", const GLintptr *offsets = 0x%016" PRIxPTR
", const GLsizeiptr *sizes = 0x%016" PRIxPTR "",
CID(context), GLenumToString(GLenumGroup::BufferTargetARB, target), first, count,
(uintptr_t)buffers, (uintptr_t)offsets, (uintptr_t)sizes);
if (context)
{
const BufferID *buffersPacked = FromGL<const BufferID *>(buffers);
......@@ -81,10 +82,12 @@ void GL_APIENTRY BindBuffersRange(GLenum target,
void GL_APIENTRY BindImageTextures(GLuint first, GLsizei count, const GLuint *textures)
{
EVENT("(GLuint first = %u, GLsizei count = %d, const GLuint *textures = 0x%016" PRIxPTR ")",
first, count, (uintptr_t)textures);
Context *context = GetValidGlobalContext();
EVENT("glBindImageTextures",
"context = %d, GLuint first = %u, GLsizei count = %d, const GLuint *textures = "
"0x%016" PRIxPTR "",
CID(context), first, count, (uintptr_t)textures);
if (context)
{
std::unique_lock<std::mutex> shareContextLock = GetShareGroupLock(context);
......@@ -100,10 +103,12 @@ void GL_APIENTRY BindImageTextures(GLuint first, GLsizei count, const GLuint *te
void GL_APIENTRY BindSamplers(GLuint first, GLsizei count, const GLuint *samplers)
{
EVENT("(GLuint first = %u, GLsizei count = %d, const GLuint *samplers = 0x%016" PRIxPTR ")",
first, count, (uintptr_t)samplers);
Context *context = GetValidGlobalContext();
EVENT("glBindSamplers",
"context = %d, GLuint first = %u, GLsizei count = %d, const GLuint *samplers = "
"0x%016" PRIxPTR "",
CID(context), first, count, (uintptr_t)samplers);
if (context)
{
std::unique_lock<std::mutex> shareContextLock = GetShareGroupLock(context);
......@@ -119,10 +124,12 @@ void GL_APIENTRY BindSamplers(GLuint first, GLsizei count, const GLuint *sampler
void GL_APIENTRY BindTextures(GLuint first, GLsizei count, const GLuint *textures)
{
EVENT("(GLuint first = %u, GLsizei count = %d, const GLuint *textures = 0x%016" PRIxPTR ")",
first, count, (uintptr_t)textures);
Context *context = GetValidGlobalContext();
EVENT("glBindTextures",
"context = %d, GLuint first = %u, GLsizei count = %d, const GLuint *textures = "
"0x%016" PRIxPTR "",
CID(context), first, count, (uintptr_t)textures);
if (context)
{
std::unique_lock<std::mutex> shareContextLock = GetShareGroupLock(context);
......@@ -142,12 +149,13 @@ void GL_APIENTRY BindVertexBuffers(GLuint first,
const GLintptr *offsets,
const GLsizei *strides)
{
EVENT("(GLuint first = %u, GLsizei count = %d, const GLuint *buffers = 0x%016" PRIxPTR
", const GLintptr *offsets = 0x%016" PRIxPTR ", const GLsizei *strides = 0x%016" PRIxPTR
")",
first, count, (uintptr_t)buffers, (uintptr_t)offsets, (uintptr_t)strides);
Context *context = GetValidGlobalContext();
EVENT("glBindVertexBuffers",
"context = %d, GLuint first = %u, GLsizei count = %d, const GLuint *buffers = "
"0x%016" PRIxPTR ", const GLintptr *offsets = 0x%016" PRIxPTR
", const GLsizei *strides = 0x%016" PRIxPTR "",
CID(context), first, count, (uintptr_t)buffers, (uintptr_t)offsets, (uintptr_t)strides);
if (context)
{
const BufferID *buffersPacked = FromGL<const BufferID *>(buffers);
......@@ -166,13 +174,14 @@ void GL_APIENTRY BindVertexBuffers(GLuint first,
void GL_APIENTRY BufferStorage(GLenum target, GLsizeiptr size, const void *data, GLbitfield flags)
{
EVENT("(GLenum target = %s, GLsizeiptr size = %llu, const void *data = 0x%016" PRIxPTR
", GLbitfield flags = %s)",
GLenumToString(GLenumGroup::BufferStorageTarget, target),
Context *context = GetValidGlobalContext();
EVENT("glBufferStorage",
"context = %d, GLenum target = %s, GLsizeiptr size = %llu, const void *data = "
"0x%016" PRIxPTR ", GLbitfield flags = %s",
CID(context), GLenumToString(GLenumGroup::BufferStorageTarget, target),
static_cast<unsigned long long>(size), (uintptr_t)data,
GLbitfieldToString(GLenumGroup::MapBufferUsageMask, flags).c_str());
Context *context = GetValidGlobalContext();
if (context)
{
std::unique_lock<std::mutex> shareContextLock = GetShareGroupLock(context);
......@@ -189,13 +198,13 @@ void GL_APIENTRY BufferStorage(GLenum target, GLsizeiptr size, const void *data,
void GL_APIENTRY
ClearTexImage(GLuint texture, GLint level, GLenum format, GLenum type, const void *data)
{
EVENT(
"(GLuint texture = %u, GLint level = %d, GLenum format = %s, GLenum type = %s, const void "
"*data = 0x%016" PRIxPTR ")",
texture, level, GLenumToString(GLenumGroup::PixelFormat, format),
GLenumToString(GLenumGroup::PixelType, type), (uintptr_t)data);
Context *context = GetValidGlobalContext();
EVENT("glClearTexImage",
"context = %d, GLuint texture = %u, GLint level = %d, GLenum format = %s, GLenum type = "
"%s, const void *data = 0x%016" PRIxPTR "",
CID(context), texture, level, GLenumToString(GLenumGroup::PixelFormat, format),
GLenumToString(GLenumGroup::PixelType, type), (uintptr_t)data);
if (context)
{
TextureID texturePacked = FromGL<TextureID>(texture);
......@@ -224,15 +233,15 @@ void GL_APIENTRY ClearTexSubImage(GLuint texture,
GLenum type,
const void *data)
{
EVENT(
"(GLuint texture = %u, GLint level = %d, GLint xoffset = %d, GLint yoffset = %d, GLint "
"zoffset = %d, GLsizei width = %d, GLsizei height = %d, GLsizei depth = %d, GLenum format "
"= %s, GLenum type = %s, const void *data = 0x%016" PRIxPTR ")",
texture, level, xoffset, yoffset, zoffset, width, height, depth,
GLenumToString(GLenumGroup::PixelFormat, format),
GLenumToString(GLenumGroup::PixelType, type), (uintptr_t)data);
Context *context = GetValidGlobalContext();
EVENT("glClearTexSubImage",
"context = %d, GLuint texture = %u, GLint level = %d, GLint xoffset = %d, GLint yoffset "
"= %d, GLint zoffset = %d, GLsizei width = %d, GLsizei height = %d, GLsizei depth = %d, "
"GLenum format = %s, GLenum type = %s, const void *data = 0x%016" PRIxPTR "",
CID(context), texture, level, xoffset, yoffset, zoffset, width, height, depth,
GLenumToString(GLenumGroup::PixelFormat, format),
GLenumToString(GLenumGroup::PixelType, type), (uintptr_t)data);
if (context)
{
TextureID texturePacked = FromGL<TextureID>(texture);
......
......@@ -32,12 +32,13 @@ void GL_APIENTRY MultiDrawArraysIndirectCount(GLenum mode,
GLsizei maxdrawcount,
GLsizei stride)
{
EVENT("(GLenum mode = %s, const void *indirect = 0x%016" PRIxPTR
", GLintptr drawcount = %llu, GLsizei maxdrawcount = %d, GLsizei stride = %d)",
GLenumToString(GLenumGroup::PrimitiveType, mode), (uintptr_t)indirect,
Context *context = GetValidGlobalContext();
EVENT("glMultiDrawArraysIndirectCount",
"context = %d, GLenum mode = %s, const void *indirect = 0x%016" PRIxPTR
", GLintptr drawcount = %llu, GLsizei maxdrawcount = %d, GLsizei stride = %d",
CID(context), GLenumToString(GLenumGroup::PrimitiveType, mode), (uintptr_t)indirect,
static_cast<unsigned long long>(drawcount), maxdrawcount, stride);
Context *context = GetValidGlobalContext();
if (context)
{
std::unique_lock<std::mutex> shareContextLock = GetShareGroupLock(context);
......@@ -60,13 +61,14 @@ void GL_APIENTRY MultiDrawElementsIndirectCount(GLenum mode,
GLsizei maxdrawcount,
GLsizei stride)
{
EVENT("(GLenum mode = %s, GLenum type = %s, const void *indirect = 0x%016" PRIxPTR
", GLintptr drawcount = %llu, GLsizei maxdrawcount = %d, GLsizei stride = %d)",
GLenumToString(GLenumGroup::PrimitiveType, mode),
Context *context = GetValidGlobalContext();
EVENT("glMultiDrawElementsIndirectCount",
"context = %d, GLenum mode = %s, GLenum type = %s, const void *indirect = 0x%016" PRIxPTR
", GLintptr drawcount = %llu, GLsizei maxdrawcount = %d, GLsizei stride = %d",
CID(context), GLenumToString(GLenumGroup::PrimitiveType, mode),
GLenumToString(GLenumGroup::DefaultGroup, type), (uintptr_t)indirect,
static_cast<unsigned long long>(drawcount), maxdrawcount, stride);
Context *context = GetValidGlobalContext();
if (context)
{
std::unique_lock<std::mutex> shareContextLock = GetShareGroupLock(context);
......@@ -85,9 +87,11 @@ void GL_APIENTRY MultiDrawElementsIndirectCount(GLenum mode,
void GL_APIENTRY PolygonOffsetClamp(GLfloat factor, GLfloat units, GLfloat clamp)
{
EVENT("(GLfloat factor = %f, GLfloat units = %f, GLfloat clamp = %f)", factor, units, clamp);
Context *context = GetValidGlobalContext();
EVENT("glPolygonOffsetClamp",
"context = %d, GLfloat factor = %f, GLfloat units = %f, GLfloat clamp = %f", CID(context),
factor, units, clamp);
if (context)
{
std::unique_lock<std::mutex> shareContextLock = GetShareGroupLock(context);
......@@ -107,13 +111,14 @@ void GL_APIENTRY SpecializeShader(GLuint shader,
const GLuint *pConstantIndex,
const GLuint *pConstantValue)
{
EVENT("(GLuint shader = %u, const GLchar *pEntryPoint = 0x%016" PRIxPTR
Context *context = GetValidGlobalContext();
EVENT("glSpecializeShader",
"context = %d, GLuint shader = %u, const GLchar *pEntryPoint = 0x%016" PRIxPTR
", GLuint numSpecializationConstants = %u, const GLuint *pConstantIndex = 0x%016" PRIxPTR
", const GLuint *pConstantValue = 0x%016" PRIxPTR ")",
shader, (uintptr_t)pEntryPoint, numSpecializationConstants, (uintptr_t)pConstantIndex,
(uintptr_t)pConstantValue);
", const GLuint *pConstantValue = 0x%016" PRIxPTR "",
CID(context), shader, (uintptr_t)pEntryPoint, numSpecializationConstants,
(uintptr_t)pConstantIndex, (uintptr_t)pConstantValue);
Context *context = GetValidGlobalContext();
if (context)
{
std::unique_lock<std::mutex> shareContextLock = GetShareGroupLock(context);
......
......@@ -17,6 +17,7 @@
#include "libANGLE/Surface.h"
#include "libANGLE/Texture.h"
#include "libANGLE/Thread.h"
#include "libANGLE/entry_points_utils.h"
#include "libANGLE/queryutils.h"
#include "libANGLE/validationEGL.h"
#include "libGL/proc_table_wgl.h"
......@@ -221,7 +222,7 @@ wglGetLayerPaletteEntries(HDC hdc, int iLayerPlane, int iStart, int cEntries, CO
PROC GL_APIENTRY wglGetProcAddress(LPCSTR lpszProc)
{
ANGLE_SCOPED_GLOBAL_LOCK();
EVENT("(const char *procname = \"%s\")", lpszProc);
FUNC_EVENT("const char *procname = \"%s\"", lpszProc);
egl::Thread *thread = egl::GetCurrentThread();
ProcEntry *entry =
......
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