2013-01-18 04:45:11 +04:00
|
|
|
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
|
|
|
/* vim: set ts=8 sts=4 et sw=4 tw=80: */
|
2012-05-21 15:12:37 +04:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
2010-04-27 06:09:44 +04:00
|
|
|
|
|
|
|
#ifndef GLCONTEXT_H_
|
|
|
|
#define GLCONTEXT_H_
|
|
|
|
|
2015-09-24 22:21:05 +03:00
|
|
|
#include <bitset>
|
2015-09-23 05:26:13 +03:00
|
|
|
#include <ctype.h>
|
2015-09-24 22:21:05 +03:00
|
|
|
#include <stdint.h>
|
|
|
|
#include <stdio.h>
|
2013-07-18 07:24:15 +04:00
|
|
|
#include <map>
|
2014-08-28 03:18:43 +04:00
|
|
|
#include <queue>
|
2015-09-24 22:21:05 +03:00
|
|
|
#include <stack>
|
2010-07-01 20:30:38 +04:00
|
|
|
|
2013-09-07 06:13:37 +04:00
|
|
|
#ifdef DEBUG
|
|
|
|
#include <string.h>
|
|
|
|
#endif
|
|
|
|
|
2013-05-30 07:15:31 +04:00
|
|
|
#ifdef GetClassName
|
|
|
|
#undef GetClassName
|
|
|
|
#endif
|
|
|
|
|
2014-10-15 05:24:53 +04:00
|
|
|
// Define MOZ_GL_DEBUG unconditionally to enable GL debugging in opt
|
|
|
|
// builds.
|
|
|
|
#ifdef DEBUG
|
|
|
|
#define MOZ_GL_DEBUG 1
|
|
|
|
#endif
|
|
|
|
|
2015-10-18 08:24:48 +03:00
|
|
|
#include "../../mfbt/RefPtr.h"
|
2015-07-15 03:37:28 +03:00
|
|
|
#include "../../mfbt/UniquePtr.h"
|
2014-01-06 19:49:03 +04:00
|
|
|
|
2010-04-27 06:09:44 +04:00
|
|
|
#include "GLDefs.h"
|
2012-03-17 02:24:12 +04:00
|
|
|
#include "GLLibraryLoader.h"
|
2010-04-27 06:09:44 +04:00
|
|
|
#include "nsISupportsImpl.h"
|
2013-02-05 22:02:17 +04:00
|
|
|
#include "plstr.h"
|
2012-11-27 02:23:27 +04:00
|
|
|
#include "GLContextTypes.h"
|
2013-02-14 03:26:24 +04:00
|
|
|
#include "SurfaceTypes.h"
|
2010-10-13 01:01:59 +04:00
|
|
|
#include "GLContextSymbols.h"
|
2014-05-09 08:18:00 +04:00
|
|
|
#include "base/platform_thread.h" // for PlatformThreadId
|
2013-06-17 06:05:56 +04:00
|
|
|
#include "mozilla/GenericRefCounted.h"
|
2013-12-10 20:11:11 +04:00
|
|
|
#include "gfx2DGlue.h"
|
2014-10-15 07:20:16 +04:00
|
|
|
#include "GeckoProfiler.h"
|
2012-04-16 23:56:12 +04:00
|
|
|
|
2015-12-24 06:03:35 +03:00
|
|
|
class nsIWidget;
|
|
|
|
|
2012-07-24 03:58:37 +04:00
|
|
|
namespace android {
|
2013-02-14 03:26:24 +04:00
|
|
|
class GraphicBuffer;
|
2015-07-13 18:25:42 +03:00
|
|
|
} // namespace android
|
2012-07-24 03:58:37 +04:00
|
|
|
|
2010-04-27 06:09:44 +04:00
|
|
|
namespace mozilla {
|
2013-02-14 03:26:24 +04:00
|
|
|
namespace gfx {
|
2013-07-09 08:21:05 +04:00
|
|
|
class DataSourceSurface;
|
2014-07-12 02:10:49 +04:00
|
|
|
class SourceSurface;
|
2015-07-13 18:25:42 +03:00
|
|
|
} // namespace gfx
|
2010-07-19 09:01:14 +04:00
|
|
|
|
2013-02-14 03:26:24 +04:00
|
|
|
namespace gl {
|
2015-07-15 03:37:28 +03:00
|
|
|
class GLBlitHelper;
|
|
|
|
class GLBlitTextureImageHelper;
|
2013-02-14 03:26:24 +04:00
|
|
|
class GLContext;
|
|
|
|
class GLLibraryEGL;
|
2015-07-15 03:37:28 +03:00
|
|
|
class GLReadTexImageHelper;
|
2013-02-14 03:26:24 +04:00
|
|
|
class GLScreenBuffer;
|
2015-07-15 03:37:28 +03:00
|
|
|
class SharedSurface;
|
2013-02-14 03:26:24 +04:00
|
|
|
class TextureGarbageBin;
|
2014-07-12 02:10:49 +04:00
|
|
|
struct SurfaceCaps;
|
2015-07-13 18:25:42 +03:00
|
|
|
} // namespace gl
|
2013-02-20 19:01:20 +04:00
|
|
|
|
2013-02-14 03:26:24 +04:00
|
|
|
namespace layers {
|
|
|
|
class ColorTextureLayerProgram;
|
2015-07-13 18:25:42 +03:00
|
|
|
} // namespace layers
|
|
|
|
} // namespace mozilla
|
2013-02-21 23:54:25 +04:00
|
|
|
|
2013-02-14 03:26:24 +04:00
|
|
|
namespace mozilla {
|
|
|
|
namespace gl {
|
2013-08-22 21:42:04 +04:00
|
|
|
|
2015-01-26 01:22:07 +03:00
|
|
|
enum class GLFeature {
|
2014-01-10 22:55:23 +04:00
|
|
|
bind_buffer_offset,
|
|
|
|
blend_minmax,
|
2014-09-18 04:17:00 +04:00
|
|
|
clear_buffers,
|
2014-05-27 14:13:09 +04:00
|
|
|
copy_buffer,
|
2014-01-10 22:55:23 +04:00
|
|
|
depth_texture,
|
|
|
|
draw_buffers,
|
|
|
|
draw_instanced,
|
2014-03-17 18:50:15 +04:00
|
|
|
draw_range_elements,
|
2014-01-10 22:55:23 +04:00
|
|
|
element_index_uint,
|
|
|
|
ES2_compatibility,
|
|
|
|
ES3_compatibility,
|
2016-05-05 02:39:02 +03:00
|
|
|
EXT_color_buffer_float,
|
2014-03-08 01:26:17 +04:00
|
|
|
frag_color_float,
|
2014-02-14 03:00:12 +04:00
|
|
|
frag_depth,
|
2014-01-10 22:55:23 +04:00
|
|
|
framebuffer_blit,
|
|
|
|
framebuffer_multisample,
|
|
|
|
framebuffer_object,
|
2015-07-03 03:14:28 +03:00
|
|
|
framebuffer_object_EXT_OES,
|
2014-05-27 14:21:30 +04:00
|
|
|
get_integer_indexed,
|
|
|
|
get_integer64_indexed,
|
2015-05-28 14:15:00 +03:00
|
|
|
get_query_object_i64v,
|
2014-01-10 22:55:23 +04:00
|
|
|
get_query_object_iv,
|
2015-02-13 06:00:41 +03:00
|
|
|
get_string_indexed,
|
2014-09-23 09:27:55 +04:00
|
|
|
gpu_shader4,
|
2014-01-10 22:55:23 +04:00
|
|
|
instanced_arrays,
|
|
|
|
instanced_non_arrays,
|
2015-07-03 03:16:09 +03:00
|
|
|
internalformat_query,
|
2014-10-15 01:49:49 +04:00
|
|
|
invalidate_framebuffer,
|
2014-08-08 05:47:13 +04:00
|
|
|
map_buffer_range,
|
2014-01-10 22:55:23 +04:00
|
|
|
occlusion_query,
|
|
|
|
occlusion_query_boolean,
|
|
|
|
occlusion_query2,
|
|
|
|
packed_depth_stencil,
|
2016-07-29 03:15:32 +03:00
|
|
|
prim_restart,
|
|
|
|
prim_restart_fixed,
|
2015-05-28 14:15:00 +03:00
|
|
|
query_counter,
|
2014-01-10 22:55:23 +04:00
|
|
|
query_objects,
|
2015-05-28 14:15:00 +03:00
|
|
|
query_time_elapsed,
|
2015-02-19 03:57:05 +03:00
|
|
|
read_buffer,
|
2014-03-08 01:26:17 +04:00
|
|
|
renderbuffer_color_float,
|
|
|
|
renderbuffer_color_half_float,
|
2014-01-10 22:55:23 +04:00
|
|
|
robustness,
|
2015-03-24 10:11:10 +03:00
|
|
|
sRGB_framebuffer,
|
|
|
|
sRGB_texture,
|
2014-09-23 09:45:34 +04:00
|
|
|
sampler_objects,
|
2016-02-12 04:57:25 +03:00
|
|
|
seamless_cube_map_opt_in,
|
2016-06-01 03:22:30 +03:00
|
|
|
shader_texture_lod,
|
2015-09-25 17:29:53 +03:00
|
|
|
split_framebuffer,
|
2014-01-10 22:55:23 +04:00
|
|
|
standard_derivatives,
|
2015-06-05 10:13:41 +03:00
|
|
|
sync,
|
2014-09-23 09:50:10 +04:00
|
|
|
texture_3D,
|
|
|
|
texture_3D_compressed,
|
|
|
|
texture_3D_copy,
|
2014-01-10 22:55:23 +04:00
|
|
|
texture_float,
|
|
|
|
texture_float_linear,
|
2014-01-23 21:47:56 +04:00
|
|
|
texture_half_float,
|
2014-02-13 18:53:53 +04:00
|
|
|
texture_half_float_linear,
|
2014-01-10 22:55:23 +04:00
|
|
|
texture_non_power_of_two,
|
2016-03-30 05:54:09 +03:00
|
|
|
texture_rg,
|
2014-09-23 09:49:19 +04:00
|
|
|
texture_storage,
|
2015-01-29 08:29:45 +03:00
|
|
|
texture_swizzle,
|
2014-09-23 09:47:28 +04:00
|
|
|
transform_feedback2,
|
2014-07-14 08:34:17 +04:00
|
|
|
uniform_buffer_object,
|
2014-09-23 09:33:55 +04:00
|
|
|
uniform_matrix_nonsquare,
|
2014-01-10 22:55:23 +04:00
|
|
|
vertex_array_object,
|
|
|
|
EnumMax
|
2015-01-26 01:22:07 +03:00
|
|
|
};
|
2013-08-22 21:42:04 +04:00
|
|
|
|
2015-01-26 01:22:07 +03:00
|
|
|
enum class ContextProfile : uint8_t {
|
2013-08-02 03:43:27 +04:00
|
|
|
Unknown = 0,
|
|
|
|
OpenGL, // only for IsAtLeast's <profile> parameter
|
|
|
|
OpenGLCore,
|
|
|
|
OpenGLCompatibility,
|
|
|
|
OpenGLES
|
2015-01-26 01:22:07 +03:00
|
|
|
};
|
2013-08-02 03:43:27 +04:00
|
|
|
|
2015-01-26 01:22:07 +03:00
|
|
|
enum class GLVendor {
|
2014-01-10 22:55:23 +04:00
|
|
|
Intel,
|
|
|
|
NVIDIA,
|
|
|
|
ATI,
|
|
|
|
Qualcomm,
|
|
|
|
Imagination,
|
|
|
|
Nouveau,
|
2014-01-10 23:50:25 +04:00
|
|
|
Vivante,
|
2014-02-28 10:57:03 +04:00
|
|
|
VMware,
|
2015-02-14 01:59:03 +03:00
|
|
|
ARM,
|
2014-01-10 22:55:23 +04:00
|
|
|
Other
|
2015-01-26 01:22:07 +03:00
|
|
|
};
|
2014-01-10 22:55:23 +04:00
|
|
|
|
2015-01-26 01:22:07 +03:00
|
|
|
enum class GLRenderer {
|
2014-01-10 22:55:23 +04:00
|
|
|
Adreno200,
|
|
|
|
Adreno205,
|
2014-06-24 19:59:59 +04:00
|
|
|
AdrenoTM200,
|
2014-01-10 22:55:23 +04:00
|
|
|
AdrenoTM205,
|
2016-07-15 18:58:58 +03:00
|
|
|
AdrenoTM305,
|
2014-01-10 22:55:23 +04:00
|
|
|
AdrenoTM320,
|
2016-07-15 18:58:58 +03:00
|
|
|
AdrenoTM330,
|
2015-09-17 05:41:00 +03:00
|
|
|
AdrenoTM420,
|
2016-07-13 13:16:54 +03:00
|
|
|
Mali400MP,
|
2016-09-21 13:12:52 +03:00
|
|
|
Mali450MP,
|
2014-01-10 22:55:23 +04:00
|
|
|
SGX530,
|
|
|
|
SGX540,
|
|
|
|
Tegra,
|
|
|
|
AndroidEmulator,
|
2014-02-28 10:57:03 +04:00
|
|
|
GalliumLlvmpipe,
|
2014-06-16 03:30:04 +04:00
|
|
|
IntelHD3000,
|
2014-07-25 18:35:03 +04:00
|
|
|
MicrosoftBasicRenderDriver,
|
2014-01-10 22:55:23 +04:00
|
|
|
Other
|
2015-01-26 01:22:07 +03:00
|
|
|
};
|
2014-01-10 22:55:23 +04:00
|
|
|
|
2010-10-11 02:48:33 +04:00
|
|
|
class GLContext
|
2012-03-17 02:24:12 +04:00
|
|
|
: public GLLibraryLoader
|
2013-06-17 06:05:56 +04:00
|
|
|
, public GenericAtomicRefCounted
|
2010-04-27 06:09:44 +04:00
|
|
|
{
|
2013-08-01 03:18:06 +04:00
|
|
|
// -----------------------------------------------------------------------------
|
|
|
|
// basic enums
|
2010-04-27 06:09:44 +04:00
|
|
|
public:
|
2012-08-22 07:30:20 +04:00
|
|
|
|
2013-08-01 03:18:06 +04:00
|
|
|
// -----------------------------------------------------------------------------
|
|
|
|
// basic getters
|
|
|
|
public:
|
2012-08-01 22:57:54 +04:00
|
|
|
|
2013-08-01 03:18:06 +04:00
|
|
|
/**
|
|
|
|
* Returns true if the context is using ANGLE. This should only be overridden
|
|
|
|
* for an ANGLE implementation.
|
|
|
|
*/
|
2014-03-04 06:47:43 +04:00
|
|
|
virtual bool IsANGLE() const {
|
2013-08-01 03:18:06 +04:00
|
|
|
return false;
|
2010-10-13 01:01:59 +04:00
|
|
|
}
|
|
|
|
|
2015-07-23 20:11:04 +03:00
|
|
|
/**
|
|
|
|
* Returns true if the context is using WARP. This should only be overridden
|
|
|
|
* for an ANGLE implementation.
|
|
|
|
*/
|
|
|
|
virtual bool IsWARP() const {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2013-08-02 03:43:27 +04:00
|
|
|
/**
|
|
|
|
* Return true if we are running on a OpenGL core profile context
|
|
|
|
*/
|
|
|
|
inline bool IsCoreProfile() const {
|
|
|
|
MOZ_ASSERT(mProfile != ContextProfile::Unknown, "unknown context profile");
|
|
|
|
|
|
|
|
return mProfile == ContextProfile::OpenGLCore;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Return true if we are running on a OpenGL compatibility profile context
|
|
|
|
* (legacy profile 2.1 on Max OS X)
|
|
|
|
*/
|
|
|
|
inline bool IsCompatibilityProfile() const {
|
|
|
|
MOZ_ASSERT(mProfile != ContextProfile::Unknown, "unknown context profile");
|
|
|
|
|
|
|
|
return mProfile == ContextProfile::OpenGLCompatibility;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Return true if the context is a true OpenGL ES context or an ANGLE context
|
|
|
|
*/
|
|
|
|
inline bool IsGLES() const {
|
|
|
|
MOZ_ASSERT(mProfile != ContextProfile::Unknown, "unknown context profile");
|
|
|
|
|
|
|
|
return mProfile == ContextProfile::OpenGLES;
|
|
|
|
}
|
|
|
|
|
|
|
|
static const char* GetProfileName(ContextProfile profile)
|
|
|
|
{
|
|
|
|
switch (profile)
|
|
|
|
{
|
|
|
|
case ContextProfile::OpenGL:
|
|
|
|
return "OpenGL";
|
|
|
|
case ContextProfile::OpenGLCore:
|
|
|
|
return "OpenGL Core";
|
|
|
|
case ContextProfile::OpenGLCompatibility:
|
|
|
|
return "OpenGL Compatibility";
|
|
|
|
case ContextProfile::OpenGLES:
|
|
|
|
return "OpenGL ES";
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
MOZ_ASSERT(profile != ContextProfile::Unknown, "unknown context profile");
|
|
|
|
return "OpenGL unknown profile";
|
|
|
|
}
|
|
|
|
|
2013-08-03 01:30:58 +04:00
|
|
|
/**
|
|
|
|
* Return true if we are running on a OpenGL core profile context
|
|
|
|
*/
|
|
|
|
const char* ProfileString() const {
|
|
|
|
return GetProfileName(mProfile);
|
|
|
|
}
|
|
|
|
|
2013-08-02 03:43:27 +04:00
|
|
|
/**
|
|
|
|
* Return true if the context is compatible with given parameters
|
|
|
|
*
|
|
|
|
* IsAtLeast(ContextProfile::OpenGL, N) is exactly same as
|
|
|
|
* IsAtLeast(ContextProfile::OpenGLCore, N) || IsAtLeast(ContextProfile::OpenGLCompatibility, N)
|
|
|
|
*/
|
|
|
|
inline bool IsAtLeast(ContextProfile profile, unsigned int version) const
|
|
|
|
{
|
|
|
|
MOZ_ASSERT(profile != ContextProfile::Unknown, "IsAtLeast: bad <profile> parameter");
|
|
|
|
MOZ_ASSERT(mProfile != ContextProfile::Unknown, "unknown context profile");
|
|
|
|
MOZ_ASSERT(mVersion != 0, "unknown context version");
|
|
|
|
|
2013-08-30 22:17:43 +04:00
|
|
|
if (version > mVersion) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2013-08-02 03:43:27 +04:00
|
|
|
if (profile == ContextProfile::OpenGL) {
|
2016-02-23 03:51:00 +03:00
|
|
|
return mProfile == ContextProfile::OpenGLCore ||
|
|
|
|
mProfile == ContextProfile::OpenGLCompatibility;
|
2013-08-02 03:43:27 +04:00
|
|
|
}
|
|
|
|
|
2013-08-30 22:17:43 +04:00
|
|
|
return profile == mProfile;
|
2013-08-02 03:43:27 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Return the version of the context.
|
|
|
|
* Example :
|
|
|
|
* If this a OpenGL 2.1, that will return 210
|
|
|
|
*/
|
2014-10-24 05:55:49 +04:00
|
|
|
inline uint32_t Version() const {
|
2013-08-02 03:43:27 +04:00
|
|
|
return mVersion;
|
|
|
|
}
|
|
|
|
|
2013-08-03 01:30:58 +04:00
|
|
|
const char* VersionString() const {
|
|
|
|
return mVersionString.get();
|
|
|
|
}
|
|
|
|
|
2015-11-27 23:54:50 +03:00
|
|
|
inline uint32_t ShadingLanguageVersion() const {
|
|
|
|
return mShadingLanguageVersion;
|
|
|
|
}
|
|
|
|
|
2014-01-10 22:55:23 +04:00
|
|
|
GLVendor Vendor() const {
|
2013-08-01 03:18:06 +04:00
|
|
|
return mVendor;
|
2010-05-25 10:35:35 +04:00
|
|
|
}
|
|
|
|
|
2014-01-10 22:55:23 +04:00
|
|
|
GLRenderer Renderer() const {
|
2013-08-01 03:18:06 +04:00
|
|
|
return mRenderer;
|
2010-05-25 10:35:35 +04:00
|
|
|
}
|
|
|
|
|
2013-08-01 03:18:06 +04:00
|
|
|
bool IsContextLost() const {
|
|
|
|
return mContextLost;
|
2010-09-10 07:09:39 +04:00
|
|
|
}
|
|
|
|
|
2012-04-11 00:20:02 +04:00
|
|
|
/**
|
2013-08-01 03:18:06 +04:00
|
|
|
* If this context is double-buffered, returns TRUE.
|
2012-04-11 00:20:02 +04:00
|
|
|
*/
|
2014-03-04 06:47:43 +04:00
|
|
|
virtual bool IsDoubleBuffered() const {
|
2013-08-01 03:18:06 +04:00
|
|
|
return false;
|
2012-04-11 00:20:02 +04:00
|
|
|
}
|
|
|
|
|
2014-03-04 06:47:43 +04:00
|
|
|
virtual GLContextType GetContextType() const = 0;
|
2011-01-07 01:07:12 +03:00
|
|
|
|
2013-08-01 03:18:06 +04:00
|
|
|
virtual bool IsCurrent() = 0;
|
2010-07-29 01:24:09 +04:00
|
|
|
|
2015-05-11 22:10:06 +03:00
|
|
|
/**
|
|
|
|
* Get the default framebuffer for this context.
|
|
|
|
*/
|
|
|
|
virtual GLuint GetDefaultFramebuffer() {
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2013-08-01 03:18:06 +04:00
|
|
|
protected:
|
|
|
|
bool mIsOffscreen;
|
|
|
|
bool mContextLost;
|
2013-08-02 03:43:27 +04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* mVersion store the OpenGL's version, multiplied by 100. For example, if
|
|
|
|
* the context is an OpenGL 2.1 context, mVersion value will be 210.
|
|
|
|
*/
|
2014-10-24 05:55:49 +04:00
|
|
|
uint32_t mVersion;
|
2013-08-03 01:30:58 +04:00
|
|
|
nsCString mVersionString;
|
2013-08-02 03:43:27 +04:00
|
|
|
ContextProfile mProfile;
|
2012-01-31 00:09:02 +04:00
|
|
|
|
2015-11-27 23:54:50 +03:00
|
|
|
uint32_t mShadingLanguageVersion;
|
|
|
|
|
2014-01-10 22:55:23 +04:00
|
|
|
GLVendor mVendor;
|
|
|
|
GLRenderer mRenderer;
|
2010-10-07 00:43:14 +04:00
|
|
|
|
2015-02-13 06:00:41 +03:00
|
|
|
void SetProfileVersion(ContextProfile profile, uint32_t version) {
|
2016-04-22 02:32:18 +03:00
|
|
|
MOZ_ASSERT(!mSymbols.fBindFramebuffer,
|
|
|
|
"SetProfileVersion can only be called before initialization!");
|
2015-02-13 06:00:41 +03:00
|
|
|
MOZ_ASSERT(profile != ContextProfile::Unknown &&
|
|
|
|
profile != ContextProfile::OpenGL,
|
|
|
|
"Invalid `profile` for SetProfileVersion");
|
2013-08-02 03:43:27 +04:00
|
|
|
MOZ_ASSERT(version >= 100, "Invalid `version` for SetProfileVersion");
|
|
|
|
|
|
|
|
mVersion = version;
|
|
|
|
mProfile = profile;
|
2012-01-31 00:09:02 +04:00
|
|
|
}
|
|
|
|
|
2012-11-07 02:39:38 +04:00
|
|
|
|
2013-08-01 03:18:06 +04:00
|
|
|
// -----------------------------------------------------------------------------
|
|
|
|
// Extensions management
|
|
|
|
/**
|
|
|
|
* This mechanism is designed to know if an extension is supported. In the long
|
|
|
|
* term, we would like to only use the extension group queries XXX_* to have
|
|
|
|
* full compatibility with context version and profiles (especialy the core that
|
|
|
|
* officialy don't bring any extensions).
|
|
|
|
*/
|
2012-11-07 02:39:38 +04:00
|
|
|
public:
|
2011-10-05 22:20:33 +04:00
|
|
|
|
2012-08-30 22:39:01 +04:00
|
|
|
/**
|
2013-08-01 03:18:06 +04:00
|
|
|
* Known GL extensions that can be queried by
|
|
|
|
* IsExtensionSupported. The results of this are cached, and as
|
|
|
|
* such it's safe to use this even in performance critical code.
|
|
|
|
* If you add to this array, remember to add to the string names
|
|
|
|
* in GLContext.cpp.
|
2012-08-30 22:39:01 +04:00
|
|
|
*/
|
2013-08-01 03:18:06 +04:00
|
|
|
enum GLExtensions {
|
2014-05-14 04:18:42 +04:00
|
|
|
Extension_None = 0,
|
2014-08-05 11:26:57 +04:00
|
|
|
AMD_compressed_ATC_texture,
|
|
|
|
ANGLE_depth_texture,
|
|
|
|
ANGLE_framebuffer_blit,
|
|
|
|
ANGLE_framebuffer_multisample,
|
|
|
|
ANGLE_instanced_arrays,
|
|
|
|
ANGLE_texture_compression_dxt3,
|
|
|
|
ANGLE_texture_compression_dxt5,
|
2015-05-28 14:15:00 +03:00
|
|
|
ANGLE_timer_query,
|
2013-08-01 03:18:06 +04:00
|
|
|
APPLE_client_storage,
|
2015-07-03 03:14:28 +03:00
|
|
|
APPLE_framebuffer_multisample,
|
2015-09-28 17:41:08 +03:00
|
|
|
APPLE_sync,
|
2013-12-12 22:27:10 +04:00
|
|
|
APPLE_texture_range,
|
2014-08-05 11:26:57 +04:00
|
|
|
APPLE_vertex_array_object,
|
2013-08-01 03:18:06 +04:00
|
|
|
ARB_ES2_compatibility,
|
2013-08-15 23:58:20 +04:00
|
|
|
ARB_ES3_compatibility,
|
2014-03-08 01:26:17 +04:00
|
|
|
ARB_color_buffer_float,
|
2014-05-27 14:13:09 +04:00
|
|
|
ARB_copy_buffer,
|
2014-08-05 11:26:57 +04:00
|
|
|
ARB_depth_texture,
|
|
|
|
ARB_draw_buffers,
|
|
|
|
ARB_draw_instanced,
|
|
|
|
ARB_framebuffer_object,
|
|
|
|
ARB_framebuffer_sRGB,
|
2015-07-03 03:14:28 +03:00
|
|
|
ARB_geometry_shader4,
|
2014-08-05 11:26:57 +04:00
|
|
|
ARB_half_float_pixel,
|
|
|
|
ARB_instanced_arrays,
|
2015-07-03 03:16:09 +03:00
|
|
|
ARB_internalformat_query,
|
2014-10-15 01:49:49 +04:00
|
|
|
ARB_invalidate_subdata,
|
2014-08-08 05:47:13 +04:00
|
|
|
ARB_map_buffer_range,
|
2014-08-05 11:26:57 +04:00
|
|
|
ARB_occlusion_query2,
|
|
|
|
ARB_pixel_buffer_object,
|
2013-08-01 03:18:06 +04:00
|
|
|
ARB_robustness,
|
2014-09-23 09:45:34 +04:00
|
|
|
ARB_sampler_objects,
|
2016-02-12 04:57:25 +03:00
|
|
|
ARB_seamless_cube_map,
|
2016-06-01 03:22:30 +03:00
|
|
|
ARB_shader_texture_lod,
|
2013-08-01 03:18:06 +04:00
|
|
|
ARB_sync,
|
2014-09-23 09:50:10 +04:00
|
|
|
ARB_texture_compression,
|
2014-08-05 11:26:57 +04:00
|
|
|
ARB_texture_float,
|
|
|
|
ARB_texture_non_power_of_two,
|
|
|
|
ARB_texture_rectangle,
|
2016-03-30 05:54:09 +03:00
|
|
|
ARB_texture_rg,
|
2014-09-23 09:49:19 +04:00
|
|
|
ARB_texture_storage,
|
2015-01-29 08:29:45 +03:00
|
|
|
ARB_texture_swizzle,
|
2015-05-28 14:15:00 +03:00
|
|
|
ARB_timer_query,
|
2014-09-23 09:47:28 +04:00
|
|
|
ARB_transform_feedback2,
|
2014-07-14 08:34:17 +04:00
|
|
|
ARB_uniform_buffer_object,
|
2013-08-01 03:18:06 +04:00
|
|
|
ARB_vertex_array_object,
|
2014-08-05 11:26:57 +04:00
|
|
|
EXT_bgra,
|
2013-08-01 03:18:06 +04:00
|
|
|
EXT_blend_minmax,
|
2014-08-05 11:26:57 +04:00
|
|
|
EXT_color_buffer_float,
|
|
|
|
EXT_color_buffer_half_float,
|
2014-09-23 09:50:10 +04:00
|
|
|
EXT_copy_texture,
|
2015-05-28 14:15:00 +03:00
|
|
|
EXT_disjoint_timer_query,
|
2014-08-05 11:26:57 +04:00
|
|
|
EXT_draw_buffers,
|
2014-05-27 14:21:30 +04:00
|
|
|
EXT_draw_buffers2,
|
2013-08-01 03:18:06 +04:00
|
|
|
EXT_draw_instanced,
|
2014-08-05 11:26:57 +04:00
|
|
|
EXT_draw_range_elements,
|
|
|
|
EXT_frag_depth,
|
|
|
|
EXT_framebuffer_blit,
|
|
|
|
EXT_framebuffer_multisample,
|
|
|
|
EXT_framebuffer_object,
|
|
|
|
EXT_framebuffer_sRGB,
|
|
|
|
EXT_gpu_shader4,
|
2015-07-03 03:14:28 +03:00
|
|
|
EXT_multisampled_render_to_texture,
|
2013-08-07 01:23:46 +04:00
|
|
|
EXT_occlusion_query_boolean,
|
2014-08-05 11:26:57 +04:00
|
|
|
EXT_packed_depth_stencil,
|
|
|
|
EXT_read_format_bgra,
|
|
|
|
EXT_robustness,
|
2013-11-05 01:05:04 +04:00
|
|
|
EXT_sRGB,
|
2015-03-24 10:11:10 +03:00
|
|
|
EXT_sRGB_write_control,
|
2014-08-05 11:26:57 +04:00
|
|
|
EXT_shader_texture_lod,
|
2014-09-23 09:50:10 +04:00
|
|
|
EXT_texture3D,
|
2014-08-05 11:26:57 +04:00
|
|
|
EXT_texture_compression_dxt1,
|
|
|
|
EXT_texture_compression_s3tc,
|
|
|
|
EXT_texture_filter_anisotropic,
|
|
|
|
EXT_texture_format_BGRA8888,
|
2013-11-05 01:05:04 +04:00
|
|
|
EXT_texture_sRGB,
|
2014-07-15 03:55:56 +04:00
|
|
|
EXT_texture_storage,
|
2015-05-28 14:15:00 +03:00
|
|
|
EXT_timer_query,
|
2014-08-05 11:26:57 +04:00
|
|
|
EXT_transform_feedback,
|
|
|
|
EXT_unpack_subimage,
|
|
|
|
IMG_read_format,
|
|
|
|
IMG_texture_compression_pvrtc,
|
|
|
|
IMG_texture_npot,
|
2013-10-09 03:20:24 +04:00
|
|
|
KHR_debug,
|
2014-08-05 11:26:57 +04:00
|
|
|
NV_draw_instanced,
|
2014-08-05 09:09:20 +04:00
|
|
|
NV_fence,
|
2015-07-03 03:14:28 +03:00
|
|
|
NV_framebuffer_blit,
|
|
|
|
NV_geometry_program4,
|
2014-08-05 11:26:57 +04:00
|
|
|
NV_half_float,
|
|
|
|
NV_instanced_arrays,
|
2016-07-29 03:15:32 +03:00
|
|
|
NV_primitive_restart,
|
2016-05-02 02:37:42 +03:00
|
|
|
NV_texture_barrier,
|
2014-08-05 11:26:57 +04:00
|
|
|
NV_transform_feedback,
|
2014-09-23 09:47:28 +04:00
|
|
|
NV_transform_feedback2,
|
2014-08-05 11:26:57 +04:00
|
|
|
OES_EGL_image,
|
|
|
|
OES_EGL_image_external,
|
|
|
|
OES_EGL_sync,
|
|
|
|
OES_compressed_ETC1_RGB8_texture,
|
|
|
|
OES_depth24,
|
|
|
|
OES_depth32,
|
|
|
|
OES_depth_texture,
|
|
|
|
OES_element_index_uint,
|
2015-07-03 03:14:28 +03:00
|
|
|
OES_framebuffer_object,
|
2014-08-05 11:26:57 +04:00
|
|
|
OES_packed_depth_stencil,
|
|
|
|
OES_rgb8_rgba8,
|
|
|
|
OES_standard_derivatives,
|
|
|
|
OES_stencil8,
|
2014-09-23 09:50:10 +04:00
|
|
|
OES_texture_3D,
|
2014-08-05 11:26:57 +04:00
|
|
|
OES_texture_float,
|
|
|
|
OES_texture_float_linear,
|
|
|
|
OES_texture_half_float,
|
|
|
|
OES_texture_half_float_linear,
|
|
|
|
OES_texture_npot,
|
|
|
|
OES_vertex_array_object,
|
2013-08-03 01:30:58 +04:00
|
|
|
Extensions_Max,
|
|
|
|
Extensions_End
|
2013-08-01 03:18:06 +04:00
|
|
|
};
|
2012-07-24 03:58:37 +04:00
|
|
|
|
2013-08-01 03:18:06 +04:00
|
|
|
bool IsExtensionSupported(GLExtensions aKnownExtension) const {
|
|
|
|
return mAvailableExtensions[aKnownExtension];
|
|
|
|
}
|
2011-12-17 02:24:46 +04:00
|
|
|
|
2015-02-13 06:00:41 +03:00
|
|
|
protected:
|
2013-08-01 03:18:06 +04:00
|
|
|
void MarkExtensionUnsupported(GLExtensions aKnownExtension) {
|
|
|
|
mAvailableExtensions[aKnownExtension] = 0;
|
|
|
|
}
|
2012-08-22 07:30:20 +04:00
|
|
|
|
2013-08-01 03:18:06 +04:00
|
|
|
void MarkExtensionSupported(GLExtensions aKnownExtension) {
|
|
|
|
mAvailableExtensions[aKnownExtension] = 1;
|
|
|
|
}
|
2012-08-22 07:30:20 +04:00
|
|
|
|
2013-09-04 16:14:52 +04:00
|
|
|
std::bitset<Extensions_Max> mAvailableExtensions;
|
2012-02-09 04:06:03 +04:00
|
|
|
|
2013-08-22 21:42:04 +04:00
|
|
|
// -----------------------------------------------------------------------------
|
|
|
|
// Feature queries
|
|
|
|
/*
|
|
|
|
* This mecahnism introduces a new way to check if a OpenGL feature is
|
|
|
|
* supported, regardless of whether it is supported by an extension or natively
|
|
|
|
* by the context version/profile
|
|
|
|
*/
|
|
|
|
public:
|
2014-01-10 22:55:23 +04:00
|
|
|
bool IsSupported(GLFeature feature) const {
|
|
|
|
return mAvailableFeatures[size_t(feature)];
|
2013-08-24 03:33:42 +04:00
|
|
|
}
|
2013-08-22 21:42:04 +04:00
|
|
|
|
2014-01-10 22:55:23 +04:00
|
|
|
static const char* GetFeatureName(GLFeature feature);
|
2013-08-22 21:42:04 +04:00
|
|
|
|
|
|
|
private:
|
2014-01-10 22:55:23 +04:00
|
|
|
std::bitset<size_t(GLFeature::EnumMax)> mAvailableFeatures;
|
2013-08-22 21:42:04 +04:00
|
|
|
|
|
|
|
/**
|
2013-08-24 03:33:42 +04:00
|
|
|
* Init features regarding OpenGL extension and context version and profile
|
|
|
|
*/
|
|
|
|
void InitFeatures();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Mark the feature and associated extensions as unsupported
|
2013-08-22 21:42:04 +04:00
|
|
|
*/
|
2014-01-10 22:55:23 +04:00
|
|
|
void MarkUnsupported(GLFeature feature);
|
2013-08-01 03:18:06 +04:00
|
|
|
|
2014-05-14 04:18:42 +04:00
|
|
|
/**
|
|
|
|
* Is this feature supported using the core (unsuffixed) symbols?
|
|
|
|
*/
|
|
|
|
bool IsFeatureProvidedByCoreSymbols(GLFeature feature);
|
|
|
|
|
2013-08-01 03:18:06 +04:00
|
|
|
// -----------------------------------------------------------------------------
|
|
|
|
// Robustness handling
|
2016-04-22 02:32:18 +03:00
|
|
|
private:
|
2013-08-01 03:18:06 +04:00
|
|
|
/**
|
|
|
|
* The derived class is expected to provide information on whether or not it
|
|
|
|
* supports robustness.
|
|
|
|
*/
|
2014-03-04 06:47:43 +04:00
|
|
|
virtual bool SupportsRobustness() const = 0;
|
2013-03-06 18:34:35 +04:00
|
|
|
|
2016-04-22 02:32:18 +03:00
|
|
|
public:
|
2013-08-01 03:18:06 +04:00
|
|
|
// -----------------------------------------------------------------------------
|
|
|
|
// Error handling
|
2014-08-28 03:18:43 +04:00
|
|
|
static const char* GLErrorToString(GLenum aError) {
|
2013-08-01 03:18:06 +04:00
|
|
|
switch (aError) {
|
|
|
|
case LOCAL_GL_INVALID_ENUM:
|
|
|
|
return "GL_INVALID_ENUM";
|
|
|
|
case LOCAL_GL_INVALID_VALUE:
|
|
|
|
return "GL_INVALID_VALUE";
|
|
|
|
case LOCAL_GL_INVALID_OPERATION:
|
|
|
|
return "GL_INVALID_OPERATION";
|
|
|
|
case LOCAL_GL_STACK_OVERFLOW:
|
|
|
|
return "GL_STACK_OVERFLOW";
|
|
|
|
case LOCAL_GL_STACK_UNDERFLOW:
|
|
|
|
return "GL_STACK_UNDERFLOW";
|
|
|
|
case LOCAL_GL_OUT_OF_MEMORY:
|
|
|
|
return "GL_OUT_OF_MEMORY";
|
|
|
|
case LOCAL_GL_TABLE_TOO_LARGE:
|
|
|
|
return "GL_TABLE_TOO_LARGE";
|
|
|
|
case LOCAL_GL_INVALID_FRAMEBUFFER_OPERATION:
|
|
|
|
return "GL_INVALID_FRAMEBUFFER_OPERATION";
|
2012-09-01 03:44:33 +04:00
|
|
|
default:
|
2013-08-01 03:18:06 +04:00
|
|
|
return "";
|
2012-09-01 03:44:33 +04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-08-28 03:18:43 +04:00
|
|
|
private:
|
2014-10-25 03:52:35 +04:00
|
|
|
GLenum mTopError;
|
2013-02-21 23:54:25 +04:00
|
|
|
|
2014-10-25 03:52:35 +04:00
|
|
|
GLenum RawGetError() {
|
|
|
|
return mSymbols.fGetError();
|
2014-08-27 12:31:14 +04:00
|
|
|
}
|
|
|
|
|
2014-10-25 03:52:35 +04:00
|
|
|
GLenum RawGetErrorAndClear() {
|
|
|
|
GLenum err = RawGetError();
|
2013-08-01 03:18:06 +04:00
|
|
|
|
2014-10-25 03:52:35 +04:00
|
|
|
if (err)
|
|
|
|
while (RawGetError()) {}
|
2014-08-28 03:18:43 +04:00
|
|
|
|
|
|
|
return err;
|
|
|
|
}
|
|
|
|
|
2014-10-25 03:52:35 +04:00
|
|
|
public:
|
|
|
|
GLenum FlushErrors() {
|
|
|
|
GLenum err = RawGetErrorAndClear();
|
|
|
|
if (!mTopError)
|
|
|
|
mTopError = err;
|
|
|
|
return err;
|
2014-08-28 03:18:43 +04:00
|
|
|
}
|
|
|
|
|
2014-10-25 03:52:35 +04:00
|
|
|
// We smash all errors together, so you never have to loop on this. We
|
|
|
|
// guarantee that immediately after this call, there are no errors left.
|
|
|
|
GLenum fGetError() {
|
|
|
|
FlushErrors();
|
2014-08-28 03:18:43 +04:00
|
|
|
|
2014-10-25 03:52:35 +04:00
|
|
|
GLenum err = mTopError;
|
|
|
|
mTopError = LOCAL_GL_NO_ERROR;
|
|
|
|
return err;
|
2014-08-28 03:18:43 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
////////////////////////////////////
|
|
|
|
// Use this safer option.
|
2014-10-25 03:52:35 +04:00
|
|
|
class LocalErrorScope;
|
|
|
|
|
2014-08-27 13:15:21 +04:00
|
|
|
private:
|
2015-09-24 22:21:05 +03:00
|
|
|
std::stack<const LocalErrorScope*> mLocalErrorScopeStack;
|
2014-08-28 03:18:43 +04:00
|
|
|
|
|
|
|
public:
|
2014-10-25 03:52:35 +04:00
|
|
|
class LocalErrorScope {
|
|
|
|
GLContext& mGL;
|
|
|
|
GLenum mOldTop;
|
2014-08-28 03:18:43 +04:00
|
|
|
bool mHasBeenChecked;
|
|
|
|
|
|
|
|
public:
|
2014-10-25 03:52:35 +04:00
|
|
|
explicit LocalErrorScope(GLContext& gl)
|
2014-08-28 03:18:43 +04:00
|
|
|
: mGL(gl)
|
|
|
|
, mHasBeenChecked(false)
|
|
|
|
{
|
2015-09-24 22:21:05 +03:00
|
|
|
mGL.mLocalErrorScopeStack.push(this);
|
2013-08-01 03:18:06 +04:00
|
|
|
|
2014-10-25 03:52:35 +04:00
|
|
|
mGL.FlushErrors();
|
2014-08-27 12:31:14 +04:00
|
|
|
|
2014-10-25 03:52:35 +04:00
|
|
|
mOldTop = mGL.mTopError;
|
|
|
|
mGL.mTopError = LOCAL_GL_NO_ERROR;
|
|
|
|
}
|
|
|
|
|
|
|
|
GLenum GetError() {
|
2014-08-28 03:18:43 +04:00
|
|
|
MOZ_ASSERT(!mHasBeenChecked);
|
|
|
|
mHasBeenChecked = true;
|
|
|
|
|
2015-11-25 07:15:29 +03:00
|
|
|
const GLenum ret = mGL.fGetError();
|
|
|
|
|
|
|
|
while (mGL.fGetError()) {}
|
|
|
|
|
|
|
|
return ret;
|
2014-08-28 03:18:43 +04:00
|
|
|
}
|
|
|
|
|
2014-10-25 03:52:35 +04:00
|
|
|
~LocalErrorScope() {
|
2014-08-28 03:18:43 +04:00
|
|
|
MOZ_ASSERT(mHasBeenChecked);
|
2014-10-25 03:52:35 +04:00
|
|
|
|
|
|
|
MOZ_ASSERT(mGL.fGetError() == LOCAL_GL_NO_ERROR);
|
|
|
|
|
2015-09-24 22:21:05 +03:00
|
|
|
MOZ_ASSERT(mGL.mLocalErrorScopeStack.top() == this);
|
|
|
|
mGL.mLocalErrorScopeStack.pop();
|
2015-09-23 05:26:13 +03:00
|
|
|
|
2015-09-24 22:21:05 +03:00
|
|
|
mGL.mTopError = mOldTop;
|
2014-08-28 03:18:43 +04:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2014-10-24 05:55:49 +04:00
|
|
|
bool GetPotentialInteger(GLenum pname, GLint* param) {
|
|
|
|
LocalErrorScope localError(*this);
|
|
|
|
|
|
|
|
fGetIntegerv(pname, param);
|
|
|
|
|
|
|
|
GLenum err = localError.GetError();
|
|
|
|
MOZ_ASSERT_IF(err != LOCAL_GL_NO_ERROR, err == LOCAL_GL_INVALID_ENUM);
|
|
|
|
return err == LOCAL_GL_NO_ERROR;
|
|
|
|
}
|
|
|
|
|
2014-08-28 03:18:43 +04:00
|
|
|
private:
|
2014-05-07 00:59:18 +04:00
|
|
|
static void GLAPIENTRY StaticDebugCallback(GLenum source,
|
|
|
|
GLenum type,
|
|
|
|
GLuint id,
|
|
|
|
GLenum severity,
|
|
|
|
GLsizei length,
|
|
|
|
const GLchar* message,
|
|
|
|
const GLvoid* userParam);
|
|
|
|
void DebugCallback(GLenum source,
|
|
|
|
GLenum type,
|
|
|
|
GLuint id,
|
|
|
|
GLenum severity,
|
|
|
|
GLsizei length,
|
|
|
|
const GLchar* message);
|
|
|
|
|
2013-08-01 03:18:06 +04:00
|
|
|
|
|
|
|
// -----------------------------------------------------------------------------
|
|
|
|
// MOZ_GL_DEBUG implementation
|
|
|
|
private:
|
|
|
|
|
2013-09-04 16:14:52 +04:00
|
|
|
#undef BEFORE_GL_CALL
|
|
|
|
#undef AFTER_GL_CALL
|
|
|
|
|
2014-10-15 05:24:53 +04:00
|
|
|
#ifdef MOZ_GL_DEBUG
|
2013-08-01 03:18:06 +04:00
|
|
|
|
|
|
|
#ifndef MOZ_FUNCTION_NAME
|
|
|
|
# ifdef __GNUC__
|
|
|
|
# define MOZ_FUNCTION_NAME __PRETTY_FUNCTION__
|
|
|
|
# elif defined(_MSC_VER)
|
|
|
|
# define MOZ_FUNCTION_NAME __FUNCTION__
|
|
|
|
# else
|
|
|
|
# define MOZ_FUNCTION_NAME __func__ // defined in C99, supported in various C++ compilers. Just raw function name.
|
|
|
|
# endif
|
|
|
|
#endif
|
|
|
|
|
2014-10-25 03:52:35 +04:00
|
|
|
void BeforeGLCall(const char* funcName) {
|
2013-08-01 03:18:06 +04:00
|
|
|
MOZ_ASSERT(IsCurrent());
|
|
|
|
|
2016-06-07 02:29:08 +03:00
|
|
|
if (mDebugFlags) {
|
2014-10-25 03:52:35 +04:00
|
|
|
FlushErrors();
|
2013-08-01 03:18:06 +04:00
|
|
|
|
2016-06-07 02:29:08 +03:00
|
|
|
if (mDebugFlags & DebugFlagTrace) {
|
2014-10-25 03:52:35 +04:00
|
|
|
printf_stderr("[gl:%p] > %s\n", this, funcName);
|
2016-06-07 02:29:08 +03:00
|
|
|
}
|
2014-10-25 03:52:35 +04:00
|
|
|
|
|
|
|
GLContext* tlsContext = (GLContext*)PR_GetThreadPrivate(sCurrentGLContextTLS);
|
|
|
|
if (this != tlsContext) {
|
|
|
|
printf_stderr("Fatal: %s called on non-current context %p. The"
|
|
|
|
" current context for this thread is %p.\n",
|
|
|
|
funcName, this, tlsContext);
|
2016-05-13 23:34:41 +03:00
|
|
|
MOZ_CRASH("GFX: GLContext is not current.");
|
2013-08-01 03:18:06 +04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-10-25 03:52:35 +04:00
|
|
|
void AfterGLCall(const char* funcName) {
|
2016-06-07 02:29:08 +03:00
|
|
|
if (mDebugFlags) {
|
2013-08-01 03:18:06 +04:00
|
|
|
// calling fFinish() immediately after every GL call makes sure that if this GL command crashes,
|
|
|
|
// the stack trace will actually point to it. Otherwise, OpenGL being an asynchronous API, stack traces
|
|
|
|
// tend to be meaningless
|
|
|
|
mSymbols.fFinish();
|
2014-10-25 03:52:35 +04:00
|
|
|
GLenum err = FlushErrors();
|
2014-08-28 03:18:43 +04:00
|
|
|
|
2016-06-07 02:29:08 +03:00
|
|
|
if (mDebugFlags & DebugFlagTrace) {
|
2014-10-25 03:52:35 +04:00
|
|
|
printf_stderr("[gl:%p] < %s [%s (0x%04x)]\n", this, funcName,
|
|
|
|
GLErrorToString(err), err);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (err != LOCAL_GL_NO_ERROR &&
|
2015-09-24 22:21:05 +03:00
|
|
|
!mLocalErrorScopeStack.size())
|
2014-10-25 03:52:35 +04:00
|
|
|
{
|
|
|
|
printf_stderr("[gl:%p] %s: Generated unexpected %s error."
|
|
|
|
" (0x%04x)\n", this, funcName,
|
|
|
|
GLErrorToString(err), err);
|
2014-08-28 03:18:43 +04:00
|
|
|
|
2016-06-21 06:14:11 +03:00
|
|
|
if (mDebugFlags & DebugFlagAbortOnError) {
|
|
|
|
MOZ_CRASH("Unexpected error with MOZ_GL_DEBUG_ABORT_ON_ERROR. (Run"
|
|
|
|
" with MOZ_GL_DEBUG_ABORT_ON_ERROR=0 to disable)");
|
|
|
|
}
|
2013-08-01 03:18:06 +04:00
|
|
|
}
|
2011-12-17 01:11:59 +04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-06-11 04:37:07 +03:00
|
|
|
GLContext* TrackingContext()
|
2013-08-01 03:18:06 +04:00
|
|
|
{
|
2016-06-11 04:37:07 +03:00
|
|
|
GLContext* tip = this;
|
2013-08-01 03:18:06 +04:00
|
|
|
while (tip->mSharedContext)
|
|
|
|
tip = tip->mSharedContext;
|
|
|
|
return tip;
|
|
|
|
}
|
|
|
|
|
2014-05-09 05:03:37 +04:00
|
|
|
static void AssertNotPassingStackBufferToTheGL(const void* ptr);
|
|
|
|
|
2014-10-15 07:20:16 +04:00
|
|
|
#ifdef MOZ_WIDGET_ANDROID
|
|
|
|
// Record the name of the GL call for better hang stacks on Android.
|
|
|
|
#define BEFORE_GL_CALL \
|
|
|
|
PROFILER_LABEL_FUNC( \
|
|
|
|
js::ProfileEntry::Category::GRAPHICS);\
|
|
|
|
BeforeGLCall(MOZ_FUNCTION_NAME)
|
|
|
|
#else
|
2013-08-01 03:18:06 +04:00
|
|
|
#define BEFORE_GL_CALL \
|
|
|
|
do { \
|
|
|
|
BeforeGLCall(MOZ_FUNCTION_NAME); \
|
|
|
|
} while (0)
|
2014-10-15 07:20:16 +04:00
|
|
|
#endif
|
2013-08-01 03:18:06 +04:00
|
|
|
|
|
|
|
#define AFTER_GL_CALL \
|
|
|
|
do { \
|
|
|
|
AfterGLCall(MOZ_FUNCTION_NAME); \
|
|
|
|
} while (0)
|
|
|
|
|
|
|
|
#define TRACKING_CONTEXT(a) \
|
|
|
|
do { \
|
|
|
|
TrackingContext()->a; \
|
|
|
|
} while (0)
|
|
|
|
|
2014-05-09 05:03:37 +04:00
|
|
|
#define ASSERT_NOT_PASSING_STACK_BUFFER_TO_GL(ptr) AssertNotPassingStackBufferToTheGL(ptr)
|
|
|
|
|
2014-10-15 05:24:53 +04:00
|
|
|
#else // ifdef MOZ_GL_DEBUG
|
2013-08-01 03:18:06 +04:00
|
|
|
|
2014-10-15 07:20:16 +04:00
|
|
|
#ifdef MOZ_WIDGET_ANDROID
|
|
|
|
// Record the name of the GL call for better hang stacks on Android.
|
|
|
|
#define BEFORE_GL_CALL PROFILER_LABEL_FUNC(js::ProfileEntry::Category::GRAPHICS)
|
|
|
|
#else
|
2013-08-01 03:18:06 +04:00
|
|
|
#define BEFORE_GL_CALL do { } while (0)
|
2014-10-15 07:20:16 +04:00
|
|
|
#endif
|
2013-08-01 03:18:06 +04:00
|
|
|
#define AFTER_GL_CALL do { } while (0)
|
|
|
|
#define TRACKING_CONTEXT(a) do {} while (0)
|
2014-05-09 05:03:37 +04:00
|
|
|
#define ASSERT_NOT_PASSING_STACK_BUFFER_TO_GL(ptr) do {} while (0)
|
2013-08-01 03:18:06 +04:00
|
|
|
|
2014-10-15 05:24:53 +04:00
|
|
|
#endif // ifdef MOZ_GL_DEBUG
|
2013-08-01 03:18:06 +04:00
|
|
|
|
|
|
|
#define ASSERT_SYMBOL_PRESENT(func) \
|
|
|
|
do {\
|
|
|
|
MOZ_ASSERT(strstr(MOZ_FUNCTION_NAME, #func) != nullptr, "Mismatched symbol check.");\
|
|
|
|
if (MOZ_UNLIKELY(!mSymbols.func)) {\
|
|
|
|
printf_stderr("RUNTIME ASSERT: Uninitialized GL function: %s\n", #func);\
|
2016-05-13 23:34:41 +03:00
|
|
|
MOZ_CRASH("GFX: Uninitialized GL function");\
|
2013-08-01 03:18:06 +04:00
|
|
|
}\
|
|
|
|
} while (0)
|
|
|
|
|
2012-02-10 05:57:26 +04:00
|
|
|
// Do whatever setup is necessary to draw to our offscreen FBO, if it's
|
|
|
|
// bound.
|
2015-07-15 03:37:28 +03:00
|
|
|
void BeforeGLDrawCall() { }
|
2011-10-19 23:09:57 +04:00
|
|
|
|
2012-02-10 05:57:26 +04:00
|
|
|
// Do whatever tear-down is necessary after drawing to our offscreen FBO,
|
|
|
|
// if it's bound.
|
2015-07-15 03:37:28 +03:00
|
|
|
void AfterGLDrawCall();
|
2011-10-19 23:09:57 +04:00
|
|
|
|
2012-02-10 05:57:26 +04:00
|
|
|
// Do whatever setup is necessary to read from our offscreen FBO, if it's
|
|
|
|
// bound.
|
2015-07-15 03:37:28 +03:00
|
|
|
void BeforeGLReadCall();
|
2011-10-19 23:09:57 +04:00
|
|
|
|
2012-02-10 05:57:26 +04:00
|
|
|
// Do whatever tear-down is necessary after reading from our offscreen FBO,
|
|
|
|
// if it's bound.
|
2015-07-15 03:37:28 +03:00
|
|
|
void AfterGLReadCall() { }
|
2011-10-19 23:09:57 +04:00
|
|
|
|
2013-08-01 03:18:06 +04:00
|
|
|
|
|
|
|
// -----------------------------------------------------------------------------
|
|
|
|
// GL official entry points
|
2011-10-19 23:09:57 +04:00
|
|
|
public:
|
2013-08-01 03:18:06 +04:00
|
|
|
|
|
|
|
void fActiveTexture(GLenum texture) {
|
|
|
|
BEFORE_GL_CALL;
|
|
|
|
mSymbols.fActiveTexture(texture);
|
|
|
|
AFTER_GL_CALL;
|
2011-10-19 23:09:57 +04:00
|
|
|
}
|
|
|
|
|
2013-08-01 03:18:06 +04:00
|
|
|
void fAttachShader(GLuint program, GLuint shader) {
|
|
|
|
BEFORE_GL_CALL;
|
|
|
|
mSymbols.fAttachShader(program, shader);
|
|
|
|
AFTER_GL_CALL;
|
2011-10-19 23:09:57 +04:00
|
|
|
}
|
|
|
|
|
2013-08-01 03:18:06 +04:00
|
|
|
void fBeginQuery(GLenum target, GLuint id) {
|
|
|
|
BEFORE_GL_CALL;
|
2013-08-07 01:23:46 +04:00
|
|
|
ASSERT_SYMBOL_PRESENT(fBeginQuery);
|
2013-08-01 03:18:06 +04:00
|
|
|
mSymbols.fBeginQuery(target, id);
|
|
|
|
AFTER_GL_CALL;
|
2011-10-19 23:09:57 +04:00
|
|
|
}
|
|
|
|
|
2013-08-01 03:18:06 +04:00
|
|
|
void fBindAttribLocation(GLuint program, GLuint index, const GLchar* name) {
|
|
|
|
BEFORE_GL_CALL;
|
|
|
|
mSymbols.fBindAttribLocation(program, index, name);
|
|
|
|
AFTER_GL_CALL;
|
|
|
|
}
|
2012-12-19 11:16:01 +04:00
|
|
|
|
2013-08-01 03:18:06 +04:00
|
|
|
void fBindBuffer(GLenum target, GLuint buffer) {
|
|
|
|
BEFORE_GL_CALL;
|
|
|
|
mSymbols.fBindBuffer(target, buffer);
|
|
|
|
AFTER_GL_CALL;
|
|
|
|
}
|
2013-07-18 07:24:15 +04:00
|
|
|
|
2015-07-15 03:37:28 +03:00
|
|
|
void fBindFramebuffer(GLenum target, GLuint framebuffer);
|
2013-08-01 03:18:06 +04:00
|
|
|
|
2014-10-15 01:49:49 +04:00
|
|
|
void fInvalidateFramebuffer(GLenum target, GLsizei numAttachments, const GLenum* attachments) {
|
|
|
|
BEFORE_GL_CALL;
|
|
|
|
ASSERT_SYMBOL_PRESENT(fInvalidateFramebuffer);
|
|
|
|
mSymbols.fInvalidateFramebuffer(target, numAttachments, attachments);
|
|
|
|
AFTER_GL_CALL;
|
|
|
|
}
|
|
|
|
|
|
|
|
void fInvalidateSubFramebuffer(GLenum target, GLsizei numAttachments, const GLenum* attachments, GLint x, GLint y, GLsizei width, GLsizei height) {
|
|
|
|
BEFORE_GL_CALL;
|
|
|
|
ASSERT_SYMBOL_PRESENT(fInvalidateSubFramebuffer);
|
|
|
|
mSymbols.fInvalidateSubFramebuffer(target, numAttachments, attachments, x, y, width, height);
|
|
|
|
AFTER_GL_CALL;
|
|
|
|
}
|
|
|
|
|
2013-08-01 03:18:06 +04:00
|
|
|
void fBindTexture(GLenum target, GLuint texture) {
|
|
|
|
BEFORE_GL_CALL;
|
|
|
|
mSymbols.fBindTexture(target, texture);
|
|
|
|
AFTER_GL_CALL;
|
|
|
|
}
|
|
|
|
|
2015-02-25 01:09:09 +03:00
|
|
|
void fBlendColor(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha) {
|
2013-08-01 03:18:06 +04:00
|
|
|
BEFORE_GL_CALL;
|
|
|
|
mSymbols.fBlendColor(red, green, blue, alpha);
|
|
|
|
AFTER_GL_CALL;
|
|
|
|
}
|
|
|
|
|
|
|
|
void fBlendEquation(GLenum mode) {
|
|
|
|
BEFORE_GL_CALL;
|
|
|
|
mSymbols.fBlendEquation(mode);
|
|
|
|
AFTER_GL_CALL;
|
|
|
|
}
|
|
|
|
|
|
|
|
void fBlendEquationSeparate(GLenum modeRGB, GLenum modeAlpha) {
|
|
|
|
BEFORE_GL_CALL;
|
|
|
|
mSymbols.fBlendEquationSeparate(modeRGB, modeAlpha);
|
|
|
|
AFTER_GL_CALL;
|
|
|
|
}
|
|
|
|
|
|
|
|
void fBlendFunc(GLenum sfactor, GLenum dfactor) {
|
|
|
|
BEFORE_GL_CALL;
|
|
|
|
mSymbols.fBlendFunc(sfactor, dfactor);
|
|
|
|
AFTER_GL_CALL;
|
|
|
|
}
|
|
|
|
|
|
|
|
void fBlendFuncSeparate(GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha) {
|
|
|
|
BEFORE_GL_CALL;
|
|
|
|
mSymbols.fBlendFuncSeparate(sfactorRGB, dfactorRGB, sfactorAlpha, dfactorAlpha);
|
|
|
|
AFTER_GL_CALL;
|
|
|
|
}
|
|
|
|
|
|
|
|
private:
|
|
|
|
void raw_fBufferData(GLenum target, GLsizeiptr size, const GLvoid* data, GLenum usage) {
|
2014-05-09 05:03:37 +04:00
|
|
|
ASSERT_NOT_PASSING_STACK_BUFFER_TO_GL(data);
|
2013-08-01 03:18:06 +04:00
|
|
|
BEFORE_GL_CALL;
|
|
|
|
mSymbols.fBufferData(target, size, data, usage);
|
|
|
|
AFTER_GL_CALL;
|
2014-09-10 05:40:51 +04:00
|
|
|
mHeavyGLCallsSinceLastFlush = true;
|
2013-08-01 03:18:06 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
public:
|
|
|
|
void fBufferData(GLenum target, GLsizeiptr size, const GLvoid* data, GLenum usage) {
|
|
|
|
raw_fBufferData(target, size, data, usage);
|
|
|
|
|
|
|
|
// bug 744888
|
|
|
|
if (WorkAroundDriverBugs() &&
|
|
|
|
!data &&
|
2014-01-10 22:55:23 +04:00
|
|
|
Vendor() == GLVendor::NVIDIA)
|
2013-08-01 03:18:06 +04:00
|
|
|
{
|
2014-07-11 04:43:01 +04:00
|
|
|
UniquePtr<char[]> buf = MakeUnique<char[]>(1);
|
2014-05-09 05:03:37 +04:00
|
|
|
buf[0] = 0;
|
2014-07-11 04:43:01 +04:00
|
|
|
fBufferSubData(target, size-1, 1, buf.get());
|
2013-08-01 03:18:06 +04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void fBufferSubData(GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid* data) {
|
2014-05-09 05:03:37 +04:00
|
|
|
ASSERT_NOT_PASSING_STACK_BUFFER_TO_GL(data);
|
2013-08-01 03:18:06 +04:00
|
|
|
BEFORE_GL_CALL;
|
|
|
|
mSymbols.fBufferSubData(target, offset, size, data);
|
|
|
|
AFTER_GL_CALL;
|
2014-09-10 05:40:51 +04:00
|
|
|
mHeavyGLCallsSinceLastFlush = true;
|
2013-08-01 03:18:06 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
private:
|
|
|
|
void raw_fClear(GLbitfield mask) {
|
|
|
|
BEFORE_GL_CALL;
|
|
|
|
mSymbols.fClear(mask);
|
|
|
|
AFTER_GL_CALL;
|
|
|
|
}
|
|
|
|
|
|
|
|
public:
|
|
|
|
void fClear(GLbitfield mask) {
|
|
|
|
BeforeGLDrawCall();
|
|
|
|
raw_fClear(mask);
|
|
|
|
AfterGLDrawCall();
|
|
|
|
}
|
|
|
|
|
2014-09-18 04:17:00 +04:00
|
|
|
void fClearBufferfi(GLenum buffer, GLint drawbuffer, GLfloat depth, GLint stencil) {
|
|
|
|
BEFORE_GL_CALL;
|
|
|
|
mSymbols.fClearBufferfi(buffer, drawbuffer, depth, stencil);
|
|
|
|
AFTER_GL_CALL;
|
|
|
|
}
|
|
|
|
|
|
|
|
void fClearBufferfv(GLenum buffer, GLint drawbuffer, const GLfloat* value) {
|
|
|
|
BEFORE_GL_CALL;
|
|
|
|
mSymbols.fClearBufferfv(buffer, drawbuffer, value);
|
|
|
|
AFTER_GL_CALL;
|
|
|
|
}
|
|
|
|
|
|
|
|
void fClearBufferiv(GLenum buffer, GLint drawbuffer, const GLint* value) {
|
|
|
|
BEFORE_GL_CALL;
|
|
|
|
mSymbols.fClearBufferiv(buffer, drawbuffer, value);
|
|
|
|
AFTER_GL_CALL;
|
|
|
|
}
|
|
|
|
|
|
|
|
void fClearBufferuiv(GLenum buffer, GLint drawbuffer, const GLuint* value) {
|
|
|
|
BEFORE_GL_CALL;
|
|
|
|
mSymbols.fClearBufferuiv(buffer, drawbuffer, value);
|
|
|
|
AFTER_GL_CALL;
|
|
|
|
}
|
|
|
|
|
2015-02-25 01:09:09 +03:00
|
|
|
void fClearColor(GLfloat r, GLfloat g, GLfloat b, GLfloat a) {
|
2013-08-01 03:18:06 +04:00
|
|
|
BEFORE_GL_CALL;
|
|
|
|
mSymbols.fClearColor(r, g, b, a);
|
|
|
|
AFTER_GL_CALL;
|
|
|
|
}
|
|
|
|
|
|
|
|
void fClearStencil(GLint s) {
|
|
|
|
BEFORE_GL_CALL;
|
|
|
|
mSymbols.fClearStencil(s);
|
|
|
|
AFTER_GL_CALL;
|
|
|
|
}
|
|
|
|
|
2013-06-08 07:11:58 +04:00
|
|
|
void fClientActiveTexture(GLenum texture) {
|
|
|
|
BEFORE_GL_CALL;
|
|
|
|
mSymbols.fClientActiveTexture(texture);
|
|
|
|
AFTER_GL_CALL;
|
|
|
|
}
|
|
|
|
|
2013-08-01 03:18:06 +04:00
|
|
|
void fColorMask(realGLboolean red, realGLboolean green, realGLboolean blue, realGLboolean alpha) {
|
|
|
|
BEFORE_GL_CALL;
|
|
|
|
mSymbols.fColorMask(red, green, blue, alpha);
|
|
|
|
AFTER_GL_CALL;
|
|
|
|
}
|
|
|
|
|
2016-06-11 04:37:07 +03:00
|
|
|
void fCompressedTexImage2D(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid* pixels) {
|
2014-05-09 05:03:37 +04:00
|
|
|
ASSERT_NOT_PASSING_STACK_BUFFER_TO_GL(pixels);
|
2013-08-01 03:18:06 +04:00
|
|
|
BEFORE_GL_CALL;
|
|
|
|
mSymbols.fCompressedTexImage2D(target, level, internalformat, width, height, border, imageSize, pixels);
|
|
|
|
AFTER_GL_CALL;
|
2014-09-10 05:40:51 +04:00
|
|
|
mHeavyGLCallsSinceLastFlush = true;
|
2013-08-01 03:18:06 +04:00
|
|
|
}
|
|
|
|
|
2016-06-11 04:37:07 +03:00
|
|
|
void fCompressedTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid* pixels) {
|
2014-05-09 05:03:37 +04:00
|
|
|
ASSERT_NOT_PASSING_STACK_BUFFER_TO_GL(pixels);
|
2013-08-01 03:18:06 +04:00
|
|
|
BEFORE_GL_CALL;
|
|
|
|
mSymbols.fCompressedTexSubImage2D(target, level, xoffset, yoffset, width, height, format, imageSize, pixels);
|
|
|
|
AFTER_GL_CALL;
|
2014-09-10 05:40:51 +04:00
|
|
|
mHeavyGLCallsSinceLastFlush = true;
|
2011-10-19 23:09:57 +04:00
|
|
|
}
|
|
|
|
|
2015-07-15 03:37:28 +03:00
|
|
|
void fCopyTexImage2D(GLenum target, GLint level, GLenum internalformat, GLint x,
|
|
|
|
GLint y, GLsizei width, GLsizei height, GLint border);
|
2011-10-19 23:09:57 +04:00
|
|
|
|
|
|
|
void fCopyTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height) {
|
|
|
|
BeforeGLReadCall();
|
|
|
|
raw_fCopyTexSubImage2D(target, level, xoffset, yoffset,
|
|
|
|
x, y, width, height);
|
|
|
|
AfterGLReadCall();
|
|
|
|
}
|
|
|
|
|
2013-08-01 03:18:06 +04:00
|
|
|
void fCullFace(GLenum mode) {
|
|
|
|
BEFORE_GL_CALL;
|
|
|
|
mSymbols.fCullFace(mode);
|
|
|
|
AFTER_GL_CALL;
|
2011-10-19 23:09:57 +04:00
|
|
|
}
|
|
|
|
|
2013-10-09 03:20:24 +04:00
|
|
|
void fDebugMessageCallback(GLDEBUGPROC callback, const GLvoid* userParam) {
|
|
|
|
BEFORE_GL_CALL;
|
|
|
|
ASSERT_SYMBOL_PRESENT(fDebugMessageCallback);
|
|
|
|
mSymbols.fDebugMessageCallback(callback, userParam);
|
|
|
|
AFTER_GL_CALL;
|
|
|
|
}
|
|
|
|
|
|
|
|
void fDebugMessageControl(GLenum source, GLenum type, GLenum severity, GLsizei count, const GLuint* ids, realGLboolean enabled) {
|
|
|
|
BEFORE_GL_CALL;
|
|
|
|
ASSERT_SYMBOL_PRESENT(fDebugMessageControl);
|
|
|
|
mSymbols.fDebugMessageControl(source, type, severity, count, ids, enabled);
|
|
|
|
AFTER_GL_CALL;
|
|
|
|
}
|
|
|
|
|
|
|
|
void fDebugMessageInsert(GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar* buf) {
|
|
|
|
BEFORE_GL_CALL;
|
|
|
|
ASSERT_SYMBOL_PRESENT(fDebugMessageInsert);
|
|
|
|
mSymbols.fDebugMessageInsert(source, type, id, severity, length, buf);
|
|
|
|
AFTER_GL_CALL;
|
|
|
|
}
|
|
|
|
|
2013-08-01 03:18:06 +04:00
|
|
|
void fDetachShader(GLuint program, GLuint shader) {
|
|
|
|
BEFORE_GL_CALL;
|
|
|
|
mSymbols.fDetachShader(program, shader);
|
|
|
|
AFTER_GL_CALL;
|
2010-09-21 23:41:24 +04:00
|
|
|
}
|
|
|
|
|
2013-08-01 03:18:06 +04:00
|
|
|
void fDepthFunc(GLenum func) {
|
|
|
|
BEFORE_GL_CALL;
|
|
|
|
mSymbols.fDepthFunc(func);
|
|
|
|
AFTER_GL_CALL;
|
2012-07-16 18:59:59 +04:00
|
|
|
}
|
2011-07-06 22:00:47 +04:00
|
|
|
|
2013-08-01 03:18:06 +04:00
|
|
|
void fDepthMask(realGLboolean flag) {
|
|
|
|
BEFORE_GL_CALL;
|
|
|
|
mSymbols.fDepthMask(flag);
|
|
|
|
AFTER_GL_CALL;
|
|
|
|
}
|
2011-11-08 19:51:44 +04:00
|
|
|
|
2013-08-01 03:18:06 +04:00
|
|
|
void fDisable(GLenum capability) {
|
|
|
|
BEFORE_GL_CALL;
|
|
|
|
mSymbols.fDisable(capability);
|
|
|
|
AFTER_GL_CALL;
|
|
|
|
}
|
2011-11-08 19:51:44 +04:00
|
|
|
|
2013-06-08 07:11:58 +04:00
|
|
|
void fDisableClientState(GLenum capability) {
|
|
|
|
BEFORE_GL_CALL;
|
|
|
|
mSymbols.fDisableClientState(capability);
|
|
|
|
AFTER_GL_CALL;
|
|
|
|
}
|
|
|
|
|
2013-08-01 03:18:06 +04:00
|
|
|
void fDisableVertexAttribArray(GLuint index) {
|
|
|
|
BEFORE_GL_CALL;
|
|
|
|
mSymbols.fDisableVertexAttribArray(index);
|
|
|
|
AFTER_GL_CALL;
|
|
|
|
}
|
2010-11-12 23:02:17 +03:00
|
|
|
|
2013-08-01 03:18:06 +04:00
|
|
|
void fDrawBuffer(GLenum mode) {
|
|
|
|
BEFORE_GL_CALL;
|
|
|
|
mSymbols.fDrawBuffer(mode);
|
|
|
|
AFTER_GL_CALL;
|
|
|
|
}
|
2010-11-12 23:02:17 +03:00
|
|
|
|
2013-08-01 03:18:06 +04:00
|
|
|
private:
|
|
|
|
void raw_fDrawArrays(GLenum mode, GLint first, GLsizei count) {
|
|
|
|
BEFORE_GL_CALL;
|
|
|
|
mSymbols.fDrawArrays(mode, first, count);
|
|
|
|
AFTER_GL_CALL;
|
|
|
|
}
|
2011-05-19 14:53:02 +04:00
|
|
|
|
2016-06-11 04:37:07 +03:00
|
|
|
void raw_fDrawElements(GLenum mode, GLsizei count, GLenum type, const GLvoid* indices) {
|
2013-08-01 03:18:06 +04:00
|
|
|
BEFORE_GL_CALL;
|
|
|
|
mSymbols.fDrawElements(mode, count, type, indices);
|
|
|
|
AFTER_GL_CALL;
|
|
|
|
}
|
2011-05-19 14:53:02 +04:00
|
|
|
|
2013-08-01 03:18:06 +04:00
|
|
|
public:
|
|
|
|
void fDrawArrays(GLenum mode, GLint first, GLsizei count) {
|
|
|
|
BeforeGLDrawCall();
|
|
|
|
raw_fDrawArrays(mode, first, count);
|
|
|
|
AfterGLDrawCall();
|
|
|
|
}
|
2011-05-19 14:53:02 +04:00
|
|
|
|
2016-06-11 04:37:07 +03:00
|
|
|
void fDrawElements(GLenum mode, GLsizei count, GLenum type, const GLvoid* indices) {
|
2013-08-01 03:18:06 +04:00
|
|
|
BeforeGLDrawCall();
|
|
|
|
raw_fDrawElements(mode, count, type, indices);
|
|
|
|
AfterGLDrawCall();
|
|
|
|
}
|
2010-11-12 23:02:17 +03:00
|
|
|
|
2013-08-01 03:18:06 +04:00
|
|
|
void fEnable(GLenum capability) {
|
|
|
|
BEFORE_GL_CALL;
|
|
|
|
mSymbols.fEnable(capability);
|
|
|
|
AFTER_GL_CALL;
|
|
|
|
}
|
2010-11-12 23:02:17 +03:00
|
|
|
|
2013-06-08 07:11:58 +04:00
|
|
|
void fEnableClientState(GLenum capability) {
|
|
|
|
BEFORE_GL_CALL;
|
|
|
|
mSymbols.fEnableClientState(capability);
|
|
|
|
AFTER_GL_CALL;
|
|
|
|
}
|
|
|
|
|
2013-08-01 03:18:06 +04:00
|
|
|
void fEnableVertexAttribArray(GLuint index) {
|
|
|
|
BEFORE_GL_CALL;
|
|
|
|
mSymbols.fEnableVertexAttribArray(index);
|
|
|
|
AFTER_GL_CALL;
|
|
|
|
}
|
2012-06-13 01:39:18 +04:00
|
|
|
|
2013-08-01 03:18:06 +04:00
|
|
|
void fEndQuery(GLenum target) {
|
|
|
|
BEFORE_GL_CALL;
|
2013-08-07 01:23:46 +04:00
|
|
|
ASSERT_SYMBOL_PRESENT(fEndQuery);
|
2013-08-01 03:18:06 +04:00
|
|
|
mSymbols.fEndQuery(target);
|
|
|
|
AFTER_GL_CALL;
|
|
|
|
}
|
2010-08-07 09:09:18 +04:00
|
|
|
|
2013-08-01 03:18:06 +04:00
|
|
|
void fFinish() {
|
|
|
|
BEFORE_GL_CALL;
|
|
|
|
mSymbols.fFinish();
|
|
|
|
AFTER_GL_CALL;
|
2014-09-10 05:40:51 +04:00
|
|
|
mHeavyGLCallsSinceLastFlush = false;
|
2013-08-01 03:18:06 +04:00
|
|
|
}
|
2013-07-24 01:33:51 +04:00
|
|
|
|
2013-08-01 03:18:06 +04:00
|
|
|
void fFlush() {
|
|
|
|
BEFORE_GL_CALL;
|
|
|
|
mSymbols.fFlush();
|
|
|
|
AFTER_GL_CALL;
|
2014-09-10 05:40:51 +04:00
|
|
|
mHeavyGLCallsSinceLastFlush = false;
|
2010-08-07 09:09:18 +04:00
|
|
|
}
|
|
|
|
|
2013-08-01 03:18:06 +04:00
|
|
|
void fFrontFace(GLenum face) {
|
|
|
|
BEFORE_GL_CALL;
|
|
|
|
mSymbols.fFrontFace(face);
|
|
|
|
AFTER_GL_CALL;
|
|
|
|
}
|
2013-07-24 01:33:51 +04:00
|
|
|
|
2013-08-01 03:18:06 +04:00
|
|
|
void fGetActiveAttrib(GLuint program, GLuint index, GLsizei maxLength, GLsizei* length, GLint* size, GLenum* type, GLchar* name) {
|
|
|
|
BEFORE_GL_CALL;
|
|
|
|
mSymbols.fGetActiveAttrib(program, index, maxLength, length, size, type, name);
|
|
|
|
AFTER_GL_CALL;
|
2013-07-24 01:33:51 +04:00
|
|
|
}
|
|
|
|
|
2013-08-01 03:18:06 +04:00
|
|
|
void fGetActiveUniform(GLuint program, GLuint index, GLsizei maxLength, GLsizei* length, GLint* size, GLenum* type, GLchar* name) {
|
|
|
|
BEFORE_GL_CALL;
|
|
|
|
mSymbols.fGetActiveUniform(program, index, maxLength, length, size, type, name);
|
|
|
|
AFTER_GL_CALL;
|
2012-04-05 05:44:55 +04:00
|
|
|
}
|
2011-05-20 23:53:53 +04:00
|
|
|
|
2013-08-01 03:18:06 +04:00
|
|
|
void fGetAttachedShaders(GLuint program, GLsizei maxCount, GLsizei* count, GLuint* shaders) {
|
|
|
|
BEFORE_GL_CALL;
|
|
|
|
mSymbols.fGetAttachedShaders(program, maxCount, count, shaders);
|
|
|
|
AFTER_GL_CALL;
|
2013-02-23 21:14:11 +04:00
|
|
|
}
|
|
|
|
|
2014-02-09 06:06:08 +04:00
|
|
|
GLint fGetAttribLocation(GLuint program, const GLchar* name) {
|
2013-08-01 03:18:06 +04:00
|
|
|
BEFORE_GL_CALL;
|
|
|
|
GLint retval = mSymbols.fGetAttribLocation(program, name);
|
|
|
|
AFTER_GL_CALL;
|
|
|
|
return retval;
|
|
|
|
}
|
2010-11-10 18:49:52 +03:00
|
|
|
|
2013-08-01 03:18:06 +04:00
|
|
|
private:
|
2015-07-15 03:37:28 +03:00
|
|
|
void raw_fGetIntegerv(GLenum pname, GLint* params) {
|
2013-08-01 03:18:06 +04:00
|
|
|
BEFORE_GL_CALL;
|
|
|
|
mSymbols.fGetIntegerv(pname, params);
|
|
|
|
AFTER_GL_CALL;
|
|
|
|
}
|
2012-06-13 01:39:18 +04:00
|
|
|
|
2013-08-01 03:18:06 +04:00
|
|
|
public:
|
|
|
|
|
2015-07-15 03:37:28 +03:00
|
|
|
void fGetIntegerv(GLenum pname, GLint* params);
|
2012-10-04 01:13:05 +04:00
|
|
|
|
2016-06-11 04:37:07 +03:00
|
|
|
void GetUIntegerv(GLenum pname, GLuint* params) {
|
2013-08-01 03:18:06 +04:00
|
|
|
fGetIntegerv(pname, reinterpret_cast<GLint*>(params));
|
|
|
|
}
|
2011-10-27 00:00:44 +04:00
|
|
|
|
2016-07-05 06:35:20 +03:00
|
|
|
template<typename T>
|
|
|
|
T GetIntAs(GLenum pname) {
|
|
|
|
static_assert(sizeof(T) == sizeof(GLint), "Invalid T.");
|
|
|
|
T ret = 0;
|
|
|
|
fGetIntegerv(pname, (GLint*)&ret);
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
2015-07-15 03:37:28 +03:00
|
|
|
void fGetFloatv(GLenum pname, GLfloat* params) {
|
2013-08-01 03:18:06 +04:00
|
|
|
BEFORE_GL_CALL;
|
|
|
|
mSymbols.fGetFloatv(pname, params);
|
|
|
|
AFTER_GL_CALL;
|
2011-11-19 07:57:29 +04:00
|
|
|
}
|
|
|
|
|
2015-07-15 03:37:28 +03:00
|
|
|
void fGetBooleanv(GLenum pname, realGLboolean* params) {
|
2013-08-01 03:18:06 +04:00
|
|
|
BEFORE_GL_CALL;
|
|
|
|
mSymbols.fGetBooleanv(pname, params);
|
|
|
|
AFTER_GL_CALL;
|
2013-02-14 03:26:24 +04:00
|
|
|
}
|
|
|
|
|
2013-08-01 03:18:06 +04:00
|
|
|
void fGetBufferParameteriv(GLenum target, GLenum pname, GLint* params) {
|
|
|
|
BEFORE_GL_CALL;
|
|
|
|
mSymbols.fGetBufferParameteriv(target, pname, params);
|
|
|
|
AFTER_GL_CALL;
|
|
|
|
}
|
2010-09-21 23:41:24 +04:00
|
|
|
|
2013-10-09 03:20:24 +04:00
|
|
|
GLuint fGetDebugMessageLog(GLuint count, GLsizei bufsize, GLenum* sources, GLenum* types, GLuint* ids, GLenum* severities, GLsizei* lengths, GLchar* messageLog) {
|
|
|
|
BEFORE_GL_CALL;
|
|
|
|
ASSERT_SYMBOL_PRESENT(fGetDebugMessageLog);
|
|
|
|
GLuint ret = mSymbols.fGetDebugMessageLog(count, bufsize, sources, types, ids, severities, lengths, messageLog);
|
|
|
|
AFTER_GL_CALL;
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
void fGetPointerv(GLenum pname, GLvoid** params) {
|
|
|
|
BEFORE_GL_CALL;
|
|
|
|
ASSERT_SYMBOL_PRESENT(fGetPointerv);
|
|
|
|
mSymbols.fGetPointerv(pname, params);
|
|
|
|
AFTER_GL_CALL;
|
|
|
|
}
|
|
|
|
|
|
|
|
void fGetObjectLabel(GLenum identifier, GLuint name, GLsizei bufSize, GLsizei* length, GLchar* label) {
|
|
|
|
BEFORE_GL_CALL;
|
|
|
|
ASSERT_SYMBOL_PRESENT(fGetObjectLabel);
|
|
|
|
mSymbols.fGetObjectLabel(identifier, name, bufSize, length, label);
|
|
|
|
AFTER_GL_CALL;
|
|
|
|
}
|
|
|
|
|
2014-02-14 03:02:03 +04:00
|
|
|
void fGetObjectPtrLabel(const GLvoid* ptr, GLsizei bufSize, GLsizei* length, GLchar* label) {
|
2013-10-09 03:20:24 +04:00
|
|
|
BEFORE_GL_CALL;
|
|
|
|
ASSERT_SYMBOL_PRESENT(fGetObjectPtrLabel);
|
|
|
|
mSymbols.fGetObjectPtrLabel(ptr, bufSize, length, label);
|
|
|
|
AFTER_GL_CALL;
|
|
|
|
}
|
|
|
|
|
2013-08-01 03:18:06 +04:00
|
|
|
void fGenerateMipmap(GLenum target) {
|
|
|
|
BEFORE_GL_CALL;
|
|
|
|
mSymbols.fGenerateMipmap(target);
|
|
|
|
AFTER_GL_CALL;
|
|
|
|
}
|
2010-10-07 00:43:14 +04:00
|
|
|
|
2013-08-01 03:18:06 +04:00
|
|
|
void fGetProgramiv(GLuint program, GLenum pname, GLint* param) {
|
|
|
|
BEFORE_GL_CALL;
|
|
|
|
mSymbols.fGetProgramiv(program, pname, param);
|
|
|
|
AFTER_GL_CALL;
|
|
|
|
}
|
2013-07-18 07:24:15 +04:00
|
|
|
|
2013-08-01 03:18:06 +04:00
|
|
|
void fGetProgramInfoLog(GLuint program, GLsizei bufSize, GLsizei* length, GLchar* infoLog) {
|
|
|
|
BEFORE_GL_CALL;
|
|
|
|
mSymbols.fGetProgramInfoLog(program, bufSize, length, infoLog);
|
|
|
|
AFTER_GL_CALL;
|
|
|
|
}
|
2010-10-13 01:01:59 +04:00
|
|
|
|
2013-08-01 03:18:06 +04:00
|
|
|
void fTexParameteri(GLenum target, GLenum pname, GLint param) {
|
|
|
|
BEFORE_GL_CALL;
|
|
|
|
mSymbols.fTexParameteri(target, pname, param);
|
|
|
|
AFTER_GL_CALL;
|
|
|
|
}
|
2010-10-13 01:01:59 +04:00
|
|
|
|
2014-02-14 03:02:03 +04:00
|
|
|
void fTexParameteriv(GLenum target, GLenum pname, const GLint* params) {
|
2013-08-01 03:18:06 +04:00
|
|
|
BEFORE_GL_CALL;
|
|
|
|
mSymbols.fTexParameteriv(target, pname, params);
|
|
|
|
AFTER_GL_CALL;
|
2011-12-17 02:24:46 +04:00
|
|
|
}
|
|
|
|
|
2013-08-01 03:18:06 +04:00
|
|
|
void fTexParameterf(GLenum target, GLenum pname, GLfloat param) {
|
|
|
|
BEFORE_GL_CALL;
|
|
|
|
mSymbols.fTexParameterf(target, pname, param);
|
|
|
|
AFTER_GL_CALL;
|
|
|
|
}
|
2010-07-19 09:01:14 +04:00
|
|
|
|
2013-08-01 03:18:06 +04:00
|
|
|
const GLubyte* fGetString(GLenum name) {
|
|
|
|
BEFORE_GL_CALL;
|
2016-06-11 04:37:07 +03:00
|
|
|
const GLubyte* result = mSymbols.fGetString(name);
|
2013-08-01 03:18:06 +04:00
|
|
|
AFTER_GL_CALL;
|
|
|
|
return result;
|
|
|
|
}
|
2012-04-11 00:20:02 +04:00
|
|
|
|
2016-06-11 04:37:07 +03:00
|
|
|
void fGetTexImage(GLenum target, GLint level, GLenum format, GLenum type, GLvoid* img) {
|
2013-08-01 03:18:06 +04:00
|
|
|
BEFORE_GL_CALL;
|
|
|
|
ASSERT_SYMBOL_PRESENT(fGetTexImage);
|
|
|
|
mSymbols.fGetTexImage(target, level, format, type, img);
|
|
|
|
AFTER_GL_CALL;
|
|
|
|
}
|
2010-10-13 01:01:59 +04:00
|
|
|
|
2016-06-11 04:37:07 +03:00
|
|
|
void fGetTexLevelParameteriv(GLenum target, GLint level, GLenum pname, GLint* params)
|
2013-08-01 03:18:06 +04:00
|
|
|
{
|
|
|
|
BEFORE_GL_CALL;
|
|
|
|
ASSERT_SYMBOL_PRESENT(fGetTexLevelParameteriv);
|
|
|
|
mSymbols.fGetTexLevelParameteriv(target, level, pname, params);
|
|
|
|
AFTER_GL_CALL;
|
|
|
|
}
|
2010-07-19 09:01:14 +04:00
|
|
|
|
2014-02-14 03:02:03 +04:00
|
|
|
void fGetTexParameterfv(GLenum target, GLenum pname, GLfloat* params) {
|
2013-08-01 03:18:06 +04:00
|
|
|
BEFORE_GL_CALL;
|
|
|
|
mSymbols.fGetTexParameterfv(target, pname, params);
|
|
|
|
AFTER_GL_CALL;
|
|
|
|
}
|
2010-09-21 23:41:24 +04:00
|
|
|
|
2014-02-14 03:02:03 +04:00
|
|
|
void fGetTexParameteriv(GLenum target, GLenum pname, GLint* params) {
|
2013-08-01 03:18:06 +04:00
|
|
|
BEFORE_GL_CALL;
|
|
|
|
mSymbols.fGetTexParameteriv(target, pname, params);
|
|
|
|
AFTER_GL_CALL;
|
|
|
|
}
|
2013-02-14 03:26:24 +04:00
|
|
|
|
2013-08-01 03:18:06 +04:00
|
|
|
void fGetUniformfv(GLuint program, GLint location, GLfloat* params) {
|
|
|
|
BEFORE_GL_CALL;
|
|
|
|
mSymbols.fGetUniformfv(program, location, params);
|
|
|
|
AFTER_GL_CALL;
|
|
|
|
}
|
2013-02-14 03:26:24 +04:00
|
|
|
|
2013-08-01 03:18:06 +04:00
|
|
|
void fGetUniformiv(GLuint program, GLint location, GLint* params) {
|
|
|
|
BEFORE_GL_CALL;
|
|
|
|
mSymbols.fGetUniformiv(program, location, params);
|
|
|
|
AFTER_GL_CALL;
|
2013-02-14 03:26:24 +04:00
|
|
|
}
|
|
|
|
|
2015-04-20 05:29:29 +03:00
|
|
|
void fGetUniformuiv(GLuint program, GLint location, GLuint* params) {
|
|
|
|
BEFORE_GL_CALL;
|
|
|
|
ASSERT_SYMBOL_PRESENT(fGetUniformuiv);
|
|
|
|
mSymbols.fGetUniformuiv(program, location, params);
|
|
|
|
AFTER_GL_CALL;
|
|
|
|
}
|
|
|
|
|
2013-08-01 03:18:06 +04:00
|
|
|
GLint fGetUniformLocation (GLint programObj, const GLchar* name) {
|
|
|
|
BEFORE_GL_CALL;
|
|
|
|
GLint retval = mSymbols.fGetUniformLocation(programObj, name);
|
|
|
|
AFTER_GL_CALL;
|
|
|
|
return retval;
|
|
|
|
}
|
2013-02-14 03:26:24 +04:00
|
|
|
|
2013-08-01 03:18:06 +04:00
|
|
|
void fGetVertexAttribfv(GLuint index, GLenum pname, GLfloat* retval) {
|
|
|
|
BEFORE_GL_CALL;
|
|
|
|
mSymbols.fGetVertexAttribfv(index, pname, retval);
|
|
|
|
AFTER_GL_CALL;
|
|
|
|
}
|
2013-02-14 03:26:24 +04:00
|
|
|
|
2013-08-01 03:18:06 +04:00
|
|
|
void fGetVertexAttribiv(GLuint index, GLenum pname, GLint* retval) {
|
|
|
|
BEFORE_GL_CALL;
|
|
|
|
mSymbols.fGetVertexAttribiv(index, pname, retval);
|
|
|
|
AFTER_GL_CALL;
|
|
|
|
}
|
2013-04-25 20:35:50 +04:00
|
|
|
|
2013-08-01 03:18:06 +04:00
|
|
|
void fGetVertexAttribPointerv(GLuint index, GLenum pname, GLvoid** retval) {
|
|
|
|
BEFORE_GL_CALL;
|
|
|
|
mSymbols.fGetVertexAttribPointerv(index, pname, retval);
|
|
|
|
AFTER_GL_CALL;
|
|
|
|
}
|
2013-02-14 03:26:24 +04:00
|
|
|
|
2013-08-01 03:18:06 +04:00
|
|
|
void fHint(GLenum target, GLenum mode) {
|
|
|
|
BEFORE_GL_CALL;
|
|
|
|
mSymbols.fHint(target, mode);
|
|
|
|
AFTER_GL_CALL;
|
2013-02-14 03:26:24 +04:00
|
|
|
}
|
2013-02-21 23:54:25 +04:00
|
|
|
|
2013-08-01 03:18:06 +04:00
|
|
|
realGLboolean fIsBuffer(GLuint buffer) {
|
|
|
|
BEFORE_GL_CALL;
|
|
|
|
realGLboolean retval = mSymbols.fIsBuffer(buffer);
|
|
|
|
AFTER_GL_CALL;
|
|
|
|
return retval;
|
|
|
|
}
|
2013-02-14 03:26:24 +04:00
|
|
|
|
2013-08-01 03:18:06 +04:00
|
|
|
realGLboolean fIsEnabled(GLenum capability) {
|
|
|
|
BEFORE_GL_CALL;
|
|
|
|
realGLboolean retval = mSymbols.fIsEnabled(capability);
|
|
|
|
AFTER_GL_CALL;
|
|
|
|
return retval;
|
|
|
|
}
|
2012-04-25 18:10:43 +04:00
|
|
|
|
2013-08-01 03:18:06 +04:00
|
|
|
realGLboolean fIsProgram(GLuint program) {
|
|
|
|
BEFORE_GL_CALL;
|
|
|
|
realGLboolean retval = mSymbols.fIsProgram(program);
|
|
|
|
AFTER_GL_CALL;
|
|
|
|
return retval;
|
|
|
|
}
|
2011-10-21 07:41:02 +04:00
|
|
|
|
2013-08-01 03:18:06 +04:00
|
|
|
realGLboolean fIsShader(GLuint shader) {
|
|
|
|
BEFORE_GL_CALL;
|
|
|
|
realGLboolean retval = mSymbols.fIsShader(shader);
|
|
|
|
AFTER_GL_CALL;
|
|
|
|
return retval;
|
|
|
|
}
|
2012-03-13 02:10:38 +04:00
|
|
|
|
2013-08-01 03:18:06 +04:00
|
|
|
realGLboolean fIsTexture(GLuint texture) {
|
|
|
|
BEFORE_GL_CALL;
|
|
|
|
realGLboolean retval = mSymbols.fIsTexture(texture);
|
|
|
|
AFTER_GL_CALL;
|
|
|
|
return retval;
|
2011-10-19 23:09:57 +04:00
|
|
|
}
|
2012-03-13 02:10:38 +04:00
|
|
|
|
2013-08-01 03:18:06 +04:00
|
|
|
void fLineWidth(GLfloat width) {
|
|
|
|
BEFORE_GL_CALL;
|
|
|
|
mSymbols.fLineWidth(width);
|
|
|
|
AFTER_GL_CALL;
|
|
|
|
}
|
2013-02-14 03:26:24 +04:00
|
|
|
|
2013-08-01 03:18:06 +04:00
|
|
|
void fLinkProgram(GLuint program) {
|
|
|
|
BEFORE_GL_CALL;
|
|
|
|
mSymbols.fLinkProgram(program);
|
|
|
|
AFTER_GL_CALL;
|
|
|
|
}
|
2013-02-14 03:26:24 +04:00
|
|
|
|
2013-10-09 03:20:24 +04:00
|
|
|
void fObjectLabel(GLenum identifier, GLuint name, GLsizei length, const GLchar* label) {
|
|
|
|
BEFORE_GL_CALL;
|
|
|
|
ASSERT_SYMBOL_PRESENT(fObjectLabel);
|
|
|
|
mSymbols.fObjectLabel(identifier, name, length, label);
|
|
|
|
AFTER_GL_CALL;
|
|
|
|
}
|
|
|
|
|
2014-02-14 03:02:03 +04:00
|
|
|
void fObjectPtrLabel(const GLvoid* ptr, GLsizei length, const GLchar* label) {
|
2013-10-09 03:20:24 +04:00
|
|
|
BEFORE_GL_CALL;
|
|
|
|
ASSERT_SYMBOL_PRESENT(fObjectPtrLabel);
|
|
|
|
mSymbols.fObjectPtrLabel(ptr, length, label);
|
|
|
|
AFTER_GL_CALL;
|
|
|
|
}
|
|
|
|
|
2013-06-08 07:11:58 +04:00
|
|
|
void fLoadIdentity() {
|
|
|
|
BEFORE_GL_CALL;
|
|
|
|
mSymbols.fLoadIdentity();
|
|
|
|
AFTER_GL_CALL;
|
|
|
|
}
|
|
|
|
|
2016-06-11 04:37:07 +03:00
|
|
|
void fLoadMatrixf(const GLfloat* matrix) {
|
2013-06-08 07:11:58 +04:00
|
|
|
BEFORE_GL_CALL;
|
|
|
|
mSymbols.fLoadMatrixf(matrix);
|
|
|
|
AFTER_GL_CALL;
|
|
|
|
}
|
|
|
|
|
|
|
|
void fMatrixMode(GLenum mode) {
|
|
|
|
BEFORE_GL_CALL;
|
|
|
|
mSymbols.fMatrixMode(mode);
|
|
|
|
AFTER_GL_CALL;
|
|
|
|
}
|
|
|
|
|
2013-08-01 03:18:06 +04:00
|
|
|
void fPixelStorei(GLenum pname, GLint param) {
|
|
|
|
BEFORE_GL_CALL;
|
|
|
|
mSymbols.fPixelStorei(pname, param);
|
|
|
|
AFTER_GL_CALL;
|
|
|
|
}
|
2013-02-14 03:26:24 +04:00
|
|
|
|
2016-06-11 04:37:07 +03:00
|
|
|
void fTextureRangeAPPLE(GLenum target, GLsizei length, GLvoid* pointer) {
|
2014-05-09 05:03:37 +04:00
|
|
|
ASSERT_NOT_PASSING_STACK_BUFFER_TO_GL(pointer);
|
2013-12-12 22:27:10 +04:00
|
|
|
BEFORE_GL_CALL;
|
|
|
|
mSymbols.fTextureRangeAPPLE(target, length, pointer);
|
|
|
|
AFTER_GL_CALL;
|
|
|
|
}
|
|
|
|
|
2013-08-01 03:18:06 +04:00
|
|
|
void fPointParameterf(GLenum pname, GLfloat param) {
|
|
|
|
BEFORE_GL_CALL;
|
|
|
|
mSymbols.fPointParameterf(pname, param);
|
|
|
|
AFTER_GL_CALL;
|
2013-02-14 03:26:24 +04:00
|
|
|
}
|
|
|
|
|
2013-08-01 03:18:06 +04:00
|
|
|
void fPolygonOffset(GLfloat factor, GLfloat bias) {
|
|
|
|
BEFORE_GL_CALL;
|
|
|
|
mSymbols.fPolygonOffset(factor, bias);
|
|
|
|
AFTER_GL_CALL;
|
2013-02-14 03:26:24 +04:00
|
|
|
}
|
|
|
|
|
2013-10-09 03:20:24 +04:00
|
|
|
void fPopDebugGroup() {
|
|
|
|
BEFORE_GL_CALL;
|
|
|
|
ASSERT_SYMBOL_PRESENT(fPopDebugGroup);
|
|
|
|
mSymbols.fPopDebugGroup();
|
|
|
|
AFTER_GL_CALL;
|
|
|
|
}
|
|
|
|
|
|
|
|
void fPushDebugGroup(GLenum source, GLuint id, GLsizei length, const GLchar* message) {
|
|
|
|
BEFORE_GL_CALL;
|
|
|
|
ASSERT_SYMBOL_PRESENT(fPushDebugGroup);
|
|
|
|
mSymbols.fPushDebugGroup(source, id, length, message);
|
|
|
|
AFTER_GL_CALL;
|
|
|
|
}
|
|
|
|
|
2013-08-01 03:18:06 +04:00
|
|
|
void fReadBuffer(GLenum mode) {
|
|
|
|
BEFORE_GL_CALL;
|
|
|
|
mSymbols.fReadBuffer(mode);
|
|
|
|
AFTER_GL_CALL;
|
2013-02-14 03:26:24 +04:00
|
|
|
}
|
|
|
|
|
2016-06-11 04:37:07 +03:00
|
|
|
void raw_fReadPixels(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid* pixels) {
|
2014-05-09 05:03:37 +04:00
|
|
|
ASSERT_NOT_PASSING_STACK_BUFFER_TO_GL(pixels);
|
2013-08-01 03:18:06 +04:00
|
|
|
BEFORE_GL_CALL;
|
2014-01-08 00:02:18 +04:00
|
|
|
mSymbols.fReadPixels(x, y, width, height, format, type, pixels);
|
2013-08-01 03:18:06 +04:00
|
|
|
AFTER_GL_CALL;
|
2014-09-10 05:40:51 +04:00
|
|
|
mHeavyGLCallsSinceLastFlush = true;
|
2013-02-14 03:26:24 +04:00
|
|
|
}
|
|
|
|
|
2015-07-15 03:37:28 +03:00
|
|
|
void fReadPixels(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format,
|
|
|
|
GLenum type, GLvoid* pixels);
|
2013-02-14 03:26:24 +04:00
|
|
|
|
2013-08-01 03:18:06 +04:00
|
|
|
public:
|
|
|
|
void fSampleCoverage(GLclampf value, realGLboolean invert) {
|
|
|
|
BEFORE_GL_CALL;
|
|
|
|
mSymbols.fSampleCoverage(value, invert);
|
|
|
|
AFTER_GL_CALL;
|
|
|
|
}
|
2013-02-14 03:26:24 +04:00
|
|
|
|
2014-01-08 00:02:19 +04:00
|
|
|
void fScissor(GLint x, GLint y, GLsizei width, GLsizei height) {
|
2014-01-08 00:02:19 +04:00
|
|
|
if (mScissorRect[0] == x &&
|
|
|
|
mScissorRect[1] == y &&
|
|
|
|
mScissorRect[2] == width &&
|
|
|
|
mScissorRect[3] == height)
|
|
|
|
{
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
mScissorRect[0] = x;
|
|
|
|
mScissorRect[1] = y;
|
|
|
|
mScissorRect[2] = width;
|
|
|
|
mScissorRect[3] = height;
|
2013-08-01 03:18:06 +04:00
|
|
|
BEFORE_GL_CALL;
|
|
|
|
mSymbols.fScissor(x, y, width, height);
|
|
|
|
AFTER_GL_CALL;
|
|
|
|
}
|
2012-07-15 19:11:17 +04:00
|
|
|
|
2015-09-12 06:30:14 +03:00
|
|
|
void fStencilFunc(GLenum func, GLint reference, GLuint mask) {
|
2013-08-01 03:18:06 +04:00
|
|
|
BEFORE_GL_CALL;
|
2015-09-12 06:30:14 +03:00
|
|
|
mSymbols.fStencilFunc(func, reference, mask);
|
2013-08-01 03:18:06 +04:00
|
|
|
AFTER_GL_CALL;
|
2013-02-14 03:26:24 +04:00
|
|
|
}
|
|
|
|
|
2015-09-12 06:30:14 +03:00
|
|
|
void fStencilFuncSeparate(GLenum frontfunc, GLenum backfunc, GLint reference, GLuint mask) {
|
2013-08-01 03:18:06 +04:00
|
|
|
BEFORE_GL_CALL;
|
2015-09-12 06:30:14 +03:00
|
|
|
mSymbols.fStencilFuncSeparate(frontfunc, backfunc, reference, mask);
|
2013-08-01 03:18:06 +04:00
|
|
|
AFTER_GL_CALL;
|
2013-02-14 03:26:24 +04:00
|
|
|
}
|
|
|
|
|
2013-08-01 03:18:06 +04:00
|
|
|
void fStencilMask(GLuint mask) {
|
|
|
|
BEFORE_GL_CALL;
|
|
|
|
mSymbols.fStencilMask(mask);
|
|
|
|
AFTER_GL_CALL;
|
2013-02-14 03:26:24 +04:00
|
|
|
}
|
|
|
|
|
2013-08-01 03:18:06 +04:00
|
|
|
void fStencilMaskSeparate(GLenum face, GLuint mask) {
|
|
|
|
BEFORE_GL_CALL;
|
|
|
|
mSymbols.fStencilMaskSeparate(face, mask);
|
|
|
|
AFTER_GL_CALL;
|
2013-02-14 03:26:24 +04:00
|
|
|
}
|
|
|
|
|
2013-08-01 03:18:06 +04:00
|
|
|
void fStencilOp(GLenum fail, GLenum zfail, GLenum zpass) {
|
|
|
|
BEFORE_GL_CALL;
|
|
|
|
mSymbols.fStencilOp(fail, zfail, zpass);
|
|
|
|
AFTER_GL_CALL;
|
2013-02-14 03:26:24 +04:00
|
|
|
}
|
|
|
|
|
2013-08-01 03:18:06 +04:00
|
|
|
void fStencilOpSeparate(GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass) {
|
|
|
|
BEFORE_GL_CALL;
|
|
|
|
mSymbols.fStencilOpSeparate(face, sfail, dpfail, dppass);
|
|
|
|
AFTER_GL_CALL;
|
|
|
|
}
|
2013-02-14 03:26:24 +04:00
|
|
|
|
2013-06-08 07:11:58 +04:00
|
|
|
void fTexGeni(GLenum coord, GLenum pname, GLint param) {
|
|
|
|
BEFORE_GL_CALL;
|
|
|
|
mSymbols.fTexGeni(coord, pname, param);
|
|
|
|
AFTER_GL_CALL;
|
|
|
|
}
|
|
|
|
|
|
|
|
void fTexGenf(GLenum coord, GLenum pname, GLfloat param) {
|
|
|
|
BEFORE_GL_CALL;
|
|
|
|
mSymbols.fTexGenf(coord, pname, param);
|
|
|
|
AFTER_GL_CALL;
|
|
|
|
}
|
|
|
|
|
2016-06-11 04:37:07 +03:00
|
|
|
void fTexGenfv(GLenum coord, GLenum pname, const GLfloat* params) {
|
2013-06-08 07:11:58 +04:00
|
|
|
BEFORE_GL_CALL;
|
|
|
|
mSymbols.fTexGenfv(coord, pname, params);
|
|
|
|
AFTER_GL_CALL;
|
|
|
|
}
|
|
|
|
|
2013-08-01 03:18:06 +04:00
|
|
|
private:
|
2016-06-11 04:37:07 +03:00
|
|
|
void raw_fTexImage2D(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid* pixels) {
|
2014-05-09 05:03:37 +04:00
|
|
|
ASSERT_NOT_PASSING_STACK_BUFFER_TO_GL(pixels);
|
2013-08-01 03:18:06 +04:00
|
|
|
BEFORE_GL_CALL;
|
|
|
|
mSymbols.fTexImage2D(target, level, internalformat, width, height, border, format, type, pixels);
|
|
|
|
AFTER_GL_CALL;
|
2014-09-10 05:40:51 +04:00
|
|
|
mHeavyGLCallsSinceLastFlush = true;
|
2013-08-01 03:18:06 +04:00
|
|
|
}
|
2010-04-27 06:09:44 +04:00
|
|
|
|
2013-08-01 03:18:06 +04:00
|
|
|
public:
|
2016-07-15 18:58:58 +03:00
|
|
|
void fTexImage2D(GLenum target, GLint level, GLint internalformat,
|
|
|
|
GLsizei width, GLsizei height, GLint border,
|
|
|
|
GLenum format, GLenum type, const GLvoid* pixels);
|
2012-04-10 19:49:10 +04:00
|
|
|
|
2013-08-01 03:18:06 +04:00
|
|
|
void fTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid* pixels) {
|
2014-05-09 05:03:37 +04:00
|
|
|
ASSERT_NOT_PASSING_STACK_BUFFER_TO_GL(pixels);
|
2013-08-01 03:18:06 +04:00
|
|
|
BEFORE_GL_CALL;
|
|
|
|
mSymbols.fTexSubImage2D(target, level, xoffset, yoffset, width, height, format, type, pixels);
|
|
|
|
AFTER_GL_CALL;
|
2014-09-10 05:40:51 +04:00
|
|
|
mHeavyGLCallsSinceLastFlush = true;
|
2013-08-01 03:18:06 +04:00
|
|
|
}
|
2013-02-14 03:26:24 +04:00
|
|
|
|
2013-08-01 03:18:06 +04:00
|
|
|
void fUniform1f(GLint location, GLfloat v0) {
|
|
|
|
BEFORE_GL_CALL;
|
|
|
|
mSymbols.fUniform1f(location, v0);
|
|
|
|
AFTER_GL_CALL;
|
2013-02-14 03:26:24 +04:00
|
|
|
}
|
2011-12-20 03:47:54 +04:00
|
|
|
|
2013-08-01 03:18:06 +04:00
|
|
|
void fUniform1fv(GLint location, GLsizei count, const GLfloat* value) {
|
|
|
|
BEFORE_GL_CALL;
|
|
|
|
mSymbols.fUniform1fv(location, count, value);
|
|
|
|
AFTER_GL_CALL;
|
|
|
|
}
|
2013-02-14 03:26:24 +04:00
|
|
|
|
2013-08-01 03:18:06 +04:00
|
|
|
void fUniform1i(GLint location, GLint v0) {
|
|
|
|
BEFORE_GL_CALL;
|
|
|
|
mSymbols.fUniform1i(location, v0);
|
|
|
|
AFTER_GL_CALL;
|
|
|
|
}
|
2010-04-27 06:09:44 +04:00
|
|
|
|
2013-08-01 03:18:06 +04:00
|
|
|
void fUniform1iv(GLint location, GLsizei count, const GLint* value) {
|
|
|
|
BEFORE_GL_CALL;
|
|
|
|
mSymbols.fUniform1iv(location, count, value);
|
|
|
|
AFTER_GL_CALL;
|
2010-07-29 01:24:09 +04:00
|
|
|
}
|
|
|
|
|
2013-08-01 03:18:06 +04:00
|
|
|
void fUniform2f(GLint location, GLfloat v0, GLfloat v1) {
|
|
|
|
BEFORE_GL_CALL;
|
|
|
|
mSymbols.fUniform2f(location, v0, v1);
|
|
|
|
AFTER_GL_CALL;
|
|
|
|
}
|
2010-04-27 06:09:44 +04:00
|
|
|
|
2013-08-01 03:18:06 +04:00
|
|
|
void fUniform2fv(GLint location, GLsizei count, const GLfloat* value) {
|
|
|
|
BEFORE_GL_CALL;
|
|
|
|
mSymbols.fUniform2fv(location, count, value);
|
|
|
|
AFTER_GL_CALL;
|
|
|
|
}
|
2010-06-15 10:55:08 +04:00
|
|
|
|
2013-08-01 03:18:06 +04:00
|
|
|
void fUniform2i(GLint location, GLint v0, GLint v1) {
|
|
|
|
BEFORE_GL_CALL;
|
|
|
|
mSymbols.fUniform2i(location, v0, v1);
|
|
|
|
AFTER_GL_CALL;
|
2011-05-20 23:53:53 +04:00
|
|
|
}
|
|
|
|
|
2013-08-01 03:18:06 +04:00
|
|
|
void fUniform2iv(GLint location, GLsizei count, const GLint* value) {
|
|
|
|
BEFORE_GL_CALL;
|
|
|
|
mSymbols.fUniform2iv(location, count, value);
|
|
|
|
AFTER_GL_CALL;
|
|
|
|
}
|
2010-10-13 01:01:59 +04:00
|
|
|
|
2013-08-01 03:18:06 +04:00
|
|
|
void fUniform3f(GLint location, GLfloat v0, GLfloat v1, GLfloat v2) {
|
|
|
|
BEFORE_GL_CALL;
|
|
|
|
mSymbols.fUniform3f(location, v0, v1, v2);
|
|
|
|
AFTER_GL_CALL;
|
|
|
|
}
|
2010-12-17 10:19:28 +03:00
|
|
|
|
2013-08-01 03:18:06 +04:00
|
|
|
void fUniform3fv(GLint location, GLsizei count, const GLfloat* value) {
|
|
|
|
BEFORE_GL_CALL;
|
|
|
|
mSymbols.fUniform3fv(location, count, value);
|
|
|
|
AFTER_GL_CALL;
|
2012-03-26 20:15:53 +04:00
|
|
|
}
|
|
|
|
|
2013-08-01 03:18:06 +04:00
|
|
|
void fUniform3i(GLint location, GLint v0, GLint v1, GLint v2) {
|
|
|
|
BEFORE_GL_CALL;
|
|
|
|
mSymbols.fUniform3i(location, v0, v1, v2);
|
|
|
|
AFTER_GL_CALL;
|
|
|
|
}
|
2013-05-22 11:05:38 +04:00
|
|
|
|
2013-08-01 03:18:06 +04:00
|
|
|
void fUniform3iv(GLint location, GLsizei count, const GLint* value) {
|
|
|
|
BEFORE_GL_CALL;
|
|
|
|
mSymbols.fUniform3iv(location, count, value);
|
|
|
|
AFTER_GL_CALL;
|
|
|
|
}
|
|
|
|
|
|
|
|
void fUniform4f(GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3) {
|
|
|
|
BEFORE_GL_CALL;
|
|
|
|
mSymbols.fUniform4f(location, v0, v1, v2, v3);
|
|
|
|
AFTER_GL_CALL;
|
|
|
|
}
|
|
|
|
|
|
|
|
void fUniform4fv(GLint location, GLsizei count, const GLfloat* value) {
|
|
|
|
BEFORE_GL_CALL;
|
|
|
|
mSymbols.fUniform4fv(location, count, value);
|
|
|
|
AFTER_GL_CALL;
|
|
|
|
}
|
2013-05-22 11:05:38 +04:00
|
|
|
|
2013-08-01 03:18:06 +04:00
|
|
|
void fUniform4i(GLint location, GLint v0, GLint v1, GLint v2, GLint v3) {
|
|
|
|
BEFORE_GL_CALL;
|
|
|
|
mSymbols.fUniform4i(location, v0, v1, v2, v3);
|
|
|
|
AFTER_GL_CALL;
|
|
|
|
}
|
2013-05-22 11:05:38 +04:00
|
|
|
|
2013-08-01 03:18:06 +04:00
|
|
|
void fUniform4iv(GLint location, GLsizei count, const GLint* value) {
|
|
|
|
BEFORE_GL_CALL;
|
|
|
|
mSymbols.fUniform4iv(location, count, value);
|
|
|
|
AFTER_GL_CALL;
|
2011-07-08 04:01:16 +04:00
|
|
|
}
|
2010-08-07 09:09:18 +04:00
|
|
|
|
2013-08-01 03:18:06 +04:00
|
|
|
void fUniformMatrix2fv(GLint location, GLsizei count, realGLboolean transpose, const GLfloat* value) {
|
|
|
|
BEFORE_GL_CALL;
|
|
|
|
mSymbols.fUniformMatrix2fv(location, count, transpose, value);
|
|
|
|
AFTER_GL_CALL;
|
|
|
|
}
|
2010-10-13 01:01:59 +04:00
|
|
|
|
2014-09-23 09:33:55 +04:00
|
|
|
void fUniformMatrix2x3fv(GLint location, GLsizei count, realGLboolean transpose, const GLfloat* value) {
|
|
|
|
BEFORE_GL_CALL;
|
|
|
|
ASSERT_SYMBOL_PRESENT(fUniformMatrix2x3fv);
|
|
|
|
mSymbols.fUniformMatrix2x3fv(location, count, transpose, value);
|
|
|
|
AFTER_GL_CALL;
|
|
|
|
}
|
|
|
|
|
|
|
|
void fUniformMatrix2x4fv(GLint location, GLsizei count, realGLboolean transpose, const GLfloat* value) {
|
|
|
|
BEFORE_GL_CALL;
|
|
|
|
ASSERT_SYMBOL_PRESENT(fUniformMatrix2x4fv);
|
|
|
|
mSymbols.fUniformMatrix2x4fv(location, count, transpose, value);
|
|
|
|
AFTER_GL_CALL;
|
|
|
|
}
|
|
|
|
|
2013-08-01 03:18:06 +04:00
|
|
|
void fUniformMatrix3fv(GLint location, GLsizei count, realGLboolean transpose, const GLfloat* value) {
|
|
|
|
BEFORE_GL_CALL;
|
|
|
|
mSymbols.fUniformMatrix3fv(location, count, transpose, value);
|
|
|
|
AFTER_GL_CALL;
|
|
|
|
}
|
2010-10-13 01:01:59 +04:00
|
|
|
|
2014-09-23 09:33:55 +04:00
|
|
|
void fUniformMatrix3x2fv(GLint location, GLsizei count, realGLboolean transpose, const GLfloat* value) {
|
|
|
|
BEFORE_GL_CALL;
|
|
|
|
ASSERT_SYMBOL_PRESENT(fUniformMatrix3x2fv);
|
|
|
|
mSymbols.fUniformMatrix3x2fv(location, count, transpose, value);
|
|
|
|
AFTER_GL_CALL;
|
|
|
|
}
|
|
|
|
|
|
|
|
void fUniformMatrix3x4fv(GLint location, GLsizei count, realGLboolean transpose, const GLfloat* value) {
|
|
|
|
BEFORE_GL_CALL;
|
|
|
|
ASSERT_SYMBOL_PRESENT(fUniformMatrix3x4fv);
|
|
|
|
mSymbols.fUniformMatrix3x4fv(location, count, transpose, value);
|
|
|
|
AFTER_GL_CALL;
|
|
|
|
}
|
|
|
|
|
2013-08-01 03:18:06 +04:00
|
|
|
void fUniformMatrix4fv(GLint location, GLsizei count, realGLboolean transpose, const GLfloat* value) {
|
|
|
|
BEFORE_GL_CALL;
|
|
|
|
mSymbols.fUniformMatrix4fv(location, count, transpose, value);
|
|
|
|
AFTER_GL_CALL;
|
|
|
|
}
|
2010-10-13 01:01:59 +04:00
|
|
|
|
2014-09-23 09:33:55 +04:00
|
|
|
void fUniformMatrix4x2fv(GLint location, GLsizei count, realGLboolean transpose, const GLfloat* value) {
|
|
|
|
BEFORE_GL_CALL;
|
|
|
|
ASSERT_SYMBOL_PRESENT(fUniformMatrix4x2fv);
|
|
|
|
mSymbols.fUniformMatrix4x2fv(location, count, transpose, value);
|
|
|
|
AFTER_GL_CALL;
|
|
|
|
}
|
|
|
|
|
|
|
|
void fUniformMatrix4x3fv(GLint location, GLsizei count, realGLboolean transpose, const GLfloat* value) {
|
|
|
|
BEFORE_GL_CALL;
|
|
|
|
ASSERT_SYMBOL_PRESENT(fUniformMatrix4x3fv);
|
|
|
|
mSymbols.fUniformMatrix4x3fv(location, count, transpose, value);
|
|
|
|
AFTER_GL_CALL;
|
|
|
|
}
|
|
|
|
|
2013-08-01 03:18:06 +04:00
|
|
|
void fUseProgram(GLuint program) {
|
|
|
|
BEFORE_GL_CALL;
|
|
|
|
mSymbols.fUseProgram(program);
|
|
|
|
AFTER_GL_CALL;
|
|
|
|
}
|
2011-07-08 04:01:16 +04:00
|
|
|
|
2013-08-01 03:18:06 +04:00
|
|
|
void fValidateProgram(GLuint program) {
|
|
|
|
BEFORE_GL_CALL;
|
|
|
|
mSymbols.fValidateProgram(program);
|
|
|
|
AFTER_GL_CALL;
|
|
|
|
}
|
2012-05-13 03:23:56 +04:00
|
|
|
|
2013-08-01 03:18:06 +04:00
|
|
|
void fVertexAttribPointer(GLuint index, GLint size, GLenum type, realGLboolean normalized, GLsizei stride, const GLvoid* pointer) {
|
|
|
|
BEFORE_GL_CALL;
|
|
|
|
mSymbols.fVertexAttribPointer(index, size, type, normalized, stride, pointer);
|
|
|
|
AFTER_GL_CALL;
|
|
|
|
}
|
2012-05-13 03:23:56 +04:00
|
|
|
|
2013-08-01 03:18:06 +04:00
|
|
|
void fVertexAttrib1f(GLuint index, GLfloat x) {
|
|
|
|
BEFORE_GL_CALL;
|
|
|
|
mSymbols.fVertexAttrib1f(index, x);
|
|
|
|
AFTER_GL_CALL;
|
2010-07-29 01:24:09 +04:00
|
|
|
}
|
|
|
|
|
2013-08-01 03:18:06 +04:00
|
|
|
void fVertexAttrib2f(GLuint index, GLfloat x, GLfloat y) {
|
|
|
|
BEFORE_GL_CALL;
|
|
|
|
mSymbols.fVertexAttrib2f(index, x, y);
|
|
|
|
AFTER_GL_CALL;
|
2010-10-13 01:01:59 +04:00
|
|
|
}
|
|
|
|
|
2013-08-01 03:18:06 +04:00
|
|
|
void fVertexAttrib3f(GLuint index, GLfloat x, GLfloat y, GLfloat z) {
|
|
|
|
BEFORE_GL_CALL;
|
|
|
|
mSymbols.fVertexAttrib3f(index, x, y, z);
|
|
|
|
AFTER_GL_CALL;
|
|
|
|
}
|
2011-04-19 02:47:40 +04:00
|
|
|
|
2013-08-01 03:18:06 +04:00
|
|
|
void fVertexAttrib4f(GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w) {
|
|
|
|
BEFORE_GL_CALL;
|
|
|
|
mSymbols.fVertexAttrib4f(index, x, y, z, w);
|
|
|
|
AFTER_GL_CALL;
|
|
|
|
}
|
2013-05-22 11:05:38 +04:00
|
|
|
|
2013-08-01 03:18:06 +04:00
|
|
|
void fVertexAttrib1fv(GLuint index, const GLfloat* v) {
|
|
|
|
BEFORE_GL_CALL;
|
|
|
|
mSymbols.fVertexAttrib1fv(index, v);
|
|
|
|
AFTER_GL_CALL;
|
|
|
|
}
|
2010-10-13 01:01:59 +04:00
|
|
|
|
2013-08-01 03:18:06 +04:00
|
|
|
void fVertexAttrib2fv(GLuint index, const GLfloat* v) {
|
|
|
|
BEFORE_GL_CALL;
|
|
|
|
mSymbols.fVertexAttrib2fv(index, v);
|
|
|
|
AFTER_GL_CALL;
|
|
|
|
}
|
2010-10-13 01:01:59 +04:00
|
|
|
|
2013-08-01 03:18:06 +04:00
|
|
|
void fVertexAttrib3fv(GLuint index, const GLfloat* v) {
|
|
|
|
BEFORE_GL_CALL;
|
|
|
|
mSymbols.fVertexAttrib3fv(index, v);
|
|
|
|
AFTER_GL_CALL;
|
|
|
|
}
|
2010-10-13 01:01:59 +04:00
|
|
|
|
2013-08-01 03:18:06 +04:00
|
|
|
void fVertexAttrib4fv(GLuint index, const GLfloat* v) {
|
|
|
|
BEFORE_GL_CALL;
|
|
|
|
mSymbols.fVertexAttrib4fv(index, v);
|
|
|
|
AFTER_GL_CALL;
|
|
|
|
}
|
2010-10-13 01:01:59 +04:00
|
|
|
|
2013-06-08 07:11:58 +04:00
|
|
|
void fVertexPointer(GLint size, GLenum type, GLsizei stride, const GLvoid* pointer) {
|
|
|
|
BEFORE_GL_CALL;
|
|
|
|
mSymbols.fVertexPointer(size, type, stride, pointer);
|
|
|
|
AFTER_GL_CALL;
|
|
|
|
}
|
|
|
|
|
2013-08-01 03:18:06 +04:00
|
|
|
void fCompileShader(GLuint shader) {
|
|
|
|
BEFORE_GL_CALL;
|
|
|
|
mSymbols.fCompileShader(shader);
|
|
|
|
AFTER_GL_CALL;
|
|
|
|
}
|
2012-12-19 11:16:01 +04:00
|
|
|
|
2013-08-01 03:18:06 +04:00
|
|
|
private:
|
2015-03-23 06:55:26 +03:00
|
|
|
|
|
|
|
friend class SharedSurface_IOSurface;
|
|
|
|
|
2014-09-23 09:38:01 +04:00
|
|
|
void raw_fCopyTexImage2D(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border)
|
|
|
|
{
|
2013-08-01 03:18:06 +04:00
|
|
|
BEFORE_GL_CALL;
|
|
|
|
mSymbols.fCopyTexImage2D(target, level, internalformat, x, y, width, height, border);
|
|
|
|
AFTER_GL_CALL;
|
|
|
|
}
|
2010-10-13 01:01:59 +04:00
|
|
|
|
2014-09-23 09:38:01 +04:00
|
|
|
void raw_fCopyTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height)
|
|
|
|
{
|
2013-08-01 03:18:06 +04:00
|
|
|
BEFORE_GL_CALL;
|
|
|
|
mSymbols.fCopyTexSubImage2D(target, level, xoffset, yoffset, x, y, width, height);
|
|
|
|
AFTER_GL_CALL;
|
|
|
|
}
|
2010-10-13 01:01:59 +04:00
|
|
|
|
2013-08-01 03:18:06 +04:00
|
|
|
public:
|
|
|
|
void fGetShaderiv(GLuint shader, GLenum pname, GLint* param) {
|
|
|
|
BEFORE_GL_CALL;
|
|
|
|
mSymbols.fGetShaderiv(shader, pname, param);
|
|
|
|
AFTER_GL_CALL;
|
2010-07-29 01:24:09 +04:00
|
|
|
}
|
|
|
|
|
2013-08-01 03:18:06 +04:00
|
|
|
void fGetShaderInfoLog(GLuint shader, GLsizei bufSize, GLsizei* length, GLchar* infoLog) {
|
|
|
|
BEFORE_GL_CALL;
|
|
|
|
mSymbols.fGetShaderInfoLog(shader, bufSize, length, infoLog);
|
|
|
|
AFTER_GL_CALL;
|
|
|
|
}
|
2010-10-13 01:01:59 +04:00
|
|
|
|
2013-08-01 03:18:06 +04:00
|
|
|
private:
|
|
|
|
void raw_fGetShaderPrecisionFormat(GLenum shadertype, GLenum precisiontype, GLint* range, GLint* precision) {
|
2014-03-31 13:10:49 +04:00
|
|
|
MOZ_ASSERT(IsGLES());
|
2010-10-13 01:01:59 +04:00
|
|
|
|
2013-08-01 03:18:06 +04:00
|
|
|
BEFORE_GL_CALL;
|
|
|
|
ASSERT_SYMBOL_PRESENT(fGetShaderPrecisionFormat);
|
|
|
|
mSymbols.fGetShaderPrecisionFormat(shadertype, precisiontype, range, precision);
|
|
|
|
AFTER_GL_CALL;
|
2011-02-25 10:44:18 +03:00
|
|
|
}
|
|
|
|
|
2010-10-13 01:01:59 +04:00
|
|
|
public:
|
2013-08-01 03:18:06 +04:00
|
|
|
void fGetShaderPrecisionFormat(GLenum shadertype, GLenum precisiontype, GLint* range, GLint* precision) {
|
2014-03-31 13:10:49 +04:00
|
|
|
if (IsGLES()) {
|
2013-08-01 03:18:06 +04:00
|
|
|
raw_fGetShaderPrecisionFormat(shadertype, precisiontype, range, precision);
|
|
|
|
} else {
|
|
|
|
// Fall back to automatic values because almost all desktop hardware supports the OpenGL standard precisions.
|
|
|
|
GetShaderPrecisionFormatNonES2(shadertype, precisiontype, range, precision);
|
|
|
|
}
|
|
|
|
}
|
2012-12-19 11:16:01 +04:00
|
|
|
|
2013-08-01 03:18:06 +04:00
|
|
|
void fGetShaderSource(GLint obj, GLsizei maxLength, GLsizei* length, GLchar* source) {
|
|
|
|
BEFORE_GL_CALL;
|
|
|
|
mSymbols.fGetShaderSource(obj, maxLength, length, source);
|
|
|
|
AFTER_GL_CALL;
|
2010-09-21 23:41:24 +04:00
|
|
|
}
|
|
|
|
|
2015-01-16 02:40:39 +03:00
|
|
|
void fShaderSource(GLuint shader, GLsizei count, const GLchar* const* strings, const GLint* lengths) {
|
2013-08-01 03:18:06 +04:00
|
|
|
BEFORE_GL_CALL;
|
|
|
|
mSymbols.fShaderSource(shader, count, strings, lengths);
|
|
|
|
AFTER_GL_CALL;
|
2010-09-21 23:41:24 +04:00
|
|
|
}
|
|
|
|
|
2013-08-01 03:18:06 +04:00
|
|
|
private:
|
2015-02-13 06:00:41 +03:00
|
|
|
friend class SharedSurface;
|
|
|
|
|
2013-08-01 03:18:06 +04:00
|
|
|
void raw_fBindFramebuffer(GLenum target, GLuint framebuffer) {
|
|
|
|
BEFORE_GL_CALL;
|
|
|
|
mSymbols.fBindFramebuffer(target, framebuffer);
|
|
|
|
AFTER_GL_CALL;
|
2010-09-21 23:41:24 +04:00
|
|
|
}
|
|
|
|
|
2013-08-01 03:18:06 +04:00
|
|
|
public:
|
|
|
|
void fBindRenderbuffer(GLenum target, GLuint renderbuffer) {
|
|
|
|
BEFORE_GL_CALL;
|
|
|
|
mSymbols.fBindRenderbuffer(target, renderbuffer);
|
|
|
|
AFTER_GL_CALL;
|
2010-09-21 23:41:24 +04:00
|
|
|
}
|
|
|
|
|
2013-08-01 03:18:06 +04:00
|
|
|
GLenum fCheckFramebufferStatus(GLenum target) {
|
|
|
|
BEFORE_GL_CALL;
|
|
|
|
GLenum retval = mSymbols.fCheckFramebufferStatus(target);
|
|
|
|
AFTER_GL_CALL;
|
|
|
|
return retval;
|
|
|
|
}
|
2010-09-21 23:41:24 +04:00
|
|
|
|
2013-08-01 03:18:06 +04:00
|
|
|
void fFramebufferRenderbuffer(GLenum target, GLenum attachmentPoint, GLenum renderbufferTarget, GLuint renderbuffer) {
|
|
|
|
BEFORE_GL_CALL;
|
|
|
|
mSymbols.fFramebufferRenderbuffer(target, attachmentPoint, renderbufferTarget, renderbuffer);
|
|
|
|
AFTER_GL_CALL;
|
2010-09-21 23:41:24 +04:00
|
|
|
}
|
|
|
|
|
2013-08-01 03:18:06 +04:00
|
|
|
void fFramebufferTexture2D(GLenum target, GLenum attachmentPoint, GLenum textureTarget, GLuint texture, GLint level) {
|
|
|
|
BEFORE_GL_CALL;
|
|
|
|
mSymbols.fFramebufferTexture2D(target, attachmentPoint, textureTarget, texture, level);
|
|
|
|
AFTER_GL_CALL;
|
2016-09-08 17:29:44 +03:00
|
|
|
if (mNeedsCheckAfterAttachTextureToFb) {
|
|
|
|
fCheckFramebufferStatus(target);
|
|
|
|
}
|
2013-08-01 03:18:06 +04:00
|
|
|
}
|
2010-10-13 01:01:59 +04:00
|
|
|
|
2015-07-03 03:14:28 +03:00
|
|
|
void fFramebufferTextureLayer(GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer) {
|
|
|
|
BEFORE_GL_CALL;
|
|
|
|
ASSERT_SYMBOL_PRESENT(fFramebufferTextureLayer);
|
|
|
|
mSymbols.fFramebufferTextureLayer(target, attachment, texture, level, layer);
|
|
|
|
AFTER_GL_CALL;
|
|
|
|
}
|
|
|
|
|
2013-08-01 03:18:06 +04:00
|
|
|
void fGetFramebufferAttachmentParameteriv(GLenum target, GLenum attachment, GLenum pname, GLint* value) {
|
2010-10-13 01:01:59 +04:00
|
|
|
BEFORE_GL_CALL;
|
2013-08-01 03:18:06 +04:00
|
|
|
mSymbols.fGetFramebufferAttachmentParameteriv(target, attachment, pname, value);
|
2010-10-13 01:01:59 +04:00
|
|
|
AFTER_GL_CALL;
|
|
|
|
}
|
|
|
|
|
2013-08-01 03:18:06 +04:00
|
|
|
void fGetRenderbufferParameteriv(GLenum target, GLenum pname, GLint* value) {
|
|
|
|
BEFORE_GL_CALL;
|
|
|
|
mSymbols.fGetRenderbufferParameteriv(target, pname, value);
|
|
|
|
AFTER_GL_CALL;
|
2010-09-21 23:41:24 +04:00
|
|
|
}
|
|
|
|
|
2013-08-01 03:18:06 +04:00
|
|
|
realGLboolean fIsFramebuffer (GLuint framebuffer) {
|
|
|
|
BEFORE_GL_CALL;
|
|
|
|
realGLboolean retval = mSymbols.fIsFramebuffer(framebuffer);
|
|
|
|
AFTER_GL_CALL;
|
|
|
|
return retval;
|
2010-09-21 23:41:24 +04:00
|
|
|
}
|
|
|
|
|
2013-08-01 03:18:06 +04:00
|
|
|
public:
|
|
|
|
realGLboolean fIsRenderbuffer (GLuint renderbuffer) {
|
|
|
|
BEFORE_GL_CALL;
|
|
|
|
realGLboolean retval = mSymbols.fIsRenderbuffer(renderbuffer);
|
|
|
|
AFTER_GL_CALL;
|
|
|
|
return retval;
|
2010-09-21 23:41:24 +04:00
|
|
|
}
|
|
|
|
|
2013-08-01 03:18:06 +04:00
|
|
|
void fRenderbufferStorage(GLenum target, GLenum internalFormat, GLsizei width, GLsizei height) {
|
|
|
|
BEFORE_GL_CALL;
|
|
|
|
mSymbols.fRenderbufferStorage(target, internalFormat, width, height);
|
|
|
|
AFTER_GL_CALL;
|
2010-09-21 23:41:24 +04:00
|
|
|
}
|
|
|
|
|
2013-08-01 03:18:06 +04:00
|
|
|
private:
|
|
|
|
void raw_fDepthRange(GLclampf a, GLclampf b) {
|
2014-03-31 13:10:49 +04:00
|
|
|
MOZ_ASSERT(!IsGLES());
|
2010-09-21 23:41:24 +04:00
|
|
|
|
2013-08-01 03:18:06 +04:00
|
|
|
BEFORE_GL_CALL;
|
|
|
|
ASSERT_SYMBOL_PRESENT(fDepthRange);
|
|
|
|
mSymbols.fDepthRange(a, b);
|
|
|
|
AFTER_GL_CALL;
|
2010-09-21 23:41:24 +04:00
|
|
|
}
|
|
|
|
|
2013-08-01 03:18:06 +04:00
|
|
|
void raw_fDepthRangef(GLclampf a, GLclampf b) {
|
2014-03-31 13:10:49 +04:00
|
|
|
MOZ_ASSERT(IsGLES());
|
2010-09-21 23:41:24 +04:00
|
|
|
|
2010-10-13 01:01:59 +04:00
|
|
|
BEFORE_GL_CALL;
|
2013-08-01 03:18:06 +04:00
|
|
|
ASSERT_SYMBOL_PRESENT(fDepthRangef);
|
|
|
|
mSymbols.fDepthRangef(a, b);
|
2010-10-13 01:01:59 +04:00
|
|
|
AFTER_GL_CALL;
|
|
|
|
}
|
2010-09-21 23:41:24 +04:00
|
|
|
|
2013-08-01 03:18:06 +04:00
|
|
|
void raw_fClearDepth(GLclampf v) {
|
2014-03-31 13:10:49 +04:00
|
|
|
MOZ_ASSERT(!IsGLES());
|
2013-08-01 03:18:06 +04:00
|
|
|
|
2010-10-13 01:01:59 +04:00
|
|
|
BEFORE_GL_CALL;
|
2013-08-01 03:18:06 +04:00
|
|
|
ASSERT_SYMBOL_PRESENT(fClearDepth);
|
|
|
|
mSymbols.fClearDepth(v);
|
2010-10-13 01:01:59 +04:00
|
|
|
AFTER_GL_CALL;
|
|
|
|
}
|
2010-09-21 23:41:24 +04:00
|
|
|
|
2013-08-01 03:18:06 +04:00
|
|
|
void raw_fClearDepthf(GLclampf v) {
|
2014-03-31 13:10:49 +04:00
|
|
|
MOZ_ASSERT(IsGLES());
|
2013-08-01 03:18:06 +04:00
|
|
|
|
2012-11-01 20:11:42 +04:00
|
|
|
BEFORE_GL_CALL;
|
2013-08-01 03:18:06 +04:00
|
|
|
ASSERT_SYMBOL_PRESENT(fClearDepthf);
|
|
|
|
mSymbols.fClearDepthf(v);
|
2012-11-01 20:11:42 +04:00
|
|
|
AFTER_GL_CALL;
|
|
|
|
}
|
|
|
|
|
2013-08-01 03:18:06 +04:00
|
|
|
public:
|
|
|
|
void fDepthRange(GLclampf a, GLclampf b) {
|
2014-03-31 13:10:49 +04:00
|
|
|
if (IsGLES()) {
|
2013-08-01 03:18:06 +04:00
|
|
|
raw_fDepthRangef(a, b);
|
|
|
|
} else {
|
|
|
|
raw_fDepthRange(a, b);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void fClearDepth(GLclampf v) {
|
2014-03-31 13:10:49 +04:00
|
|
|
if (IsGLES()) {
|
2013-08-01 03:18:06 +04:00
|
|
|
raw_fClearDepthf(v);
|
|
|
|
} else {
|
|
|
|
raw_fClearDepth(v);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void* fMapBuffer(GLenum target, GLenum access) {
|
2010-10-13 01:01:59 +04:00
|
|
|
BEFORE_GL_CALL;
|
2013-08-01 03:18:06 +04:00
|
|
|
ASSERT_SYMBOL_PRESENT(fMapBuffer);
|
2016-06-11 04:37:07 +03:00
|
|
|
void* ret = mSymbols.fMapBuffer(target, access);
|
2010-10-13 01:01:59 +04:00
|
|
|
AFTER_GL_CALL;
|
2013-08-01 03:18:06 +04:00
|
|
|
return ret;
|
2010-10-13 01:01:59 +04:00
|
|
|
}
|
2010-09-21 23:41:24 +04:00
|
|
|
|
2013-08-01 03:18:06 +04:00
|
|
|
realGLboolean fUnmapBuffer(GLenum target) {
|
2010-10-13 01:01:59 +04:00
|
|
|
BEFORE_GL_CALL;
|
2013-08-01 03:18:06 +04:00
|
|
|
ASSERT_SYMBOL_PRESENT(fUnmapBuffer);
|
|
|
|
realGLboolean ret = mSymbols.fUnmapBuffer(target);
|
2010-10-13 01:01:59 +04:00
|
|
|
AFTER_GL_CALL;
|
2013-08-01 03:18:06 +04:00
|
|
|
return ret;
|
2010-10-13 01:01:59 +04:00
|
|
|
}
|
2010-07-19 09:01:14 +04:00
|
|
|
|
2013-08-01 03:18:06 +04:00
|
|
|
|
|
|
|
private:
|
2014-03-06 05:35:40 +04:00
|
|
|
GLuint raw_fCreateProgram() {
|
2010-10-13 01:01:59 +04:00
|
|
|
BEFORE_GL_CALL;
|
2013-08-01 03:18:06 +04:00
|
|
|
GLuint ret = mSymbols.fCreateProgram();
|
2010-10-13 01:01:59 +04:00
|
|
|
AFTER_GL_CALL;
|
2013-08-01 03:18:06 +04:00
|
|
|
return ret;
|
2010-10-13 01:01:59 +04:00
|
|
|
}
|
2010-07-19 09:01:14 +04:00
|
|
|
|
2014-03-06 05:35:40 +04:00
|
|
|
GLuint raw_fCreateShader(GLenum t) {
|
2010-10-13 01:01:59 +04:00
|
|
|
BEFORE_GL_CALL;
|
2013-08-01 03:18:06 +04:00
|
|
|
GLuint ret = mSymbols.fCreateShader(t);
|
2010-10-13 01:01:59 +04:00
|
|
|
AFTER_GL_CALL;
|
2013-08-01 03:18:06 +04:00
|
|
|
return ret;
|
2010-07-19 09:01:14 +04:00
|
|
|
}
|
|
|
|
|
2014-03-06 05:35:40 +04:00
|
|
|
void raw_fGenBuffers(GLsizei n, GLuint* names) {
|
2010-10-13 01:01:59 +04:00
|
|
|
BEFORE_GL_CALL;
|
2013-08-01 03:18:06 +04:00
|
|
|
mSymbols.fGenBuffers(n, names);
|
2010-10-13 01:01:59 +04:00
|
|
|
AFTER_GL_CALL;
|
2010-07-19 09:01:14 +04:00
|
|
|
}
|
|
|
|
|
2014-03-06 05:35:40 +04:00
|
|
|
void raw_fGenFramebuffers(GLsizei n, GLuint* names) {
|
2010-10-13 01:01:59 +04:00
|
|
|
BEFORE_GL_CALL;
|
2013-08-01 03:18:06 +04:00
|
|
|
mSymbols.fGenFramebuffers(n, names);
|
2010-10-13 01:01:59 +04:00
|
|
|
AFTER_GL_CALL;
|
2010-07-19 09:01:14 +04:00
|
|
|
}
|
|
|
|
|
2014-03-06 05:35:40 +04:00
|
|
|
void raw_fGenRenderbuffers(GLsizei n, GLuint* names) {
|
2010-10-13 01:01:59 +04:00
|
|
|
BEFORE_GL_CALL;
|
2013-08-01 03:18:06 +04:00
|
|
|
mSymbols.fGenRenderbuffers(n, names);
|
2010-10-13 01:01:59 +04:00
|
|
|
AFTER_GL_CALL;
|
2010-07-19 09:01:14 +04:00
|
|
|
}
|
|
|
|
|
2014-03-06 05:35:40 +04:00
|
|
|
void raw_fGenTextures(GLsizei n, GLuint* names) {
|
2010-10-13 01:01:59 +04:00
|
|
|
BEFORE_GL_CALL;
|
2013-08-01 03:18:06 +04:00
|
|
|
mSymbols.fGenTextures(n, names);
|
2012-12-19 11:16:01 +04:00
|
|
|
AFTER_GL_CALL;
|
|
|
|
}
|
|
|
|
|
|
|
|
public:
|
2013-08-01 03:18:06 +04:00
|
|
|
GLuint fCreateProgram() {
|
|
|
|
GLuint ret = raw_fCreateProgram();
|
|
|
|
TRACKING_CONTEXT(CreatedProgram(this, ret));
|
|
|
|
return ret;
|
|
|
|
}
|
2012-04-16 23:56:12 +04:00
|
|
|
|
2013-08-01 03:18:06 +04:00
|
|
|
GLuint fCreateShader(GLenum t) {
|
|
|
|
GLuint ret = raw_fCreateShader(t);
|
|
|
|
TRACKING_CONTEXT(CreatedShader(this, ret));
|
|
|
|
return ret;
|
2010-07-19 09:01:14 +04:00
|
|
|
}
|
|
|
|
|
2013-08-01 03:18:06 +04:00
|
|
|
void fGenBuffers(GLsizei n, GLuint* names) {
|
|
|
|
raw_fGenBuffers(n, names);
|
|
|
|
TRACKING_CONTEXT(CreatedBuffers(this, n, names));
|
|
|
|
}
|
|
|
|
|
|
|
|
void fGenFramebuffers(GLsizei n, GLuint* names) {
|
|
|
|
raw_fGenFramebuffers(n, names);
|
|
|
|
TRACKING_CONTEXT(CreatedFramebuffers(this, n, names));
|
|
|
|
}
|
|
|
|
|
|
|
|
void fGenRenderbuffers(GLsizei n, GLuint* names) {
|
|
|
|
raw_fGenRenderbuffers(n, names);
|
|
|
|
TRACKING_CONTEXT(CreatedRenderbuffers(this, n, names));
|
|
|
|
}
|
|
|
|
|
|
|
|
void fGenTextures(GLsizei n, GLuint* names) {
|
|
|
|
raw_fGenTextures(n, names);
|
|
|
|
TRACKING_CONTEXT(CreatedTextures(this, n, names));
|
2010-07-19 09:01:14 +04:00
|
|
|
}
|
|
|
|
|
2012-12-19 11:16:01 +04:00
|
|
|
private:
|
2014-03-06 05:35:40 +04:00
|
|
|
void raw_fDeleteProgram(GLuint program) {
|
2010-10-13 01:01:59 +04:00
|
|
|
BEFORE_GL_CALL;
|
2013-08-01 03:18:06 +04:00
|
|
|
mSymbols.fDeleteProgram(program);
|
2010-10-13 01:01:59 +04:00
|
|
|
AFTER_GL_CALL;
|
2010-07-19 09:01:14 +04:00
|
|
|
}
|
|
|
|
|
2014-03-06 05:35:40 +04:00
|
|
|
void raw_fDeleteShader(GLuint shader) {
|
2010-10-13 01:01:59 +04:00
|
|
|
BEFORE_GL_CALL;
|
2013-08-01 03:18:06 +04:00
|
|
|
mSymbols.fDeleteShader(shader);
|
2010-10-13 01:01:59 +04:00
|
|
|
AFTER_GL_CALL;
|
2010-07-19 09:01:14 +04:00
|
|
|
}
|
|
|
|
|
2014-03-06 05:35:40 +04:00
|
|
|
void raw_fDeleteBuffers(GLsizei n, const GLuint* names) {
|
2010-10-13 01:01:59 +04:00
|
|
|
BEFORE_GL_CALL;
|
2013-08-01 03:18:06 +04:00
|
|
|
mSymbols.fDeleteBuffers(n, names);
|
2010-10-13 01:01:59 +04:00
|
|
|
AFTER_GL_CALL;
|
2010-07-19 09:01:14 +04:00
|
|
|
}
|
|
|
|
|
2014-03-06 05:35:40 +04:00
|
|
|
void raw_fDeleteFramebuffers(GLsizei n, const GLuint* names) {
|
2010-10-13 01:01:59 +04:00
|
|
|
BEFORE_GL_CALL;
|
2013-08-01 03:18:06 +04:00
|
|
|
mSymbols.fDeleteFramebuffers(n, names);
|
2012-05-08 21:29:31 +04:00
|
|
|
AFTER_GL_CALL;
|
|
|
|
}
|
|
|
|
|
2014-03-06 05:35:40 +04:00
|
|
|
void raw_fDeleteRenderbuffers(GLsizei n, const GLuint* names) {
|
2012-05-08 21:29:31 +04:00
|
|
|
BEFORE_GL_CALL;
|
2013-08-01 03:18:06 +04:00
|
|
|
mSymbols.fDeleteRenderbuffers(n, names);
|
2012-05-08 21:29:31 +04:00
|
|
|
AFTER_GL_CALL;
|
|
|
|
}
|
|
|
|
|
2014-03-06 05:35:40 +04:00
|
|
|
void raw_fDeleteTextures(GLsizei n, const GLuint* names) {
|
2012-05-08 21:29:31 +04:00
|
|
|
BEFORE_GL_CALL;
|
2013-08-01 03:18:06 +04:00
|
|
|
mSymbols.fDeleteTextures(n, names);
|
2010-10-13 01:01:59 +04:00
|
|
|
AFTER_GL_CALL;
|
2010-07-19 09:01:14 +04:00
|
|
|
}
|
|
|
|
|
2013-08-01 03:18:06 +04:00
|
|
|
public:
|
|
|
|
|
|
|
|
void fDeleteProgram(GLuint program) {
|
|
|
|
raw_fDeleteProgram(program);
|
|
|
|
TRACKING_CONTEXT(DeletedProgram(this, program));
|
|
|
|
}
|
|
|
|
|
|
|
|
void fDeleteShader(GLuint shader) {
|
|
|
|
raw_fDeleteShader(shader);
|
|
|
|
TRACKING_CONTEXT(DeletedShader(this, shader));
|
|
|
|
}
|
|
|
|
|
2014-02-09 06:06:08 +04:00
|
|
|
void fDeleteBuffers(GLsizei n, const GLuint* names) {
|
2013-08-01 03:18:06 +04:00
|
|
|
raw_fDeleteBuffers(n, names);
|
|
|
|
TRACKING_CONTEXT(DeletedBuffers(this, n, names));
|
|
|
|
}
|
|
|
|
|
2015-07-15 03:37:28 +03:00
|
|
|
void fDeleteFramebuffers(GLsizei n, const GLuint* names);
|
2013-08-01 03:18:06 +04:00
|
|
|
|
2014-02-09 06:06:08 +04:00
|
|
|
void fDeleteRenderbuffers(GLsizei n, const GLuint* names) {
|
2013-08-01 03:18:06 +04:00
|
|
|
raw_fDeleteRenderbuffers(n, names);
|
|
|
|
TRACKING_CONTEXT(DeletedRenderbuffers(this, n, names));
|
2010-10-13 01:01:59 +04:00
|
|
|
}
|
|
|
|
|
2014-02-09 06:06:08 +04:00
|
|
|
void fDeleteTextures(GLsizei n, const GLuint* names) {
|
2013-08-01 03:18:06 +04:00
|
|
|
raw_fDeleteTextures(n, names);
|
|
|
|
TRACKING_CONTEXT(DeletedTextures(this, n, names));
|
2010-10-13 01:01:59 +04:00
|
|
|
}
|
|
|
|
|
2014-03-06 05:35:40 +04:00
|
|
|
GLenum fGetGraphicsResetStatus() {
|
2010-10-13 01:01:59 +04:00
|
|
|
BEFORE_GL_CALL;
|
2013-08-01 03:18:06 +04:00
|
|
|
ASSERT_SYMBOL_PRESENT(fGetGraphicsResetStatus);
|
|
|
|
GLenum ret = mSymbols.fGetGraphicsResetStatus();
|
2010-10-13 01:01:59 +04:00
|
|
|
AFTER_GL_CALL;
|
2013-08-01 03:18:06 +04:00
|
|
|
return ret;
|
2010-10-13 01:01:59 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2013-08-01 03:18:06 +04:00
|
|
|
// -----------------------------------------------------------------------------
|
|
|
|
// Extension ARB_sync (GL)
|
|
|
|
public:
|
2014-03-06 05:35:40 +04:00
|
|
|
GLsync fFenceSync(GLenum condition, GLbitfield flags) {
|
2012-11-01 20:11:42 +04:00
|
|
|
BEFORE_GL_CALL;
|
2013-08-01 03:18:06 +04:00
|
|
|
ASSERT_SYMBOL_PRESENT(fFenceSync);
|
|
|
|
GLsync ret = mSymbols.fFenceSync(condition, flags);
|
2012-11-01 20:11:42 +04:00
|
|
|
AFTER_GL_CALL;
|
2013-08-01 03:18:06 +04:00
|
|
|
return ret;
|
2012-11-01 20:11:42 +04:00
|
|
|
}
|
|
|
|
|
2014-03-06 05:35:40 +04:00
|
|
|
realGLboolean fIsSync(GLsync sync) {
|
2012-11-01 20:11:42 +04:00
|
|
|
BEFORE_GL_CALL;
|
2013-08-01 03:18:06 +04:00
|
|
|
ASSERT_SYMBOL_PRESENT(fIsSync);
|
|
|
|
realGLboolean ret = mSymbols.fIsSync(sync);
|
2012-11-01 20:11:42 +04:00
|
|
|
AFTER_GL_CALL;
|
2013-08-01 03:18:06 +04:00
|
|
|
return ret;
|
2012-11-01 20:11:42 +04:00
|
|
|
}
|
|
|
|
|
2014-03-06 05:35:40 +04:00
|
|
|
void fDeleteSync(GLsync sync) {
|
2010-10-13 01:01:59 +04:00
|
|
|
BEFORE_GL_CALL;
|
2013-08-01 03:18:06 +04:00
|
|
|
ASSERT_SYMBOL_PRESENT(fDeleteSync);
|
|
|
|
mSymbols.fDeleteSync(sync);
|
2010-10-13 01:01:59 +04:00
|
|
|
AFTER_GL_CALL;
|
|
|
|
}
|
|
|
|
|
2014-03-06 05:35:40 +04:00
|
|
|
GLenum fClientWaitSync(GLsync sync, GLbitfield flags, GLuint64 timeout) {
|
2010-10-13 01:01:59 +04:00
|
|
|
BEFORE_GL_CALL;
|
2013-08-01 03:18:06 +04:00
|
|
|
ASSERT_SYMBOL_PRESENT(fClientWaitSync);
|
|
|
|
GLenum ret = mSymbols.fClientWaitSync(sync, flags, timeout);
|
2010-10-13 01:01:59 +04:00
|
|
|
AFTER_GL_CALL;
|
2013-08-01 03:18:06 +04:00
|
|
|
return ret;
|
2010-10-13 01:01:59 +04:00
|
|
|
}
|
|
|
|
|
2014-03-06 05:35:40 +04:00
|
|
|
void fWaitSync(GLsync sync, GLbitfield flags, GLuint64 timeout) {
|
2010-10-13 01:01:59 +04:00
|
|
|
BEFORE_GL_CALL;
|
2013-08-01 03:18:06 +04:00
|
|
|
ASSERT_SYMBOL_PRESENT(fWaitSync);
|
|
|
|
mSymbols.fWaitSync(sync, flags, timeout);
|
2010-10-13 01:01:59 +04:00
|
|
|
AFTER_GL_CALL;
|
|
|
|
}
|
|
|
|
|
2016-06-11 04:37:07 +03:00
|
|
|
void fGetInteger64v(GLenum pname, GLint64* params) {
|
2010-10-13 01:01:59 +04:00
|
|
|
BEFORE_GL_CALL;
|
2013-08-01 03:18:06 +04:00
|
|
|
ASSERT_SYMBOL_PRESENT(fGetInteger64v);
|
|
|
|
mSymbols.fGetInteger64v(pname, params);
|
2010-10-13 01:01:59 +04:00
|
|
|
AFTER_GL_CALL;
|
|
|
|
}
|
|
|
|
|
2016-06-11 04:37:07 +03:00
|
|
|
void fGetSynciv(GLsync sync, GLenum pname, GLsizei bufSize, GLsizei* length, GLint* values) {
|
2012-11-01 20:11:42 +04:00
|
|
|
BEFORE_GL_CALL;
|
2013-08-01 03:18:06 +04:00
|
|
|
ASSERT_SYMBOL_PRESENT(fGetSynciv);
|
|
|
|
mSymbols.fGetSynciv(sync, pname, bufSize, length, values);
|
2012-11-01 20:11:42 +04:00
|
|
|
AFTER_GL_CALL;
|
|
|
|
}
|
|
|
|
|
2010-10-13 01:01:59 +04:00
|
|
|
|
2013-08-01 03:18:06 +04:00
|
|
|
// -----------------------------------------------------------------------------
|
|
|
|
// Extension OES_EGL_image (GLES)
|
|
|
|
public:
|
|
|
|
void fEGLImageTargetTexture2D(GLenum target, GLeglImage image) {
|
2010-10-13 01:01:59 +04:00
|
|
|
BEFORE_GL_CALL;
|
2013-08-01 03:18:06 +04:00
|
|
|
ASSERT_SYMBOL_PRESENT(fEGLImageTargetTexture2D);
|
|
|
|
mSymbols.fEGLImageTargetTexture2D(target, image);
|
2010-10-13 01:01:59 +04:00
|
|
|
AFTER_GL_CALL;
|
2014-09-10 05:40:51 +04:00
|
|
|
mHeavyGLCallsSinceLastFlush = true;
|
2010-10-13 01:01:59 +04:00
|
|
|
}
|
|
|
|
|
2013-08-01 03:18:06 +04:00
|
|
|
void fEGLImageTargetRenderbufferStorage(GLenum target, GLeglImage image)
|
|
|
|
{
|
2010-10-13 01:01:59 +04:00
|
|
|
BEFORE_GL_CALL;
|
2013-08-01 03:18:06 +04:00
|
|
|
ASSERT_SYMBOL_PRESENT(fEGLImageTargetRenderbufferStorage);
|
|
|
|
mSymbols.fEGLImageTargetRenderbufferStorage(target, image);
|
2010-10-13 01:01:59 +04:00
|
|
|
AFTER_GL_CALL;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2013-08-20 19:36:20 +04:00
|
|
|
// -----------------------------------------------------------------------------
|
|
|
|
// Package XXX_bind_buffer_offset
|
|
|
|
public:
|
|
|
|
void fBindBufferOffset(GLenum target, GLuint index, GLuint buffer, GLintptr offset)
|
|
|
|
{
|
|
|
|
BEFORE_GL_CALL;
|
|
|
|
ASSERT_SYMBOL_PRESENT(fBindBufferOffset);
|
|
|
|
mSymbols.fBindBufferOffset(target, index, buffer, offset);
|
|
|
|
AFTER_GL_CALL;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2013-08-01 03:18:06 +04:00
|
|
|
// -----------------------------------------------------------------------------
|
|
|
|
// Package XXX_draw_buffers
|
|
|
|
public:
|
|
|
|
void fDrawBuffers(GLsizei n, const GLenum* bufs) {
|
2010-10-13 01:01:59 +04:00
|
|
|
BEFORE_GL_CALL;
|
2015-11-25 07:15:29 +03:00
|
|
|
ASSERT_SYMBOL_PRESENT(fDrawBuffers);
|
2013-08-01 03:18:06 +04:00
|
|
|
mSymbols.fDrawBuffers(n, bufs);
|
2010-10-13 01:01:59 +04:00
|
|
|
AFTER_GL_CALL;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2013-08-01 03:18:06 +04:00
|
|
|
// -----------------------------------------------------------------------------
|
|
|
|
// Package XXX_draw_instanced
|
|
|
|
public:
|
|
|
|
void fDrawArraysInstanced(GLenum mode, GLint first, GLsizei count, GLsizei primcount)
|
|
|
|
{
|
2013-08-02 02:27:54 +04:00
|
|
|
BeforeGLDrawCall();
|
2014-03-21 08:20:02 +04:00
|
|
|
raw_fDrawArraysInstanced(mode, first, count, primcount);
|
|
|
|
AfterGLDrawCall();
|
|
|
|
}
|
|
|
|
|
|
|
|
void fDrawElementsInstanced(GLenum mode, GLsizei count, GLenum type, const GLvoid* indices, GLsizei primcount)
|
|
|
|
{
|
|
|
|
BeforeGLDrawCall();
|
|
|
|
raw_fDrawElementsInstanced(mode, count, type, indices, primcount);
|
|
|
|
AfterGLDrawCall();
|
|
|
|
}
|
|
|
|
|
|
|
|
private:
|
|
|
|
void raw_fDrawArraysInstanced(GLenum mode, GLint first, GLsizei count, GLsizei primcount)
|
|
|
|
{
|
2010-10-13 01:01:59 +04:00
|
|
|
BEFORE_GL_CALL;
|
2013-08-01 03:18:06 +04:00
|
|
|
ASSERT_SYMBOL_PRESENT(fDrawArraysInstanced);
|
|
|
|
mSymbols.fDrawArraysInstanced(mode, first, count, primcount);
|
2010-10-13 01:01:59 +04:00
|
|
|
AFTER_GL_CALL;
|
|
|
|
}
|
|
|
|
|
2014-03-21 08:20:02 +04:00
|
|
|
void raw_fDrawElementsInstanced(GLenum mode, GLsizei count, GLenum type, const GLvoid* indices, GLsizei primcount)
|
2013-08-01 03:18:06 +04:00
|
|
|
{
|
2012-11-01 20:11:42 +04:00
|
|
|
BEFORE_GL_CALL;
|
2013-08-01 03:18:06 +04:00
|
|
|
ASSERT_SYMBOL_PRESENT(fDrawElementsInstanced);
|
|
|
|
mSymbols.fDrawElementsInstanced(mode, count, type, indices, primcount);
|
2012-11-01 20:11:42 +04:00
|
|
|
AFTER_GL_CALL;
|
|
|
|
}
|
|
|
|
|
2014-03-17 18:50:15 +04:00
|
|
|
// -----------------------------------------------------------------------------
|
|
|
|
// Feature draw_range_elements
|
|
|
|
public:
|
|
|
|
void fDrawRangeElements(GLenum mode, GLuint start, GLuint end,
|
|
|
|
GLsizei count, GLenum type, const GLvoid* indices)
|
2014-03-21 08:20:02 +04:00
|
|
|
{
|
|
|
|
BeforeGLDrawCall();
|
|
|
|
raw_fDrawRangeElements(mode, start, end, count, type, indices);
|
|
|
|
AfterGLDrawCall();
|
|
|
|
}
|
|
|
|
|
|
|
|
private:
|
|
|
|
void raw_fDrawRangeElements(GLenum mode, GLuint start, GLuint end,
|
|
|
|
GLsizei count, GLenum type, const GLvoid* indices)
|
2014-03-17 18:50:15 +04:00
|
|
|
{
|
|
|
|
BEFORE_GL_CALL;
|
|
|
|
ASSERT_SYMBOL_PRESENT(fDrawRangeElements);
|
|
|
|
mSymbols.fDrawRangeElements(mode, start, end, count, type, indices);
|
|
|
|
AFTER_GL_CALL;
|
|
|
|
}
|
2012-11-01 20:11:42 +04:00
|
|
|
|
2013-08-01 03:18:06 +04:00
|
|
|
// -----------------------------------------------------------------------------
|
|
|
|
// Package XXX_framebuffer_blit
|
|
|
|
public:
|
|
|
|
// Draw/Read
|
|
|
|
void fBlitFramebuffer(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter) {
|
|
|
|
BeforeGLDrawCall();
|
|
|
|
BeforeGLReadCall();
|
|
|
|
raw_fBlitFramebuffer(srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter);
|
|
|
|
AfterGLReadCall();
|
|
|
|
AfterGLDrawCall();
|
2012-11-01 20:11:42 +04:00
|
|
|
}
|
|
|
|
|
2013-08-01 03:18:06 +04:00
|
|
|
|
2012-02-10 05:57:26 +04:00
|
|
|
private:
|
2013-08-01 03:18:06 +04:00
|
|
|
void raw_fBlitFramebuffer(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter) {
|
2010-10-13 01:01:59 +04:00
|
|
|
BEFORE_GL_CALL;
|
2013-08-01 03:18:06 +04:00
|
|
|
ASSERT_SYMBOL_PRESENT(fBlitFramebuffer);
|
|
|
|
mSymbols.fBlitFramebuffer(srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter);
|
2010-10-13 01:01:59 +04:00
|
|
|
AFTER_GL_CALL;
|
|
|
|
}
|
|
|
|
|
2012-08-22 07:30:20 +04:00
|
|
|
|
2013-08-01 03:18:06 +04:00
|
|
|
// -----------------------------------------------------------------------------
|
|
|
|
// Package XXX_framebuffer_multisample
|
|
|
|
public:
|
|
|
|
void fRenderbufferStorageMultisample(GLenum target, GLsizei samples, GLenum internalFormat, GLsizei width, GLsizei height) {
|
2010-10-13 01:01:59 +04:00
|
|
|
BEFORE_GL_CALL;
|
2013-08-01 03:18:06 +04:00
|
|
|
ASSERT_SYMBOL_PRESENT(fRenderbufferStorageMultisample);
|
|
|
|
mSymbols.fRenderbufferStorageMultisample(target, samples, internalFormat, width, height);
|
2010-10-13 01:01:59 +04:00
|
|
|
AFTER_GL_CALL;
|
|
|
|
}
|
|
|
|
|
2014-09-23 09:27:55 +04:00
|
|
|
// -----------------------------------------------------------------------------
|
|
|
|
// GL 3.0, GL ES 3.0 & EXT_gpu_shader4
|
|
|
|
public:
|
2015-07-20 10:54:41 +03:00
|
|
|
void fGetVertexAttribIiv(GLuint index, GLenum pname, GLint* params)
|
|
|
|
{
|
|
|
|
ASSERT_SYMBOL_PRESENT(fGetVertexAttribIiv);
|
|
|
|
BEFORE_GL_CALL;
|
|
|
|
mSymbols.fGetVertexAttribIiv(index, pname, params);
|
|
|
|
AFTER_GL_CALL;
|
|
|
|
}
|
|
|
|
|
|
|
|
void fGetVertexAttribIuiv(GLuint index, GLenum pname, GLuint* params)
|
|
|
|
{
|
|
|
|
ASSERT_SYMBOL_PRESENT(fGetVertexAttribIuiv);
|
|
|
|
BEFORE_GL_CALL;
|
|
|
|
mSymbols.fGetVertexAttribIuiv(index, pname, params);
|
|
|
|
AFTER_GL_CALL;
|
|
|
|
}
|
|
|
|
|
2014-09-23 09:27:55 +04:00
|
|
|
void fVertexAttribI4i(GLuint index, GLint x, GLint y, GLint z, GLint w)
|
|
|
|
{
|
|
|
|
BEFORE_GL_CALL;
|
|
|
|
ASSERT_SYMBOL_PRESENT(fVertexAttribI4i);
|
|
|
|
mSymbols.fVertexAttribI4i(index, x, y, z, w);
|
|
|
|
AFTER_GL_CALL;
|
|
|
|
}
|
|
|
|
|
|
|
|
void fVertexAttribI4iv(GLuint index, const GLint* v)
|
|
|
|
{
|
|
|
|
BEFORE_GL_CALL;
|
|
|
|
ASSERT_SYMBOL_PRESENT(fVertexAttribI4iv);
|
|
|
|
mSymbols.fVertexAttribI4iv(index, v);
|
|
|
|
AFTER_GL_CALL;
|
|
|
|
}
|
|
|
|
|
|
|
|
void fVertexAttribI4ui(GLuint index, GLuint x, GLuint y, GLuint z, GLuint w)
|
|
|
|
{
|
|
|
|
BEFORE_GL_CALL;
|
|
|
|
ASSERT_SYMBOL_PRESENT(fVertexAttribI4ui);
|
|
|
|
mSymbols.fVertexAttribI4ui(index, x, y, z, w);
|
|
|
|
AFTER_GL_CALL;
|
|
|
|
}
|
|
|
|
|
|
|
|
void fVertexAttribI4uiv(GLuint index, const GLuint* v)
|
|
|
|
{
|
|
|
|
BEFORE_GL_CALL;
|
|
|
|
ASSERT_SYMBOL_PRESENT(fVertexAttribI4uiv);
|
|
|
|
mSymbols.fVertexAttribI4uiv(index, v);
|
|
|
|
AFTER_GL_CALL;
|
|
|
|
}
|
|
|
|
|
|
|
|
void fVertexAttribIPointer(GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid* offset)
|
|
|
|
{
|
|
|
|
BEFORE_GL_CALL;
|
|
|
|
ASSERT_SYMBOL_PRESENT(fVertexAttribIPointer);
|
|
|
|
mSymbols.fVertexAttribIPointer(index, size, type, stride, offset);
|
|
|
|
AFTER_GL_CALL;
|
|
|
|
}
|
|
|
|
|
|
|
|
void fUniform1ui(GLint location, GLuint v0) {
|
|
|
|
BEFORE_GL_CALL;
|
|
|
|
ASSERT_SYMBOL_PRESENT(fUniform1ui);
|
|
|
|
mSymbols.fUniform1ui(location, v0);
|
|
|
|
AFTER_GL_CALL;
|
|
|
|
}
|
|
|
|
|
|
|
|
void fUniform2ui(GLint location, GLuint v0, GLuint v1) {
|
|
|
|
BEFORE_GL_CALL;
|
|
|
|
ASSERT_SYMBOL_PRESENT(fUniform2ui);
|
|
|
|
mSymbols.fUniform2ui(location, v0, v1);
|
|
|
|
AFTER_GL_CALL;
|
|
|
|
}
|
|
|
|
|
|
|
|
void fUniform3ui(GLint location, GLuint v0, GLuint v1, GLuint v2) {
|
|
|
|
BEFORE_GL_CALL;
|
|
|
|
ASSERT_SYMBOL_PRESENT(fUniform3ui);
|
|
|
|
mSymbols.fUniform3ui(location, v0, v1, v2);
|
|
|
|
AFTER_GL_CALL;
|
|
|
|
}
|
|
|
|
|
|
|
|
void fUniform4ui(GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3) {
|
|
|
|
BEFORE_GL_CALL;
|
|
|
|
ASSERT_SYMBOL_PRESENT(fUniform4ui);
|
|
|
|
mSymbols.fUniform4ui(location, v0, v1, v2, v3);
|
|
|
|
AFTER_GL_CALL;
|
|
|
|
}
|
|
|
|
|
|
|
|
void fUniform1uiv(GLint location, GLsizei count, const GLuint* value) {
|
|
|
|
BEFORE_GL_CALL;
|
|
|
|
ASSERT_SYMBOL_PRESENT(fUniform1uiv);
|
|
|
|
mSymbols.fUniform1uiv(location, count, value);
|
|
|
|
AFTER_GL_CALL;
|
|
|
|
}
|
|
|
|
|
|
|
|
void fUniform2uiv(GLint location, GLsizei count, const GLuint* value) {
|
|
|
|
BEFORE_GL_CALL;
|
|
|
|
ASSERT_SYMBOL_PRESENT(fUniform2uiv);
|
|
|
|
mSymbols.fUniform2uiv(location, count, value);
|
|
|
|
AFTER_GL_CALL;
|
|
|
|
}
|
|
|
|
|
|
|
|
void fUniform3uiv(GLint location, GLsizei count, const GLuint* value) {
|
|
|
|
BEFORE_GL_CALL;
|
|
|
|
ASSERT_SYMBOL_PRESENT(fUniform3uiv);
|
|
|
|
mSymbols.fUniform3uiv(location, count, value);
|
|
|
|
AFTER_GL_CALL;
|
|
|
|
}
|
|
|
|
|
|
|
|
void fUniform4uiv(GLint location, GLsizei count, const GLuint* value) {
|
|
|
|
BEFORE_GL_CALL;
|
|
|
|
ASSERT_SYMBOL_PRESENT(fUniform4uiv);
|
|
|
|
mSymbols.fUniform4uiv(location, count, value);
|
|
|
|
AFTER_GL_CALL;
|
|
|
|
}
|
|
|
|
|
|
|
|
GLint fGetFragDataLocation(GLuint program, const GLchar* name)
|
|
|
|
{
|
|
|
|
BEFORE_GL_CALL;
|
|
|
|
ASSERT_SYMBOL_PRESENT(fGetFragDataLocation);
|
|
|
|
GLint result = mSymbols.fGetFragDataLocation(program, name);
|
|
|
|
AFTER_GL_CALL;
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
2010-10-13 01:01:59 +04:00
|
|
|
|
2013-08-07 04:05:51 +04:00
|
|
|
// -----------------------------------------------------------------------------
|
|
|
|
// Package XXX_instanced_arrays
|
|
|
|
public:
|
|
|
|
void fVertexAttribDivisor(GLuint index, GLuint divisor)
|
|
|
|
{
|
|
|
|
BEFORE_GL_CALL;
|
|
|
|
ASSERT_SYMBOL_PRESENT(fVertexAttribDivisor);
|
|
|
|
mSymbols.fVertexAttribDivisor(index, divisor);
|
|
|
|
AFTER_GL_CALL;
|
|
|
|
}
|
|
|
|
|
2015-07-03 03:16:09 +03:00
|
|
|
// -----------------------------------------------------------------------------
|
|
|
|
// Feature internalformat_query
|
|
|
|
public:
|
|
|
|
void fGetInternalformativ(GLenum target, GLenum internalformat, GLenum pname, GLsizei bufSize, GLint* params) {
|
|
|
|
BEFORE_GL_CALL;
|
|
|
|
ASSERT_SYMBOL_PRESENT(fGetInternalformativ);
|
|
|
|
mSymbols.fGetInternalformativ(target, internalformat, pname, bufSize, params);
|
|
|
|
AFTER_GL_CALL;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2015-05-28 14:15:00 +03:00
|
|
|
// -----------------------------------------------------------------------------
|
|
|
|
// Package XXX_query_counter
|
|
|
|
/**
|
|
|
|
* XXX_query_counter:
|
|
|
|
* - depends on XXX_query_objects
|
|
|
|
* - provide all followed entry points
|
|
|
|
* - provide GL_TIMESTAMP
|
|
|
|
*/
|
|
|
|
public:
|
|
|
|
void fQueryCounter(GLuint id, GLenum target) {
|
|
|
|
BEFORE_GL_CALL;
|
|
|
|
ASSERT_SYMBOL_PRESENT(fQueryCounter);
|
|
|
|
mSymbols.fQueryCounter(id, target);
|
|
|
|
AFTER_GL_CALL;
|
|
|
|
}
|
|
|
|
|
2013-08-07 04:05:51 +04:00
|
|
|
|
2013-08-15 23:58:20 +04:00
|
|
|
// -----------------------------------------------------------------------------
|
|
|
|
// Package XXX_query_objects
|
|
|
|
/**
|
|
|
|
* XXX_query_objects:
|
|
|
|
* - provide all followed entry points
|
|
|
|
*
|
|
|
|
* XXX_occlusion_query2:
|
|
|
|
* - depends on XXX_query_objects
|
|
|
|
* - provide ANY_SAMPLES_PASSED
|
|
|
|
*
|
|
|
|
* XXX_occlusion_query_boolean:
|
|
|
|
* - depends on XXX_occlusion_query2
|
|
|
|
* - provide ANY_SAMPLES_PASSED_CONSERVATIVE
|
|
|
|
*/
|
|
|
|
public:
|
|
|
|
void fDeleteQueries(GLsizei n, const GLuint* names) {
|
|
|
|
BEFORE_GL_CALL;
|
|
|
|
ASSERT_SYMBOL_PRESENT(fDeleteQueries);
|
|
|
|
mSymbols.fDeleteQueries(n, names);
|
|
|
|
AFTER_GL_CALL;
|
|
|
|
TRACKING_CONTEXT(DeletedQueries(this, n, names));
|
|
|
|
}
|
|
|
|
|
|
|
|
void fGenQueries(GLsizei n, GLuint* names) {
|
|
|
|
BEFORE_GL_CALL;
|
|
|
|
ASSERT_SYMBOL_PRESENT(fGenQueries);
|
|
|
|
mSymbols.fGenQueries(n, names);
|
|
|
|
AFTER_GL_CALL;
|
|
|
|
TRACKING_CONTEXT(CreatedQueries(this, n, names));
|
|
|
|
}
|
|
|
|
|
|
|
|
void fGetQueryiv(GLenum target, GLenum pname, GLint* params) {
|
|
|
|
BEFORE_GL_CALL;
|
|
|
|
ASSERT_SYMBOL_PRESENT(fGetQueryiv);
|
|
|
|
mSymbols.fGetQueryiv(target, pname, params);
|
|
|
|
AFTER_GL_CALL;
|
|
|
|
}
|
|
|
|
|
|
|
|
void fGetQueryObjectuiv(GLuint id, GLenum pname, GLuint* params) {
|
|
|
|
BEFORE_GL_CALL;
|
|
|
|
ASSERT_SYMBOL_PRESENT(fGetQueryObjectuiv);
|
|
|
|
mSymbols.fGetQueryObjectuiv(id, pname, params);
|
|
|
|
AFTER_GL_CALL;
|
|
|
|
}
|
|
|
|
|
|
|
|
realGLboolean fIsQuery(GLuint query) {
|
|
|
|
BEFORE_GL_CALL;
|
|
|
|
ASSERT_SYMBOL_PRESENT(fIsQuery);
|
|
|
|
realGLboolean retval = mSymbols.fIsQuery(query);
|
|
|
|
AFTER_GL_CALL;
|
|
|
|
return retval;
|
|
|
|
}
|
|
|
|
|
2015-05-28 14:15:00 +03:00
|
|
|
// -----------------------------------------------------------------------------
|
|
|
|
// Package XXX_get_query_object_i64v
|
|
|
|
/**
|
|
|
|
* XXX_get_query_object_i64v:
|
|
|
|
* - depends on XXX_query_objects
|
|
|
|
* - provide the followed entry point
|
|
|
|
*/
|
|
|
|
public:
|
|
|
|
void fGetQueryObjecti64v(GLuint id, GLenum pname, GLint64* params) {
|
|
|
|
BEFORE_GL_CALL;
|
|
|
|
ASSERT_SYMBOL_PRESENT(fGetQueryObjecti64v);
|
|
|
|
mSymbols.fGetQueryObjecti64v(id, pname, params);
|
|
|
|
AFTER_GL_CALL;
|
|
|
|
}
|
|
|
|
|
|
|
|
void fGetQueryObjectui64v(GLuint id, GLenum pname, GLuint64* params) {
|
|
|
|
BEFORE_GL_CALL;
|
|
|
|
ASSERT_SYMBOL_PRESENT(fGetQueryObjectui64v);
|
|
|
|
mSymbols.fGetQueryObjectui64v(id, pname, params);
|
|
|
|
AFTER_GL_CALL;
|
|
|
|
}
|
|
|
|
|
2013-08-15 23:58:20 +04:00
|
|
|
|
|
|
|
// -----------------------------------------------------------------------------
|
|
|
|
// Package XXX_get_query_object_iv
|
|
|
|
/**
|
|
|
|
* XXX_get_query_object_iv:
|
|
|
|
* - depends on XXX_query_objects
|
|
|
|
* - provide the followed entry point
|
|
|
|
*
|
|
|
|
* XXX_occlusion_query:
|
|
|
|
* - depends on XXX_get_query_object_iv
|
|
|
|
* - provide LOCAL_GL_SAMPLES_PASSED
|
|
|
|
*/
|
|
|
|
public:
|
|
|
|
void fGetQueryObjectiv(GLuint id, GLenum pname, GLint* params) {
|
|
|
|
BEFORE_GL_CALL;
|
|
|
|
ASSERT_SYMBOL_PRESENT(fGetQueryObjectiv);
|
|
|
|
mSymbols.fGetQueryObjectiv(id, pname, params);
|
|
|
|
AFTER_GL_CALL;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2013-08-20 19:36:20 +04:00
|
|
|
// -----------------------------------------------------------------------------
|
2014-09-23 09:47:28 +04:00
|
|
|
// GL 4.0, GL ES 3.0, ARB_transform_feedback2, NV_transform_feedback2
|
2013-08-20 19:36:20 +04:00
|
|
|
public:
|
|
|
|
void fBindBufferBase(GLenum target, GLuint index, GLuint buffer)
|
|
|
|
{
|
|
|
|
BEFORE_GL_CALL;
|
|
|
|
ASSERT_SYMBOL_PRESENT(fBindBufferBase);
|
|
|
|
mSymbols.fBindBufferBase(target, index, buffer);
|
|
|
|
AFTER_GL_CALL;
|
|
|
|
}
|
|
|
|
|
|
|
|
void fBindBufferRange(GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size)
|
|
|
|
{
|
|
|
|
BEFORE_GL_CALL;
|
|
|
|
ASSERT_SYMBOL_PRESENT(fBindBufferRange);
|
|
|
|
mSymbols.fBindBufferRange(target, index, buffer, offset, size);
|
|
|
|
AFTER_GL_CALL;
|
|
|
|
}
|
|
|
|
|
2014-09-23 09:47:28 +04:00
|
|
|
void fGenTransformFeedbacks(GLsizei n, GLuint* ids)
|
|
|
|
{
|
|
|
|
BEFORE_GL_CALL;
|
|
|
|
ASSERT_SYMBOL_PRESENT(fGenTransformFeedbacks);
|
|
|
|
mSymbols.fGenTransformFeedbacks(n, ids);
|
|
|
|
AFTER_GL_CALL;
|
|
|
|
}
|
|
|
|
|
2014-11-26 05:00:06 +03:00
|
|
|
void fDeleteTransformFeedbacks(GLsizei n, const GLuint* ids)
|
2014-09-23 09:47:28 +04:00
|
|
|
{
|
|
|
|
BEFORE_GL_CALL;
|
|
|
|
ASSERT_SYMBOL_PRESENT(fDeleteTransformFeedbacks);
|
|
|
|
mSymbols.fDeleteTransformFeedbacks(n, ids);
|
|
|
|
AFTER_GL_CALL;
|
|
|
|
}
|
|
|
|
|
|
|
|
realGLboolean fIsTransformFeedback(GLuint id)
|
|
|
|
{
|
|
|
|
BEFORE_GL_CALL;
|
|
|
|
ASSERT_SYMBOL_PRESENT(fIsTransformFeedback);
|
|
|
|
realGLboolean result = mSymbols.fIsTransformFeedback(id);
|
|
|
|
AFTER_GL_CALL;
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
|
|
|
void fBindTransformFeedback(GLenum target, GLuint id)
|
|
|
|
{
|
|
|
|
BEFORE_GL_CALL;
|
|
|
|
ASSERT_SYMBOL_PRESENT(fBindTransformFeedback);
|
|
|
|
mSymbols.fBindTransformFeedback(target, id);
|
|
|
|
AFTER_GL_CALL;
|
|
|
|
}
|
|
|
|
|
2013-08-20 19:36:20 +04:00
|
|
|
void fBeginTransformFeedback(GLenum primitiveMode)
|
|
|
|
{
|
|
|
|
BEFORE_GL_CALL;
|
|
|
|
ASSERT_SYMBOL_PRESENT(fBeginTransformFeedback);
|
|
|
|
mSymbols.fBeginTransformFeedback(primitiveMode);
|
|
|
|
AFTER_GL_CALL;
|
|
|
|
}
|
|
|
|
|
|
|
|
void fEndTransformFeedback()
|
|
|
|
{
|
|
|
|
BEFORE_GL_CALL;
|
|
|
|
ASSERT_SYMBOL_PRESENT(fEndTransformFeedback);
|
|
|
|
mSymbols.fEndTransformFeedback();
|
|
|
|
AFTER_GL_CALL;
|
|
|
|
}
|
|
|
|
|
|
|
|
void fTransformFeedbackVaryings(GLuint program, GLsizei count, const GLchar* const* varyings, GLenum bufferMode)
|
|
|
|
{
|
|
|
|
BEFORE_GL_CALL;
|
|
|
|
ASSERT_SYMBOL_PRESENT(fTransformFeedbackVaryings);
|
|
|
|
mSymbols.fTransformFeedbackVaryings(program, count, varyings, bufferMode);
|
|
|
|
AFTER_GL_CALL;
|
|
|
|
}
|
|
|
|
|
|
|
|
void fGetTransformFeedbackVarying(GLuint program, GLuint index, GLsizei bufSize, GLsizei* length, GLsizei* size, GLenum* type, GLchar* name)
|
|
|
|
{
|
|
|
|
BEFORE_GL_CALL;
|
|
|
|
ASSERT_SYMBOL_PRESENT(fGetTransformFeedbackVarying);
|
|
|
|
mSymbols.fGetTransformFeedbackVarying(program, index, bufSize, length, size, type, name);
|
|
|
|
AFTER_GL_CALL;
|
|
|
|
}
|
|
|
|
|
2014-09-23 09:47:28 +04:00
|
|
|
void fPauseTransformFeedback()
|
|
|
|
{
|
|
|
|
BEFORE_GL_CALL;
|
|
|
|
ASSERT_SYMBOL_PRESENT(fPauseTransformFeedback);
|
|
|
|
mSymbols.fPauseTransformFeedback();
|
|
|
|
AFTER_GL_CALL;
|
|
|
|
}
|
|
|
|
|
|
|
|
void fResumeTransformFeedback()
|
|
|
|
{
|
|
|
|
BEFORE_GL_CALL;
|
|
|
|
ASSERT_SYMBOL_PRESENT(fResumeTransformFeedback);
|
|
|
|
mSymbols.fResumeTransformFeedback();
|
|
|
|
AFTER_GL_CALL;
|
|
|
|
}
|
|
|
|
|
2013-08-20 19:36:20 +04:00
|
|
|
void fGetIntegeri_v(GLenum param, GLuint index, GLint* values)
|
|
|
|
{
|
|
|
|
BEFORE_GL_CALL;
|
|
|
|
ASSERT_SYMBOL_PRESENT(fGetIntegeri_v);
|
|
|
|
mSymbols.fGetIntegeri_v(param, index, values);
|
|
|
|
AFTER_GL_CALL;
|
|
|
|
}
|
|
|
|
|
2014-05-27 14:21:30 +04:00
|
|
|
void fGetInteger64i_v(GLenum target, GLuint index, GLint64* data) {
|
|
|
|
ASSERT_SYMBOL_PRESENT(fGetInteger64i_v);
|
|
|
|
BEFORE_GL_CALL;
|
|
|
|
mSymbols.fGetInteger64i_v(target, index, data);
|
|
|
|
AFTER_GL_CALL;
|
|
|
|
}
|
2013-08-20 19:36:20 +04:00
|
|
|
|
2013-08-01 03:18:06 +04:00
|
|
|
// -----------------------------------------------------------------------------
|
|
|
|
// Package XXX_vertex_array_object
|
|
|
|
public:
|
2014-03-06 05:35:40 +04:00
|
|
|
void fBindVertexArray(GLuint array)
|
2013-08-01 03:18:06 +04:00
|
|
|
{
|
2010-10-13 01:01:59 +04:00
|
|
|
BEFORE_GL_CALL;
|
2013-08-01 03:18:06 +04:00
|
|
|
ASSERT_SYMBOL_PRESENT(fBindVertexArray);
|
|
|
|
mSymbols.fBindVertexArray(array);
|
2010-10-13 01:01:59 +04:00
|
|
|
AFTER_GL_CALL;
|
|
|
|
}
|
|
|
|
|
2016-06-11 04:37:07 +03:00
|
|
|
void fDeleteVertexArrays(GLsizei n, const GLuint* arrays)
|
2013-08-01 03:18:06 +04:00
|
|
|
{
|
2010-10-13 01:01:59 +04:00
|
|
|
BEFORE_GL_CALL;
|
2013-08-01 03:18:06 +04:00
|
|
|
ASSERT_SYMBOL_PRESENT(fDeleteVertexArrays);
|
|
|
|
mSymbols.fDeleteVertexArrays(n, arrays);
|
2010-10-13 01:01:59 +04:00
|
|
|
AFTER_GL_CALL;
|
|
|
|
}
|
|
|
|
|
2016-06-11 04:37:07 +03:00
|
|
|
void fGenVertexArrays(GLsizei n, GLuint* arrays)
|
2013-08-01 03:18:06 +04:00
|
|
|
{
|
2010-10-13 01:01:59 +04:00
|
|
|
BEFORE_GL_CALL;
|
2013-08-01 03:18:06 +04:00
|
|
|
ASSERT_SYMBOL_PRESENT(fGenVertexArrays);
|
|
|
|
mSymbols.fGenVertexArrays(n, arrays);
|
2010-10-13 01:01:59 +04:00
|
|
|
AFTER_GL_CALL;
|
|
|
|
}
|
|
|
|
|
2014-03-06 05:35:40 +04:00
|
|
|
realGLboolean fIsVertexArray(GLuint array)
|
2013-08-01 03:18:06 +04:00
|
|
|
{
|
2010-10-13 01:01:59 +04:00
|
|
|
BEFORE_GL_CALL;
|
2013-08-01 03:18:06 +04:00
|
|
|
ASSERT_SYMBOL_PRESENT(fIsVertexArray);
|
|
|
|
realGLboolean ret = mSymbols.fIsVertexArray(array);
|
2010-10-13 01:01:59 +04:00
|
|
|
AFTER_GL_CALL;
|
2013-08-01 03:18:06 +04:00
|
|
|
return ret;
|
2010-10-13 01:01:59 +04:00
|
|
|
}
|
|
|
|
|
2014-08-05 09:09:20 +04:00
|
|
|
// -----------------------------------------------------------------------------
|
|
|
|
// Extension NV_fence
|
|
|
|
public:
|
|
|
|
void fGenFences(GLsizei n, GLuint* fences)
|
|
|
|
{
|
|
|
|
ASSERT_SYMBOL_PRESENT(fGenFences);
|
|
|
|
BEFORE_GL_CALL;
|
|
|
|
mSymbols.fGenFences(n, fences);
|
|
|
|
AFTER_GL_CALL;
|
|
|
|
}
|
|
|
|
|
|
|
|
void fDeleteFences(GLsizei n, const GLuint* fences)
|
|
|
|
{
|
|
|
|
ASSERT_SYMBOL_PRESENT(fDeleteFences);
|
|
|
|
BEFORE_GL_CALL;
|
|
|
|
mSymbols.fDeleteFences(n, fences);
|
|
|
|
AFTER_GL_CALL;
|
|
|
|
}
|
|
|
|
|
|
|
|
void fSetFence(GLuint fence, GLenum condition)
|
|
|
|
{
|
|
|
|
ASSERT_SYMBOL_PRESENT(fSetFence);
|
|
|
|
BEFORE_GL_CALL;
|
|
|
|
mSymbols.fSetFence(fence, condition);
|
|
|
|
AFTER_GL_CALL;
|
|
|
|
}
|
|
|
|
|
|
|
|
realGLboolean fTestFence(GLuint fence)
|
|
|
|
{
|
|
|
|
ASSERT_SYMBOL_PRESENT(fTestFence);
|
|
|
|
BEFORE_GL_CALL;
|
|
|
|
realGLboolean ret = mSymbols.fTestFence(fence);
|
|
|
|
AFTER_GL_CALL;
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
void fFinishFence(GLuint fence)
|
|
|
|
{
|
|
|
|
ASSERT_SYMBOL_PRESENT(fFinishFence);
|
|
|
|
BEFORE_GL_CALL;
|
|
|
|
mSymbols.fFinishFence(fence);
|
|
|
|
AFTER_GL_CALL;
|
|
|
|
}
|
|
|
|
|
|
|
|
realGLboolean fIsFence(GLuint fence)
|
|
|
|
{
|
|
|
|
ASSERT_SYMBOL_PRESENT(fIsFence);
|
|
|
|
BEFORE_GL_CALL;
|
|
|
|
realGLboolean ret = mSymbols.fIsFence(fence);
|
|
|
|
AFTER_GL_CALL;
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
void fGetFenceiv(GLuint fence, GLenum pname, GLint* params)
|
|
|
|
{
|
|
|
|
ASSERT_SYMBOL_PRESENT(fGetFenceiv);
|
|
|
|
BEFORE_GL_CALL;
|
|
|
|
mSymbols.fGetFenceiv(fence, pname, params);
|
|
|
|
AFTER_GL_CALL;
|
|
|
|
}
|
|
|
|
|
2016-05-02 02:37:42 +03:00
|
|
|
// -----------------------------------------------------------------------------
|
|
|
|
// Extension NV_texture_barrier
|
|
|
|
public:
|
|
|
|
void fTextureBarrier()
|
|
|
|
{
|
|
|
|
ASSERT_SYMBOL_PRESENT(fTextureBarrier);
|
|
|
|
BEFORE_GL_CALL;
|
|
|
|
mSymbols.fTextureBarrier();
|
|
|
|
AFTER_GL_CALL;
|
|
|
|
}
|
|
|
|
|
2014-05-27 14:13:09 +04:00
|
|
|
// Core GL & Extension ARB_copy_buffer
|
|
|
|
public:
|
|
|
|
void fCopyBufferSubData(GLenum readtarget, GLenum writetarget,
|
|
|
|
GLintptr readoffset, GLintptr writeoffset,
|
|
|
|
GLsizeiptr size)
|
|
|
|
{
|
|
|
|
BEFORE_GL_CALL;
|
|
|
|
ASSERT_SYMBOL_PRESENT(fCopyBufferSubData);
|
|
|
|
mSymbols.fCopyBufferSubData(readtarget, writetarget, readoffset, writeoffset, size);
|
|
|
|
AFTER_GL_CALL;
|
|
|
|
}
|
|
|
|
|
2010-10-13 01:01:59 +04:00
|
|
|
|
2014-08-08 05:47:13 +04:00
|
|
|
// -----------------------------------------------------------------------------
|
|
|
|
// Core GL & Extension ARB_map_buffer_range
|
|
|
|
public:
|
|
|
|
void* fMapBufferRange(GLenum target, GLintptr offset, GLsizeiptr length,
|
|
|
|
GLbitfield access)
|
|
|
|
{
|
|
|
|
ASSERT_SYMBOL_PRESENT(fMapBufferRange);
|
|
|
|
BEFORE_GL_CALL;
|
|
|
|
void* data = mSymbols.fMapBufferRange(target, offset, length, access);
|
|
|
|
AFTER_GL_CALL;
|
|
|
|
return data;
|
|
|
|
}
|
|
|
|
|
|
|
|
void fFlushMappedBufferRange(GLenum target, GLintptr offset, GLsizeiptr length) {
|
|
|
|
ASSERT_SYMBOL_PRESENT(fFlushMappedBufferRange);
|
|
|
|
BEFORE_GL_CALL;
|
|
|
|
mSymbols.fFlushMappedBufferRange(target, offset, length);
|
|
|
|
AFTER_GL_CALL;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2014-09-23 09:45:34 +04:00
|
|
|
// -----------------------------------------------------------------------------
|
|
|
|
// Core GL & Extension ARB_sampler_objects
|
|
|
|
public:
|
2016-06-11 04:37:07 +03:00
|
|
|
void fGenSamplers(GLsizei count, GLuint* samplers)
|
2014-09-23 09:45:34 +04:00
|
|
|
{
|
|
|
|
BEFORE_GL_CALL;
|
|
|
|
ASSERT_SYMBOL_PRESENT(fGenSamplers);
|
|
|
|
mSymbols.fGenSamplers(count, samplers);
|
|
|
|
AFTER_GL_CALL;
|
|
|
|
}
|
|
|
|
|
2016-06-11 04:37:07 +03:00
|
|
|
void fDeleteSamplers(GLsizei count, const GLuint* samplers)
|
2014-09-23 09:45:34 +04:00
|
|
|
{
|
|
|
|
BEFORE_GL_CALL;
|
|
|
|
ASSERT_SYMBOL_PRESENT(fDeleteSamplers);
|
|
|
|
mSymbols.fDeleteSamplers(count, samplers);
|
|
|
|
AFTER_GL_CALL;
|
|
|
|
}
|
|
|
|
|
|
|
|
realGLboolean fIsSampler(GLuint sampler)
|
|
|
|
{
|
|
|
|
BEFORE_GL_CALL;
|
|
|
|
ASSERT_SYMBOL_PRESENT(fIsSampler);
|
|
|
|
realGLboolean result = mSymbols.fIsSampler(sampler);
|
|
|
|
AFTER_GL_CALL;
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
|
|
|
void fBindSampler(GLuint unit, GLuint sampler)
|
|
|
|
{
|
|
|
|
BEFORE_GL_CALL;
|
|
|
|
ASSERT_SYMBOL_PRESENT(fBindSampler);
|
|
|
|
mSymbols.fBindSampler(unit, sampler);
|
|
|
|
AFTER_GL_CALL;
|
|
|
|
}
|
|
|
|
|
|
|
|
void fSamplerParameteri(GLuint sampler, GLenum pname, GLint param)
|
|
|
|
{
|
|
|
|
BEFORE_GL_CALL;
|
|
|
|
ASSERT_SYMBOL_PRESENT(fSamplerParameteri);
|
|
|
|
mSymbols.fSamplerParameteri(sampler, pname, param);
|
|
|
|
AFTER_GL_CALL;
|
|
|
|
}
|
|
|
|
|
2016-06-11 04:37:07 +03:00
|
|
|
void fSamplerParameteriv(GLuint sampler, GLenum pname, const GLint* param)
|
2014-09-23 09:45:34 +04:00
|
|
|
{
|
|
|
|
BEFORE_GL_CALL;
|
|
|
|
ASSERT_SYMBOL_PRESENT(fSamplerParameteriv);
|
|
|
|
mSymbols.fSamplerParameteriv(sampler, pname, param);
|
|
|
|
AFTER_GL_CALL;
|
|
|
|
}
|
|
|
|
|
|
|
|
void fSamplerParameterf(GLuint sampler, GLenum pname, GLfloat param)
|
|
|
|
{
|
|
|
|
BEFORE_GL_CALL;
|
|
|
|
ASSERT_SYMBOL_PRESENT(fSamplerParameterf);
|
|
|
|
mSymbols.fSamplerParameterf(sampler, pname, param);
|
|
|
|
AFTER_GL_CALL;
|
|
|
|
}
|
|
|
|
|
2016-06-11 04:37:07 +03:00
|
|
|
void fSamplerParameterfv(GLuint sampler, GLenum pname, const GLfloat* param)
|
2014-09-23 09:45:34 +04:00
|
|
|
{
|
|
|
|
BEFORE_GL_CALL;
|
|
|
|
ASSERT_SYMBOL_PRESENT(fSamplerParameterfv);
|
|
|
|
mSymbols.fSamplerParameterfv(sampler, pname, param);
|
|
|
|
AFTER_GL_CALL;
|
|
|
|
}
|
|
|
|
|
2016-06-11 04:37:07 +03:00
|
|
|
void fGetSamplerParameteriv(GLuint sampler, GLenum pname, GLint* params)
|
2014-09-23 09:45:34 +04:00
|
|
|
{
|
|
|
|
BEFORE_GL_CALL;
|
|
|
|
ASSERT_SYMBOL_PRESENT(fGetSamplerParameteriv);
|
|
|
|
mSymbols.fGetSamplerParameteriv(sampler, pname, params);
|
|
|
|
AFTER_GL_CALL;
|
|
|
|
}
|
|
|
|
|
2016-06-11 04:37:07 +03:00
|
|
|
void fGetSamplerParameterfv(GLuint sampler, GLenum pname, GLfloat* params)
|
2014-09-23 09:45:34 +04:00
|
|
|
{
|
|
|
|
BEFORE_GL_CALL;
|
|
|
|
ASSERT_SYMBOL_PRESENT(fGetSamplerParameterfv);
|
|
|
|
mSymbols.fGetSamplerParameterfv(sampler, pname, params);
|
|
|
|
AFTER_GL_CALL;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2014-07-14 08:34:17 +04:00
|
|
|
// -----------------------------------------------------------------------------
|
|
|
|
// Core GL & Extension ARB_uniform_buffer_object
|
|
|
|
public:
|
|
|
|
void fGetUniformIndices(GLuint program, GLsizei uniformCount,
|
|
|
|
const GLchar* const* uniformNames, GLuint* uniformIndices)
|
|
|
|
{
|
|
|
|
ASSERT_SYMBOL_PRESENT(fGetUniformIndices);
|
|
|
|
BEFORE_GL_CALL;
|
|
|
|
mSymbols.fGetUniformIndices(program, uniformCount, uniformNames, uniformIndices);
|
|
|
|
AFTER_GL_CALL;
|
|
|
|
}
|
|
|
|
|
|
|
|
void fGetActiveUniformsiv(GLuint program, GLsizei uniformCount, const GLuint* uniformIndices,
|
|
|
|
GLenum pname, GLint* params)
|
|
|
|
{
|
|
|
|
ASSERT_SYMBOL_PRESENT(fGetActiveUniformsiv);
|
|
|
|
BEFORE_GL_CALL;
|
|
|
|
mSymbols.fGetActiveUniformsiv(program, uniformCount, uniformIndices, pname, params);
|
|
|
|
AFTER_GL_CALL;
|
|
|
|
}
|
|
|
|
|
|
|
|
GLuint fGetUniformBlockIndex(GLuint program, const GLchar* uniformBlockName) {
|
|
|
|
ASSERT_SYMBOL_PRESENT(fGetUniformBlockIndex);
|
|
|
|
BEFORE_GL_CALL;
|
|
|
|
GLuint result = mSymbols.fGetUniformBlockIndex(program, uniformBlockName);
|
|
|
|
AFTER_GL_CALL;
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
|
|
|
void fGetActiveUniformBlockiv(GLuint program, GLuint uniformBlockIndex,
|
|
|
|
GLenum pname, GLint* params)
|
|
|
|
{
|
|
|
|
ASSERT_SYMBOL_PRESENT(fGetActiveUniformBlockiv);
|
|
|
|
BEFORE_GL_CALL;
|
|
|
|
mSymbols.fGetActiveUniformBlockiv(program, uniformBlockIndex, pname, params);
|
|
|
|
AFTER_GL_CALL;
|
|
|
|
}
|
|
|
|
|
|
|
|
void fGetActiveUniformBlockName(GLuint program, GLuint uniformBlockIndex, GLsizei bufSize,
|
|
|
|
GLsizei* length, GLchar* uniformBlockName)
|
|
|
|
{
|
|
|
|
ASSERT_SYMBOL_PRESENT(fGetActiveUniformBlockName);
|
|
|
|
BEFORE_GL_CALL;
|
|
|
|
mSymbols.fGetActiveUniformBlockName(program, uniformBlockIndex, bufSize, length, uniformBlockName);
|
|
|
|
AFTER_GL_CALL;
|
|
|
|
}
|
|
|
|
|
|
|
|
void fUniformBlockBinding(GLuint program, GLuint uniformBlockIndex, GLuint uniformBlockBinding) {
|
|
|
|
ASSERT_SYMBOL_PRESENT(fUniformBlockBinding);
|
|
|
|
BEFORE_GL_CALL;
|
|
|
|
mSymbols.fUniformBlockBinding(program, uniformBlockIndex, uniformBlockBinding);
|
|
|
|
AFTER_GL_CALL;
|
|
|
|
}
|
|
|
|
|
2014-09-23 09:49:19 +04:00
|
|
|
// -----------------------------------------------------------------------------
|
|
|
|
// Core GL 4.2, GL ES 3.0 & Extension ARB_texture_storage/EXT_texture_storage
|
|
|
|
void fTexStorage2D(GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height)
|
|
|
|
{
|
|
|
|
BEFORE_GL_CALL;
|
|
|
|
ASSERT_SYMBOL_PRESENT(fTexStorage2D);
|
|
|
|
mSymbols.fTexStorage2D(target, levels, internalformat, width, height);
|
|
|
|
AFTER_GL_CALL;
|
|
|
|
}
|
|
|
|
|
|
|
|
void fTexStorage3D(GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth)
|
|
|
|
{
|
|
|
|
BEFORE_GL_CALL;
|
|
|
|
ASSERT_SYMBOL_PRESENT(fTexStorage3D);
|
|
|
|
mSymbols.fTexStorage3D(target, levels, internalformat, width, height, depth);
|
|
|
|
AFTER_GL_CALL;
|
|
|
|
}
|
2014-07-14 08:34:17 +04:00
|
|
|
|
2013-08-01 03:18:06 +04:00
|
|
|
// -----------------------------------------------------------------------------
|
2014-09-23 09:50:10 +04:00
|
|
|
// 3D Textures
|
2014-10-17 06:03:34 +04:00
|
|
|
void fTexImage3D(GLenum target, GLint level,
|
|
|
|
GLint internalFormat,
|
|
|
|
GLsizei width, GLsizei height, GLsizei depth,
|
|
|
|
GLint border, GLenum format, GLenum type,
|
|
|
|
const GLvoid * data)
|
|
|
|
{
|
|
|
|
BEFORE_GL_CALL;
|
|
|
|
ASSERT_SYMBOL_PRESENT(fTexImage3D);
|
|
|
|
mSymbols.fTexImage3D(target, level, internalFormat,
|
|
|
|
width, height, depth,
|
|
|
|
border, format, type,
|
|
|
|
data);
|
|
|
|
AFTER_GL_CALL;
|
|
|
|
}
|
|
|
|
|
2014-09-23 09:50:10 +04:00
|
|
|
void fTexSubImage3D(GLenum target, GLint level, GLint xoffset, GLint yoffset,
|
|
|
|
GLint zoffset, GLsizei width, GLsizei height, GLsizei depth,
|
|
|
|
GLenum format, GLenum type, const GLvoid* pixels)
|
|
|
|
{
|
|
|
|
BEFORE_GL_CALL;
|
|
|
|
ASSERT_SYMBOL_PRESENT(fTexSubImage3D);
|
|
|
|
mSymbols.fTexSubImage3D(target, level, xoffset, yoffset, zoffset,
|
|
|
|
width, height, depth, format, type,
|
|
|
|
pixels);
|
|
|
|
AFTER_GL_CALL;
|
|
|
|
}
|
|
|
|
|
|
|
|
void fCopyTexSubImage3D(GLenum target, GLint level, GLint xoffset,
|
|
|
|
GLint yoffset, GLint zoffset, GLint x,
|
|
|
|
GLint y, GLsizei width, GLsizei height)
|
|
|
|
{
|
|
|
|
BEFORE_GL_CALL;
|
|
|
|
ASSERT_SYMBOL_PRESENT(fCopyTexSubImage3D);
|
|
|
|
mSymbols.fCopyTexSubImage3D(target, level, xoffset, yoffset, zoffset,
|
|
|
|
x, y, width, height);
|
|
|
|
AFTER_GL_CALL;
|
|
|
|
}
|
|
|
|
|
|
|
|
void fCompressedTexImage3D(GLenum target, GLint level, GLenum internalformat,
|
|
|
|
GLsizei width, GLsizei height, GLsizei depth,
|
|
|
|
GLint border, GLsizei imageSize, const GLvoid* data)
|
|
|
|
{
|
|
|
|
BEFORE_GL_CALL;
|
|
|
|
ASSERT_SYMBOL_PRESENT(fCompressedTexImage3D);
|
|
|
|
mSymbols.fCompressedTexImage3D(target, level, internalformat,
|
|
|
|
width, height, depth,
|
|
|
|
border, imageSize, data);
|
|
|
|
AFTER_GL_CALL;
|
|
|
|
}
|
|
|
|
|
|
|
|
void fCompressedTexSubImage3D(GLenum target, GLint level,
|
|
|
|
GLint xoffset, GLint yoffset, GLint zoffset,
|
|
|
|
GLsizei width, GLsizei height, GLsizei depth,
|
|
|
|
GLenum format, GLsizei imageSize, const GLvoid* data)
|
|
|
|
{
|
|
|
|
BEFORE_GL_CALL;
|
|
|
|
ASSERT_SYMBOL_PRESENT(fCompressedTexSubImage3D);
|
|
|
|
mSymbols.fCompressedTexSubImage3D(target, level,
|
|
|
|
xoffset, yoffset, zoffset,
|
|
|
|
width, height, depth,
|
|
|
|
format, imageSize, data);
|
|
|
|
AFTER_GL_CALL;
|
|
|
|
}
|
|
|
|
|
2015-02-13 06:00:41 +03:00
|
|
|
// -----------------------------------------------------------------------------
|
|
|
|
// get_string_indexed
|
|
|
|
|
|
|
|
const GLubyte* fGetStringi(GLenum name, GLuint index) {
|
|
|
|
BEFORE_GL_CALL;
|
|
|
|
ASSERT_SYMBOL_PRESENT(fGetStringi);
|
|
|
|
const GLubyte* ret = mSymbols.fGetStringi(name, index);
|
|
|
|
AFTER_GL_CALL;
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
2015-09-25 17:29:53 +03:00
|
|
|
// -----------------------------------------------------------------------------
|
|
|
|
// APPLE_framebuffer_multisample
|
|
|
|
|
|
|
|
void fResolveMultisampleFramebufferAPPLE() {
|
|
|
|
BEFORE_GL_CALL;
|
|
|
|
ASSERT_SYMBOL_PRESENT(fResolveMultisampleFramebufferAPPLE);
|
|
|
|
mSymbols.fResolveMultisampleFramebufferAPPLE();
|
|
|
|
AFTER_GL_CALL;
|
|
|
|
}
|
|
|
|
|
2016-07-29 03:15:32 +03:00
|
|
|
// -----------------------------------------------------------------------------
|
|
|
|
// prim_restart
|
|
|
|
|
|
|
|
void fPrimitiveRestartIndex(GLuint index) {
|
|
|
|
BEFORE_GL_CALL;
|
|
|
|
ASSERT_SYMBOL_PRESENT(fPrimitiveRestartIndex);
|
|
|
|
mSymbols.fPrimitiveRestartIndex(index);
|
|
|
|
AFTER_GL_CALL;
|
|
|
|
}
|
|
|
|
|
2014-09-23 09:50:10 +04:00
|
|
|
// -----------------------------------------------------------------------------
|
2013-08-01 03:18:06 +04:00
|
|
|
// Constructor
|
|
|
|
protected:
|
2016-06-07 02:27:43 +03:00
|
|
|
explicit GLContext(CreateContextFlags flags, const SurfaceCaps& caps,
|
2014-08-08 05:17:30 +04:00
|
|
|
GLContext* sharedContext = nullptr,
|
|
|
|
bool isOffscreen = false);
|
2010-10-13 01:01:59 +04:00
|
|
|
|
2013-08-01 03:18:06 +04:00
|
|
|
|
|
|
|
// -----------------------------------------------------------------------------
|
|
|
|
// Destructor
|
|
|
|
public:
|
2013-09-07 06:13:37 +04:00
|
|
|
virtual ~GLContext();
|
2010-10-13 01:01:59 +04:00
|
|
|
|
2014-09-02 16:05:00 +04:00
|
|
|
// Mark this context as destroyed. This will nullptr out all
|
|
|
|
// the GL function pointers!
|
|
|
|
void MarkDestroyed();
|
2012-03-05 22:09:05 +04:00
|
|
|
|
2013-08-01 03:18:06 +04:00
|
|
|
// -----------------------------------------------------------------------------
|
|
|
|
// Everything that isn't standard GL APIs
|
|
|
|
protected:
|
|
|
|
typedef gfx::SurfaceFormat SurfaceFormat;
|
2010-10-13 01:01:59 +04:00
|
|
|
|
2014-03-04 06:47:43 +04:00
|
|
|
virtual bool MakeCurrentImpl(bool aForce) = 0;
|
2010-10-13 01:01:59 +04:00
|
|
|
|
2014-03-04 06:47:43 +04:00
|
|
|
public:
|
2014-10-15 05:24:53 +04:00
|
|
|
#ifdef MOZ_GL_DEBUG
|
2013-08-01 03:18:06 +04:00
|
|
|
static void StaticInit() {
|
|
|
|
PR_NewThreadPrivateIndex(&sCurrentGLContextTLS, nullptr);
|
2010-10-13 01:01:59 +04:00
|
|
|
}
|
2013-08-01 03:18:06 +04:00
|
|
|
#endif
|
2010-10-13 01:01:59 +04:00
|
|
|
|
2013-08-01 03:18:06 +04:00
|
|
|
bool MakeCurrent(bool aForce = false) {
|
2013-12-03 14:44:37 +04:00
|
|
|
if (IsDestroyed()) {
|
|
|
|
return false;
|
|
|
|
}
|
2014-10-15 05:24:53 +04:00
|
|
|
#ifdef MOZ_GL_DEBUG
|
2013-08-01 03:18:06 +04:00
|
|
|
PR_SetThreadPrivate(sCurrentGLContextTLS, this);
|
2010-10-13 01:01:59 +04:00
|
|
|
|
2013-08-01 03:18:06 +04:00
|
|
|
// XXX this assertion is disabled because it's triggering on Mac;
|
|
|
|
// we need to figure out why and reenable it.
|
|
|
|
#if 0
|
|
|
|
// IsOwningThreadCurrent is a bit of a misnomer;
|
|
|
|
// the "owning thread" is the creation thread,
|
|
|
|
// and the only thread that can own this. We don't
|
|
|
|
// support contexts used on multiple threads.
|
|
|
|
NS_ASSERTION(IsOwningThreadCurrent(),
|
|
|
|
"MakeCurrent() called on different thread than this context was created on!");
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
return MakeCurrentImpl(aForce);
|
2010-10-13 01:01:59 +04:00
|
|
|
}
|
|
|
|
|
2014-04-15 18:57:26 +04:00
|
|
|
virtual bool Init() = 0;
|
|
|
|
|
2013-08-01 03:18:06 +04:00
|
|
|
virtual bool SetupLookupFunction() = 0;
|
2010-10-13 01:01:59 +04:00
|
|
|
|
2013-08-01 03:18:06 +04:00
|
|
|
virtual void ReleaseSurface() {}
|
2012-08-22 07:30:20 +04:00
|
|
|
|
2013-08-01 03:18:06 +04:00
|
|
|
bool IsDestroyed() {
|
|
|
|
// MarkDestroyed will mark all these as null.
|
|
|
|
return mSymbols.fUseProgram == nullptr;
|
2010-10-13 01:01:59 +04:00
|
|
|
}
|
|
|
|
|
2016-06-11 04:37:07 +03:00
|
|
|
GLContext* GetSharedContext() { return mSharedContext; }
|
2010-10-13 01:01:59 +04:00
|
|
|
|
2013-08-01 03:18:06 +04:00
|
|
|
/**
|
|
|
|
* Returns true if the thread on which this context was created is the currently
|
|
|
|
* executing thread.
|
|
|
|
*/
|
2013-09-07 06:13:37 +04:00
|
|
|
bool IsOwningThreadCurrent();
|
2010-10-13 01:01:59 +04:00
|
|
|
|
2013-08-01 03:18:06 +04:00
|
|
|
static void PlatformStartup();
|
|
|
|
|
2012-12-19 11:16:01 +04:00
|
|
|
public:
|
2013-08-01 03:18:06 +04:00
|
|
|
/**
|
|
|
|
* If this context wraps a double-buffered target, swap the back
|
|
|
|
* and front buffers. It should be assumed that after a swap, the
|
|
|
|
* contents of the new back buffer are undefined.
|
|
|
|
*/
|
|
|
|
virtual bool SwapBuffers() { return false; }
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Defines a two-dimensional texture image for context target surface
|
|
|
|
*/
|
|
|
|
virtual bool BindTexImage() { return false; }
|
|
|
|
/*
|
|
|
|
* Releases a color buffer that is being used as a texture
|
|
|
|
*/
|
|
|
|
virtual bool ReleaseTexImage() { return false; }
|
|
|
|
|
|
|
|
// Before reads from offscreen texture
|
|
|
|
void GuaranteeResolve();
|
2010-10-13 01:01:59 +04:00
|
|
|
|
2013-08-01 03:18:06 +04:00
|
|
|
/*
|
|
|
|
* Resize the current offscreen buffer. Returns true on success.
|
|
|
|
* If it returns false, the context should be treated as unusable
|
|
|
|
* and should be recreated. After the resize, the viewport is not
|
|
|
|
* changed; glViewport should be called as appropriate.
|
|
|
|
*
|
|
|
|
* Only valid if IsOffscreen() returns true.
|
|
|
|
*/
|
2014-03-04 06:47:43 +04:00
|
|
|
bool ResizeOffscreen(const gfx::IntSize& size) {
|
2013-12-10 20:12:42 +04:00
|
|
|
return ResizeScreenBuffer(size);
|
2010-10-13 01:01:59 +04:00
|
|
|
}
|
|
|
|
|
2013-08-01 03:18:06 +04:00
|
|
|
/*
|
|
|
|
* Return size of this offscreen context.
|
|
|
|
*
|
|
|
|
* Only valid if IsOffscreen() returns true.
|
|
|
|
*/
|
2013-12-10 20:11:58 +04:00
|
|
|
const gfx::IntSize& OffscreenSize() const;
|
2010-10-13 01:01:59 +04:00
|
|
|
|
2013-08-01 03:18:06 +04:00
|
|
|
void BindFB(GLuint fb) {
|
|
|
|
fBindFramebuffer(LOCAL_GL_FRAMEBUFFER, fb);
|
|
|
|
MOZ_ASSERT(!fb || fIsFramebuffer(fb));
|
2010-10-13 01:01:59 +04:00
|
|
|
}
|
|
|
|
|
2013-08-01 03:18:06 +04:00
|
|
|
void BindDrawFB(GLuint fb) {
|
|
|
|
fBindFramebuffer(LOCAL_GL_DRAW_FRAMEBUFFER_EXT, fb);
|
2010-08-07 09:09:18 +04:00
|
|
|
}
|
|
|
|
|
2013-08-01 03:18:06 +04:00
|
|
|
void BindReadFB(GLuint fb) {
|
|
|
|
fBindFramebuffer(LOCAL_GL_READ_FRAMEBUFFER_EXT, fb);
|
2010-07-19 09:01:14 +04:00
|
|
|
}
|
|
|
|
|
2015-07-15 03:37:28 +03:00
|
|
|
GLuint GetDrawFB();
|
2010-07-19 09:01:14 +04:00
|
|
|
|
2015-07-15 03:37:28 +03:00
|
|
|
GLuint GetReadFB();
|
2010-07-19 09:01:14 +04:00
|
|
|
|
2015-07-15 03:37:28 +03:00
|
|
|
GLuint GetFB();
|
2010-07-19 09:01:14 +04:00
|
|
|
|
2013-08-01 03:18:06 +04:00
|
|
|
private:
|
|
|
|
void GetShaderPrecisionFormatNonES2(GLenum shadertype, GLenum precisiontype, GLint* range, GLint* precision) {
|
|
|
|
switch (precisiontype) {
|
|
|
|
case LOCAL_GL_LOW_FLOAT:
|
|
|
|
case LOCAL_GL_MEDIUM_FLOAT:
|
|
|
|
case LOCAL_GL_HIGH_FLOAT:
|
|
|
|
// Assume IEEE 754 precision
|
|
|
|
range[0] = 127;
|
|
|
|
range[1] = 127;
|
|
|
|
*precision = 23;
|
|
|
|
break;
|
|
|
|
case LOCAL_GL_LOW_INT:
|
|
|
|
case LOCAL_GL_MEDIUM_INT:
|
|
|
|
case LOCAL_GL_HIGH_INT:
|
|
|
|
// Some (most) hardware only supports single-precision floating-point numbers,
|
|
|
|
// which can accurately represent integers up to +/-16777216
|
|
|
|
range[0] = 24;
|
|
|
|
range[1] = 24;
|
|
|
|
*precision = 0;
|
|
|
|
break;
|
|
|
|
}
|
2010-07-19 09:01:14 +04:00
|
|
|
}
|
|
|
|
|
2013-08-01 03:18:06 +04:00
|
|
|
public:
|
2010-07-19 09:01:14 +04:00
|
|
|
|
2013-08-01 03:18:06 +04:00
|
|
|
void ForceDirtyScreen();
|
|
|
|
void CleanDirtyScreen();
|
2010-07-19 09:01:14 +04:00
|
|
|
|
2014-03-04 06:47:43 +04:00
|
|
|
virtual GLenum GetPreferredARGB32Format() const { return LOCAL_GL_RGBA; }
|
2010-10-13 01:01:59 +04:00
|
|
|
|
2016-07-13 13:16:54 +03:00
|
|
|
virtual GLenum GetPreferredEGLImageTextureTarget() const {
|
|
|
|
return IsExtensionSupported(OES_EGL_image_external) ?
|
|
|
|
LOCAL_GL_TEXTURE_EXTERNAL : LOCAL_GL_TEXTURE_2D;
|
|
|
|
}
|
|
|
|
|
2015-12-24 06:03:35 +03:00
|
|
|
virtual bool RenewSurface(nsIWidget* aWidget) { return false; }
|
2010-10-13 01:01:59 +04:00
|
|
|
|
2013-08-01 03:18:06 +04:00
|
|
|
// Shared code for GL extensions and GLX extensions.
|
2016-06-11 04:37:07 +03:00
|
|
|
static bool ListHasExtension(const GLubyte* extensions,
|
|
|
|
const char* extension);
|
2010-10-13 01:01:59 +04:00
|
|
|
|
2013-08-01 03:18:06 +04:00
|
|
|
GLint GetMaxTextureImageSize() { return mMaxTextureImageSize; }
|
2010-10-13 01:01:59 +04:00
|
|
|
|
2013-08-01 03:18:06 +04:00
|
|
|
public:
|
2014-07-12 02:10:49 +04:00
|
|
|
std::map<GLuint, SharedSurface*> mFBOMapping;
|
2010-10-13 01:01:59 +04:00
|
|
|
|
2013-08-01 03:18:06 +04:00
|
|
|
enum {
|
2016-06-07 02:29:08 +03:00
|
|
|
DebugFlagEnabled = 1 << 0,
|
|
|
|
DebugFlagTrace = 1 << 1,
|
|
|
|
DebugFlagAbortOnError = 1 << 2
|
2013-08-01 03:18:06 +04:00
|
|
|
};
|
2010-10-13 01:01:59 +04:00
|
|
|
|
2016-06-07 02:29:08 +03:00
|
|
|
const uint8_t mDebugFlags;
|
2010-10-13 01:01:59 +04:00
|
|
|
|
2013-08-01 03:18:06 +04:00
|
|
|
protected:
|
2015-10-18 08:24:48 +03:00
|
|
|
RefPtr<GLContext> mSharedContext;
|
2010-10-13 01:01:59 +04:00
|
|
|
|
2014-05-09 08:18:00 +04:00
|
|
|
// The thread id which this context was created.
|
|
|
|
PlatformThreadId mOwningThreadId;
|
2011-10-19 23:09:57 +04:00
|
|
|
|
2013-08-01 03:18:06 +04:00
|
|
|
GLContextSymbols mSymbols;
|
2012-12-19 11:16:01 +04:00
|
|
|
|
2014-10-15 05:24:53 +04:00
|
|
|
#ifdef MOZ_GL_DEBUG
|
2016-06-07 02:29:08 +03:00
|
|
|
// Non-zero debug flags will check that we don't send call
|
2013-08-01 03:18:06 +04:00
|
|
|
// to a GLContext that isn't current on the current
|
|
|
|
// thread.
|
|
|
|
// Store the current context when binding to thread local
|
2016-06-07 02:29:08 +03:00
|
|
|
// storage to support debug flags on an arbitrary thread.
|
2013-08-01 03:18:06 +04:00
|
|
|
static unsigned sCurrentGLContextTLS;
|
|
|
|
#endif
|
2014-03-17 18:50:15 +04:00
|
|
|
|
2014-01-06 19:49:03 +04:00
|
|
|
UniquePtr<GLBlitHelper> mBlitHelper;
|
|
|
|
UniquePtr<GLReadTexImageHelper> mReadTexImageHelper;
|
2013-11-29 00:57:19 +04:00
|
|
|
|
2013-08-01 03:18:06 +04:00
|
|
|
public:
|
2013-11-29 00:57:19 +04:00
|
|
|
GLBlitHelper* BlitHelper();
|
2013-11-29 00:57:19 +04:00
|
|
|
GLBlitTextureImageHelper* BlitTextureImageHelper();
|
2014-01-02 19:17:22 +04:00
|
|
|
GLReadTexImageHelper* ReadTexImageHelper();
|
2013-11-29 00:57:19 +04:00
|
|
|
|
2013-08-01 03:18:06 +04:00
|
|
|
// Assumes shares are created by all sharing with the same global context.
|
|
|
|
bool SharesWith(const GLContext* other) const {
|
|
|
|
MOZ_ASSERT(!this->mSharedContext || !this->mSharedContext->mSharedContext);
|
|
|
|
MOZ_ASSERT(!other->mSharedContext || !other->mSharedContext->mSharedContext);
|
|
|
|
MOZ_ASSERT(!this->mSharedContext ||
|
|
|
|
!other->mSharedContext ||
|
|
|
|
this->mSharedContext == other->mSharedContext);
|
2012-12-19 11:16:01 +04:00
|
|
|
|
2013-08-01 03:18:06 +04:00
|
|
|
const GLContext* thisShared = this->mSharedContext ? this->mSharedContext
|
|
|
|
: this;
|
|
|
|
const GLContext* otherShared = other->mSharedContext ? other->mSharedContext
|
|
|
|
: other;
|
2012-12-19 11:16:01 +04:00
|
|
|
|
2013-08-01 03:18:06 +04:00
|
|
|
return thisShared == otherShared;
|
2012-12-19 11:16:01 +04:00
|
|
|
}
|
|
|
|
|
2015-07-15 03:37:28 +03:00
|
|
|
bool InitOffscreen(const gfx::IntSize& size, const SurfaceCaps& caps);
|
2010-12-17 10:49:42 +03:00
|
|
|
|
2013-08-01 03:18:06 +04:00
|
|
|
protected:
|
|
|
|
// Note that it does -not- clear the resized buffers.
|
2013-12-10 20:12:42 +04:00
|
|
|
bool CreateScreenBuffer(const gfx::IntSize& size, const SurfaceCaps& caps) {
|
2013-08-01 03:18:06 +04:00
|
|
|
if (!IsOffscreenSizeAllowed(size))
|
|
|
|
return false;
|
2010-12-17 10:49:42 +03:00
|
|
|
|
2014-10-26 04:32:46 +03:00
|
|
|
return CreateScreenBufferImpl(size, caps);
|
2012-12-18 05:58:44 +04:00
|
|
|
}
|
2010-10-13 01:01:59 +04:00
|
|
|
|
2013-12-10 20:12:42 +04:00
|
|
|
bool CreateScreenBufferImpl(const gfx::IntSize& size,
|
2013-08-01 03:18:06 +04:00
|
|
|
const SurfaceCaps& caps);
|
2010-10-13 01:01:59 +04:00
|
|
|
|
2013-08-01 03:18:06 +04:00
|
|
|
public:
|
2013-12-10 20:12:42 +04:00
|
|
|
bool ResizeScreenBuffer(const gfx::IntSize& size);
|
2010-10-13 01:01:59 +04:00
|
|
|
|
2013-08-01 03:18:06 +04:00
|
|
|
protected:
|
|
|
|
SurfaceCaps mCaps;
|
2010-10-13 01:01:59 +04:00
|
|
|
|
2013-08-01 03:18:06 +04:00
|
|
|
public:
|
|
|
|
const SurfaceCaps& Caps() const {
|
|
|
|
return mCaps;
|
2012-11-01 20:11:42 +04:00
|
|
|
}
|
|
|
|
|
2013-08-01 03:18:06 +04:00
|
|
|
// Only varies based on bpp16 and alpha.
|
|
|
|
GLFormats ChooseGLFormats(const SurfaceCaps& caps) const;
|
2012-12-19 11:16:01 +04:00
|
|
|
|
2013-08-01 03:18:06 +04:00
|
|
|
bool IsFramebufferComplete(GLuint fb, GLenum* status = nullptr);
|
2012-12-19 11:16:01 +04:00
|
|
|
|
2013-08-01 03:18:06 +04:00
|
|
|
// Does not check completeness.
|
|
|
|
void AttachBuffersToFB(GLuint colorTex, GLuint colorRB,
|
|
|
|
GLuint depthRB, GLuint stencilRB,
|
|
|
|
GLuint fb, GLenum target = LOCAL_GL_TEXTURE_2D);
|
2010-10-13 01:01:59 +04:00
|
|
|
|
2013-08-01 03:18:06 +04:00
|
|
|
// Passing null is fine if the value you'd get is 0.
|
|
|
|
bool AssembleOffscreenFBs(const GLuint colorMSRB,
|
|
|
|
const GLuint depthRB,
|
|
|
|
const GLuint stencilRB,
|
|
|
|
const GLuint texture,
|
|
|
|
GLuint* drawFB,
|
|
|
|
GLuint* readFB);
|
2012-12-19 11:16:01 +04:00
|
|
|
|
2013-08-01 03:18:06 +04:00
|
|
|
protected:
|
|
|
|
friend class GLScreenBuffer;
|
2014-08-16 04:38:07 +04:00
|
|
|
UniquePtr<GLScreenBuffer> mScreen;
|
2010-10-13 01:01:59 +04:00
|
|
|
|
2014-07-12 02:10:49 +04:00
|
|
|
SharedSurface* mLockedSurface;
|
2013-08-01 03:18:06 +04:00
|
|
|
|
|
|
|
public:
|
2014-07-12 02:10:49 +04:00
|
|
|
void LockSurface(SharedSurface* surf) {
|
2013-08-01 03:18:06 +04:00
|
|
|
MOZ_ASSERT(!mLockedSurface);
|
|
|
|
mLockedSurface = surf;
|
2012-12-18 05:58:44 +04:00
|
|
|
}
|
2010-10-13 01:01:59 +04:00
|
|
|
|
2014-07-12 02:10:49 +04:00
|
|
|
void UnlockSurface(SharedSurface* surf) {
|
2013-08-01 03:18:06 +04:00
|
|
|
MOZ_ASSERT(mLockedSurface == surf);
|
|
|
|
mLockedSurface = nullptr;
|
2012-12-19 11:16:01 +04:00
|
|
|
}
|
|
|
|
|
2014-07-12 02:10:49 +04:00
|
|
|
SharedSurface* GetLockedSurface() const {
|
2013-08-01 03:18:06 +04:00
|
|
|
return mLockedSurface;
|
2012-12-18 05:58:44 +04:00
|
|
|
}
|
2010-10-13 01:01:59 +04:00
|
|
|
|
2013-08-01 03:18:06 +04:00
|
|
|
bool IsOffscreen() const {
|
2015-02-13 06:00:41 +03:00
|
|
|
return mIsOffscreen;
|
2012-12-19 11:16:01 +04:00
|
|
|
}
|
|
|
|
|
2013-08-01 03:18:06 +04:00
|
|
|
GLScreenBuffer* Screen() const {
|
2014-08-16 04:38:07 +04:00
|
|
|
return mScreen.get();
|
2012-11-01 20:11:42 +04:00
|
|
|
}
|
|
|
|
|
2013-08-01 03:18:06 +04:00
|
|
|
/* Clear to transparent black, with 0 depth and stencil,
|
|
|
|
* while preserving current ClearColor etc. values.
|
|
|
|
* Useful for resizing offscreen buffers.
|
|
|
|
*/
|
|
|
|
void ClearSafely();
|
|
|
|
|
|
|
|
bool WorkAroundDriverBugs() const { return mWorkAroundDriverBugs; }
|
|
|
|
|
2015-07-15 03:37:28 +03:00
|
|
|
bool IsDrawingToDefaultFramebuffer();
|
2014-10-15 01:49:49 +04:00
|
|
|
|
2013-08-01 03:18:06 +04:00
|
|
|
protected:
|
2015-10-18 08:24:48 +03:00
|
|
|
RefPtr<TextureGarbageBin> mTexGarbageBin;
|
2013-08-01 03:18:06 +04:00
|
|
|
|
2012-12-19 11:16:01 +04:00
|
|
|
public:
|
2013-08-01 03:18:06 +04:00
|
|
|
TextureGarbageBin* TexGarbageBin() {
|
|
|
|
MOZ_ASSERT(mTexGarbageBin);
|
|
|
|
return mTexGarbageBin;
|
2012-11-01 20:11:42 +04:00
|
|
|
}
|
|
|
|
|
2013-08-01 03:18:06 +04:00
|
|
|
void EmptyTexGarbageBin();
|
2012-12-19 11:16:01 +04:00
|
|
|
|
2013-12-10 20:12:42 +04:00
|
|
|
bool IsOffscreenSizeAllowed(const gfx::IntSize& aSize) const;
|
2013-12-03 22:44:38 +04:00
|
|
|
|
2013-08-01 03:18:06 +04:00
|
|
|
protected:
|
2016-04-22 02:32:18 +03:00
|
|
|
bool InitWithPrefix(const char* prefix, bool trygl);
|
2012-12-19 11:16:01 +04:00
|
|
|
|
2016-04-22 02:32:18 +03:00
|
|
|
private:
|
|
|
|
bool InitWithPrefixImpl(const char* prefix, bool trygl);
|
|
|
|
void LoadMoreSymbols(const char* prefix, bool trygl);
|
|
|
|
bool LoadExtSymbols(const char* prefix, bool trygl, const SymLoadStruct* list,
|
|
|
|
GLExtensions ext);
|
|
|
|
bool LoadFeatureSymbols(const char* prefix, bool trygl, const SymLoadStruct* list,
|
|
|
|
GLFeature feature);
|
|
|
|
|
|
|
|
protected:
|
2013-08-01 03:18:06 +04:00
|
|
|
void InitExtensions();
|
2013-02-14 03:26:24 +04:00
|
|
|
|
2014-01-08 00:02:18 +04:00
|
|
|
GLint mViewportRect[4];
|
2014-01-08 00:02:19 +04:00
|
|
|
GLint mScissorRect[4];
|
2014-01-08 00:02:18 +04:00
|
|
|
|
2013-08-01 03:18:06 +04:00
|
|
|
GLint mMaxTextureSize;
|
|
|
|
GLint mMaxCubeMapTextureSize;
|
|
|
|
GLint mMaxTextureImageSize;
|
|
|
|
GLint mMaxRenderbufferSize;
|
2014-08-28 03:16:22 +04:00
|
|
|
GLint mMaxViewportDims[2];
|
2013-08-01 03:18:06 +04:00
|
|
|
GLsizei mMaxSamples;
|
|
|
|
bool mNeedsTextureSizeChecks;
|
2015-09-17 05:41:00 +03:00
|
|
|
bool mNeedsFlushBeforeDeleteFB;
|
2016-07-15 18:58:58 +03:00
|
|
|
bool mTextureAllocCrashesOnMapFailure;
|
2016-09-08 17:29:44 +03:00
|
|
|
bool mNeedsCheckAfterAttachTextureToFb;
|
2013-08-01 03:18:06 +04:00
|
|
|
bool mWorkAroundDriverBugs;
|
|
|
|
|
|
|
|
bool IsTextureSizeSafeToPassToDriver(GLenum target, GLsizei width, GLsizei height) const {
|
|
|
|
if (mNeedsTextureSizeChecks) {
|
|
|
|
// some drivers incorrectly handle some large texture sizes that are below the
|
|
|
|
// max texture size that they report. So we check ourselves against our own values
|
|
|
|
// (mMax[CubeMap]TextureSize).
|
|
|
|
// see bug 737182 for Mac Intel 2D textures
|
|
|
|
// see bug 684882 for Mac Intel cube map textures
|
|
|
|
// see bug 814716 for Mesa Nouveau
|
|
|
|
GLsizei maxSize = target == LOCAL_GL_TEXTURE_CUBE_MAP ||
|
|
|
|
(target >= LOCAL_GL_TEXTURE_CUBE_MAP_POSITIVE_X &&
|
|
|
|
target <= LOCAL_GL_TEXTURE_CUBE_MAP_NEGATIVE_Z)
|
|
|
|
? mMaxCubeMapTextureSize
|
|
|
|
: mMaxTextureSize;
|
|
|
|
return width <= maxSize && height <= maxSize;
|
|
|
|
}
|
|
|
|
return true;
|
2012-12-19 11:16:01 +04:00
|
|
|
}
|
|
|
|
|
2011-10-27 00:00:44 +04:00
|
|
|
|
2013-08-01 03:18:06 +04:00
|
|
|
public:
|
2014-10-26 04:32:46 +03:00
|
|
|
GLsizei MaxSamples() const {
|
|
|
|
return mMaxSamples;
|
|
|
|
}
|
2012-12-18 05:58:44 +04:00
|
|
|
|
2014-01-08 00:02:18 +04:00
|
|
|
void fViewport(GLint x, GLint y, GLsizei width, GLsizei height) {
|
2014-01-08 00:02:18 +04:00
|
|
|
if (mViewportRect[0] == x &&
|
|
|
|
mViewportRect[1] == y &&
|
|
|
|
mViewportRect[2] == width &&
|
|
|
|
mViewportRect[3] == height)
|
|
|
|
{
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
mViewportRect[0] = x;
|
|
|
|
mViewportRect[1] = y;
|
|
|
|
mViewportRect[2] = width;
|
|
|
|
mViewportRect[3] = height;
|
2013-02-14 03:26:24 +04:00
|
|
|
BEFORE_GL_CALL;
|
2013-08-01 03:18:06 +04:00
|
|
|
mSymbols.fViewport(x, y, width, height);
|
2013-02-14 03:26:24 +04:00
|
|
|
AFTER_GL_CALL;
|
|
|
|
}
|
|
|
|
|
2012-12-19 11:16:01 +04:00
|
|
|
#undef ASSERT_SYMBOL_PRESENT
|
|
|
|
|
2014-10-15 05:24:53 +04:00
|
|
|
#ifdef MOZ_GL_DEBUG
|
2016-06-11 04:37:07 +03:00
|
|
|
void CreatedProgram(GLContext* aOrigin, GLuint aName);
|
|
|
|
void CreatedShader(GLContext* aOrigin, GLuint aName);
|
|
|
|
void CreatedBuffers(GLContext* aOrigin, GLsizei aCount, GLuint* aNames);
|
|
|
|
void CreatedQueries(GLContext* aOrigin, GLsizei aCount, GLuint* aNames);
|
|
|
|
void CreatedTextures(GLContext* aOrigin, GLsizei aCount, GLuint* aNames);
|
|
|
|
void CreatedFramebuffers(GLContext* aOrigin, GLsizei aCount, GLuint* aNames);
|
|
|
|
void CreatedRenderbuffers(GLContext* aOrigin, GLsizei aCount, GLuint* aNames);
|
|
|
|
void DeletedProgram(GLContext* aOrigin, GLuint aName);
|
|
|
|
void DeletedShader(GLContext* aOrigin, GLuint aName);
|
|
|
|
void DeletedBuffers(GLContext* aOrigin, GLsizei aCount, const GLuint* aNames);
|
|
|
|
void DeletedQueries(GLContext* aOrigin, GLsizei aCount, const GLuint* aNames);
|
|
|
|
void DeletedTextures(GLContext* aOrigin, GLsizei aCount, const GLuint* aNames);
|
|
|
|
void DeletedFramebuffers(GLContext* aOrigin, GLsizei aCount, const GLuint* aNames);
|
|
|
|
void DeletedRenderbuffers(GLContext* aOrigin, GLsizei aCount, const GLuint* aNames);
|
|
|
|
|
|
|
|
void SharedContextDestroyed(GLContext* aChild);
|
2010-07-19 09:01:14 +04:00
|
|
|
void ReportOutstandingNames();
|
|
|
|
|
|
|
|
struct NamedResource {
|
|
|
|
NamedResource()
|
2012-07-30 18:20:58 +04:00
|
|
|
: origin(nullptr), name(0), originDeleted(false)
|
2010-07-19 09:01:14 +04:00
|
|
|
{ }
|
|
|
|
|
2016-06-11 04:37:07 +03:00
|
|
|
NamedResource(GLContext* aOrigin, GLuint aName)
|
2011-10-17 18:59:28 +04:00
|
|
|
: origin(aOrigin), name(aName), originDeleted(false)
|
2010-07-19 09:01:14 +04:00
|
|
|
{ }
|
|
|
|
|
2016-06-11 04:37:07 +03:00
|
|
|
GLContext* origin;
|
2010-07-19 09:01:14 +04:00
|
|
|
GLuint name;
|
2011-09-29 10:19:26 +04:00
|
|
|
bool originDeleted;
|
2010-07-19 09:01:14 +04:00
|
|
|
|
|
|
|
// for sorting
|
|
|
|
bool operator<(const NamedResource& aOther) const {
|
|
|
|
if (intptr_t(origin) < intptr_t(aOther.origin))
|
|
|
|
return true;
|
|
|
|
if (name < aOther.name)
|
|
|
|
return true;
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
bool operator==(const NamedResource& aOther) const {
|
|
|
|
return origin == aOther.origin &&
|
|
|
|
name == aOther.name &&
|
|
|
|
originDeleted == aOther.originDeleted;
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
nsTArray<NamedResource> mTrackedPrograms;
|
|
|
|
nsTArray<NamedResource> mTrackedShaders;
|
|
|
|
nsTArray<NamedResource> mTrackedTextures;
|
|
|
|
nsTArray<NamedResource> mTrackedFramebuffers;
|
|
|
|
nsTArray<NamedResource> mTrackedRenderbuffers;
|
|
|
|
nsTArray<NamedResource> mTrackedBuffers;
|
2012-11-01 20:11:42 +04:00
|
|
|
nsTArray<NamedResource> mTrackedQueries;
|
2010-07-19 09:01:14 +04:00
|
|
|
#endif
|
2014-09-10 05:40:51 +04:00
|
|
|
|
|
|
|
|
|
|
|
protected:
|
|
|
|
bool mHeavyGLCallsSinceLastFlush;
|
|
|
|
|
|
|
|
public:
|
|
|
|
void FlushIfHeavyGLCallsSinceLastFlush();
|
2014-10-25 05:26:41 +04:00
|
|
|
static bool ShouldSpew();
|
2015-02-13 06:00:41 +03:00
|
|
|
static bool ShouldDumpExts();
|
|
|
|
void Readback(SharedSurface* src, gfx::DataSourceSurface* dest);
|
2013-01-18 04:45:11 +04:00
|
|
|
};
|
2010-10-07 00:43:14 +04:00
|
|
|
|
2016-06-11 04:37:07 +03:00
|
|
|
bool DoesStringMatch(const char* aString, const char* aWantedString);
|
2010-10-07 00:43:14 +04:00
|
|
|
|
2015-02-13 06:00:41 +03:00
|
|
|
void SplitByChar(const nsACString& str, const char delim,
|
|
|
|
std::vector<nsCString>* const out);
|
|
|
|
|
|
|
|
template<size_t N>
|
|
|
|
bool
|
2016-03-11 05:52:13 +03:00
|
|
|
MarkBitfieldByString(const nsACString& str, const char* const (&markStrList)[N],
|
2015-02-13 06:00:41 +03:00
|
|
|
std::bitset<N>* const out_markList)
|
|
|
|
{
|
|
|
|
for (size_t i = 0; i < N; i++) {
|
|
|
|
if (str.Equals(markStrList[i])) {
|
|
|
|
(*out_markList)[i] = 1;
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
template<size_t N>
|
|
|
|
void
|
|
|
|
MarkBitfieldByStrings(const std::vector<nsCString>& strList,
|
2016-03-11 05:52:13 +03:00
|
|
|
bool dumpStrings, const char* const (&markStrList)[N],
|
2015-02-13 06:00:41 +03:00
|
|
|
std::bitset<N>* const out_markList)
|
|
|
|
{
|
|
|
|
for (auto itr = strList.begin(); itr != strList.end(); ++itr) {
|
|
|
|
const nsACString& str = *itr;
|
|
|
|
const bool wasMarked = MarkBitfieldByString(str, markStrList,
|
|
|
|
out_markList);
|
|
|
|
if (dumpStrings)
|
|
|
|
printf_stderr(" %s%s\n", str.BeginReading(), wasMarked ? "(*)" : "");
|
|
|
|
}
|
|
|
|
}
|
2013-02-14 03:26:24 +04:00
|
|
|
|
2015-09-29 06:35:46 +03:00
|
|
|
/**
|
|
|
|
* Helper function that creates a 2D texture aSize.width x aSize.height with
|
|
|
|
* storage type specified by aFormats. Returns GL texture object id.
|
|
|
|
*
|
|
|
|
* See mozilla::gl::CreateTexture.
|
|
|
|
*/
|
|
|
|
GLuint CreateTextureForOffscreen(GLContext* aGL, const GLFormats& aFormats,
|
|
|
|
const gfx::IntSize& aSize);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Helper function that creates a 2D texture aSize.width x aSize.height with
|
|
|
|
* storage type aInternalFormat. Returns GL texture object id.
|
|
|
|
*
|
|
|
|
* Initialize textyre parameters to:
|
|
|
|
* GL_TEXTURE_MIN_FILTER = GL_LINEAR
|
|
|
|
* GL_TEXTURE_MAG_FILTER = GL_LINEAR
|
|
|
|
* GL_TEXTURE_WRAP_S = GL_CLAMP_TO_EDGE
|
|
|
|
* GL_TEXTURE_WRAP_T = GL_CLAMP_TO_EDGE
|
|
|
|
*/
|
|
|
|
GLuint CreateTexture(GLContext* aGL, GLenum aInternalFormat, GLenum aFormat,
|
|
|
|
GLenum aType, const gfx::IntSize& aSize, bool linear = true);
|
|
|
|
|
2016-07-15 18:58:58 +03:00
|
|
|
/**
|
|
|
|
* Helper function that calculates the number of bytes required per
|
|
|
|
* texel for a texture from its format and type.
|
|
|
|
*/
|
|
|
|
uint32_t GetBytesPerTexel(GLenum format, GLenum type);
|
|
|
|
|
2010-04-27 06:09:44 +04:00
|
|
|
} /* namespace gl */
|
|
|
|
} /* namespace mozilla */
|
|
|
|
|
2010-05-18 08:04:22 +04:00
|
|
|
#endif /* GLCONTEXT_H_ */
|