mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-28 23:31:56 +00:00
Bug 1048693 - WebGL2 - GL symbols for MapBufferRange.; r=jgilbert
--HG-- extra : source : 60f8018abde66d8ec07329fabaa0a7131acf84da extra : histedit_source : b4fa1e2d81c7c007479ae2409233a600fc75c257
This commit is contained in:
parent
e4ee224432
commit
f49eba2345
@ -85,6 +85,7 @@ static const char *sExtensionNames[] = {
|
||||
"GL_ARB_framebuffer_sRGB",
|
||||
"GL_ARB_half_float_pixel",
|
||||
"GL_ARB_instanced_arrays",
|
||||
"GL_ARB_map_buffer_range",
|
||||
"GL_ARB_occlusion_query2",
|
||||
"GL_ARB_pixel_buffer_object",
|
||||
"GL_ARB_robustness",
|
||||
@ -1086,6 +1087,21 @@ GLContext::InitWithPrefix(const char *prefix, bool trygl)
|
||||
}
|
||||
}
|
||||
|
||||
if (IsSupported(GLFeature::map_buffer_range)) {
|
||||
SymLoadStruct mapBufferRangeSymbols[] = {
|
||||
{ (PRFuncPtr*) &mSymbols.fMapBufferRange, { "MapBufferRange", nullptr } },
|
||||
{ (PRFuncPtr*) &mSymbols.fFlushMappedBufferRange, { "FlushMappedBufferRange", nullptr } },
|
||||
END_SYMBOLS
|
||||
};
|
||||
|
||||
if (!LoadSymbols(mapBufferRangeSymbols, trygl, prefix)) {
|
||||
NS_ERROR("GL supports map_buffer_range without supplying its functions.");
|
||||
|
||||
MarkUnsupported(GLFeature::map_buffer_range);
|
||||
ClearSymbols(mapBufferRangeSymbols);
|
||||
}
|
||||
}
|
||||
|
||||
if (IsExtensionSupported(KHR_debug)) {
|
||||
SymLoadStruct extSymbols[] = {
|
||||
{ (PRFuncPtr*) &mSymbols.fDebugMessageControl, { "DebugMessageControl", "DebugMessageControlKHR", nullptr } },
|
||||
|
@ -97,6 +97,7 @@ MOZ_BEGIN_ENUM_CLASS(GLFeature)
|
||||
get_query_object_iv,
|
||||
instanced_arrays,
|
||||
instanced_non_arrays,
|
||||
map_buffer_range,
|
||||
occlusion_query,
|
||||
occlusion_query_boolean,
|
||||
occlusion_query2,
|
||||
@ -356,6 +357,7 @@ public:
|
||||
ARB_framebuffer_sRGB,
|
||||
ARB_half_float_pixel,
|
||||
ARB_instanced_arrays,
|
||||
ARB_map_buffer_range,
|
||||
ARB_occlusion_query2,
|
||||
ARB_pixel_buffer_object,
|
||||
ARB_robustness,
|
||||
@ -2679,6 +2681,27 @@ public:
|
||||
}
|
||||
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// 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;
|
||||
}
|
||||
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// Constructor
|
||||
protected:
|
||||
|
@ -259,6 +259,15 @@ static const FeatureInfo sFeatureInfoArr[] = {
|
||||
* has no such restriction.
|
||||
*/
|
||||
},
|
||||
{
|
||||
"map_buffer_range",
|
||||
300, // OpenGL version
|
||||
300, // OpenGL ES version
|
||||
GLContext::ARB_map_buffer_range,
|
||||
{
|
||||
GLContext::Extensions_End
|
||||
}
|
||||
},
|
||||
{
|
||||
"occlusion_query",
|
||||
200, // OpenGL version
|
||||
|
@ -527,6 +527,12 @@ struct GLContextSymbols
|
||||
pfnIsFenceT fIsFence;
|
||||
typedef void (GLAPIENTRY * pfnGetFenceivT) (GLuint fence, GLenum pname, GLint* params);
|
||||
pfnGetFenceivT fGetFenceiv;
|
||||
|
||||
// map_buffer_range
|
||||
typedef void* (GLAPIENTRY * PFNGLMAPBUFFERRANGEPROC) (GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access);
|
||||
PFNGLMAPBUFFERRANGEPROC fMapBufferRange;
|
||||
typedef void (GLAPIENTRY * PFNGLFLUSHMAPPEDBUFFERRANGEPROC) (GLenum target, GLintptr offset, GLsizeiptr length);
|
||||
PFNGLFLUSHMAPPEDBUFFERRANGEPROC fFlushMappedBufferRange;
|
||||
};
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user