Logging refinements

REGAL_SYS_FOO variables are always defined. (0 or 1)
Initialization refinement for EGL - EmuInit.py added.
Regal::Config support for EGL and GLX at runtime.
Complete list of extensions in Regal::ContextInfo
REGAL_LOG_ONCE for logging warnings and errors once only
Sampler object emulation refinements.
This commit is contained in:
Nigel Stewart 2012-12-12 08:17:22 -06:00
parent 0dbaa1c8ab
commit ef137d3953
21 changed files with 1366 additions and 41 deletions

View file

@ -680,8 +680,8 @@ tmp/$(SYSTEM)/gtest/static/%.o: src/googletest/src/%.cc
@mkdir -p $(dir $@)
$(CCACHE) $(CC) $(CFLAGS) $(GTEST.CFLAGS) $(CFLAGS.SO) -o $@ -c $<
lib/$(GTEST.STATIC): $(GTEST.OBJS)
$(CCACHE) $(AR) cr $@ $^
lib/$(GTEST.STATIC): lib $(GTEST.OBJS)
$(CCACHE) $(AR) cr $@ $(GTEST.OBJS)
ifneq ($(STRIP),)
$(STRIP) -x $@
endif

View file

@ -236,7 +236,7 @@ void dreamTorusDisplay( bool clear )
}
glEnable( GL_DEPTH_TEST );
for( int i = 0; i < 8; i++ ) {
for( int i = 0; i < 4; i++ ) {
glActiveTexture( GL_TEXTURE0 + i );
glDisable( GL_TEXTURE_2D );
}

View file

@ -42,13 +42,13 @@
#if _WIN32
# if defined(PPAPI)
# ifndef REGAL_SYS_PPAPI
# define REGAL_SYS_PPAPI 1
# endif
# ifndef REGAL_SYS_PPAPI
# define REGAL_SYS_PPAPI 1
# endif
# else
# ifndef REGAL_SYS_WGL
# define REGAL_SYS_WGL 1
# endif
# ifndef REGAL_SYS_WGL
# define REGAL_SYS_WGL 1
# endif
# endif
#elif __APPLE__
# include <TargetConditionals.h>
@ -78,6 +78,34 @@
# endif
#endif
#ifndef REGAL_SYS_WGL
# define REGAL_SYS_WGL 0
#endif
#ifndef REGAL_SYS_IOS
# define REGAL_SYS_IOS 0
#endif
#ifndef REGAL_SYS_OSX
# define REGAL_SYS_OSX 0
#endif
#ifndef REGAL_SYS_PPAPI
# define REGAL_SYS_PPAPI 0
#endif
#ifndef REGAL_SYS_ANDROID
# define REGAL_SYS_ANDROID 0
#endif
#ifndef REGAL_SYS_EGL
# define REGAL_SYS_EGL 0
#endif
#ifndef REGAL_SYS_GLX
# define REGAL_SYS_GLX 0
#endif
#if REGAL_SYS_WGL
# define REGAL_CALL __stdcall
#else
@ -158,7 +186,7 @@ extern "C" {
typedef unsigned __int64 uint64_t;
#endif
#else
#include <inttypes.h>
#include <inttypes.h>
#endif
typedef unsigned int GLenum;

View file

@ -8,7 +8,6 @@ formulae = {
'ForceCoreMac' : {
'entries' : [ 'CGLChoosePixelFormat' ],
'impl' : [
'Init::init();',
'static const CGLPixelFormatAttribute nattribs[] =',
'{',
' kCGLPFAOpenGLProfile,',

15
scripts/EmuInit.py Normal file
View file

@ -0,0 +1,15 @@
#!/usr/bin/python -B
#
# Selectively initialize Regal for known initialization calls
# in addition to Regal API entry points.
#
# eglGetDisplay is needed for apitrace eglretrace tool.
#
formulae = {
'EmuInit' : {
'entries' : [ 'CGLChoosePixelFormat', 'eglGetDisplay' ],
'prefix' : [ 'Init::init();' ]
}
}

View file

@ -92,8 +92,15 @@ extern "C" {
typedef struct HGLRC__* HGLRC;
#endif
#endif
#elif REGAL_SYS_PPAPI
#if defined(__native_client__)
#include <inttypes.h>
#else
typedef __int64 int64_t;
typedef unsigned __int64 uint64_t;
#endif
#else
# include <inttypes.h>
#include <inttypes.h>
#endif
${API_TYPEDEF}
@ -268,6 +275,8 @@ def apiFuncDefineCode(apis, args):
else:
c += ' %s\n' % debugPrintFunction(function, 'App' )
c += listToString(indent(emuCodeGen(emue,'prefix'),' '))
if api.name=='egl':
c += '\n'
c += ' #if !REGAL_STATIC_EGL\n'
@ -361,7 +370,7 @@ def debugPrintFunction(function, trace = 'ITrace', input = True, output = False,
# If it's array of strings, quote each string
quote = ''
if t == 'char **' or t == 'const char **' or t == 'GLchar **' or t == 'const GLchar **' or t == 'LPCSTR *':
if t == 'char **' or t == 'const char **' or t == 'GLchar **' or t == 'const GLchar **' or t == 'GLcharARB *' or t == 'LPCSTR *':
quote = ',"\\\""'
if i.regalLog != None:
@ -374,7 +383,7 @@ def debugPrintFunction(function, trace = 'ITrace', input = True, output = False,
args.append('EGLenumToString(%s)'%n)
elif t == 'GLboolean' or t == 'const GLboolean':
args.append('toString(%s)'%n)
elif t == 'char *' or t == 'const char *' or t == 'GLchar *' or t == 'const GLchar *' or t == 'LPCSTR':
elif t == 'char *' or t == 'const char *' or t == 'GLchar *' or t == 'const GLchar *' or t == 'GLcharARB *' or t == 'LPCSTR':
args.append('boost::print::quote(%s,\'"\')'%n)
elif i.size!=None and (isinstance(i.size,int) or isinstance(i.size, long)) and t.find('void')==-1 and t.find('PIXELFORMATDESCRIPTOR')==-1:
args.append('boost::print::array(%s,%s)'%(n,i.size))

View file

@ -5,6 +5,7 @@ from string import Template, upper, replace
from ApiUtil import outputCode
from ApiCodeGen import *
from EmuInit import formulae as initFormulae
from EmuContextState import formulae as contextStateFormulae
from EmuGetString import formulae as getStringFormulae
from EmuForceCore import formulae as forceCoreFormulae
@ -34,6 +35,7 @@ from EmuFilter import formulae as filterFormulae
# Regal.cpp emulation
emuRegal = [
{ 'type' : None, 'include' : None, 'member' : None, 'conditional' : None, 'ifdef' : None, 'formulae' : initFormulae },
{ 'type' : None, 'include' : None, 'member' : None, 'conditional' : None, 'ifdef' : None, 'formulae' : contextStateFormulae },
{ 'type' : None, 'include' : None, 'member' : None, 'conditional' : None, 'ifdef' : None, 'formulae' : getStringFormulae },
{ 'type' : None, 'include' : None, 'member' : None, 'conditional' : None, 'ifdef' : None, 'formulae' : forceCoreFormulae },

View file

@ -317,8 +317,15 @@ def traverseContextInfo(apis, args):
c.update([i.category for i in api.functions])
c.update([i.category for i in api.typedefs])
c.update([i.category for i in api.enums])
for i in api.enums:
c.update([j.category for j in i.enumerants])
api.categories = [i for i in c if i and len(i) and i.find('_VERSION_')==-1 and i.find('WGL_core')==-1]
if api.name == 'egl':
api.categories = [i for i in api.categories if not i.startswith('GL_')]
def versionDeclareCode(apis, args):
code = ''

View file

@ -5,8 +5,14 @@ from string import Template, upper, replace
from ApiUtil import outputCode
regalSys = '''#if _WIN32
# ifndef REGAL_SYS_WGL
# define REGAL_SYS_WGL 1
# if defined(PPAPI)
# ifndef REGAL_SYS_PPAPI
# define REGAL_SYS_PPAPI 1
# endif
# else
# ifndef REGAL_SYS_WGL
# define REGAL_SYS_WGL 1
# endif
# endif
#elif __APPLE__
# include <TargetConditionals.h>
@ -35,6 +41,34 @@ regalSys = '''#if _WIN32
# define REGAL_SYS_GLX 1
# endif
#endif
#ifndef REGAL_SYS_WGL
# define REGAL_SYS_WGL 0
#endif
#ifndef REGAL_SYS_IOS
# define REGAL_SYS_IOS 0
#endif
#ifndef REGAL_SYS_OSX
# define REGAL_SYS_OSX 0
#endif
#ifndef REGAL_SYS_PPAPI
# define REGAL_SYS_PPAPI 0
#endif
#ifndef REGAL_SYS_ANDROID
# define REGAL_SYS_ANDROID 0
#endif
#ifndef REGAL_SYS_EGL
# define REGAL_SYS_EGL 0
#endif
#ifndef REGAL_SYS_GLX
# define REGAL_SYS_GLX 0
#endif
'''
systemTemplate = Template( '''${AUTOGENERATED}

View file

@ -32754,6 +32754,7 @@ extern "C" {
REGAL_DECL CGLError REGAL_CALL CGLChoosePixelFormat(const CGLPixelFormatAttribute *attribs, CGLPixelFormatObj *pix, GLint *npix)
{
App("CGLChoosePixelFormat","(", attribs, ")");
Init::init();
if (!dispatchTableGlobal.CGLChoosePixelFormat)
{
GetProcAddress( dispatchTableGlobal.CGLChoosePixelFormat, "CGLChoosePixelFormat" );
@ -32762,7 +32763,6 @@ extern "C" {
dispatchTableGlobal.CGLChoosePixelFormat = NULL;
}
CGLError ret = (CGLError )0;
Init::init();
static const CGLPixelFormatAttribute nattribs[] =
{
kCGLPFAOpenGLProfile,
@ -34938,6 +34938,7 @@ extern "C" {
REGAL_DECL EGLDisplay REGAL_CALL eglGetDisplay(EGLNativeDisplayType display_id)
{
App("eglGetDisplay","(", display_id, ")");
Init::init();
#if !REGAL_STATIC_EGL
if (!dispatchTableGlobal.eglGetDisplay)

View file

@ -39,6 +39,7 @@ using boost::print::print_string;
#include "RegalLog.h"
#include "RegalConfig.h"
#include "RegalSystem.h"
REGAL_GLOBAL_END
@ -48,6 +49,8 @@ namespace Config {
bool forceCoreProfile = REGAL_FORCE_CORE_PROFILE;
bool forceES2Profile = REGAL_FORCE_ES2_PROFILE;
bool sysGLX = REGAL_SYS_GLX;
bool sysEGL = REGAL_SYS_EGL && !REGAL_SYS_GLX;
bool forceEmulation = REGAL_FORCE_EMULATION;
bool enableEmulation = REGAL_EMULATION;
bool enableDebug = false;
@ -96,6 +99,23 @@ void Init()
if (tmp) forceES2Profile = atoi(tmp)!=0;
#endif
#if REGAL_SYS_GLX
tmp = GetEnv( "REGAL_SYS_GLX" );
if (tmp) sysGLX = atoi(tmp)!=0;
#endif
#if REGAL_SYS_EGL
tmp = GetEnv( "REGAL_SYS_EGL" );
if (tmp) sysEGL = atoi(tmp)!=0;
#endif
// Default to GLX, if necessary
#if REGAL_SYS_GLX && REGAL_SYS_EGL
if (sysGLX && sysEGL)
sysEGL = false;
#endif
#if !REGAL_FORCE_EMULATION
tmp = GetEnv( "REGAL_FORCE_EMULATION" );
if (tmp) forceEmulation = atoi(tmp)!=0;
@ -221,6 +241,14 @@ void Init()
Info("REGAL_FORCE_CORE_PROFILE ", forceCoreProfile ? "enabled" : "disabled");
Info("REGAL_FORCE_ES2_PROFILE ", forceES2Profile ? "enabled" : "disabled");
#if REGAL_SYS_GLX
Info("REGAL_SYS_GLX ", sysGLX ? "enabled" : "disabled");
#endif
#if REGAL_SYS_EGL
Info("REGAL_SYS_EGL ", sysEGL ? "enabled" : "disabled");
#endif
Info("REGAL_FORCE_EMULATION ", forceEmulation ? "enabled" : "disabled");
Info("REGAL_DEBUG ", enableDebug ? "enabled" : "disabled");
Info("REGAL_ERROR ", enableError ? "enabled" : "disabled");

View file

@ -48,6 +48,11 @@ namespace Config
extern bool forceCoreProfile;
extern bool forceES2Profile;
// Use GLX or EGL, but not both
extern bool sysGLX;
extern bool sysEGL;
// Initial dispatch enable/disable state
extern bool forceEmulation;

File diff suppressed because it is too large Load diff

View file

@ -132,84 +132,141 @@ struct ContextInfo
GLboolean egl_version_1_1 : 1;
GLboolean egl_version_1_2 : 1;
GLboolean gl_3dfx_multisample : 1;
GLboolean gl_3dfx_tbuffer : 1;
GLboolean gl_3dfx_texture_compression_fxt1 : 1;
GLboolean gl_amd_blend_minmax_factor : 1;
GLboolean gl_amd_compressed_3dc_texture : 1;
GLboolean gl_amd_compressed_atc_texture : 1;
GLboolean gl_amd_debug_output : 1;
GLboolean gl_amd_depth_clamp_separate : 1;
GLboolean gl_amd_draw_buffers_blend : 1;
GLboolean gl_amd_multi_draw_indirect : 1;
GLboolean gl_amd_name_gen_delete : 1;
GLboolean gl_amd_performance_monitor : 1;
GLboolean gl_amd_pinned_memory : 1;
GLboolean gl_amd_program_binary_z400 : 1;
GLboolean gl_amd_query_buffer_object : 1;
GLboolean gl_amd_sample_positions : 1;
GLboolean gl_amd_seamless_cubemap_per_texture : 1;
GLboolean gl_amd_stencil_operation_extended : 1;
GLboolean gl_amd_vertex_shader_tessellator : 1;
GLboolean gl_angle_framebuffer_blit : 1;
GLboolean gl_angle_framebuffer_multisample : 1;
GLboolean gl_angle_instanced_arrays : 1;
GLboolean gl_angle_pack_reverse_row_order : 1;
GLboolean gl_angle_texture_compression_dxt5 : 1;
GLboolean gl_angle_texture_usage : 1;
GLboolean gl_angle_translated_shader_source : 1;
GLboolean gl_apple_aux_depth_stencil : 1;
GLboolean gl_apple_client_storage : 1;
GLboolean gl_apple_copy_texture_levels : 1;
GLboolean gl_apple_element_array : 1;
GLboolean gl_apple_fence : 1;
GLboolean gl_apple_float_pixels : 1;
GLboolean gl_apple_flush_buffer_range : 1;
GLboolean gl_apple_flush_render : 1;
GLboolean gl_apple_framebuffer_multisample : 1;
GLboolean gl_apple_object_purgeable : 1;
GLboolean gl_apple_pixel_buffer : 1;
GLboolean gl_apple_rgb_422 : 1;
GLboolean gl_apple_row_bytes : 1;
GLboolean gl_apple_specular_vector : 1;
GLboolean gl_apple_sync : 1;
GLboolean gl_apple_texture_max_level : 1;
GLboolean gl_apple_texture_range : 1;
GLboolean gl_apple_transform_hint : 1;
GLboolean gl_apple_vertex_array_object : 1;
GLboolean gl_apple_vertex_array_range : 1;
GLboolean gl_apple_vertex_program_evaluators : 1;
GLboolean gl_apple_ycbcr_422 : 1;
GLboolean gl_arb_es2_compatibility : 1;
GLboolean gl_arb_es3_compatibility : 1;
GLboolean gl_arb_base_instance : 1;
GLboolean gl_arb_blend_func_extended : 1;
GLboolean gl_arb_cl_event : 1;
GLboolean gl_arb_clear_buffer_object : 1;
GLboolean gl_arb_color_buffer_float : 1;
GLboolean gl_arb_compressed_texture_pixel_storage : 1;
GLboolean gl_arb_compute_shader : 1;
GLboolean gl_arb_copy_buffer : 1;
GLboolean gl_arb_copy_image : 1;
GLboolean gl_arb_debug_output : 1;
GLboolean gl_arb_depth_buffer_float : 1;
GLboolean gl_arb_depth_clamp : 1;
GLboolean gl_arb_depth_texture : 1;
GLboolean gl_arb_draw_buffers : 1;
GLboolean gl_arb_draw_buffers_blend : 1;
GLboolean gl_arb_draw_elements_base_vertex : 1;
GLboolean gl_arb_draw_indirect : 1;
GLboolean gl_arb_draw_instanced : 1;
GLboolean gl_arb_explicit_uniform_location : 1;
GLboolean gl_arb_fragment_program : 1;
GLboolean gl_arb_fragment_shader : 1;
GLboolean gl_arb_framebuffer_no_attachments : 1;
GLboolean gl_arb_framebuffer_object : 1;
GLboolean gl_arb_framebuffer_srgb : 1;
GLboolean gl_arb_geometry_shader4 : 1;
GLboolean gl_arb_get_program_binary : 1;
GLboolean gl_arb_gpu_shader5 : 1;
GLboolean gl_arb_gpu_shader_fp64 : 1;
GLboolean gl_arb_half_float_pixel : 1;
GLboolean gl_arb_half_float_vertex : 1;
GLboolean gl_arb_imaging : 1;
GLboolean gl_arb_instanced_arrays : 1;
GLboolean gl_arb_internalformat_query : 1;
GLboolean gl_arb_internalformat_query2 : 1;
GLboolean gl_arb_invalidate_subdata : 1;
GLboolean gl_arb_map_buffer_alignment : 1;
GLboolean gl_arb_map_buffer_range : 1;
GLboolean gl_arb_matrix_palette : 1;
GLboolean gl_arb_multi_draw_indirect : 1;
GLboolean gl_arb_multisample : 1;
GLboolean gl_arb_multitexture : 1;
GLboolean gl_arb_occlusion_query : 1;
GLboolean gl_arb_occlusion_query2 : 1;
GLboolean gl_arb_pixel_buffer_object : 1;
GLboolean gl_arb_point_parameters : 1;
GLboolean gl_arb_point_sprite : 1;
GLboolean gl_arb_program_interface_query : 1;
GLboolean gl_arb_provoking_vertex : 1;
GLboolean gl_arb_robustness : 1;
GLboolean gl_arb_sample_shading : 1;
GLboolean gl_arb_sampler_objects : 1;
GLboolean gl_arb_seamless_cube_map : 1;
GLboolean gl_arb_separate_shader_objects : 1;
GLboolean gl_arb_shader_atomic_counters : 1;
GLboolean gl_arb_shader_image_load_store : 1;
GLboolean gl_arb_shader_objects : 1;
GLboolean gl_arb_shader_storage_buffer_object : 1;
GLboolean gl_arb_shader_subroutine : 1;
GLboolean gl_arb_shading_language_100 : 1;
GLboolean gl_arb_shading_language_include : 1;
GLboolean gl_arb_shadow : 1;
GLboolean gl_arb_shadow_ambient : 1;
GLboolean gl_arb_stencil_texturing : 1;
GLboolean gl_arb_sync : 1;
GLboolean gl_arb_tessellation_shader : 1;
GLboolean gl_arb_texture_border_clamp : 1;
GLboolean gl_arb_texture_buffer_object : 1;
GLboolean gl_arb_texture_buffer_range : 1;
GLboolean gl_arb_texture_compression : 1;
GLboolean gl_arb_texture_compression_bptc : 1;
GLboolean gl_arb_texture_compression_rgtc : 1;
GLboolean gl_arb_texture_cube_map : 1;
GLboolean gl_arb_texture_cube_map_array : 1;
GLboolean gl_arb_texture_env_combine : 1;
GLboolean gl_arb_texture_env_dot3 : 1;
GLboolean gl_arb_texture_float : 1;
GLboolean gl_arb_texture_gather : 1;
GLboolean gl_arb_texture_mirrored_repeat : 1;
GLboolean gl_arb_texture_multisample : 1;
GLboolean gl_arb_texture_rectangle : 1;
GLboolean gl_arb_texture_rg : 1;
GLboolean gl_arb_texture_rgb10_a2ui : 1;
GLboolean gl_arb_texture_storage : 1;
GLboolean gl_arb_texture_storage_multisample : 1;
GLboolean gl_arb_texture_swizzle : 1;
GLboolean gl_arb_texture_view : 1;
GLboolean gl_arb_timer_query : 1;
GLboolean gl_arb_transform_feedback2 : 1;
@ -227,21 +284,38 @@ struct ContextInfo
GLboolean gl_arb_vertex_type_2_10_10_10_rev : 1;
GLboolean gl_arb_viewport_array : 1;
GLboolean gl_arb_window_pos : 1;
GLboolean gl_arm_mali_program_binary : 1;
GLboolean gl_arm_mali_shader_binary : 1;
GLboolean gl_ati_draw_buffers : 1;
GLboolean gl_ati_element_array : 1;
GLboolean gl_ati_envmap_bumpmap : 1;
GLboolean gl_ati_fragment_shader : 1;
GLboolean gl_ati_map_object_buffer : 1;
GLboolean gl_ati_meminfo : 1;
GLboolean gl_ati_pn_triangles : 1;
GLboolean gl_ati_separate_stencil : 1;
GLboolean gl_ati_text_fragment_shader : 1;
GLboolean gl_ati_texture_compression_3dc : 1;
GLboolean gl_ati_texture_env_combine3 : 1;
GLboolean gl_ati_texture_float : 1;
GLboolean gl_ati_texture_mirror_once : 1;
GLboolean gl_ati_vertex_array_object : 1;
GLboolean gl_ati_vertex_attrib_array_object : 1;
GLboolean gl_ati_vertex_streams : 1;
GLboolean gl_dmp_shader_binary : 1;
GLboolean gl_ext_422_pixels : 1;
GLboolean gl_ext_cg_shader : 1;
GLboolean gl_ext_abgr : 1;
GLboolean gl_ext_bgra : 1;
GLboolean gl_ext_bindable_uniform : 1;
GLboolean gl_ext_blend_color : 1;
GLboolean gl_ext_blend_equation_separate : 1;
GLboolean gl_ext_blend_func_separate : 1;
GLboolean gl_ext_blend_minmax : 1;
GLboolean gl_ext_blend_subtract : 1;
GLboolean gl_ext_clip_volume_hint : 1;
GLboolean gl_ext_cmyka : 1;
GLboolean gl_ext_color_buffer_half_float : 1;
GLboolean gl_ext_color_subtable : 1;
GLboolean gl_ext_compiled_vertex_array : 1;
GLboolean gl_ext_convolution : 1;
@ -260,7 +334,9 @@ struct ContextInfo
GLboolean gl_ext_fragment_lighting : 1;
GLboolean gl_ext_framebuffer_blit : 1;
GLboolean gl_ext_framebuffer_multisample : 1;
GLboolean gl_ext_framebuffer_multisample_blit_scaled : 1;
GLboolean gl_ext_framebuffer_object : 1;
GLboolean gl_ext_framebuffer_srgb : 1;
GLboolean gl_ext_geometry_shader4 : 1;
GLboolean gl_ext_gpu_program_parameters : 1;
GLboolean gl_ext_gpu_shader4 : 1;
@ -274,63 +350,130 @@ struct ContextInfo
GLboolean gl_ext_multisampled_render_to_texture : 1;
GLboolean gl_ext_multiview_draw_buffers : 1;
GLboolean gl_ext_occlusion_query_boolean : 1;
GLboolean gl_ext_packed_depth_stencil : 1;
GLboolean gl_ext_packed_float : 1;
GLboolean gl_ext_packed_pixels : 1;
GLboolean gl_ext_paletted_texture : 1;
GLboolean gl_ext_pixel_buffer_object : 1;
GLboolean gl_ext_pixel_transform : 1;
GLboolean gl_ext_point_parameters : 1;
GLboolean gl_ext_polygon_offset : 1;
GLboolean gl_ext_provoking_vertex : 1;
GLboolean gl_ext_read_format_bgra : 1;
GLboolean gl_ext_rescale_normal : 1;
GLboolean gl_ext_robustness : 1;
GLboolean gl_ext_srgb : 1;
GLboolean gl_ext_scene_marker : 1;
GLboolean gl_ext_secondary_color : 1;
GLboolean gl_ext_separate_shader_objects : 1;
GLboolean gl_ext_separate_specular_color : 1;
GLboolean gl_ext_shader_framebuffer_fetch : 1;
GLboolean gl_ext_shader_image_load_store : 1;
GLboolean gl_ext_shadow_samplers : 1;
GLboolean gl_ext_shared_texture_palette : 1;
GLboolean gl_ext_stencil_clear_tag : 1;
GLboolean gl_ext_stencil_two_side : 1;
GLboolean gl_ext_stencil_wrap : 1;
GLboolean gl_ext_subtexture : 1;
GLboolean gl_ext_texture : 1;
GLboolean gl_ext_texture3d : 1;
GLboolean gl_ext_texture_array : 1;
GLboolean gl_ext_texture_buffer_object : 1;
GLboolean gl_ext_texture_compression_latc : 1;
GLboolean gl_ext_texture_compression_rgtc : 1;
GLboolean gl_ext_texture_compression_s3tc : 1;
GLboolean gl_ext_texture_cube_map : 1;
GLboolean gl_ext_texture_edge_clamp : 1;
GLboolean gl_ext_texture_env_combine : 1;
GLboolean gl_ext_texture_env_dot3 : 1;
GLboolean gl_ext_texture_filter_anisotropic : 1;
GLboolean gl_ext_texture_format_bgra8888 : 1;
GLboolean gl_ext_texture_integer : 1;
GLboolean gl_ext_texture_lod_bias : 1;
GLboolean gl_ext_texture_mirror_clamp : 1;
GLboolean gl_ext_texture_object : 1;
GLboolean gl_ext_texture_perturb_normal : 1;
GLboolean gl_ext_texture_rectangle : 1;
GLboolean gl_ext_texture_rg : 1;
GLboolean gl_ext_texture_srgb : 1;
GLboolean gl_ext_texture_srgb_decode : 1;
GLboolean gl_ext_texture_shared_exponent : 1;
GLboolean gl_ext_texture_snorm : 1;
GLboolean gl_ext_texture_storage : 1;
GLboolean gl_ext_texture_swizzle : 1;
GLboolean gl_ext_texture_type_2_10_10_10_rev : 1;
GLboolean gl_ext_timer_query : 1;
GLboolean gl_ext_transform_feedback : 1;
GLboolean gl_ext_unpack_subimage : 1;
GLboolean gl_ext_vertex_array : 1;
GLboolean gl_ext_vertex_attrib_64bit : 1;
GLboolean gl_ext_vertex_shader : 1;
GLboolean gl_ext_vertex_weighting : 1;
GLboolean gl_ext_x11_sync_object : 1;
GLboolean gl_fj_shader_binary_gccso : 1;
GLboolean gl_gremedy_frame_terminator : 1;
GLboolean gl_gremedy_string_marker : 1;
GLboolean gl_hp_image_transform : 1;
GLboolean gl_hp_occlusion_test : 1;
GLboolean gl_ibm_cull_vertex : 1;
GLboolean gl_ibm_multimode_draw_arrays : 1;
GLboolean gl_ibm_rasterpos_clip : 1;
GLboolean gl_ibm_static_data : 1;
GLboolean gl_ibm_texture_mirrored_repeat : 1;
GLboolean gl_ibm_vertex_array_lists : 1;
GLboolean gl_img_multisampled_render_to_texture : 1;
GLboolean gl_img_program_binary : 1;
GLboolean gl_img_read_format : 1;
GLboolean gl_img_shader_binary : 1;
GLboolean gl_img_texture_compression_pvrtc : 1;
GLboolean gl_img_texture_env_enhanced_fixed_function : 1;
GLboolean gl_img_user_clip_plane : 1;
GLboolean gl_ingr_blend_func_separate : 1;
GLboolean gl_ingr_color_clamp : 1;
GLboolean gl_ingr_interlace_read : 1;
GLboolean gl_intel_parallel_arrays : 1;
GLboolean gl_intel_texture_scissor : 1;
GLboolean gl_khr_debug : 1;
GLboolean gl_khr_texture_compression_astc_ldr : 1;
GLboolean gl_ktx_buffer_region : 1;
GLboolean gl_mesax_texture_stack : 1;
GLboolean gl_mesa_pack_invert : 1;
GLboolean gl_mesa_resize_buffers : 1;
GLboolean gl_mesa_window_pos : 1;
GLboolean gl_mesa_ycbcr_texture : 1;
GLboolean gl_nvx_conditional_render : 1;
GLboolean gl_nvx_gpu_memory_info : 1;
GLboolean gl_nv_bindless_texture : 1;
GLboolean gl_nv_compute_program5 : 1;
GLboolean gl_nv_conditional_render : 1;
GLboolean gl_nv_copy_depth_to_color : 1;
GLboolean gl_nv_copy_image : 1;
GLboolean gl_nv_coverage_sample : 1;
GLboolean gl_nv_deep_texture3d : 1;
GLboolean gl_nv_depth_buffer_float : 1;
GLboolean gl_nv_depth_clamp : 1;
GLboolean gl_nv_depth_nonlinear : 1;
GLboolean gl_nv_depth_range_unclamped : 1;
GLboolean gl_nv_draw_buffers : 1;
GLboolean gl_nv_evaluators : 1;
GLboolean gl_nv_explicit_multisample : 1;
GLboolean gl_nv_fbo_color_attachments : 1;
GLboolean gl_nv_fence : 1;
GLboolean gl_nv_float_buffer : 1;
GLboolean gl_nv_fog_distance : 1;
GLboolean gl_nv_fragment_program : 1;
GLboolean gl_nv_fragment_program2 : 1;
GLboolean gl_nv_framebuffer_multisample_coverage : 1;
GLboolean gl_nv_geometry_program4 : 1;
GLboolean gl_nv_gpu_program4 : 1;
GLboolean gl_nv_gpu_program5 : 1;
GLboolean gl_nv_gpu_shader5 : 1;
GLboolean gl_nv_half_float : 1;
GLboolean gl_nv_light_max_exponent : 1;
GLboolean gl_nv_multisample_coverage : 1;
GLboolean gl_nv_multisample_filter_hint : 1;
GLboolean gl_nv_occlusion_query : 1;
GLboolean gl_nv_packed_depth_stencil : 1;
GLboolean gl_nv_parameter_buffer_object : 1;
GLboolean gl_nv_path_rendering : 1;
GLboolean gl_nv_pixel_data_range : 1;
@ -338,70 +481,142 @@ struct ContextInfo
GLboolean gl_nv_present_video : 1;
GLboolean gl_nv_primitive_restart : 1;
GLboolean gl_nv_read_buffer : 1;
GLboolean gl_nv_read_buffer_front : 1;
GLboolean gl_nv_register_combiners : 1;
GLboolean gl_nv_register_combiners2 : 1;
GLboolean gl_nv_shader_buffer_load : 1;
GLboolean gl_nv_tessellation_program5 : 1;
GLboolean gl_nv_texgen_emboss : 1;
GLboolean gl_nv_texgen_reflection : 1;
GLboolean gl_nv_texture_barrier : 1;
GLboolean gl_nv_texture_env_combine4 : 1;
GLboolean gl_nv_texture_expand_normal : 1;
GLboolean gl_nv_texture_multisample : 1;
GLboolean gl_nv_texture_rectangle : 1;
GLboolean gl_nv_texture_shader : 1;
GLboolean gl_nv_texture_shader2 : 1;
GLboolean gl_nv_texture_shader3 : 1;
GLboolean gl_nv_transform_feedback : 1;
GLboolean gl_nv_transform_feedback2 : 1;
GLboolean gl_nv_vdpau_interop : 1;
GLboolean gl_nv_vertex_array_range : 1;
GLboolean gl_nv_vertex_array_range2 : 1;
GLboolean gl_nv_vertex_attrib_integer_64bit : 1;
GLboolean gl_nv_vertex_buffer_unified_memory : 1;
GLboolean gl_nv_vertex_program : 1;
GLboolean gl_nv_vertex_program2_option : 1;
GLboolean gl_nv_vertex_program3 : 1;
GLboolean gl_nv_vertex_program4 : 1;
GLboolean gl_nv_video_capture : 1;
GLboolean gl_oes_blend_equation_separate : 1;
GLboolean gl_oes_blend_func_separate : 1;
GLboolean gl_oes_blend_subtract : 1;
GLboolean gl_oes_compressed_etc1_rgb8_texture : 1;
GLboolean gl_oes_compressed_paletted_texture : 1;
GLboolean gl_oes_depth_texture : 1;
GLboolean gl_oes_draw_texture : 1;
GLboolean gl_oes_element_index_uint : 1;
GLboolean gl_oes_framebuffer_object : 1;
GLboolean gl_oes_get_program_binary : 1;
GLboolean gl_oes_mapbuffer : 1;
GLboolean gl_oes_matrix_get : 1;
GLboolean gl_oes_matrix_palette : 1;
GLboolean gl_oes_packed_depth_stencil : 1;
GLboolean gl_oes_point_size_array : 1;
GLboolean gl_oes_point_sprite : 1;
GLboolean gl_oes_read_format : 1;
GLboolean gl_oes_required_internalformat : 1;
GLboolean gl_oes_rgb8_rgba8 : 1;
GLboolean gl_oes_single_precision : 1;
GLboolean gl_oes_standard_derivatives : 1;
GLboolean gl_oes_stencil1 : 1;
GLboolean gl_oes_stencil4 : 1;
GLboolean gl_oes_stencil8 : 1;
GLboolean gl_oes_surfaceless_context : 1;
GLboolean gl_oes_texture_3d : 1;
GLboolean gl_oes_texture_cube_map : 1;
GLboolean gl_oes_texture_mirrored_repeat : 1;
GLboolean gl_oes_vertex_array_object : 1;
GLboolean gl_oes_vertex_half_float : 1;
GLboolean gl_oes_vertex_type_10_10_10_2 : 1;
GLboolean gl_oml_interlace : 1;
GLboolean gl_oml_resample : 1;
GLboolean gl_oml_subsample : 1;
GLboolean gl_pgi_misc_hints : 1;
GLboolean gl_pgi_vertex_hints : 1;
GLboolean gl_qcom_alpha_test : 1;
GLboolean gl_qcom_binning_control : 1;
GLboolean gl_qcom_driver_control : 1;
GLboolean gl_qcom_extended_get : 1;
GLboolean gl_qcom_extended_get2 : 1;
GLboolean gl_qcom_perfmon_global_mode : 1;
GLboolean gl_qcom_tiled_rendering : 1;
GLboolean gl_qcom_writeonly_rendering : 1;
GLboolean gl_regal_es1_0_compatibility : 1;
GLboolean gl_regal_es1_1_compatibility : 1;
GLboolean gl_regal_enable : 1;
GLboolean gl_regal_error_string : 1;
GLboolean gl_regal_extension_query : 1;
GLboolean gl_regal_log : 1;
GLboolean gl_rend_screen_coordinates : 1;
GLboolean gl_s3_s3tc : 1;
GLboolean gl_sgis_color_range : 1;
GLboolean gl_sgis_detail_texture : 1;
GLboolean gl_sgis_fog_function : 1;
GLboolean gl_sgis_generate_mipmap : 1;
GLboolean gl_sgis_multisample : 1;
GLboolean gl_sgis_pixel_texture : 1;
GLboolean gl_sgis_point_line_texgen : 1;
GLboolean gl_sgis_point_parameters : 1;
GLboolean gl_sgis_sharpen_texture : 1;
GLboolean gl_sgis_texture4d : 1;
GLboolean gl_sgis_texture_border_clamp : 1;
GLboolean gl_sgis_texture_color_mask : 1;
GLboolean gl_sgis_texture_edge_clamp : 1;
GLboolean gl_sgis_texture_filter4 : 1;
GLboolean gl_sgis_texture_lod : 1;
GLboolean gl_sgix_async : 1;
GLboolean gl_sgix_async_histogram : 1;
GLboolean gl_sgix_async_pixel : 1;
GLboolean gl_sgix_blend_alpha_minmax : 1;
GLboolean gl_sgix_convolution_accuracy : 1;
GLboolean gl_sgix_depth_texture : 1;
GLboolean gl_sgix_flush_raster : 1;
GLboolean gl_sgix_fog_offset : 1;
GLboolean gl_sgix_fog_texture : 1;
GLboolean gl_sgix_fragment_lighting : 1;
GLboolean gl_sgix_framezoom : 1;
GLboolean gl_sgix_igloo_interface : 1;
GLboolean gl_sgix_instruments : 1;
GLboolean gl_sgix_interlace : 1;
GLboolean gl_sgix_list_priority : 1;
GLboolean gl_sgix_pixel_texture : 1;
GLboolean gl_sgix_polynomial_ffd : 1;
GLboolean gl_sgix_reference_plane : 1;
GLboolean gl_sgix_resample : 1;
GLboolean gl_sgix_shadow : 1;
GLboolean gl_sgix_shadow_ambient : 1;
GLboolean gl_sgix_sprite : 1;
GLboolean gl_sgix_tag_sample_buffer : 1;
GLboolean gl_sgix_texture_coordinate_clamp : 1;
GLboolean gl_sgix_texture_multi_buffer : 1;
GLboolean gl_sgix_texture_range : 1;
GLboolean gl_sgix_texture_scale_bias : 1;
GLboolean gl_sgix_vertex_preclip_hint : 1;
GLboolean gl_sgi_color_matrix : 1;
GLboolean gl_sgi_color_table : 1;
GLboolean gl_sgi_texture_color_table : 1;
GLboolean gl_sunx_constant_data : 1;
GLboolean gl_sun_convolution_border_modes : 1;
GLboolean gl_sun_global_alpha : 1;
GLboolean gl_sun_mesh_array : 1;
GLboolean gl_sun_read_video_pixels : 1;
GLboolean gl_sun_slice_accum : 1;
GLboolean gl_sun_triangle_list : 1;
GLboolean gl_sun_vertex : 1;
GLboolean gl_viv_shader_binary : 1;
GLboolean gl_win_phong_shading : 1;
GLboolean gl_win_specular_fog : 1;
GLboolean gl_win_swap_hint : 1;
#if REGAL_SYS_WGL
@ -409,16 +624,30 @@ struct ContextInfo
GLboolean wgl_amd_gpu_association : 1;
GLboolean wgl_arb_buffer_region : 1;
GLboolean wgl_arb_create_context : 1;
GLboolean wgl_arb_create_context_profile : 1;
GLboolean wgl_arb_create_context_robustness : 1;
GLboolean wgl_arb_extensions_string : 1;
GLboolean wgl_arb_framebuffer_srgb : 1;
GLboolean wgl_arb_make_current_read : 1;
GLboolean wgl_arb_multisample : 1;
GLboolean wgl_arb_pbuffer : 1;
GLboolean wgl_arb_pixel_format : 1;
GLboolean wgl_arb_pixel_format_float : 1;
GLboolean wgl_arb_render_texture : 1;
GLboolean wgl_arb_robustness_share_group_isolation : 1;
GLboolean wgl_ati_pixel_format_float : 1;
GLboolean wgl_ati_render_texture_rectangle : 1;
GLboolean wgl_ext_create_context_es2_profile : 1;
GLboolean wgl_ext_create_context_es_profile : 1;
GLboolean wgl_ext_depth_float : 1;
GLboolean wgl_ext_display_color_table : 1;
GLboolean wgl_ext_extensions_string : 1;
GLboolean wgl_ext_framebuffer_srgb : 1;
GLboolean wgl_ext_make_current_read : 1;
GLboolean wgl_ext_multisample : 1;
GLboolean wgl_ext_pbuffer : 1;
GLboolean wgl_ext_pixel_format : 1;
GLboolean wgl_ext_pixel_format_packed_float : 1;
GLboolean wgl_ext_swap_control : 1;
GLboolean wgl_gdi : 1;
GLboolean wgl_i3d_digital_video_control : 1;
@ -429,8 +658,12 @@ struct ContextInfo
GLboolean wgl_i3d_swap_frame_usage : 1;
GLboolean wgl_nv_dx_interop : 1;
GLboolean wgl_nv_copy_image : 1;
GLboolean wgl_nv_float_buffer : 1;
GLboolean wgl_nv_gpu_affinity : 1;
GLboolean wgl_nv_multisample_coverage : 1;
GLboolean wgl_nv_present_video : 1;
GLboolean wgl_nv_render_depth_texture : 1;
GLboolean wgl_nv_render_texture_rectangle : 1;
GLboolean wgl_nv_swap_group : 1;
GLboolean wgl_nv_vertex_array_range : 1;
GLboolean wgl_nv_video_capture : 1;
@ -439,13 +672,30 @@ struct ContextInfo
#endif
#if REGAL_SYS_GLX
GLboolean glx_3dfx_multisample : 1;
GLboolean glx_amd_gpu_association : 1;
GLboolean glx_arb_create_context : 1;
GLboolean glx_arb_create_context_profile : 1;
GLboolean glx_arb_create_context_robustness : 1;
GLboolean glx_arb_fbconfig_float : 1;
GLboolean glx_arb_framebuffer_srgb : 1;
GLboolean glx_arb_get_proc_address : 1;
GLboolean glx_arb_multisample : 1;
GLboolean glx_arb_robustness_share_group_isolation : 1;
GLboolean glx_arb_vertex_buffer_object : 1;
GLboolean glx_ati_pixel_format_float : 1;
GLboolean glx_ati_render_texture : 1;
GLboolean glx_ext_create_context_es2_profile : 1;
GLboolean glx_ext_create_context_es_profile : 1;
GLboolean glx_ext_fbconfig_packed_float : 1;
GLboolean glx_ext_framebuffer_srgb : 1;
GLboolean glx_ext_import_context : 1;
GLboolean glx_ext_swap_control : 1;
GLboolean glx_ext_swap_control_tear : 1;
GLboolean glx_ext_texture_from_pixmap : 1;
GLboolean glx_ext_visual_info : 1;
GLboolean glx_ext_visual_rating : 1;
GLboolean glx_intel_swap_event : 1;
GLboolean glx_mesa_agp_offset : 1;
GLboolean glx_mesa_copy_sub_buffer : 1;
GLboolean glx_mesa_pixmap_colormap : 1;
@ -453,17 +703,26 @@ struct ContextInfo
GLboolean glx_mesa_set_3dfx_mode : 1;
GLboolean glx_mesa_swap_control : 1;
GLboolean glx_nv_copy_image : 1;
GLboolean glx_nv_float_buffer : 1;
GLboolean glx_nv_multisample_coverage : 1;
GLboolean glx_nv_present_video : 1;
GLboolean glx_nv_swap_group : 1;
GLboolean glx_nv_vertex_array_range : 1;
GLboolean glx_nv_video_capture : 1;
GLboolean glx_nv_video_output : 1;
GLboolean glx_oml_swap_method : 1;
GLboolean glx_oml_sync_control : 1;
GLboolean glx_sgis_blended_overlay : 1;
GLboolean glx_sgis_color_range : 1;
GLboolean glx_sgis_multisample : 1;
GLboolean glx_sgis_shared_multisample : 1;
GLboolean glx_sgix_fbconfig : 1;
GLboolean glx_sgix_hyperpipe : 1;
GLboolean glx_sgix_pbuffer : 1;
GLboolean glx_sgix_swap_barrier : 1;
GLboolean glx_sgix_swap_group : 1;
GLboolean glx_sgix_video_resize : 1;
GLboolean glx_sgix_visual_select_group : 1;
GLboolean glx_sgi_cushion : 1;
GLboolean glx_sgi_make_current_read : 1;
GLboolean glx_sgi_swap_control : 1;
@ -474,16 +733,30 @@ struct ContextInfo
#if REGAL_SYS_EGL
GLboolean egl_angle_query_surface_pointer : 1;
GLboolean egl_angle_surface_d3d_texture_2d_share_handle : 1;
GLboolean egl_ext_create_context_robustness : 1;
GLboolean egl_ext_multiview_window : 1;
GLboolean egl_hi_colorformats : 1;
GLboolean egl_img_context_priority : 1;
GLboolean egl_khr_config_attribs : 1;
GLboolean egl_khr_create_context : 1;
GLboolean egl_khr_fence_sync : 1;
GLboolean egl_khr_gl_texture_cubemap_image : 1;
GLboolean egl_khr_image_base : 1;
GLboolean egl_khr_image_pixmap : 1;
GLboolean egl_khr_lock_surface : 1;
GLboolean egl_khr_lock_surface2 : 1;
GLboolean egl_khr_reusable_sync : 1;
GLboolean egl_khr_stream : 1;
GLboolean egl_khr_stream_consumer_gltexture : 1;
GLboolean egl_khr_stream_cross_process_fd : 1;
GLboolean egl_khr_stream_fifo : 1;
GLboolean egl_khr_stream_producer_eglsurface : 1;
GLboolean egl_khr_vg_parent_image : 1;
GLboolean egl_khr_wait_sync : 1;
GLboolean egl_mesa_drm_image : 1;
GLboolean egl_nv_coverage_sample : 1;
GLboolean egl_nv_coverage_sample_resolve : 1;
GLboolean egl_nv_post_sub_buffer : 1;
GLboolean egl_nv_sync : 1;
GLboolean egl_nv_system_time : 1;

View file

@ -10219,7 +10219,7 @@ static void REGAL_CALL log_glGetActiveUniformARB(GLhandleARB programObj, GLuint
DispatchTable *_next = _context->dispatcher.logging._next;
RegalAssert(_next);
_next->call(&_next->glGetActiveUniformARB)(programObj, index, maxLength, length, size, type, name);
Driver("glGetActiveUniformARB","(", programObj, ", ", index, ", ", maxLength, ", ", boost::print::array(length,1), ", ", boost::print::array(size,1), ", ", boost::print::array(type,1), ", ", name, ")");
Driver("glGetActiveUniformARB","(", programObj, ", ", index, ", ", maxLength, ", ", boost::print::array(length,1), ", ", boost::print::array(size,1), ", ", boost::print::array(type,1), ", ", boost::print::quote(name,'"'), ")");
}
static void REGAL_CALL log_glGetAttachedObjectsARB(GLhandleARB containerObj, GLsizei maxCount, GLsizei *count, GLhandleARB *obj)
@ -10250,7 +10250,7 @@ static void REGAL_CALL log_glGetInfoLogARB(GLhandleARB obj, GLsizei maxLength, G
DispatchTable *_next = _context->dispatcher.logging._next;
RegalAssert(_next);
_next->call(&_next->glGetInfoLogARB)(obj, maxLength, length, infoLog);
Driver("glGetInfoLogARB","(", obj, ", ", maxLength, ", ", boost::print::array(length,length ? 1 : 0), ", ", infoLog, ")");
Driver("glGetInfoLogARB","(", obj, ", ", maxLength, ", ", boost::print::array(length,length ? 1 : 0), ", ", boost::print::quote(infoLog,'"'), ")");
}
static void REGAL_CALL log_glGetObjectParameterfvARB(GLhandleARB obj, GLenum pname, GLfloat *params)
@ -10280,7 +10280,7 @@ static void REGAL_CALL log_glGetShaderSourceARB(GLhandleARB obj, GLsizei maxLeng
DispatchTable *_next = _context->dispatcher.logging._next;
RegalAssert(_next);
_next->call(&_next->glGetShaderSourceARB)(obj, maxLength, length, source);
Driver("glGetShaderSourceARB","(", obj, ", ", maxLength, ", ", boost::print::array(length,1), ", ", source, ")");
Driver("glGetShaderSourceARB","(", obj, ", ", maxLength, ", ", boost::print::array(length,1), ", ", boost::print::quote(source,'"'), ")");
}
static GLint REGAL_CALL log_glGetUniformLocationARB(GLhandleARB programObj, const GLcharARB *name)
@ -12444,7 +12444,7 @@ static void REGAL_CALL log_glGetActiveAttribARB(GLhandleARB programObj, GLuint i
DispatchTable *_next = _context->dispatcher.logging._next;
RegalAssert(_next);
_next->call(&_next->glGetActiveAttribARB)(programObj, index, maxLength, length, size, type, name);
Driver("glGetActiveAttribARB","(", programObj, ", ", index, ", ", maxLength, ", ", boost::print::array(length,1), ", ", boost::print::array(size,1), ", ", boost::print::array(type,1), ", ", name, ")");
Driver("glGetActiveAttribARB","(", programObj, ", ", index, ", ", maxLength, ", ", boost::print::array(length,1), ", ", boost::print::array(size,1), ", ", boost::print::array(type,1), ", ", boost::print::quote(name,'"'), ")");
}
static GLint REGAL_CALL log_glGetAttribLocationARB(GLhandleARB programObj, const GLcharARB *name)

View file

@ -288,7 +288,7 @@ namespace Http
// Currently there is a problem with shutting down mongoose
// on Windows - so just skip the cleanup for now.
#ifndef REGAL_SYS_WGL
#if !REGAL_SYS_WGL
mg_stop(ctx);
#endif

View file

@ -103,6 +103,12 @@ namespace Logging {
bool initialized = false;
#if REGAL_LOG_ONCE
bool once = (REGAL_LOG_ONCE);
std::set<std::string> uniqueErrors;
std::set<std::string> uniqueWarnings;
#endif
Timer timer;
void Init()
@ -137,6 +143,11 @@ namespace Logging {
const char *ml = GetEnv("REGAL_LOG_MAX_LINES");
if (ml) maxLines = atoi(ml);
#if REGAL_LOG_ONCE
const char *lo = GetEnv("REGAL_LOG_ONCE");
if (lo) once = atoi(lo)!=0;
#endif
const char *tmp = GetEnv("REGAL_FRAME_TIME");
if (tmp) frameTime = atoi(tmp)!=0;
@ -251,7 +262,7 @@ namespace Logging {
// trying to create a RegalContext and triggering more
// (recursive) logging.
#if !defined(REGAL_SYS_WGL) && !REGAL_NO_TLS
#if !REGAL_SYS_WGL && !REGAL_NO_TLS
if (!Thread::currentContextKey || !pthread_getspecific(Thread::currentContextKey))
return 0;
#endif
@ -380,15 +391,41 @@ namespace Logging {
#define REGAL_LOG_TAG "Regal"
#endif
void Output(const char *prefix, const char *delim, const char *name, const string &str)
void Output(const Mode mode, const char *file, const int line, const char *prefix, const char *delim, const char *name, const string &str)
{
if (initialized && str.length())
{
string m = message(prefix,delim,name,str);
// TODO - optional Regal source line numbers.
#if 0
m = print_string(file,":",line," ",m);
#endif
#if REGAL_LOG_ONCE
if (once)
switch (mode)
{
case LOG_WARNING:
if (uniqueWarnings.find(m)!=uniqueWarnings.end())
return;
uniqueWarnings.insert(m);
break;
case LOG_ERROR:
if (uniqueErrors.find(m)!=uniqueErrors.end())
return;
uniqueErrors.insert(m);
break;
default:
break;
}
#endif
RegalContext *rCtx = NULL;
#if !defined(REGAL_SYS_WGL) && !REGAL_NO_TLS
#if !REGAL_SYS_WGL && !REGAL_NO_TLS
if (Thread::currentContextKey && pthread_getspecific(Thread::currentContextKey))
rCtx = REGAL_GET_CONTEXT();
#else

View file

@ -37,6 +37,7 @@ REGAL_GLOBAL_BEGIN
#include <string>
#include <list>
#include <set>
#include <boost/print/json.hpp> // Note - shouldn't need this in RegalLog.h
#include <boost/print/print_string.hpp>
@ -99,6 +100,10 @@ REGAL_NAMESPACE_BEGIN
# define REGAL_LOG_MAX_LINES -1 // unlimited by default
#endif
#ifndef REGAL_LOG_ONCE
# define REGAL_LOG_ONCE 1
#endif
#ifndef REGAL_LOG_JSON
# define REGAL_LOG_JSON 1
#endif
@ -129,7 +134,22 @@ namespace Logging
extern void Init();
extern void Cleanup();
extern void Output(const char *prefix, const char *delim, const char *name, const std::string &str = std::string());
// GL_REGAL_log
enum Mode
{
LOG_ERROR = 0,
LOG_WARNING,
LOG_INFO,
LOG_APP,
LOG_DRIVER,
LOG_INTERNAL,
LOG_DEBUG,
LOG_STATUS,
LOG_HTTP
};
extern void Output(const Mode mode, const char *file, const int line, const char *prefix, const char *delim, const char *name, const std::string &str = std::string());
// Runtime control of logging
@ -147,6 +167,12 @@ namespace Logging
extern bool frameTime; // Per-frame elapsed time to info log
#if REGAL_LOG_ONCE
extern bool once; // Warning and error message logged once only
extern std::set<std::string> uniqueErrors;
extern std::set<std::string> uniqueWarnings;
#endif
// Callback output
extern bool callback;
@ -177,7 +203,7 @@ namespace Logging
#if REGAL_LOG_ERROR
#define Error(...) { \
if (::REGAL_NAMESPACE_INTERNAL::Logging::enableError) \
::REGAL_NAMESPACE_INTERNAL::Logging::Output( "error ", " | ", NULL, ::boost::print::print_string( __VA_ARGS__) ); }
::REGAL_NAMESPACE_INTERNAL::Logging::Output( ::REGAL_NAMESPACE_INTERNAL::Logging::LOG_ERROR, __FILE__, __LINE__, "error ", " | ", NULL, ::boost::print::print_string( __VA_ARGS__) ); }
#else
#define Error(...) {}
#endif
@ -185,7 +211,7 @@ namespace Logging
#if REGAL_LOG_WARNING
#define Warning(...) { \
if (::REGAL_NAMESPACE_INTERNAL::Logging::enableWarning) \
::REGAL_NAMESPACE_INTERNAL::Logging::Output( "warning ", " | ", NULL, ::boost::print::print_string( __VA_ARGS__) ); }
::REGAL_NAMESPACE_INTERNAL::Logging::Output( ::REGAL_NAMESPACE_INTERNAL::Logging::LOG_WARNING, __FILE__, __LINE__, "warning ", " | ", NULL, ::boost::print::print_string( __VA_ARGS__) ); }
#else
#define Warning(...) {}
#endif
@ -193,7 +219,7 @@ namespace Logging
#if REGAL_LOG_INFO
#define Info(...) { \
if (::REGAL_NAMESPACE_INTERNAL::Logging::enableInfo) \
::REGAL_NAMESPACE_INTERNAL::Logging::Output( "info ", " | ", NULL, ::boost::print::print_string( __VA_ARGS__) ); }
::REGAL_NAMESPACE_INTERNAL::Logging::Output( ::REGAL_NAMESPACE_INTERNAL::Logging::LOG_INFO, __FILE__, __LINE__, "info ", " | ", NULL, ::boost::print::print_string( __VA_ARGS__) ); }
#else
#define Info(...) {}
#endif
@ -201,7 +227,7 @@ namespace Logging
#if REGAL_LOG_APP
#define App(name,...) { \
if (::REGAL_NAMESPACE_INTERNAL::Logging::enableApp) \
::REGAL_NAMESPACE_INTERNAL::Logging::Output( "app ", " | ", name, ::boost::print::print_string( __VA_ARGS__) ); }
::REGAL_NAMESPACE_INTERNAL::Logging::Output( ::REGAL_NAMESPACE_INTERNAL::Logging::LOG_APP, __FILE__, __LINE__, "app ", " | ", name, ::boost::print::print_string( __VA_ARGS__) ); }
#else
#define App(...) {}
#endif
@ -209,7 +235,7 @@ namespace Logging
#if REGAL_LOG_DRIVER
#define Driver(name,...) { \
if (::REGAL_NAMESPACE_INTERNAL::Logging::enableDriver) \
::REGAL_NAMESPACE_INTERNAL::Logging::Output( "driver ", " | ", name, ::boost::print::print_string( __VA_ARGS__) ); }
::REGAL_NAMESPACE_INTERNAL::Logging::Output( ::REGAL_NAMESPACE_INTERNAL::Logging::LOG_DRIVER, __FILE__, __LINE__, "driver ", " | ", name, ::boost::print::print_string( __VA_ARGS__) ); }
#else
#define Driver(...) {}
#endif
@ -217,7 +243,7 @@ namespace Logging
#if REGAL_LOG_INTERNAL
#define Internal(name,...) { \
if (::REGAL_NAMESPACE_INTERNAL::Logging::enableInternal) \
::REGAL_NAMESPACE_INTERNAL::Logging::Output( "internal", " | ", name, ::boost::print::print_string( __VA_ARGS__) ); }
::REGAL_NAMESPACE_INTERNAL::Logging::Output( ::REGAL_NAMESPACE_INTERNAL::Logging::LOG_INTERNAL, __FILE__, __LINE__, "internal", " | ", name, ::boost::print::print_string( __VA_ARGS__) ); }
#else
#define Internal(...) {}
#endif
@ -225,7 +251,7 @@ namespace Logging
#if REGAL_LOG_HTTP
#define HTrace(...) { \
if (::REGAL_NAMESPACE_INTERNAL::Logging::enableHttp) \
::REGAL_NAMESPACE_INTERNAL::Logging::Output( "http ", " | ", NULL, ::boost::print::print_string( __VA_ARGS__) ); }
::REGAL_NAMESPACE_INTERNAL::Logging::Output( ::REGAL_NAMESPACE_INTERNAL::Logging::LOG_HTTP, __FILE__, __LINE__, "http ", " | ", NULL, ::boost::print::print_string( __VA_ARGS__) ); }
#else
#define HTrace(...) {}
#endif

View file

@ -494,7 +494,19 @@ struct RegalSo : public RegalEmu
to->self.SrgbDecodeExt = (GLenum)(params[0]);
break;
case GL_DEPTH_STENCIL_TEXTURE_MODE:
case GL_TEXTURE_BASE_LEVEL:
case GL_TEXTURE_MAX_LEVEL:
case GL_TEXTURE_SWIZZLE_A:
case GL_TEXTURE_SWIZZLE_B:
case GL_TEXTURE_SWIZZLE_G:
case GL_TEXTURE_SWIZZLE_R:
// Known texture object state that is not in a sampler object.
// Everything is cool, just return silently
return;
default:
// Otherwise an unrecognezed enum. Issue a warning...
Warning( "Unhandled texture parameter enum: pname = ", Token::GLenumToString(pname));
return;
}

View file

@ -41,15 +41,15 @@
#define __REGAL_SYSTEM_H__
#if _WIN32
#if defined(PPAPI)
# ifndef REGAL_SYS_PPAPI
# define REGAL_SYS_PPAPI 1
# if defined(PPAPI)
# ifndef REGAL_SYS_PPAPI
# define REGAL_SYS_PPAPI 1
# endif
# else
# ifndef REGAL_SYS_WGL
# define REGAL_SYS_WGL 1
# endif
# endif
#else
# ifndef REGAL_SYS_WGL
# define REGAL_SYS_WGL 1
# endif
#endif
#elif __APPLE__
# include <TargetConditionals.h>
# if TARGET_OS_IPHONE
@ -78,4 +78,32 @@
# endif
#endif
#ifndef REGAL_SYS_WGL
# define REGAL_SYS_WGL 0
#endif
#ifndef REGAL_SYS_IOS
# define REGAL_SYS_IOS 0
#endif
#ifndef REGAL_SYS_OSX
# define REGAL_SYS_OSX 0
#endif
#ifndef REGAL_SYS_PPAPI
# define REGAL_SYS_PPAPI 0
#endif
#ifndef REGAL_SYS_ANDROID
# define REGAL_SYS_ANDROID 0
#endif
#ifndef REGAL_SYS_EGL
# define REGAL_SYS_EGL 0
#endif
#ifndef REGAL_SYS_GLX
# define REGAL_SYS_GLX 0
#endif
#endif // __REGAL_SYSTEM_H__

View file

@ -42,6 +42,8 @@ using namespace std;
#include <boost/print/print_string.hpp>
using boost::print::print_string;
#include "RegalConfig.h"
#if REGAL_SYS_WGL
typedef void *HMODULE;