Skip to content
Browse files

Replace the use of RegalEmuScopedActivate with generic Push<int>.

Add EmuFilter for preventing glClientActiveTexture calls into ES 2.0 specifically.
Updates for XCode and Visual Studio builds.
  • Loading branch information...
1 parent b734791 commit 994fa02b6929d61dd8b99b08cc74f4dba2b2aaf4 @nigels-com nigels-com committed
View
26 build/ios/Regal/Regal.xcodeproj/project.pbxproj
@@ -62,6 +62,8 @@
43FC5FA315C4619B00D0177C /* RegalUtil.h in Headers */ = {isa = PBXBuildFile; fileRef = 43FC5F7615C4619B00D0177C /* RegalUtil.h */; };
43FC5FA415C4619B00D0177C /* RegalVao.h in Headers */ = {isa = PBXBuildFile; fileRef = 43FC5F7715C4619B00D0177C /* RegalVao.h */; };
43FC5FA715C461AC00D0177C /* mongoose.c in Sources */ = {isa = PBXBuildFile; fileRef = 43FC5FA615C461AC00D0177C /* mongoose.c */; };
+ BC020947160D1919003FAB99 /* RegalMarker.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC020946160D1919003FAB99 /* RegalMarker.cpp */; };
+ BC020958160D1C73003FAB99 /* md5.c in Sources */ = {isa = PBXBuildFile; fileRef = BC020957160D1C73003FAB99 /* md5.c */; };
BC6C912A15EE3DC60056E4F7 /* RegalDispatchGlobal.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC6C912915EE3DC60056E4F7 /* RegalDispatchGlobal.cpp */; };
BC921A5E15D5624600E52C91 /* RegalDispatchMissing.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC921A5C15D5624600E52C91 /* RegalDispatchMissing.cpp */; };
BC921A5F15D5624600E52C91 /* RegalDispatchNacl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC921A5D15D5624600E52C91 /* RegalDispatchNacl.cpp */; };
@@ -124,6 +126,8 @@
43FC5F7615C4619B00D0177C /* RegalUtil.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RegalUtil.h; path = ../../../src/regal/RegalUtil.h; sourceTree = "<group>"; };
43FC5F7715C4619B00D0177C /* RegalVao.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RegalVao.h; path = ../../../src/regal/RegalVao.h; sourceTree = "<group>"; };
43FC5FA615C461AC00D0177C /* mongoose.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = mongoose.c; path = ../../../src/mongoose/mongoose.c; sourceTree = "<group>"; };
+ BC020946160D1919003FAB99 /* RegalMarker.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = RegalMarker.cpp; path = ../../../src/regal/RegalMarker.cpp; sourceTree = "<group>"; };
+ BC020957160D1C73003FAB99 /* md5.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = md5.c; path = ../../../src/md5/src/md5.c; sourceTree = "<group>"; };
BC6C912915EE3DC60056E4F7 /* RegalDispatchGlobal.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = RegalDispatchGlobal.cpp; path = ../../../src/regal/RegalDispatchGlobal.cpp; sourceTree = "<group>"; };
BC921A5C15D5624600E52C91 /* RegalDispatchMissing.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = RegalDispatchMissing.cpp; path = ../../../src/regal/RegalDispatchMissing.cpp; sourceTree = "<group>"; };
BC921A5D15D5624600E52C91 /* RegalDispatchNacl.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = RegalDispatchNacl.cpp; path = ../../../src/regal/RegalDispatchNacl.cpp; sourceTree = "<group>"; };
@@ -169,12 +173,13 @@
43FC5F4A15C4617A00D0177C /* Regal */ = {
isa = PBXGroup;
children = (
+ BC020956160D1C65003FAB99 /* md5 */,
+ 43FC5FA515C461A100D0177C /* mongoose */,
43EFD6F415EAADAC004080CE /* RegalDispatcher.cpp */,
43EFD6F515EAADAC004080CE /* RegalDispatcher.h */,
43EFD6F615EAADAC004080CE /* RegalDispatchStaticEGL.cpp */,
43EFD6F715EAADAC004080CE /* RegalDispatchStaticES2.cpp */,
43EFD6F815EAADAC004080CE /* RegalSystem.h */,
- 43FC5FA515C461A100D0177C /* mongoose */,
43FC5F4B15C4619B00D0177C /* linear.h */,
43FC5F4C15C4619B00D0177C /* Regal.cpp */,
43FC5F4D15C4619B00D0177C /* RegalBin.h */,
@@ -215,6 +220,7 @@
43FC5F6B15C4619B00D0177C /* RegalLookup.h */,
4366EEED15C9B54E00211205 /* RegalMac.cpp */,
43FC5F6C15C4619B00D0177C /* RegalMarker.h */,
+ BC020946160D1919003FAB99 /* RegalMarker.cpp */,
43FC5F6D15C4619B00D0177C /* RegalObj.h */,
43FC5F6E15C4619B00D0177C /* RegalPpa.h */,
43FC5F6F15C4619B00D0177C /* RegalPpc.h */,
@@ -238,6 +244,14 @@
name = mongoose;
sourceTree = "<group>";
};
+ BC020956160D1C65003FAB99 /* md5 */ = {
+ isa = PBXGroup;
+ children = (
+ BC020957160D1C73003FAB99 /* md5.c */,
+ );
+ name = md5;
+ sourceTree = "<group>";
+ };
/* End PBXGroup section */
/* Begin PBXHeadersBuildPhase section */
@@ -356,6 +370,8 @@
43EFD6FB15EAADAC004080CE /* RegalDispatchStaticEGL.cpp in Sources */,
43EFD6FC15EAADAC004080CE /* RegalDispatchStaticES2.cpp in Sources */,
BC6C912A15EE3DC60056E4F7 /* RegalDispatchGlobal.cpp in Sources */,
+ BC020947160D1919003FAB99 /* RegalMarker.cpp in Sources */,
+ BC020958160D1C73003FAB99 /* md5.c in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -365,7 +381,7 @@
43FC5EE615C45EBB00D0177C /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
- ALWAYS_SEARCH_USER_PATHS = NO;
+ ALWAYS_SEARCH_USER_PATHS = YES;
ARCHS = "$(ARCHS_STANDARD_32_BIT)";
COPY_PHASE_STRIP = NO;
GCC_C_LANGUAGE_STANDARD = gnu99;
@@ -383,14 +399,14 @@
HEADER_SEARCH_PATHS = ../../../include;
IPHONEOS_DEPLOYMENT_TARGET = 5.1;
SDKROOT = iphoneos;
- USER_HEADER_SEARCH_PATHS = "../../../src/mongoose ../../../src/boost";
+ USER_HEADER_SEARCH_PATHS = "../../../src/mongoose ../../../src/boost ../../../src/md5/include";
};
name = Debug;
};
43FC5EE715C45EBB00D0177C /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
- ALWAYS_SEARCH_USER_PATHS = NO;
+ ALWAYS_SEARCH_USER_PATHS = YES;
ARCHS = "$(ARCHS_STANDARD_32_BIT)";
COPY_PHASE_STRIP = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
@@ -401,7 +417,7 @@
HEADER_SEARCH_PATHS = ../../../include;
IPHONEOS_DEPLOYMENT_TARGET = 5.1;
SDKROOT = iphoneos;
- USER_HEADER_SEARCH_PATHS = "../../../src/mongoose ../../../src/boost";
+ USER_HEADER_SEARCH_PATHS = "../../../src/mongoose ../../../src/boost ../../../src/md5/include";
VALIDATE_PRODUCT = YES;
};
name = Release;
View
20 build/mac/Regal/Regal.xcodeproj/project.pbxproj
@@ -56,6 +56,8 @@
43A6C22A15C48D200063667E /* RegalUtil.h in Headers */ = {isa = PBXBuildFile; fileRef = 43A6C1FD15C48D200063667E /* RegalUtil.h */; };
43A6C22B15C48D200063667E /* RegalVao.h in Headers */ = {isa = PBXBuildFile; fileRef = 43A6C1FE15C48D200063667E /* RegalVao.h */; };
43A6C22E15C48D3A0063667E /* mongoose.c in Sources */ = {isa = PBXBuildFile; fileRef = 43A6C22D15C48D3A0063667E /* mongoose.c */; };
+ BC02094E160D1BA3003FAB99 /* RegalMarker.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC02094D160D1BA3003FAB99 /* RegalMarker.cpp */; };
+ BC020950160D1BD0003FAB99 /* md5.c in Sources */ = {isa = PBXBuildFile; fileRef = BC02094F160D1BD0003FAB99 /* md5.c */; };
BC456F1215D55F8E0080B420 /* RegalDispatchMissing.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC456F1015D55F8E0080B420 /* RegalDispatchMissing.cpp */; };
BC456F1315D55F8E0080B420 /* RegalDispatchNacl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC456F1115D55F8E0080B420 /* RegalDispatchNacl.cpp */; };
BC6C911D15EE3CDF0056E4F7 /* RegalDispatchGlobal.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC6C911C15EE3CDF0056E4F7 /* RegalDispatchGlobal.cpp */; };
@@ -115,6 +117,8 @@
43A6C1FD15C48D200063667E /* RegalUtil.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RegalUtil.h; path = ../../../src/regal/RegalUtil.h; sourceTree = "<group>"; };
43A6C1FE15C48D200063667E /* RegalVao.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RegalVao.h; path = ../../../src/regal/RegalVao.h; sourceTree = "<group>"; };
43A6C22D15C48D3A0063667E /* mongoose.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = mongoose.c; path = ../../../src/mongoose/mongoose.c; sourceTree = "<group>"; };
+ BC02094D160D1BA3003FAB99 /* RegalMarker.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = RegalMarker.cpp; path = ../../../src/regal/RegalMarker.cpp; sourceTree = "<group>"; };
+ BC02094F160D1BD0003FAB99 /* md5.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = md5.c; path = ../../../src/md5/src/md5.c; sourceTree = "<group>"; };
BC456F1015D55F8E0080B420 /* RegalDispatchMissing.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = RegalDispatchMissing.cpp; path = ../../../src/regal/RegalDispatchMissing.cpp; sourceTree = "<group>"; };
BC456F1115D55F8E0080B420 /* RegalDispatchNacl.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = RegalDispatchNacl.cpp; path = ../../../src/regal/RegalDispatchNacl.cpp; sourceTree = "<group>"; };
BC6C911C15EE3CDF0056E4F7 /* RegalDispatchGlobal.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = RegalDispatchGlobal.cpp; path = ../../../src/regal/RegalDispatchGlobal.cpp; sourceTree = "<group>"; };
@@ -153,6 +157,7 @@
43A6C1D015C48CFA0063667E /* Regal */ = {
isa = PBXGroup;
children = (
+ BC020951160D1BD8003FAB99 /* md5 */,
43A6C22C15C48D2D0063667E /* mongoose */,
43A6C1D215C48D1F0063667E /* linear.h */,
43A6C1D315C48D1F0063667E /* Regal.cpp */,
@@ -196,6 +201,7 @@
43A6C1F115C48D200063667E /* RegalLookup.cpp */,
43A6C1F215C48D200063667E /* RegalLookup.h */,
431D3C0C15C9B6F0009DD04F /* RegalMac.cpp */,
+ BC02094D160D1BA3003FAB99 /* RegalMarker.cpp */,
43A6C1F315C48D200063667E /* RegalMarker.h */,
43A6C1F415C48D200063667E /* RegalObj.h */,
43A6C1F515C48D200063667E /* RegalPpa.h */,
@@ -220,6 +226,14 @@
name = mongoose;
sourceTree = "<group>";
};
+ BC020951160D1BD8003FAB99 /* md5 */ = {
+ isa = PBXGroup;
+ children = (
+ BC02094F160D1BD0003FAB99 /* md5.c */,
+ );
+ name = md5;
+ sourceTree = "<group>";
+ };
/* End PBXGroup section */
/* Begin PBXHeadersBuildPhase section */
@@ -336,6 +350,8 @@
BCF889A715E079C20093B7D5 /* RegalDispatcher.cpp in Sources */,
BCF889AA15E079D80093B7D5 /* RegalDispatchStaticES2.cpp in Sources */,
BC6C911D15EE3CDF0056E4F7 /* RegalDispatchGlobal.cpp in Sources */,
+ BC02094E160D1BA3003FAB99 /* RegalMarker.cpp in Sources */,
+ BC020950160D1BD0003FAB99 /* md5.c in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -369,7 +385,7 @@
MACOSX_DEPLOYMENT_TARGET = 10.7;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = macosx;
- USER_HEADER_SEARCH_PATHS = ../../../src/mongoose;
+ USER_HEADER_SEARCH_PATHS = "../../../src/mongoose ../../../src/md5/include";
};
name = Debug;
};
@@ -393,7 +409,7 @@
);
MACOSX_DEPLOYMENT_TARGET = 10.7;
SDKROOT = macosx;
- USER_HEADER_SEARCH_PATHS = ../../../src/mongoose;
+ USER_HEADER_SEARCH_PATHS = "../../../src/mongoose ../../../src/md5/include";
};
name = Release;
};
View
7 build/win32/vs2010/Regal/Regal.vcxproj
@@ -58,7 +58,7 @@
<WarningLevel>Level4</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;_HAS_EXCEPTIONS=0;REGAL_EXPORTS;REGAL_SYS_WGL_DECLARE_WGL;REGAL_DECL_EXPORT;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <AdditionalIncludeDirectories>$(ProjectDir)/../../../../include;$(ProjectDir)/../../../../src/boost;$(ProjectDir)/../../../../src/mongoose</AdditionalIncludeDirectories>
+ <AdditionalIncludeDirectories>$(ProjectDir)/../../../../include;$(ProjectDir)/../../../../src/boost;$(ProjectDir)/../../../../src/mongoose;$(ProjectDir)/../../../../src/md5/include</AdditionalIncludeDirectories>
<ExceptionHandling>false</ExceptionHandling>
<RuntimeTypeInfo>false</RuntimeTypeInfo>
<BufferSecurityCheck>false</BufferSecurityCheck>
@@ -89,7 +89,7 @@
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;_HAS_EXCEPTIONS=0;REGAL_EXPORTS;REGAL_SYS_WGL_DECLARE_WGL;REGAL_DECL_EXPORT;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <AdditionalIncludeDirectories>$(ProjectDir)/../../../../include;$(ProjectDir)/../../../../src/boost;$(ProjectDir)/../../../../src/mongoose</AdditionalIncludeDirectories>
+ <AdditionalIncludeDirectories>$(ProjectDir)/../../../../include;$(ProjectDir)/../../../../src/boost;$(ProjectDir)/../../../../src/mongoose;$(ProjectDir)/../../../../src/md5/include</AdditionalIncludeDirectories>
<ExceptionHandling>false</ExceptionHandling>
<RuntimeTypeInfo>false</RuntimeTypeInfo>
<BufferSecurityCheck>false</BufferSecurityCheck>
@@ -129,6 +129,7 @@
<ClInclude Include="..\..\..\..\src\regal\RegalInit.h" />
<ClInclude Include="..\..\..\..\src\regal\RegalLog.h" />
<ClInclude Include="..\..\..\..\src\regal\RegalLookup.h" />
+ <ClInclude Include="..\..\..\..\src\regal\RegalMarker.h" />
<ClInclude Include="..\..\..\..\src\regal\RegalObj.h" />
<ClInclude Include="..\..\..\..\src\regal\RegalPrivate.h" />
<ClInclude Include="..\..\..\..\src\regal\RegalToken.h" />
@@ -136,6 +137,7 @@
<ClInclude Include="..\..\..\..\src\regal\RegalVao.h" />
</ItemGroup>
<ItemGroup>
+ <ClCompile Include="..\..\..\..\src\md5\src\md5.c" />
<ClCompile Include="..\..\..\..\src\mongoose\mongoose.c" />
<ClCompile Include="..\..\..\..\src\regal\Regal.cpp" />
<ClCompile Include="..\..\..\..\src\regal\RegalConfig.cpp" />
@@ -159,6 +161,7 @@
<ClCompile Include="..\..\..\..\src\regal\RegalInit.cpp" />
<ClCompile Include="..\..\..\..\src\regal\RegalLog.cpp" />
<ClCompile Include="..\..\..\..\src\regal\RegalLookup.cpp" />
+ <ClCompile Include="..\..\..\..\src\regal\RegalMarker.cpp" />
<ClCompile Include="..\..\..\..\src\regal\RegalToken.cpp" />
<ClCompile Include="..\..\..\..\src\regal\RegalUtil.cpp" />
</ItemGroup>
View
20 scripts/EmuFilter.py
@@ -0,0 +1,20 @@
+#!/usr/bin/python -B
+
+#
+# Filter calls that don't exist for ES 2.0
+#
+# This is the last layer of the emulation dispatch.
+#
+
+formulae = {
+ 'glClientActiveTexture' : {
+ 'entries' : [ 'glClientActiveTexture' ],
+ 'impl' : [
+ '#if REGAL_FORCE_ES2_PROFILE',
@kmixter
kmixter added a note

When this is true isn't _context->info->gles always set?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
+ 'return;',
+ '#else',
+ 'if (_context->info->gles)',
+ ' return;',
+ '#endif' ]
+ }
+}
View
24 scripts/regal/RegalContext.py
@@ -24,6 +24,7 @@
from EmuIff import iffFormulae
from EmuBin import binFormulae
from EmuObj import objFormulae
+from EmuFilter import formulae as filterFormulae
# Regal.cpp emulation
@@ -43,14 +44,15 @@
# RegalDispathEmu.cpp fixed-function emulation
emu = [
- { 'type' : 'RegalObj', 'member' : 'obj', 'conditional' : 'Config::enableEmuObj', 'ifdef' : 'REGAL_EMU_OBJ', 'formulae' : objFormulae },
- #{ 'type' : 'RegalPpc', 'member' : 'ppc', 'conditional' : None, 'ifdef' : '', 'formulae' : ppcFormulae },
- { 'type' : 'RegalPpa', 'member' : 'ppa', 'conditional' : 'Config::enableEmuPpa', 'ifdef' : 'REGAL_EMU_PPA', 'formulae' : ppaFormulae },
- { 'type' : 'RegalBin', 'member' : 'bin', 'conditional' : 'Config::enableEmuBin', 'ifdef' : 'REGAL_EMU_BIN', 'formulae' : binFormulae },
- { 'type' : 'RegalDsa', 'member' : 'dsa', 'conditional' : 'Config::enableEmuDsa', 'ifdef' : 'REGAL_EMU_DSA', 'formulae' : dsaFormulae },
- { 'type' : 'RegalIff', 'member' : 'iff', 'conditional' : 'Config::enableEmuIff', 'ifdef' : 'REGAL_EMU_IFF', 'formulae' : iffFormulae },
- { 'type' : 'RegalVao', 'member' : 'vao', 'conditional' : 'Config::enableEmuVao', 'ifdef' : 'REGAL_EMU_VAO', 'formulae' : vaoFormulae },
- { 'type' : 'void', 'member' : None, 'conditional' : None, 'ifdef' : None, 'formulae' : None }
+ { 'type' : 'RegalObj', 'member' : 'obj', 'conditional' : 'Config::enableEmuObj', 'ifdef' : 'REGAL_EMU_OBJ', 'formulae' : objFormulae },
+ #{ 'type' : 'RegalPpc', 'member' : 'ppc', 'conditional' : None, 'ifdef' : '', 'formulae' : ppcFormulae },
+ { 'type' : 'RegalPpa', 'member' : 'ppa', 'conditional' : 'Config::enableEmuPpa', 'ifdef' : 'REGAL_EMU_PPA', 'formulae' : ppaFormulae },
+ { 'type' : 'RegalBin', 'member' : 'bin', 'conditional' : 'Config::enableEmuBin', 'ifdef' : 'REGAL_EMU_BIN', 'formulae' : binFormulae },
+ { 'type' : 'RegalDsa', 'member' : 'dsa', 'conditional' : 'Config::enableEmuDsa', 'ifdef' : 'REGAL_EMU_DSA', 'formulae' : dsaFormulae },
+ { 'type' : 'RegalIff', 'member' : 'iff', 'conditional' : 'Config::enableEmuIff', 'ifdef' : 'REGAL_EMU_IFF', 'formulae' : iffFormulae },
+ { 'type' : 'RegalVao', 'member' : 'vao', 'conditional' : 'Config::enableEmuVao', 'ifdef' : 'REGAL_EMU_VAO', 'formulae' : vaoFormulae },
+ { 'type' : None, 'member' : None, 'conditional' : 'Config::enableEmuFilter', 'ifdef' : 'REGAL_EMU_FILTER', 'formulae' : filterFormulae },
+ { 'type' : 'void', 'member' : None, 'conditional' : None, 'ifdef' : None, 'formulae' : None }
]
contextHeaderTemplate = Template( '''${AUTOGENERATED}
@@ -296,10 +298,12 @@ def generateContextSource(apis, args):
# init += '#endif\n'
init += '%s = new %s;\n' % ( emu[revi]['member'], emu[revi]['type'] )
- init += '%s->emuLevel = %d;\n' % ( emu[revi]['member'], emu[revi]['level'] )
- init += '%s->Init( this );\n' % emu[revi]['member']
+ init += 'emuLevel = %d;\n' % ( int(emu[revi]['level']) - 1)
+ init += '%s->Init(*this);\n' % emu[revi]['member']
emuMemberInit += indent(wrapIf(emu[revi]['ifdef'],wrapCIf(emu[revi]['conditional'],init)),' ')
+ emuMemberInit += ' emuLevel = %d;\n' % ( len( emu ) - 1 )
+
# Output
substitute = {}
View
12 scripts/regal/RegalDispatchEmu.py
@@ -119,9 +119,10 @@ def apiEmuFuncDefineCode(apis, args):
if e != None and 'prefix' in e and len(e['prefix']):
if l['member'] :
code += ' if (_context->%s) {\n' % l['member']
- code += ' RegalEmuScopedActivate activate( _context, _context->%s );\n' % l['member']
+ code += ' Push<int> pushLevel(_context->emuLevel);\n'
+ code += ' _context->emuLevel = %d;\n' %( int(l['level']) - 1 )
for j in e['prefix'] :
- code += ' %s\n' % j
+ code += ' %s\n' % j
if l['member'] :
code += ' }\n'
if e!= None and 'impl' in e and l['member']:
@@ -155,12 +156,13 @@ def apiEmuFuncDefineCode(apis, args):
if e != None and 'impl' in e and len(e['impl']):
if l['member'] :
code += ' if (_context->%s) {\n' % l['member']
- code += ' RegalEmuScopedActivate activate( _context, _context->%s );\n' % l['member']
+ code += ' Push<int> pushLevel(_context->emuLevel);\n'
+ code += ' _context->emuLevel = %d;\n' %( int(l['level']) - 1 )
for j in e['impl'] :
- code += ' %s\n' % j
+ code += ' %s\n' % j
if l['member'] :
if typeIsVoid(rType):
- code += ' return;\n'
+ code += ' return;\n'
code += ' }\n'
if l['ifdef']:
code += ' #endif\n'
View
5 src/md5/src/md5.c
@@ -19,8 +19,9 @@
prototypes) to maintain the tradition that Netfone will compile
with Sun's original "cc". */
-#include <memory.h> /* for memcpy() */
-#include <string.h> /* for memcpy() */
+#include <memory.h> /* for memcpy() */
+#include <string.h> /* for memcpy() */
+
#include "md5.h"
#ifndef HIGHFIRST
View
84 src/regal/RegalBin.h
@@ -1,31 +1,32 @@
/*
- Copyright (c) 2011 NVIDIA Corporation
- Copyright (c) 2011-2012 Cass Everitt
- Copyright (c) 2012 Scott Nations
- Copyright (c) 2012 Mathias Schott
- Copyright (c) 2012 Nigel Stewart
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without modification,
- are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
- INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
- BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
- OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
- OF THE POSSIBILITY OF SUCH DAMAGE.
- */
+ Copyright (c) 2011-2012 NVIDIA Corporation
+ Copyright (c) 2011-2012 Cass Everitt
+ Copyright (c) 2012 Scott Nations
+ Copyright (c) 2012 Mathias Schott
+ Copyright (c) 2012 Nigel Stewart
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without modification,
+ are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following disclaimer in the documentation
+ and/or other materials provided with the distribution.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+ OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
/*
@@ -47,25 +48,20 @@ REGAL_GLOBAL_END
REGAL_NAMESPACE_BEGIN
-struct RegalBin : public RegalEmu {
-
- void Init( RegalContext * ctx ) {
- UNUSED_PARAMETER(ctx);
- }
-
- void ShaderBinary( RegalContext * ctx, GLsizei count, const GLuint *shaders, GLenum binaryFormat, const void * binary, GLsizei length) {
- DispatchTable & tbl = ctx->dispatcher.emulation;
- tbl.glShaderBinary( count, shaders, binaryFormat, binary, length );
- }
+struct RegalBin : public RegalEmu
+{
+ void Init( RegalContext &ctx )
+ {
+ UNUSED_PARAMETER(ctx);
+ }
+
+ void ShaderBinary( RegalContext * ctx, GLsizei count, const GLuint *shaders, GLenum binaryFormat, const void * binary, GLsizei length)
+ {
+ DispatchTable & tbl = ctx->dispatcher.emulation;
+ tbl.glShaderBinary( count, shaders, binaryFormat, binary, length );
+ }
};
REGAL_NAMESPACE_END
#endif // ! __REGAL_VAO_H__
-
-
-
-
-
-
-
View
9 src/regal/RegalConfig.cpp
@@ -61,6 +61,7 @@ bool enableEmuBin = REGAL_EMU_BIN;
bool enableEmuDsa = REGAL_EMU_DSA;
bool enableEmuIff = REGAL_EMU_IFF;
bool enableEmuVao = REGAL_EMU_VAO;
+bool enableEmuFilter = REGAL_EMU_FILTER;
bool frameMd5Color = false;
bool frameMd5Stencil = false;
@@ -152,6 +153,9 @@ void Init()
if (tmp) enableEmuVao = atoi(tmp)!=0;
#endif
+ tmp = GetEnv( "REGAL_EMU_FILTER" );
+ if (tmp) enableEmuFilter = atoi(tmp)!=0;
+
tmp = GetEnv( "REGAL_MD5_COLOR" );
if (tmp) frameMd5Color = atoi(tmp)!=0;
@@ -193,10 +197,7 @@ void Init()
Info("REGAL_EMU_DSA ", enableEmuDsa ? "enabled" : "disabled");
Info("REGAL_EMU_IFF ", enableEmuIff ? "enabled" : "disabled");
Info("REGAL_EMU_VAO ", enableEmuVao ? "enabled" : "disabled");
-
- Info("REGAL_EMU_PPA ", enableEmuPpa ? "enabled" : "disabled");
- Info("REGAL_EMU_OBJ ", enableEmuObj ? "enabled" : "disabled");
- Info("REGAL_EMU_BIN ", enableEmuBin ? "enabled" : "disabled");
+ Info("REGAL_EMU_FILTER ", enableEmuFilter ? "enabled" : "disabled");
Info("REGAL_MD5_COLOR ", frameMd5Color ? "enabled" : "disabled");
Info("REGAL_MD5_STENCIL ", frameMd5Stencil ? "enabled" : "disabled");
View
1 src/regal/RegalConfig.h
@@ -63,6 +63,7 @@ namespace Config
extern bool enableEmuDsa;
extern bool enableEmuIff;
extern bool enableEmuVao;
+ extern bool enableEmuFilter;
// Initial context configuration
View
27 src/regal/RegalContext.cpp
@@ -121,21 +121,21 @@ RegalContext::Init()
{
RegalAssert(info);
// emu
- emuLevel = 6;
+ emuLevel = 7;
#if REGAL_EMU_VAO
if (Config::enableEmuVao)
{
vao = new RegalVao;
- vao->emuLevel = 1;
- vao->Init( this );
+ emuLevel = 1;
+ vao->Init(*this);
}
#endif /* REGAL_EMU_VAO */
#if REGAL_EMU_IFF
if (Config::enableEmuIff)
{
iff = new RegalIff;
- iff->emuLevel = 2;
- iff->Init( this );
+ emuLevel = 2;
+ iff->Init(*this);
}
#endif /* REGAL_EMU_IFF */
#if REGAL_EMU_DSA
@@ -146,34 +146,35 @@ RegalContext::Init()
info->regalExtensionsSet.insert("GL_EXT_direct_state_access");
info->regalExtensions = ::boost::print::detail::join(info->regalExtensionsSet,std::string(" "));
dsa = new RegalDsa;
- dsa->emuLevel = 3;
- dsa->Init( this );
+ emuLevel = 3;
+ dsa->Init(*this);
}
#endif /* REGAL_EMU_DSA */
#if REGAL_EMU_BIN
if (Config::enableEmuBin)
{
bin = new RegalBin;
- bin->emuLevel = 4;
- bin->Init( this );
+ emuLevel = 4;
+ bin->Init(*this);
}
#endif /* REGAL_EMU_BIN */
#if REGAL_EMU_PPA
if (Config::enableEmuPpa)
{
ppa = new RegalPpa;
- ppa->emuLevel = 5;
- ppa->Init( this );
+ emuLevel = 5;
+ ppa->Init(*this);
}
#endif /* REGAL_EMU_PPA */
#if REGAL_EMU_OBJ
if (Config::enableEmuObj)
{
obj = new RegalObj;
- obj->emuLevel = 6;
- obj->Init( this );
+ emuLevel = 6;
+ obj->Init(*this);
}
#endif /* REGAL_EMU_OBJ */
+ emuLevel = 7;
}
#endif
View
9,134 src/regal/RegalDispatchEmu.cpp
5,055 additions, 4,079 deletions not shown because the diff is too large. Please use a local Git client to view these changes.
View
60 src/regal/RegalDsa.h
@@ -1,31 +1,32 @@
/*
- Copyright (c) 2011 NVIDIA Corporation
- Copyright (c) 2011-2012 Cass Everitt
- Copyright (c) 2012 Scott Nations
- Copyright (c) 2012 Mathias Schott
- Copyright (c) 2012 Nigel Stewart
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without modification,
- are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
- INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
- BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
- OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
- OF THE POSSIBILITY OF SUCH DAMAGE.
- */
+ Copyright (c) 2011-2012 NVIDIA Corporation
+ Copyright (c) 2011-2012 Cass Everitt
+ Copyright (c) 2012 Scott Nations
+ Copyright (c) 2012 Mathias Schott
+ Copyright (c) 2012 Nigel Stewart
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without modification,
+ are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following disclaimer in the documentation
+ and/or other materials provided with the distribution.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+ OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
/*
@@ -41,7 +42,6 @@
REGAL_GLOBAL_BEGIN
-#include "RegalUtil.h"
#include "RegalEmu.h"
REGAL_GLOBAL_END
@@ -75,8 +75,8 @@ struct RegalDsa : public RegalEmu {
Cache drv;
Cache dsa;
- void Init( RegalContext * ctx ) {
- RegalEmuScopedActivate activate( ctx, this );
+ void Init( RegalContext &ctx )
+ {
callDepth = 0;
drv.matrixMode = GL_MODELVIEW;
drv.activeTexture = GL_TEXTURE0;
View
88 src/regal/RegalEmu.h
@@ -1,31 +1,32 @@
/*
- Copyright (c) 2011 NVIDIA Corporation
- Copyright (c) 2011-2012 Cass Everitt
- Copyright (c) 2012 Scott Nations
- Copyright (c) 2012 Mathias Schott
- Copyright (c) 2012 Nigel Stewart
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without modification,
- are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
- INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
- BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
- OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
- OF THE POSSIBILITY OF SUCH DAMAGE.
- */
+ Copyright (c) 2011-2012 NVIDIA Corporation
+ Copyright (c) 2011-2012 Cass Everitt
+ Copyright (c) 2012 Scott Nations
+ Copyright (c) 2012 Mathias Schott
+ Copyright (c) 2012 Nigel Stewart
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without modification,
+ are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following disclaimer in the documentation
+ and/or other materials provided with the distribution.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+ OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
/*
@@ -99,37 +100,8 @@ struct Float4
};
-struct RegalEmu {
-
- int emuLevel;
- int emuSavedLevel;
-
- void SetLevel( int level ) {
- emuLevel = level;
- }
-
- void Activate( RegalContext * ctx ) {
- emuSavedLevel = ctx->emuLevel;
- ctx->emuLevel = emuLevel - 1;
- }
-
- void Deactivate( RegalContext * ctx ) {
- ctx->emuLevel = emuSavedLevel;
- emuSavedLevel = -1;
- }
-
-
-};
-
-struct RegalEmuScopedActivate {
- RegalContext * ctx;
- RegalEmu * emu;
- RegalEmuScopedActivate( RegalContext * rCtx, RegalEmu * e ) : ctx( rCtx ), emu( e ) {
- emu->Activate( ctx );
- }
- ~RegalEmuScopedActivate() {
- emu->Deactivate( ctx );
- }
+struct RegalEmu
+{
};
REGAL_NAMESPACE_END
View
13 src/regal/RegalIff.h
@@ -55,9 +55,9 @@ REGAL_GLOBAL_BEGIN
#include <string>
#include <algorithm>
+#include "RegalEmu.h"
#include "RegalPrivate.h"
#include "RegalContextInfo.h"
-#include "RegalEmu.h"
#include "linear.h"
REGAL_GLOBAL_END
@@ -1941,9 +1941,8 @@ struct RegalIff : public RegalEmu {
}
//
- void Init( RegalContext * ctx ) {
- RegalEmuScopedActivate activate( ctx, this );
-
+ void Init( RegalContext &ctx )
+ {
shadowMatrixMode = 0;
shadowActiveTextureIndex = 0;
activeTextureIndex = 0;
@@ -1953,9 +1952,9 @@ struct RegalIff : public RegalEmu {
es = false;
legacy = false;
- InitVertexArray( ctx );
- InitFixedFunction( ctx );
- InitImmediate( ctx );
+ InitVertexArray( &ctx );
+ InitFixedFunction( &ctx );
+ InitImmediate( &ctx );
}
};
View
73 src/regal/RegalObj.h
@@ -1,31 +1,32 @@
/*
- Copyright (c) 2011 NVIDIA Corporation
- Copyright (c) 2011-2012 Cass Everitt
- Copyright (c) 2012 Scott Nations
- Copyright (c) 2012 Mathias Schott
- Copyright (c) 2012 Nigel Stewart
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without modification,
- are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
- INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
- BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
- OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
- OF THE POSSIBILITY OF SUCH DAMAGE.
- */
+ Copyright (c) 2011-2012 NVIDIA Corporation
+ Copyright (c) 2011-2012 Cass Everitt
+ Copyright (c) 2012 Scott Nations
+ Copyright (c) 2012 Mathias Schott
+ Copyright (c) 2012 Nigel Stewart
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without modification,
+ are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following disclaimer in the documentation
+ and/or other materials provided with the distribution.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+ OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
/*
@@ -43,8 +44,8 @@ REGAL_GLOBAL_BEGIN
#include <map>
-#include "RegalPrivate.h"
#include "RegalEmu.h"
+#include "RegalPrivate.h"
REGAL_GLOBAL_END
@@ -124,16 +125,16 @@ struct RegalNameTranslator {
struct RegalObj : public RegalEmu {
- RegalNameTranslator bufferNames;
+ RegalNameTranslator bufferNames;
RegalNameTranslator vaoNames;
- void Init( RegalContext * ctx ) {
- RegalEmuScopedActivate activate( ctx, this );
- bufferNames.gen = ctx->dispatcher.emulation.glGenBuffers;
- bufferNames.del = ctx->dispatcher.emulation.glDeleteBuffers;
- vaoNames.gen = ctx->dispatcher.emulation.glGenVertexArrays;
- vaoNames.del = ctx->dispatcher.emulation.glDeleteVertexArrays;
- }
+ void Init( RegalContext &ctx )
+ {
+ bufferNames.gen = ctx.dispatcher.emulation.glGenBuffers;
+ bufferNames.del = ctx.dispatcher.emulation.glDeleteBuffers;
+ vaoNames.gen = ctx.dispatcher.emulation.glGenVertexArrays;
+ vaoNames.del = ctx.dispatcher.emulation.glDeleteVertexArrays;
+ }
void BindBuffer( RegalContext * ctx, GLenum target, GLuint bufferBinding ) {
DispatchTable & tbl = ctx->dispatcher.emulation;
View
2 src/regal/RegalPpa.h
@@ -60,7 +60,7 @@ REGAL_NAMESPACE_BEGIN
struct RegalPpa : public RegalEmu, State::Stencil, State::Depth, State::Polygon
{
- void Init(RegalContext *ctx)
+ void Init(RegalContext &ctx)
{
UNUSED_PARAMETER(ctx);
}
View
4 src/regal/RegalUtil.h
@@ -173,6 +173,10 @@
#define REGAL_EMU_VAO 1
#endif
+#ifndef REGAL_EMU_FILTER
+#define REGAL_EMU_FILTER 1
+#endif
+
//
#ifndef REGAL_FORCE_CORE_PROFILE
View
71 src/regal/RegalVao.h
@@ -1,31 +1,32 @@
/*
- Copyright (c) 2011 NVIDIA Corporation
- Copyright (c) 2011-2012 Cass Everitt
- Copyright (c) 2012 Scott Nations
- Copyright (c) 2012 Mathias Schott
- Copyright (c) 2012 Nigel Stewart
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without modification,
- are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
- INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
- BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
- OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
- OF THE POSSIBILITY OF SUCH DAMAGE.
- */
+ Copyright (c) 2011-2012 NVIDIA Corporation
+ Copyright (c) 2011-2012 Cass Everitt
+ Copyright (c) 2012 Scott Nations
+ Copyright (c) 2012 Mathias Schott
+ Copyright (c) 2012 Nigel Stewart
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without modification,
+ are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following disclaimer in the documentation
+ and/or other materials provided with the distribution.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+ OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
/*
@@ -106,11 +107,12 @@ struct RegalVao : public RegalEmu {
GLuint ffAttrNumTex;
GLuint maxVertexAttribs;
- void Init( RegalContext * ctx ) {
+ void Init( RegalContext &ctx )
+ {
clientActiveTexture = GL_TEXTURE0;
- maxVertexAttribs = ctx->info->maxVertexAttribs;
+ maxVertexAttribs = ctx.info->maxVertexAttribs;
RegalAssert( maxVertexAttribs <= REGAL_VAO_NUM_ARRAYS );
// we have RFF2A maps for sets of 8 and 16 attributes. if
@@ -144,17 +146,16 @@ struct RegalVao : public RegalEmu {
ffAttrNumTex = ffAttrTexEnd - ffAttrTexBegin;
core = true;
- //std::string s = (const char *)ctx->dispatcher.driver.glGetString( GL_RENDER );
- RegalEmuScopedActivate activate( ctx, this );
- if( ctx->info->core ) {
+ if( ctx.info->core )
+ {
maxName = 1;
- ctx->dispatcher.driver.glGenVertexArrays( 1, & coreVao );
+ ctx.dispatcher.driver.glGenVertexArrays( 1, & coreVao );
RegalAssert( coreVao != 0 );
- ctx->dispatcher.driver.glBindVertexArray( coreVao );
+ ctx.dispatcher.driver.glBindVertexArray( coreVao );
}
current = 9999999; // this is only to force the bind...
currVao = NULL;
- BindVertexArray( ctx, 0 );
+ BindVertexArray( &ctx, 0 );
}
void ShadowBufferBinding( GLenum target, GLuint bufferBinding ) {
View
7 win32/vs2010/Regal/Regal.vcxproj
@@ -58,7 +58,7 @@
<WarningLevel>Level4</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;_HAS_EXCEPTIONS=0;REGAL_EXPORTS;REGAL_SYS_WGL_DECLARE_WGL;REGAL_DECL_EXPORT;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <AdditionalIncludeDirectories>$(ProjectDir)/../../../include;$(ProjectDir)/../../../src/boost;$(ProjectDir)/../../../src/mongoose</AdditionalIncludeDirectories>
+ <AdditionalIncludeDirectories>$(ProjectDir)/../../../include;$(ProjectDir)/../../../src/boost;$(ProjectDir)/../../../src/mongoose;$(ProjectDir)/../../../src/md5/include</AdditionalIncludeDirectories>
<ExceptionHandling>false</ExceptionHandling>
<RuntimeTypeInfo>false</RuntimeTypeInfo>
<BufferSecurityCheck>false</BufferSecurityCheck>
@@ -89,7 +89,7 @@
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;_HAS_EXCEPTIONS=0;REGAL_EXPORTS;REGAL_SYS_WGL_DECLARE_WGL;REGAL_DECL_EXPORT;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <AdditionalIncludeDirectories>$(ProjectDir)/../../../include;$(ProjectDir)/../../../src/boost;$(ProjectDir)/../../../src/mongoose</AdditionalIncludeDirectories>
+ <AdditionalIncludeDirectories>$(ProjectDir)/../../../include;$(ProjectDir)/../../../src/boost;$(ProjectDir)/../../../src/mongoose;$(ProjectDir)/../../../src/md5/include</AdditionalIncludeDirectories>
<ExceptionHandling>false</ExceptionHandling>
<RuntimeTypeInfo>false</RuntimeTypeInfo>
<BufferSecurityCheck>false</BufferSecurityCheck>
@@ -129,6 +129,7 @@
<ClInclude Include="..\..\..\src\regal\RegalInit.h" />
<ClInclude Include="..\..\..\src\regal\RegalLog.h" />
<ClInclude Include="..\..\..\src\regal\RegalLookup.h" />
+ <ClInclude Include="..\..\..\src\regal\RegalMarker.h" />
<ClInclude Include="..\..\..\src\regal\RegalObj.h" />
<ClInclude Include="..\..\..\src\regal\RegalPrivate.h" />
<ClInclude Include="..\..\..\src\regal\RegalToken.h" />
@@ -136,6 +137,7 @@
<ClInclude Include="..\..\..\src\regal\RegalVao.h" />
</ItemGroup>
<ItemGroup>
+ <ClCompile Include="..\..\..\src\md5\src\md5.c" />
<ClCompile Include="..\..\..\src\mongoose\mongoose.c" />
<ClCompile Include="..\..\..\src\regal\Regal.cpp" />
<ClCompile Include="..\..\..\src\regal\RegalConfig.cpp" />
@@ -159,6 +161,7 @@
<ClCompile Include="..\..\..\src\regal\RegalInit.cpp" />
<ClCompile Include="..\..\..\src\regal\RegalLog.cpp" />
<ClCompile Include="..\..\..\src\regal\RegalLookup.cpp" />
+ <ClCompile Include="..\..\..\src\regal\RegalMarker.cpp" />
<ClCompile Include="..\..\..\src\regal\RegalToken.cpp" />
<ClCompile Include="..\..\..\src\regal\RegalUtil.cpp" />
</ItemGroup>

0 comments on commit 994fa02

Please sign in to comment.
Something went wrong with that request. Please try again.