mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-14 08:04:40 +00:00
Merge pull request #615 from JeffProgrammer/gl_meminfo
OpenGL Memory Info Extensions
This commit is contained in:
commit
ed80136322
5 changed files with 88 additions and 16 deletions
|
|
@ -119,7 +119,7 @@
|
||||||
* This follows the return type of the function and precedes the function
|
* This follows the return type of the function and precedes the function
|
||||||
* name in the function prototype.
|
* name in the function prototype.
|
||||||
*/
|
*/
|
||||||
#if defined(_WIN32) && !defined(_WIN32_WCE) && !defined(KHRONOS_STATIC)
|
#if defined(_WIN32) && !defined(_WIN32_WCE) && !defined(__SCITECH_SNAP__)
|
||||||
/* Win32 but not WinCE */
|
/* Win32 but not WinCE */
|
||||||
# define KHRONOS_APIENTRY __stdcall
|
# define KHRONOS_APIENTRY __stdcall
|
||||||
#else
|
#else
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
|
|
||||||
GLX loader generated by glad 0.1.33 on Sun Aug 18 11:26:39 2019.
|
GLX loader generated by glad 0.1.34 on Mon Oct 11 00:48:11 2021.
|
||||||
|
|
||||||
Language/Generator: C/C++
|
Language/Generator: C/C++
|
||||||
Specification: glx
|
Specification: glx
|
||||||
|
|
@ -27,6 +27,7 @@
|
||||||
GLX_EXT_create_context_es_profile,
|
GLX_EXT_create_context_es_profile,
|
||||||
GLX_EXT_fbconfig_packed_float,
|
GLX_EXT_fbconfig_packed_float,
|
||||||
GLX_EXT_framebuffer_sRGB,
|
GLX_EXT_framebuffer_sRGB,
|
||||||
|
GLX_EXT_get_drawable_type,
|
||||||
GLX_EXT_import_context,
|
GLX_EXT_import_context,
|
||||||
GLX_EXT_libglvnd,
|
GLX_EXT_libglvnd,
|
||||||
GLX_EXT_no_config_context,
|
GLX_EXT_no_config_context,
|
||||||
|
|
@ -48,6 +49,7 @@
|
||||||
GLX_NV_copy_image,
|
GLX_NV_copy_image,
|
||||||
GLX_NV_delay_before_swap,
|
GLX_NV_delay_before_swap,
|
||||||
GLX_NV_float_buffer,
|
GLX_NV_float_buffer,
|
||||||
|
GLX_NV_multigpu_context,
|
||||||
GLX_NV_multisample_coverage,
|
GLX_NV_multisample_coverage,
|
||||||
GLX_NV_present_video,
|
GLX_NV_present_video,
|
||||||
GLX_NV_robustness_video_memory_purge,
|
GLX_NV_robustness_video_memory_purge,
|
||||||
|
|
@ -79,7 +81,7 @@
|
||||||
Reproducible: False
|
Reproducible: False
|
||||||
|
|
||||||
Commandline:
|
Commandline:
|
||||||
--api="glx=1.4" --generator="c" --spec="glx" --extensions="GLX_3DFX_multisample,GLX_AMD_gpu_association,GLX_ARB_context_flush_control,GLX_ARB_create_context,GLX_ARB_create_context_no_error,GLX_ARB_create_context_profile,GLX_ARB_create_context_robustness,GLX_ARB_fbconfig_float,GLX_ARB_framebuffer_sRGB,GLX_ARB_get_proc_address,GLX_ARB_multisample,GLX_ARB_robustness_application_isolation,GLX_ARB_robustness_share_group_isolation,GLX_ARB_vertex_buffer_object,GLX_EXT_buffer_age,GLX_EXT_context_priority,GLX_EXT_create_context_es2_profile,GLX_EXT_create_context_es_profile,GLX_EXT_fbconfig_packed_float,GLX_EXT_framebuffer_sRGB,GLX_EXT_import_context,GLX_EXT_libglvnd,GLX_EXT_no_config_context,GLX_EXT_stereo_tree,GLX_EXT_swap_control,GLX_EXT_swap_control_tear,GLX_EXT_texture_from_pixmap,GLX_EXT_visual_info,GLX_EXT_visual_rating,GLX_INTEL_swap_event,GLX_MESA_agp_offset,GLX_MESA_copy_sub_buffer,GLX_MESA_pixmap_colormap,GLX_MESA_query_renderer,GLX_MESA_release_buffers,GLX_MESA_set_3dfx_mode,GLX_MESA_swap_control,GLX_NV_copy_buffer,GLX_NV_copy_image,GLX_NV_delay_before_swap,GLX_NV_float_buffer,GLX_NV_multisample_coverage,GLX_NV_present_video,GLX_NV_robustness_video_memory_purge,GLX_NV_swap_group,GLX_NV_video_capture,GLX_NV_video_out,GLX_OML_swap_method,GLX_OML_sync_control,GLX_SGIS_blended_overlay,GLX_SGIS_multisample,GLX_SGIS_shared_multisample,GLX_SGIX_dmbuffer,GLX_SGIX_fbconfig,GLX_SGIX_hyperpipe,GLX_SGIX_pbuffer,GLX_SGIX_swap_barrier,GLX_SGIX_swap_group,GLX_SGIX_video_resize,GLX_SGIX_video_source,GLX_SGIX_visual_select_group,GLX_SGI_cushion,GLX_SGI_make_current_read,GLX_SGI_swap_control,GLX_SGI_video_sync,GLX_SUN_get_transparent_index"
|
--api="glx=1.4" --generator="c" --spec="glx" --extensions="GLX_3DFX_multisample,GLX_AMD_gpu_association,GLX_ARB_context_flush_control,GLX_ARB_create_context,GLX_ARB_create_context_no_error,GLX_ARB_create_context_profile,GLX_ARB_create_context_robustness,GLX_ARB_fbconfig_float,GLX_ARB_framebuffer_sRGB,GLX_ARB_get_proc_address,GLX_ARB_multisample,GLX_ARB_robustness_application_isolation,GLX_ARB_robustness_share_group_isolation,GLX_ARB_vertex_buffer_object,GLX_EXT_buffer_age,GLX_EXT_context_priority,GLX_EXT_create_context_es2_profile,GLX_EXT_create_context_es_profile,GLX_EXT_fbconfig_packed_float,GLX_EXT_framebuffer_sRGB,GLX_EXT_get_drawable_type,GLX_EXT_import_context,GLX_EXT_libglvnd,GLX_EXT_no_config_context,GLX_EXT_stereo_tree,GLX_EXT_swap_control,GLX_EXT_swap_control_tear,GLX_EXT_texture_from_pixmap,GLX_EXT_visual_info,GLX_EXT_visual_rating,GLX_INTEL_swap_event,GLX_MESA_agp_offset,GLX_MESA_copy_sub_buffer,GLX_MESA_pixmap_colormap,GLX_MESA_query_renderer,GLX_MESA_release_buffers,GLX_MESA_set_3dfx_mode,GLX_MESA_swap_control,GLX_NV_copy_buffer,GLX_NV_copy_image,GLX_NV_delay_before_swap,GLX_NV_float_buffer,GLX_NV_multigpu_context,GLX_NV_multisample_coverage,GLX_NV_present_video,GLX_NV_robustness_video_memory_purge,GLX_NV_swap_group,GLX_NV_video_capture,GLX_NV_video_out,GLX_OML_swap_method,GLX_OML_sync_control,GLX_SGIS_blended_overlay,GLX_SGIS_multisample,GLX_SGIS_shared_multisample,GLX_SGIX_dmbuffer,GLX_SGIX_fbconfig,GLX_SGIX_hyperpipe,GLX_SGIX_pbuffer,GLX_SGIX_swap_barrier,GLX_SGIX_swap_group,GLX_SGIX_video_resize,GLX_SGIX_video_source,GLX_SGIX_visual_select_group,GLX_SGI_cushion,GLX_SGI_make_current_read,GLX_SGI_swap_control,GLX_SGI_video_sync,GLX_SUN_get_transparent_index"
|
||||||
Online:
|
Online:
|
||||||
Too many extensions
|
Too many extensions
|
||||||
*/
|
*/
|
||||||
|
|
@ -139,6 +141,7 @@ typedef void* (* GLADloadproc)(const char *name);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
GLAPI int gladLoadGLX(Display *dpy, int screen);
|
GLAPI int gladLoadGLX(Display *dpy, int screen);
|
||||||
|
GLAPI void gladUnloadGLX(void);
|
||||||
|
|
||||||
GLAPI int gladLoadGLXLoader(GLADloadproc, Display *dpy, int screen);
|
GLAPI int gladLoadGLXLoader(GLADloadproc, Display *dpy, int screen);
|
||||||
|
|
||||||
|
|
@ -616,6 +619,11 @@ GLAPI PFNGLXGETPROCADDRESSPROC glad_glXGetProcAddress;
|
||||||
#define GLX_3DFX_WINDOW_MODE_MESA 0x1
|
#define GLX_3DFX_WINDOW_MODE_MESA 0x1
|
||||||
#define GLX_3DFX_FULLSCREEN_MODE_MESA 0x2
|
#define GLX_3DFX_FULLSCREEN_MODE_MESA 0x2
|
||||||
#define GLX_FLOAT_COMPONENTS_NV 0x20B0
|
#define GLX_FLOAT_COMPONENTS_NV 0x20B0
|
||||||
|
#define GLX_CONTEXT_MULTIGPU_ATTRIB_NV 0x20AA
|
||||||
|
#define GLX_CONTEXT_MULTIGPU_ATTRIB_SINGLE_NV 0x20AB
|
||||||
|
#define GLX_CONTEXT_MULTIGPU_ATTRIB_AFR_NV 0x20AC
|
||||||
|
#define GLX_CONTEXT_MULTIGPU_ATTRIB_MULTICAST_NV 0x20AD
|
||||||
|
#define GLX_CONTEXT_MULTIGPU_ATTRIB_MULTI_DISPLAY_MULTICAST_NV 0x20AE
|
||||||
#define GLX_COVERAGE_SAMPLES_NV 100001
|
#define GLX_COVERAGE_SAMPLES_NV 100001
|
||||||
#define GLX_COLOR_SAMPLES_NV 0x20B3
|
#define GLX_COLOR_SAMPLES_NV 0x20B3
|
||||||
#define GLX_NUM_VIDEO_SLOTS_NV 0x20F0
|
#define GLX_NUM_VIDEO_SLOTS_NV 0x20F0
|
||||||
|
|
@ -804,6 +812,10 @@ GLAPI int GLAD_GLX_EXT_fbconfig_packed_float;
|
||||||
#define GLX_EXT_framebuffer_sRGB 1
|
#define GLX_EXT_framebuffer_sRGB 1
|
||||||
GLAPI int GLAD_GLX_EXT_framebuffer_sRGB;
|
GLAPI int GLAD_GLX_EXT_framebuffer_sRGB;
|
||||||
#endif
|
#endif
|
||||||
|
#ifndef GLX_EXT_get_drawable_type
|
||||||
|
#define GLX_EXT_get_drawable_type 1
|
||||||
|
GLAPI int GLAD_GLX_EXT_get_drawable_type;
|
||||||
|
#endif
|
||||||
#ifndef GLX_EXT_import_context
|
#ifndef GLX_EXT_import_context
|
||||||
#define GLX_EXT_import_context 1
|
#define GLX_EXT_import_context 1
|
||||||
GLAPI int GLAD_GLX_EXT_import_context;
|
GLAPI int GLAD_GLX_EXT_import_context;
|
||||||
|
|
@ -957,6 +969,10 @@ GLAPI PFNGLXDELAYBEFORESWAPNVPROC glad_glXDelayBeforeSwapNV;
|
||||||
#define GLX_NV_float_buffer 1
|
#define GLX_NV_float_buffer 1
|
||||||
GLAPI int GLAD_GLX_NV_float_buffer;
|
GLAPI int GLAD_GLX_NV_float_buffer;
|
||||||
#endif
|
#endif
|
||||||
|
#ifndef GLX_NV_multigpu_context
|
||||||
|
#define GLX_NV_multigpu_context 1
|
||||||
|
GLAPI int GLAD_GLX_NV_multigpu_context;
|
||||||
|
#endif
|
||||||
#ifndef GLX_NV_multisample_coverage
|
#ifndef GLX_NV_multisample_coverage
|
||||||
#define GLX_NV_multisample_coverage 1
|
#define GLX_NV_multisample_coverage 1
|
||||||
GLAPI int GLAD_GLX_NV_multisample_coverage;
|
GLAPI int GLAD_GLX_NV_multisample_coverage;
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
|
|
||||||
GLX loader generated by glad 0.1.33 on Sun Aug 18 11:26:39 2019.
|
GLX loader generated by glad 0.1.34 on Mon Oct 11 00:48:11 2021.
|
||||||
|
|
||||||
Language/Generator: C/C++
|
Language/Generator: C/C++
|
||||||
Specification: glx
|
Specification: glx
|
||||||
|
|
@ -27,6 +27,7 @@
|
||||||
GLX_EXT_create_context_es_profile,
|
GLX_EXT_create_context_es_profile,
|
||||||
GLX_EXT_fbconfig_packed_float,
|
GLX_EXT_fbconfig_packed_float,
|
||||||
GLX_EXT_framebuffer_sRGB,
|
GLX_EXT_framebuffer_sRGB,
|
||||||
|
GLX_EXT_get_drawable_type,
|
||||||
GLX_EXT_import_context,
|
GLX_EXT_import_context,
|
||||||
GLX_EXT_libglvnd,
|
GLX_EXT_libglvnd,
|
||||||
GLX_EXT_no_config_context,
|
GLX_EXT_no_config_context,
|
||||||
|
|
@ -48,6 +49,7 @@
|
||||||
GLX_NV_copy_image,
|
GLX_NV_copy_image,
|
||||||
GLX_NV_delay_before_swap,
|
GLX_NV_delay_before_swap,
|
||||||
GLX_NV_float_buffer,
|
GLX_NV_float_buffer,
|
||||||
|
GLX_NV_multigpu_context,
|
||||||
GLX_NV_multisample_coverage,
|
GLX_NV_multisample_coverage,
|
||||||
GLX_NV_present_video,
|
GLX_NV_present_video,
|
||||||
GLX_NV_robustness_video_memory_purge,
|
GLX_NV_robustness_video_memory_purge,
|
||||||
|
|
@ -79,7 +81,7 @@
|
||||||
Reproducible: False
|
Reproducible: False
|
||||||
|
|
||||||
Commandline:
|
Commandline:
|
||||||
--api="glx=1.4" --generator="c" --spec="glx" --extensions="GLX_3DFX_multisample,GLX_AMD_gpu_association,GLX_ARB_context_flush_control,GLX_ARB_create_context,GLX_ARB_create_context_no_error,GLX_ARB_create_context_profile,GLX_ARB_create_context_robustness,GLX_ARB_fbconfig_float,GLX_ARB_framebuffer_sRGB,GLX_ARB_get_proc_address,GLX_ARB_multisample,GLX_ARB_robustness_application_isolation,GLX_ARB_robustness_share_group_isolation,GLX_ARB_vertex_buffer_object,GLX_EXT_buffer_age,GLX_EXT_context_priority,GLX_EXT_create_context_es2_profile,GLX_EXT_create_context_es_profile,GLX_EXT_fbconfig_packed_float,GLX_EXT_framebuffer_sRGB,GLX_EXT_import_context,GLX_EXT_libglvnd,GLX_EXT_no_config_context,GLX_EXT_stereo_tree,GLX_EXT_swap_control,GLX_EXT_swap_control_tear,GLX_EXT_texture_from_pixmap,GLX_EXT_visual_info,GLX_EXT_visual_rating,GLX_INTEL_swap_event,GLX_MESA_agp_offset,GLX_MESA_copy_sub_buffer,GLX_MESA_pixmap_colormap,GLX_MESA_query_renderer,GLX_MESA_release_buffers,GLX_MESA_set_3dfx_mode,GLX_MESA_swap_control,GLX_NV_copy_buffer,GLX_NV_copy_image,GLX_NV_delay_before_swap,GLX_NV_float_buffer,GLX_NV_multisample_coverage,GLX_NV_present_video,GLX_NV_robustness_video_memory_purge,GLX_NV_swap_group,GLX_NV_video_capture,GLX_NV_video_out,GLX_OML_swap_method,GLX_OML_sync_control,GLX_SGIS_blended_overlay,GLX_SGIS_multisample,GLX_SGIS_shared_multisample,GLX_SGIX_dmbuffer,GLX_SGIX_fbconfig,GLX_SGIX_hyperpipe,GLX_SGIX_pbuffer,GLX_SGIX_swap_barrier,GLX_SGIX_swap_group,GLX_SGIX_video_resize,GLX_SGIX_video_source,GLX_SGIX_visual_select_group,GLX_SGI_cushion,GLX_SGI_make_current_read,GLX_SGI_swap_control,GLX_SGI_video_sync,GLX_SUN_get_transparent_index"
|
--api="glx=1.4" --generator="c" --spec="glx" --extensions="GLX_3DFX_multisample,GLX_AMD_gpu_association,GLX_ARB_context_flush_control,GLX_ARB_create_context,GLX_ARB_create_context_no_error,GLX_ARB_create_context_profile,GLX_ARB_create_context_robustness,GLX_ARB_fbconfig_float,GLX_ARB_framebuffer_sRGB,GLX_ARB_get_proc_address,GLX_ARB_multisample,GLX_ARB_robustness_application_isolation,GLX_ARB_robustness_share_group_isolation,GLX_ARB_vertex_buffer_object,GLX_EXT_buffer_age,GLX_EXT_context_priority,GLX_EXT_create_context_es2_profile,GLX_EXT_create_context_es_profile,GLX_EXT_fbconfig_packed_float,GLX_EXT_framebuffer_sRGB,GLX_EXT_get_drawable_type,GLX_EXT_import_context,GLX_EXT_libglvnd,GLX_EXT_no_config_context,GLX_EXT_stereo_tree,GLX_EXT_swap_control,GLX_EXT_swap_control_tear,GLX_EXT_texture_from_pixmap,GLX_EXT_visual_info,GLX_EXT_visual_rating,GLX_INTEL_swap_event,GLX_MESA_agp_offset,GLX_MESA_copy_sub_buffer,GLX_MESA_pixmap_colormap,GLX_MESA_query_renderer,GLX_MESA_release_buffers,GLX_MESA_set_3dfx_mode,GLX_MESA_swap_control,GLX_NV_copy_buffer,GLX_NV_copy_image,GLX_NV_delay_before_swap,GLX_NV_float_buffer,GLX_NV_multigpu_context,GLX_NV_multisample_coverage,GLX_NV_present_video,GLX_NV_robustness_video_memory_purge,GLX_NV_swap_group,GLX_NV_video_capture,GLX_NV_video_out,GLX_OML_swap_method,GLX_OML_sync_control,GLX_SGIS_blended_overlay,GLX_SGIS_multisample,GLX_SGIS_shared_multisample,GLX_SGIX_dmbuffer,GLX_SGIX_fbconfig,GLX_SGIX_hyperpipe,GLX_SGIX_pbuffer,GLX_SGIX_swap_barrier,GLX_SGIX_swap_group,GLX_SGIX_video_resize,GLX_SGIX_video_source,GLX_SGIX_visual_select_group,GLX_SGI_cushion,GLX_SGI_make_current_read,GLX_SGI_swap_control,GLX_SGI_video_sync,GLX_SUN_get_transparent_index"
|
||||||
Online:
|
Online:
|
||||||
Too many extensions
|
Too many extensions
|
||||||
*/
|
*/
|
||||||
|
|
@ -119,7 +121,7 @@ static PFNWGLGETPROCADDRESSPROC_PRIVATE gladGetProcAddressPtr;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static
|
static
|
||||||
int open_gl(void) {
|
int open_glx(void) {
|
||||||
#ifndef IS_UWP
|
#ifndef IS_UWP
|
||||||
libGL = LoadLibraryW(L"opengl32.dll");
|
libGL = LoadLibraryW(L"opengl32.dll");
|
||||||
if(libGL != NULL) {
|
if(libGL != NULL) {
|
||||||
|
|
@ -134,7 +136,7 @@ int open_gl(void) {
|
||||||
}
|
}
|
||||||
|
|
||||||
static
|
static
|
||||||
void close_gl(void) {
|
void close_glx(void) {
|
||||||
if(libGL != NULL) {
|
if(libGL != NULL) {
|
||||||
FreeLibrary((HMODULE) libGL);
|
FreeLibrary((HMODULE) libGL);
|
||||||
libGL = NULL;
|
libGL = NULL;
|
||||||
|
|
@ -150,7 +152,7 @@ static PFNGLXGETPROCADDRESSPROC_PRIVATE gladGetProcAddressPtr;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static
|
static
|
||||||
int open_gl(void) {
|
int open_glx(void) {
|
||||||
#ifdef __APPLE__
|
#ifdef __APPLE__
|
||||||
static const char *NAMES[] = {
|
static const char *NAMES[] = {
|
||||||
"../Frameworks/OpenGL.framework/OpenGL",
|
"../Frameworks/OpenGL.framework/OpenGL",
|
||||||
|
|
@ -181,7 +183,7 @@ int open_gl(void) {
|
||||||
}
|
}
|
||||||
|
|
||||||
static
|
static
|
||||||
void close_gl(void) {
|
void close_glx(void) {
|
||||||
if(libGL != NULL) {
|
if(libGL != NULL) {
|
||||||
dlclose(libGL);
|
dlclose(libGL);
|
||||||
libGL = NULL;
|
libGL = NULL;
|
||||||
|
|
@ -213,14 +215,17 @@ void* get_proc(const char *namez) {
|
||||||
int gladLoadGLX(Display *dpy, int screen) {
|
int gladLoadGLX(Display *dpy, int screen) {
|
||||||
int status = 0;
|
int status = 0;
|
||||||
|
|
||||||
if(open_gl()) {
|
if(open_glx()) {
|
||||||
status = gladLoadGLXLoader((GLADloadproc)get_proc, dpy, screen);
|
status = gladLoadGLXLoader((GLADloadproc)get_proc, dpy, screen);
|
||||||
close_gl();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void gladUnloadGLX(void) {
|
||||||
|
close_glx();
|
||||||
|
}
|
||||||
|
|
||||||
static Display *GLADGLXDisplay = 0;
|
static Display *GLADGLXDisplay = 0;
|
||||||
static int GLADGLXscreen = 0;
|
static int GLADGLXscreen = 0;
|
||||||
|
|
||||||
|
|
@ -326,6 +331,7 @@ int GLAD_GLX_EXT_create_context_es2_profile = 0;
|
||||||
int GLAD_GLX_EXT_create_context_es_profile = 0;
|
int GLAD_GLX_EXT_create_context_es_profile = 0;
|
||||||
int GLAD_GLX_EXT_fbconfig_packed_float = 0;
|
int GLAD_GLX_EXT_fbconfig_packed_float = 0;
|
||||||
int GLAD_GLX_EXT_framebuffer_sRGB = 0;
|
int GLAD_GLX_EXT_framebuffer_sRGB = 0;
|
||||||
|
int GLAD_GLX_EXT_get_drawable_type = 0;
|
||||||
int GLAD_GLX_EXT_import_context = 0;
|
int GLAD_GLX_EXT_import_context = 0;
|
||||||
int GLAD_GLX_EXT_libglvnd = 0;
|
int GLAD_GLX_EXT_libglvnd = 0;
|
||||||
int GLAD_GLX_EXT_no_config_context = 0;
|
int GLAD_GLX_EXT_no_config_context = 0;
|
||||||
|
|
@ -347,6 +353,7 @@ int GLAD_GLX_NV_copy_buffer = 0;
|
||||||
int GLAD_GLX_NV_copy_image = 0;
|
int GLAD_GLX_NV_copy_image = 0;
|
||||||
int GLAD_GLX_NV_delay_before_swap = 0;
|
int GLAD_GLX_NV_delay_before_swap = 0;
|
||||||
int GLAD_GLX_NV_float_buffer = 0;
|
int GLAD_GLX_NV_float_buffer = 0;
|
||||||
|
int GLAD_GLX_NV_multigpu_context = 0;
|
||||||
int GLAD_GLX_NV_multisample_coverage = 0;
|
int GLAD_GLX_NV_multisample_coverage = 0;
|
||||||
int GLAD_GLX_NV_present_video = 0;
|
int GLAD_GLX_NV_present_video = 0;
|
||||||
int GLAD_GLX_NV_robustness_video_memory_purge = 0;
|
int GLAD_GLX_NV_robustness_video_memory_purge = 0;
|
||||||
|
|
@ -752,6 +759,7 @@ static int find_extensionsGLX(void) {
|
||||||
GLAD_GLX_EXT_create_context_es_profile = has_ext("GLX_EXT_create_context_es_profile");
|
GLAD_GLX_EXT_create_context_es_profile = has_ext("GLX_EXT_create_context_es_profile");
|
||||||
GLAD_GLX_EXT_fbconfig_packed_float = has_ext("GLX_EXT_fbconfig_packed_float");
|
GLAD_GLX_EXT_fbconfig_packed_float = has_ext("GLX_EXT_fbconfig_packed_float");
|
||||||
GLAD_GLX_EXT_framebuffer_sRGB = has_ext("GLX_EXT_framebuffer_sRGB");
|
GLAD_GLX_EXT_framebuffer_sRGB = has_ext("GLX_EXT_framebuffer_sRGB");
|
||||||
|
GLAD_GLX_EXT_get_drawable_type = has_ext("GLX_EXT_get_drawable_type");
|
||||||
GLAD_GLX_EXT_import_context = has_ext("GLX_EXT_import_context");
|
GLAD_GLX_EXT_import_context = has_ext("GLX_EXT_import_context");
|
||||||
GLAD_GLX_EXT_libglvnd = has_ext("GLX_EXT_libglvnd");
|
GLAD_GLX_EXT_libglvnd = has_ext("GLX_EXT_libglvnd");
|
||||||
GLAD_GLX_EXT_no_config_context = has_ext("GLX_EXT_no_config_context");
|
GLAD_GLX_EXT_no_config_context = has_ext("GLX_EXT_no_config_context");
|
||||||
|
|
@ -773,6 +781,7 @@ static int find_extensionsGLX(void) {
|
||||||
GLAD_GLX_NV_copy_image = has_ext("GLX_NV_copy_image");
|
GLAD_GLX_NV_copy_image = has_ext("GLX_NV_copy_image");
|
||||||
GLAD_GLX_NV_delay_before_swap = has_ext("GLX_NV_delay_before_swap");
|
GLAD_GLX_NV_delay_before_swap = has_ext("GLX_NV_delay_before_swap");
|
||||||
GLAD_GLX_NV_float_buffer = has_ext("GLX_NV_float_buffer");
|
GLAD_GLX_NV_float_buffer = has_ext("GLX_NV_float_buffer");
|
||||||
|
GLAD_GLX_NV_multigpu_context = has_ext("GLX_NV_multigpu_context");
|
||||||
GLAD_GLX_NV_multisample_coverage = has_ext("GLX_NV_multisample_coverage");
|
GLAD_GLX_NV_multisample_coverage = has_ext("GLX_NV_multisample_coverage");
|
||||||
GLAD_GLX_NV_present_video = has_ext("GLX_NV_present_video");
|
GLAD_GLX_NV_present_video = has_ext("GLX_NV_present_video");
|
||||||
GLAD_GLX_NV_robustness_video_memory_purge = has_ext("GLX_NV_robustness_video_memory_purge");
|
GLAD_GLX_NV_robustness_video_memory_purge = has_ext("GLX_NV_robustness_video_memory_purge");
|
||||||
|
|
|
||||||
|
|
@ -51,6 +51,12 @@
|
||||||
#include "shaderGen/shaderGen.h"
|
#include "shaderGen/shaderGen.h"
|
||||||
#include "gfxGLUtils.h"
|
#include "gfxGLUtils.h"
|
||||||
|
|
||||||
|
#if defined(TORQUE_OS_WIN)
|
||||||
|
#include "gfx/gl/tGL/tWGL.h"
|
||||||
|
#elif defined(TORQUE_OS_LINUX)
|
||||||
|
#include "gfx/gl/tGL/tXGL.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
GFXAdapter::CreateDeviceInstanceDelegate GFXGLDevice::mCreateDeviceInstance(GFXGLDevice::createInstance);
|
GFXAdapter::CreateDeviceInstanceDelegate GFXGLDevice::mCreateDeviceInstance(GFXGLDevice::createInstance);
|
||||||
|
|
||||||
GFXDevice *GFXGLDevice::createInstance( U32 adapterIndex )
|
GFXDevice *GFXGLDevice::createInstance( U32 adapterIndex )
|
||||||
|
|
@ -1073,8 +1079,36 @@ U32 GFXGLDevice::getTotalVideoMemory_GL_EXT()
|
||||||
return mem / 1024;
|
return mem / 1024;
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO OPENGL, add supprt for INTEL cards.
|
|
||||||
|
#if defined(TORQUE_OS_WIN)
|
||||||
|
else if( (gglHasWExtension(AMD_gpu_association)) )
|
||||||
|
{
|
||||||
|
// Just assume 1 AMD gpu. Who uses crossfire anyways now? And, crossfire doesn't double
|
||||||
|
// vram anyways, so does it really matter?
|
||||||
|
UINT id;
|
||||||
|
if (wglGetGPUIDsAMD(1, &id) != 0)
|
||||||
|
{
|
||||||
|
S32 memorySize;
|
||||||
|
if (wglGetGPUInfoAMD(id, WGL_GPU_RAM_AMD, GL_INT, 1, &memorySize) != -1)
|
||||||
|
{
|
||||||
|
// memory size is returned in MB
|
||||||
|
return memorySize;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined(TORQUE_OS_LINUX)
|
||||||
|
else if ( (gglHasXExtension(NULL, NULL, MESA_query_renderer)) )
|
||||||
|
{
|
||||||
|
// memory size is in mb
|
||||||
|
U32 memorySize;
|
||||||
|
glXQueryCurrentRendererIntegerMESA(GLX_RENDERER_VIDEO_MEMORY_MESA, &memorySize);
|
||||||
|
return memorySize;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// No other way, sad. Probably windows Intel.
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -25,8 +25,10 @@
|
||||||
#include "core/strings/stringFunctions.h"
|
#include "core/strings/stringFunctions.h"
|
||||||
#include "console/console.h"
|
#include "console/console.h"
|
||||||
|
|
||||||
#ifdef TORQUE_OS_WIN
|
#if defined(TORQUE_OS_WIN)
|
||||||
#include "tWGL.h"
|
#include "tWGL.h"
|
||||||
|
#elif defined(TORQUE_OS_LINUX)
|
||||||
|
#include "tXGL.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
namespace GL
|
namespace GL
|
||||||
|
|
@ -41,7 +43,18 @@ namespace GL
|
||||||
|
|
||||||
void gglPerformExtensionBinds(void *context)
|
void gglPerformExtensionBinds(void *context)
|
||||||
{
|
{
|
||||||
|
#if defined(TORQUE_OS_WIN)
|
||||||
|
if (!gladLoadWGL((HDC)context))
|
||||||
|
{
|
||||||
|
AssertFatal(false, "Unable to load WGL in GLAD. Make sure your OpenGL drivers are up to date!");
|
||||||
|
}
|
||||||
|
#elif defined(TORQUE_OS_LINUX)
|
||||||
|
|
||||||
|
if (!gladLoadGLX(NULL, 0))
|
||||||
|
{
|
||||||
|
AssertFatal(false, "Unable to load GLX in GLAD. Make sure your OpenGL drivers are up to date!");
|
||||||
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue