mirror of
https://github.com/nillerusr/source-engine.git
synced 2026-08-07 17:29:36 +00:00
Update ToGLES( fix occlusion query and other small things )
This commit is contained in:
@@ -38,8 +38,18 @@
|
||||
#include "interface.h"
|
||||
#include "togles/rendermechanism.h"
|
||||
|
||||
#ifdef LINUX
|
||||
#include <sys/time.h>
|
||||
#endif
|
||||
|
||||
void *VoidFnPtrLookup_GlMgr(const char *fn, bool &okay, const bool bRequired, void *fallback=NULL);
|
||||
|
||||
/*
|
||||
#define GL_USE_EXECUTE_HELPER_FOR_ALL_API_CALLS 1
|
||||
#define GL_TRACK_API_TIME 1
|
||||
#define GL_DUMP_ALL_API_CALLS 1
|
||||
*/
|
||||
|
||||
#if GL_USE_EXECUTE_HELPER_FOR_ALL_API_CALLS
|
||||
class CGLExecuteHelperBase
|
||||
{
|
||||
@@ -47,7 +57,7 @@ public:
|
||||
inline void StartCall(const char *pName);
|
||||
inline void StopCall(const char *pName);
|
||||
#if GL_TRACK_API_TIME
|
||||
TmU64 m_nStartTime;
|
||||
uint64 m_nStartTime;
|
||||
#endif
|
||||
};
|
||||
|
||||
@@ -308,13 +318,14 @@ public:
|
||||
GLDriverProvider_t m_nDriverProvider;
|
||||
|
||||
#ifdef OSX
|
||||
#define GL_EXT(x,glmajor,glminor) bool m_bHave_##x;
|
||||
#define GL_FUNC(ext,req,ret,fn,arg,call) CDynamicFunctionOpenGL< req, ret (*) arg, ret > fn;
|
||||
#define GL_FUNC_VOID(ext,req,fn,arg,call) CDynamicFunctionOpenGL< req, void (*) arg, void > fn;
|
||||
#else
|
||||
#define GL_EXT(x,glmajor,glminor) bool m_bHave_##x;
|
||||
#define GL_FUNC(ext,req,ret,fn,arg,call) CDynamicFunctionOpenGL< req, ret (APIENTRY *) arg, ret > fn;
|
||||
#define GL_FUNC_VOID(ext,req,fn,arg,call) CDynamicFunctionOpenGL< req, void (APIENTRY *) arg, void > fn;
|
||||
#define GL_FUNC(ext,req,ret,fn,arg,call) CDynamicFunctionOpenGL< req, ret (*) arg, ret > fn;
|
||||
#define GL_FUNC_VOID(ext,req,fn,arg,call) CDynamicFunctionOpenGL< req, void (*) arg, void > fn;
|
||||
#else
|
||||
#define _APIENTRY __attribute__((pcs("aapcs"))) APIENTRY
|
||||
#define GL_EXT(x,glmajor,glminor) bool m_bHave_##x;
|
||||
#define GL_FUNC(ext,req,ret,fn,arg,call) CDynamicFunctionOpenGL< req, ret (_APIENTRY *) arg, ret > fn;
|
||||
#define GL_FUNC_VOID(ext,req,fn,arg,call) CDynamicFunctionOpenGL< req, void (_APIENTRY *) arg, void > fn;
|
||||
#endif
|
||||
#include "togles/glfuncs.inl"
|
||||
#undef GL_FUNC_VOID
|
||||
@@ -347,54 +358,30 @@ typedef void * (*GL_GetProcAddressCallbackFunc_t)(const char *, bool &, const bo
|
||||
DLL_IMPORT void ClearOpenGLEntryPoints();
|
||||
#endif
|
||||
|
||||
inline uint64 get_nsecs()
|
||||
{
|
||||
struct timespec time={0,0};
|
||||
clock_gettime(CLOCK_MONOTONIC, &time);
|
||||
return time.tv_nsec;
|
||||
}
|
||||
|
||||
#if GL_USE_EXECUTE_HELPER_FOR_ALL_API_CALLS
|
||||
inline void CGLExecuteHelperBase::StartCall(const char *pName)
|
||||
{
|
||||
(void)pName;
|
||||
|
||||
#if GL_TELEMETRY_ZONES
|
||||
tmEnter( TELEMETRY_LEVEL3, TMZF_NONE, pName );
|
||||
#endif
|
||||
|
||||
#if GL_TRACK_API_TIME
|
||||
m_nStartTime = tmFastTime();
|
||||
#endif
|
||||
|
||||
#if GL_DUMP_ALL_API_CALLS
|
||||
static bool s_bDumpCalls;
|
||||
if ( s_bDumpCalls )
|
||||
{
|
||||
char buf[128];
|
||||
buf[0] = 'G';
|
||||
buf[1] = 'L';
|
||||
buf[2] = ':';
|
||||
size_t l = strlen( pName );
|
||||
memcpy( buf + 3, pName, l );
|
||||
buf[3 + l] = '\n';
|
||||
buf[4 + l] = '\0';
|
||||
Plat_DebugString( buf );
|
||||
}
|
||||
#endif
|
||||
m_nStartTime = get_nsecs();
|
||||
}
|
||||
|
||||
inline void CGLExecuteHelperBase::StopCall(const char *pName)
|
||||
{
|
||||
#if GL_TRACK_API_TIME
|
||||
uint64 nTotalCycles = tmFastTime() - m_nStartTime;
|
||||
#endif
|
||||
|
||||
#if GL_TELEMETRY_ZONES
|
||||
tmLeave( TELEMETRY_LEVEL3 );
|
||||
#endif
|
||||
|
||||
#if GL_TRACK_API_TIME
|
||||
//double flMilliseconds = g_Telemetry.flRDTSCToMilliSeconds * nTotalCycles;
|
||||
if (gGL)
|
||||
{
|
||||
gGL->m_nTotalGLCycles += nTotalCycles;
|
||||
gGL->m_nTotalGLCalls++;
|
||||
}
|
||||
#endif
|
||||
{
|
||||
if( gGL )
|
||||
{
|
||||
uint64 time = get_nsecs() - m_nStartTime;
|
||||
printf("Function %s finished in %llu\n", pName, time);
|
||||
|
||||
if( strcmp(pName, "glBufferSubData") == 0 && time > 1000000 )
|
||||
DebuggerBreak();
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
@@ -36,7 +36,6 @@ GL_FUNC_VOID(OpenGL,true,glBlendEquation,(GLenum a),(a))
|
||||
GL_FUNC_VOID(OpenGL,true,glBlendFunc,(GLenum a,GLenum b),(a,b))
|
||||
GL_FUNC_VOID(OpenGL,true,glBufferData,(GLenum a, GLsizeiptr b, const GLvoid *c,GLenum d),(a,b,c,d))
|
||||
GL_FUNC_VOID(OpenGL,true,glClear,(GLbitfield a),(a))
|
||||
GL_FUNC_VOID(OpenGL,true,glClearDepthf,(GLfloat a),(a))
|
||||
GL_FUNC_VOID(OpenGL,true,glClearColor,(GLclampf a,GLclampf b,GLclampf c,GLclampf d),(a,b,c,d))
|
||||
GL_FUNC_VOID(OpenGL,true,glReadPixels, (GLint a, GLint b, GLsizei c, GLsizei d, GLenum e, GLenum f, void * g), (a,b,c,d,e,f,g))
|
||||
GL_FUNC_VOID(OpenGL,true,glClearStencil,(GLint a),(a))
|
||||
@@ -55,13 +54,18 @@ GL_FUNC_VOID(OpenGL,true,glDeleteShader,(GLuint a),(a))
|
||||
GL_FUNC_VOID(OpenGL,true,glDeleteTextures,(GLsizei a,const GLuint *b),(a,b))
|
||||
GL_FUNC_VOID(OpenGL,true,glDepthFunc,(GLenum a),(a))
|
||||
GL_FUNC_VOID(OpenGL,true,glDepthMask,(GLboolean a),(a))
|
||||
GL_FUNC_VOID(OpenGL,true,glDepthRangef,(GLfloat a,GLfloat b),(a,b))
|
||||
GL_FUNC_VOID(OpenGL,true,glDisable,(GLenum a),(a))
|
||||
GL_FUNC_VOID(OpenGL,true,glDisableVertexAttribArray,(GLuint a),(a))
|
||||
GL_FUNC_VOID(OpenGL,true,glDrawArrays,(GLenum a,GLint b,GLsizei c),(a,b,c))
|
||||
GL_FUNC_VOID(OpenGL,true,glDrawBuffers,(GLsizei a,const GLenum *b),(a,b))
|
||||
GL_FUNC_VOID(OpenGL,true,glDetachShader,(GLuint a,GLuint b),(a,b))
|
||||
GL_FUNC_VOID(OpenGL,true,glDrawRangeElements,(GLenum a,GLuint b,GLuint c,GLsizei d,GLenum e,const GLvoid *f),(a,b,c,d,e,f))
|
||||
GL_FUNC_VOID(OpenGL,true,glGetSynciv,(GLsync a, GLenum b, GLsizei c, GLsizei *d, GLint *e),(a,b,c,d,e))
|
||||
GL_FUNC(OpenGL,true,GLenum,glClientWaitSync,(GLsync a, GLbitfield b, GLuint64 c),(a,b,c))
|
||||
GL_FUNC_VOID(OpenGL,true,glWaitSync,(GLsync a, GLbitfield b, GLuint64 c),(a,b,c))
|
||||
GL_FUNC_VOID(OpenGL,true,glDeleteSync,(GLsync a),(a))
|
||||
GL_FUNC(OpenGL,true,GLsync,glFenceSync,(GLenum a, GLbitfield b),(a,b))
|
||||
|
||||
#ifndef OSX // 10.6/GL 2.1 compatability
|
||||
GL_FUNC_VOID(OpenGL,true,glDrawRangeElementsBaseVertex,(GLenum a,GLuint b,GLuint c,GLsizei d,GLenum e,const GLvoid *f, GLenum g),(a,b,c,d,e,f,g))
|
||||
#endif
|
||||
@@ -73,7 +77,6 @@ GL_FUNC_VOID(OpenGL,true,glFrontFace,(GLenum a),(a))
|
||||
GL_FUNC_VOID(OpenGL,true,glGenBuffers,(GLsizei a,GLuint *b),(a,b))
|
||||
GL_FUNC_VOID(OpenGL,true,glGenTextures,(GLsizei a,GLuint *b),(a,b))
|
||||
GL_FUNC_VOID(OpenGL,true,glGetBooleanv,(GLenum a,GLboolean *b),(a,b))
|
||||
GL_FUNC_VOID(OpenGL,true,glGetFloatv,(GLenum a,GLfloat *b),(a,b))
|
||||
//GL_FUNC_VOID(OpenGL,true,glGetInfoLog,(GLuint a,GLsizei b,GLsizei *c,GLchar *d),(a,b,c,d))
|
||||
GL_FUNC_VOID(OpenGL,true,glGetIntegerv,(GLenum a,GLint *b),(a,b))
|
||||
GL_FUNC_VOID(OpenGL,true,glGetProgramiv,(GLenum a,GLenum b,GLint *c),(a,b,c))
|
||||
@@ -85,7 +88,6 @@ GL_FUNC_VOID(OpenGL,true,glLinkProgram,(GLuint a),(a))
|
||||
//GL_FUNC_VOID(OpenGL,true,glOrtho,(GLdouble a,GLdouble b,GLdouble c,GLdouble d,GLdouble e,GLdouble f),(a,b,c,d,e,f))
|
||||
GL_FUNC_VOID(OpenGL,true,glPixelStorei,(GLenum a,GLint b),(a,b))
|
||||
//GL_FUNC_VOID(OpenGL,true,glPolygonMode,(GLenum a,GLenum b),(a,b))
|
||||
GL_FUNC_VOID(OpenGL,true,glPolygonOffset,(GLfloat a,GLfloat b),(a,b))
|
||||
GL_FUNC_VOID(OpenGL,true,glReadBuffer,(GLenum a),(a))
|
||||
GL_FUNC_VOID(OpenGL,true,glScissor,(GLint a,GLint b,GLsizei c,GLsizei d),(a,b,c,d))
|
||||
GL_FUNC_VOID(OpenGL,true,glShaderSource,(GLuint a,GLsizei b,const GLchar **c,const GLint *d),(a,b,c,d))
|
||||
@@ -94,12 +96,9 @@ GL_FUNC_VOID(OpenGL,true,glStencilMask,(GLuint a),(a))
|
||||
GL_FUNC_VOID(OpenGL,true,glStencilOp,(GLenum a,GLenum b,GLenum c),(a,b,c))
|
||||
GL_FUNC_VOID(OpenGL,true,glTexImage2D,(GLenum a,GLint b,GLint c,GLsizei d,GLsizei e,GLint f,GLenum g,GLenum h,const GLvoid *i),(a,b,c,d,e,f,g,h,i))
|
||||
GL_FUNC_VOID(OpenGL,true,glTexImage3D,(GLenum a,GLint b,GLint c,GLsizei d,GLsizei e,GLsizei f,GLint g,GLenum h,GLenum i,const GLvoid *j),(a,b,c,d,e,f,g,h,i,j))
|
||||
GL_FUNC_VOID(OpenGL,true,glTexParameterfv,(GLenum a,GLenum b,const GLfloat *c),(a,b,c))
|
||||
GL_FUNC_VOID(OpenGL,true,glTexParameteri,(GLenum a,GLenum b,GLint c),(a,b,c))
|
||||
GL_FUNC_VOID(OpenGL,true,glTexSubImage2D,(GLenum a,GLint b,GLint c,GLint d,GLsizei e,GLsizei f,GLenum g,GLenum h,const GLvoid *i),(a,b,c,d,e,f,g,h,i))
|
||||
GL_FUNC_VOID(OpenGL,true,glUniform1f,(GLint a,GLfloat b),(a,b))
|
||||
GL_FUNC_VOID(OpenGL,true,glUniform1i,(GLint a,GLint b),(a,b))
|
||||
GL_FUNC_VOID(OpenGL,true,glUniform4fv,(GLint a,GLsizei b,const GLfloat *c),(a,b,c))
|
||||
GL_FUNC(OpenGL,true,GLboolean,glUnmapBuffer,(GLenum a),(a))
|
||||
GL_FUNC_VOID(OpenGL,true,glUseProgram,(GLuint a),(a))
|
||||
GL_FUNC_VOID(OpenGL,true,glVertexAttribPointer,(GLuint a,GLint b,GLenum c,GLboolean d,GLsizei e,const GLvoid *f),(a,b,c,d,e,f))
|
||||
@@ -108,22 +107,8 @@ GL_FUNC_VOID(OpenGL,true,glClientActiveTexture,(GLenum a),(a))
|
||||
GL_FUNC_VOID(OpenGL,true,glStencilOpSeparate,(GLenum a,GLenum b,GLenum c,GLenum d),(a,b,c,d))
|
||||
GL_FUNC_VOID(OpenGL,true,glStencilFuncSeparate,(GLenum a,GLenum b,GLint c,GLuint d),(a,b,c,d))
|
||||
GL_FUNC_VOID(OpenGL,true,glGetTexLevelParameteriv,(GLenum a,GLint b,GLenum c,GLint *d),(a,b,c,d))
|
||||
GL_FUNC_VOID(OpenGL,true,glColor4f,(GLfloat a,GLfloat b,GLfloat c,GLfloat d),(a,b,c,d))
|
||||
GL_EXT(GL_EXT_framebuffer_object,-1,-1)
|
||||
GL_EXT(GL_EXT_framebuffer_blit,-1,-1)
|
||||
GL_EXT(GL_EXT_framebuffer_multisample,-1,-1)
|
||||
/*GL_FUNC_VOID(GL_EXT_framebuffer_object,false,glBindFramebufferEXT,(GLenum a,GLuint b),(a,b))
|
||||
GL_FUNC_VOID(GL_EXT_framebuffer_object,false,glBindRenderbufferEXT,(GLenum a,GLuint b),(a,b))
|
||||
GL_FUNC(GL_EXT_framebuffer_object,false,GLenum,glCheckFramebufferStatusEXT,(GLenum a),(a))
|
||||
GL_FUNC_VOID(GL_EXT_framebuffer_object,false,glDeleteRenderbuffersEXT,(GLsizei a,const GLuint *b),(a,b))
|
||||
GL_FUNC_VOID(GL_EXT_framebuffer_object,false,glFramebufferRenderbufferEXT,(GLenum a,GLenum b,GLenum c,GLuint d),(a,b,c,d))
|
||||
GL_FUNC_VOID(GL_EXT_framebuffer_object,false,glFramebufferTexture2DEXT,(GLenum a,GLenum b,GLenum c,GLuint d,GLint e),(a,b,c,d,e))
|
||||
GL_FUNC_VOID(GL_EXT_framebuffer_object,false,glFramebufferTexture3DEXT,(GLenum a,GLenum b,GLenum c,GLuint d,GLint e,GLint f),(a,b,c,d,e,f))
|
||||
GL_FUNC_VOID(GL_EXT_framebuffer_object,false,glGenFramebuffersEXT,(GLsizei a,GLuint *b),(a,b))
|
||||
GL_FUNC_VOID(GL_EXT_framebuffer_object,false,glGenRenderbuffersEXT,(GLsizei a,GLuint *b),(a,b))
|
||||
GL_FUNC_VOID(GL_EXT_framebuffer_object,false,glDeleteFramebuffersEXT,(GLsizei a,const GLuint *b),(a,b))
|
||||
GL_FUNC_VOID(GL_EXT_framebuffer_blit,false,glBlitFramebufferEXT,(GLint a,GLint b,GLint c,GLint d,GLint e,GLint f,GLint g,GLint h,GLbitfield i,GLenum j),(a,b,c,d,e,f,g,h,i,j))
|
||||
GL_FUNC_VOID(GL_EXT_framebuffer_multisample,false,glRenderbufferStorageMultisampleEXT,(GLenum a,GLsizei b,GLenum c,GLsizei d,GLsizei e),(a,b,c,d,e))*/
|
||||
GL_EXT(GL_APPLE_fence,-1,-1)
|
||||
GL_FUNC(GL_APPLE_fence,false,GLboolean,glTestFenceAPPLE,(GLuint a),(a))
|
||||
GL_FUNC_VOID(GL_APPLE_fence,false,glSetFenceAPPLE,(GLuint a),(a))
|
||||
@@ -137,13 +122,8 @@ GL_FUNC_VOID(GL_NV_fence,false,glFinishFenceNV,(GLuint a),(a))
|
||||
GL_FUNC_VOID(GL_NV_fence,false,glDeleteFencesNV,(GLsizei a,const GLuint *b),(a,b))
|
||||
GL_FUNC_VOID(GL_NV_fence,false,glGenFencesNV,(GLsizei a,GLuint *b),(a,b))
|
||||
GL_EXT(GL_ARB_sync,3,2)
|
||||
#ifdef HAVE_GL_ARB_SYNC
|
||||
GL_FUNC_VOID(GL_ARB_sync,false,glGetSynciv,(GLsync a, GLenum b, GLsizei c, GLsizei *d, GLint *e),(a,b,c,d,e))
|
||||
GL_FUNC(GL_ARB_sync,false,GLenum,glClientWaitSync,(GLsync a, GLbitfield b, GLuint64 c),(a,b,c))
|
||||
GL_FUNC_VOID(GL_ARB_sync,false,glWaitSync,(GLsync a, GLbitfield b, GLuint64 c),(a,b,c))
|
||||
GL_FUNC_VOID(GL_ARB_sync,false,glDeleteSync,(GLsync a),(a))
|
||||
GL_FUNC(GL_ARB_sync,false,GLsync,glFenceSync,(GLenum a, GLbitfield b),(a,b))
|
||||
#endif
|
||||
//#ifdef HAVE_GL_ARB_SYNC
|
||||
//#endif
|
||||
GL_EXT(GL_EXT_bindable_uniform,-1,-1)
|
||||
GL_FUNC_VOID(GL_EXT_bindable_uniform,false,glUniformBufferEXT,(GLuint a,GLint b,GLuint c),(a,b,c))
|
||||
GL_FUNC(GL_EXT_bindable_uniform,false,int,glGetUniformBufferSizeEXT,(GLenum a, GLenum b),(a,b))
|
||||
@@ -165,6 +145,7 @@ GL_EXT(GL_APPLE_client_storage,-1,-1)
|
||||
GL_EXT(GL_ARB_uniform_buffer,-1,-1)
|
||||
GL_EXT(GL_ARB_vertex_array_bgra,-1,-1)
|
||||
GL_EXT(GL_EXT_vertex_array_bgra,-1,-1)
|
||||
GL_EXT(GL_EXT_framebuffer_multisample_blit_scaled,-1,-1)
|
||||
|
||||
GL_EXT(GL_ARB_framebuffer_object,3,0)
|
||||
/*GL_FUNC_VOID(GL_ARB_framebuffer_object,false,glBindFramebuffer,(GLenum a,GLuint b),(a,b))
|
||||
@@ -208,9 +189,7 @@ GL_FUNC_VOID(OpenGL, true, glGenSamplers, (GLuint a, GLuint *b), (a, b))
|
||||
GL_FUNC_VOID(OpenGL, true, glDeleteSamplers, (GLsizei a, const GLuint *b), (a, b))
|
||||
GL_FUNC_VOID(OpenGL, true, glBindSampler, (GLuint a, GLuint b), (a, b))
|
||||
GL_FUNC_VOID(OpenGL, true, glSamplerParameteri, (GLuint a, GLenum b, GLint c), (a, b, c))
|
||||
GL_FUNC_VOID(OpenGL, true, glSamplerParameterf, (GLuint a, GLenum b, GLfloat c), (a, b, c))
|
||||
GL_FUNC_VOID(OpenGL, true, glSamplerParameterfv, (GLuint a, GLenum b, const GLfloat *c), (a, b, c))
|
||||
GL_FUNC(GL_NV_bindless_texture, false, GLuint64, glGetTextureHandleNV, (GLuint texture), (texture))
|
||||
/*GL_FUNC(GL_NV_bindless_texture, false, GLuint64, glGetTextureHandleNV, (GLuint texture), (texture))
|
||||
GL_FUNC(GL_NV_bindless_texture, false, GLuint64, glGetTextureSamplerHandleNV, (GLuint texture, GLuint sampler), (texture, sampler))
|
||||
GL_FUNC_VOID(GL_NV_bindless_texture, false, glMakeTextureHandleResidentNV, (GLuint64 handle), (handle))
|
||||
GL_FUNC_VOID(GL_NV_bindless_texture, false, glMakeTextureHandleNonResidentNV, (GLuint64 handle), (handle))
|
||||
@@ -218,7 +197,7 @@ GL_FUNC_VOID(GL_NV_bindless_texture, false, glUniformHandleui64NV, (GLint locati
|
||||
GL_FUNC_VOID(GL_NV_bindless_texture, false, glUniformHandleui64vNV, (int location, GLsizei count, const GLuint64 *value), (location count, value))
|
||||
GL_FUNC_VOID(GL_NV_bindless_texture, false, glProgramUniformHandleui64NV, (GLuint program, GLint location, GLuint64 value), (program, location, value))
|
||||
GL_FUNC_VOID(GL_NV_bindless_texture, false, glProgramUniformHandleui64vNV, (GLuint program, GLint location, GLsizei count, const GLuint64 *values), (program, location, count, values))
|
||||
GL_FUNC(GL_NV_bindless_texture, false, GLboolean, glIsTextureHandleResidentNV, (GLuint64 handle), (handle))
|
||||
GL_FUNC(GL_NV_bindless_texture, false, GLboolean, glIsTextureHandleResidentNV, (GLuint64 handle), (handle))*/
|
||||
GL_FUNC_VOID(OpenGL,true,glGenQueries,(GLsizei n, GLuint *ids), (n, ids))
|
||||
GL_FUNC_VOID(OpenGL,true,glDeleteQueries,(GLsizei n, const GLuint *ids),(n, ids))
|
||||
GL_FUNC_VOID(OpenGL,true,glBeginQuery,(GLenum target, GLuint id), (target, id))
|
||||
@@ -227,7 +206,6 @@ GL_FUNC_VOID(OpenGL,true,glCopyBufferSubData,(GLenum readtarget, GLenum writetar
|
||||
#endif // !OSX
|
||||
|
||||
GL_EXT(GL_AMD_pinned_memory,-1,-1)
|
||||
GL_EXT(GL_EXT_framebuffer_multisample_blit_scaled,-1,-1)
|
||||
|
||||
#ifndef OSX
|
||||
GL_FUNC_VOID(OpenGL,true,glGenVertexArrays,(GLsizei n, GLuint *arrays),(n, arrays))
|
||||
@@ -235,6 +213,9 @@ GL_FUNC_VOID(OpenGL,true,glDeleteVertexArrays,(GLsizei n, GLuint *arrays),(n, ar
|
||||
GL_FUNC_VOID(OpenGL,true,glBindVertexArray,(GLuint a),(a))
|
||||
#endif // !OSX
|
||||
|
||||
GL_EXT(GL_QCOM_alpha_test,-1,-1)
|
||||
|
||||
|
||||
GL_EXT(GL_EXT_texture_sRGB_decode,-1,-1)
|
||||
GL_EXT(GL_NVX_gpu_memory_info,-1,-1)
|
||||
GL_EXT(GL_ATI_meminfo,-1,-1)
|
||||
@@ -243,8 +224,12 @@ GL_EXT(GL_EXT_texture_compression_dxt1,-1,-1)
|
||||
GL_EXT(GL_ANGLE_texture_compression_dxt3,-1,-1)
|
||||
GL_EXT(GL_ANGLE_texture_compression_dxt5,-1,-1)
|
||||
|
||||
GL_EXT( GL_EXT_color_buffer_half_float, -1, -1 )
|
||||
GL_EXT( GL_EXT_texture_norm16, -1, -1 )
|
||||
GL_EXT( GL_EXT_buffer_storage, -1, -1 )
|
||||
GL_FUNC_VOID( GL_EXT_buffer_storage, false, glBufferStorageEXT, (GLenum target, GLsizeiptr size, const void *data, GLbitfield flags), (target, size, data, flags) )
|
||||
//GL_FUNC_VOID(OpenGL, false,glGetTexImage,(GLenum a,GLint b,GLenum c,GLenum d,GLvoid *e),(a,b,c,d,e))
|
||||
|
||||
|
||||
// This one is an OS extension. We'll add a little helper function to look for it.
|
||||
#ifdef _WIN32
|
||||
@@ -252,3 +237,15 @@ GL_FUNC_VOID( GL_EXT_buffer_storage, false, glBufferStorageEXT, (GLenum target,
|
||||
#else
|
||||
GL_EXT(GLX_EXT_swap_control_tear,-1,-1)
|
||||
#endif
|
||||
|
||||
GL_FUNC_VOID(OpenGL,true,glGetFloatv,(GLenum a,GLfloat *b),(a,b))
|
||||
GL_FUNC_VOID(OpenGL,true,glPolygonOffset,(GLfloat a,GLfloat b),(a,b))
|
||||
GL_FUNC_VOID(OpenGL,true,glTexParameterfv,(GLenum a,GLenum b,const GLfloat *c),(a,b,c))
|
||||
GL_FUNC_VOID(OpenGL,true,glUniform1f,(GLint a,GLfloat b),(a,b))
|
||||
GL_FUNC_VOID(OpenGL,true,glUniform4fv,(GLint a,GLsizei b,const GLfloat *c),(a,b,c))
|
||||
GL_FUNC_VOID(OpenGL,true,glColor4f,(GLfloat a,GLfloat b,GLfloat c,GLfloat d),(a,b,c,d))
|
||||
GL_FUNC_VOID(OpenGL,true,glSamplerParameterf,(GLuint a, GLenum b, GLfloat c), (a, b, c))
|
||||
GL_FUNC_VOID(OpenGL,true,glSamplerParameterfv,(GLuint a, GLenum b, const GLfloat *c), (a, b, c))
|
||||
GL_FUNC_VOID(GL_QCOM_alpha_test,false,glAlphaFuncQCOM,(GLenum a, GLfloat b),(a,b))
|
||||
GL_FUNC_VOID(OpenGL,true,glClearDepthf,(GLfloat a),(a))
|
||||
GL_FUNC_VOID(OpenGL,true,glDepthRangef,(GLfloat a,GLfloat b),(a,b))
|
||||
|
||||
@@ -55,7 +55,6 @@
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
//===============================================================================
|
||||
// debug channels
|
||||
|
||||
|
||||
@@ -65,6 +65,10 @@
|
||||
#define GLM_OPENGL_DEFAULT_DEVICE_ID 1
|
||||
#define GLM_OPENGL_LOW_PERF_DEVICE_ID 2
|
||||
|
||||
#define GL_ALPHA_TEST_QCOM 0x0BC0
|
||||
#define GL_ALPHA_TEST_FUNC_QCOM 0x0BC1
|
||||
#define GL_ALPHA_TEST_REF_QCOM 0x0BC2
|
||||
|
||||
extern void GLMDebugPrintf( const char *pMsg, ... );
|
||||
|
||||
extern uint g_nTotalDrawsOrClears, g_nTotalVBLockBytes, g_nTotalIBLockBytes;
|
||||
@@ -314,14 +318,18 @@ static GLAlphaTest_t g_alpha_test;
|
||||
// --- GLAlphaTestEnable ---
|
||||
FORCEINLINE void GLContextSet( GLAlphaTestEnable_t *src )
|
||||
{
|
||||
// glSetEnable( GL_ALPHA_TEST, src->enable != 0 );
|
||||
g_alpha_test.enable = src->enable;
|
||||
if( gGL->m_bHave_GL_QCOM_alpha_test )
|
||||
glSetEnable( GL_ALPHA_TEST_QCOM, src->enable != 0 );
|
||||
else
|
||||
g_alpha_test.enable = src->enable;
|
||||
}
|
||||
|
||||
FORCEINLINE void GLContextGet( GLAlphaTestEnable_t *dst )
|
||||
{
|
||||
// dst->enable = gGL->glIsEnabled( GL_ALPHA_TEST );
|
||||
dst->enable = g_alpha_test.enable;
|
||||
if( gGL->m_bHave_GL_QCOM_alpha_test )
|
||||
dst->enable = gGL->glIsEnabled( GL_ALPHA_TEST_QCOM );
|
||||
else
|
||||
dst->enable = g_alpha_test.enable;
|
||||
}
|
||||
|
||||
FORCEINLINE void GLContextGetDefault( GLAlphaTestEnable_t *dst )
|
||||
@@ -332,17 +340,25 @@ FORCEINLINE void GLContextGetDefault( GLAlphaTestEnable_t *dst )
|
||||
// --- GLAlphaTestFunc ---
|
||||
FORCEINLINE void GLContextSet( GLAlphaTestFunc_t *src )
|
||||
{
|
||||
// gGL->glAlphaFunc( src->func, src->ref );
|
||||
if( gGL->m_bHave_GL_QCOM_alpha_test )
|
||||
gGL->glAlphaFuncQCOM( src->func, src->ref );
|
||||
|
||||
g_alpha_test.func = src->func;
|
||||
g_alpha_test.ref = src->ref;
|
||||
}
|
||||
|
||||
FORCEINLINE void GLContextGet( GLAlphaTestFunc_t *dst )
|
||||
{
|
||||
// glGetEnumv( GL_ALPHA_TEST_FUNC, &dst->func );
|
||||
// gGL->glGetFloatv( GL_ALPHA_TEST_REF, &dst->ref );
|
||||
dst->func = g_alpha_test.func;
|
||||
dst->ref = g_alpha_test.ref;
|
||||
if( gGL->m_bHave_GL_QCOM_alpha_test )
|
||||
{
|
||||
glGetEnumv( GL_ALPHA_TEST_FUNC_QCOM, &dst->func );
|
||||
gGL->glGetFloatv( GL_ALPHA_TEST_REF_QCOM, &dst->ref );
|
||||
}
|
||||
else
|
||||
{
|
||||
dst->func = g_alpha_test.func;
|
||||
dst->ref = g_alpha_test.ref;
|
||||
}
|
||||
}
|
||||
|
||||
FORCEINLINE void GLContextGetDefault( GLAlphaTestFunc_t *dst )
|
||||
@@ -723,8 +739,8 @@ FORCEINLINE void GLContextSet( GLBlendEnableSRGB_t *src )
|
||||
|
||||
FORCEINLINE void GLContextGet( GLBlendEnableSRGB_t *dst )
|
||||
{
|
||||
// dst->enable = gGL->glIsEnabled( GL_FRAMEBUFFER_SRGB_EXT );
|
||||
dst->enable = true; // wtf ?
|
||||
dst->enable = gGL->glIsEnabled( GL_FRAMEBUFFER_SRGB_EXT );
|
||||
// dst->enable = true; // wtf ?
|
||||
}
|
||||
|
||||
FORCEINLINE void GLContextGetDefault( GLBlendEnableSRGB_t *dst )
|
||||
@@ -1403,7 +1419,7 @@ class GLMContext
|
||||
else
|
||||
{
|
||||
m_FakeBlendEnableSRGB = src->enable != 0;
|
||||
}
|
||||
}
|
||||
// note however that we're still tracking what this mode should be, so FlushDrawStates can look at it and adjust the pixel shader
|
||||
// if fake SRGB mode is in place (m_caps.m_hasGammaWrites is false)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user