Skip to content
Browse files

Replace DispatchState with Dispatcher

Further NaCL branch harmonization
Add initial static-linking ES2 dispatch support
  • Loading branch information...
1 parent a5d44f7 commit 6179f0a9735c6465738e8b529c130da9d94a2166 @nigels-com nigels-com committed Aug 21, 2012
Showing with 113,936 additions and 146,388 deletions.
  1. +2 −0 Makefile
  2. +137 −2 Makefile.nacl
  3. +12 −4 build/mac/Regal/Regal.xcodeproj/project.pbxproj
  4. +3 −1 build/win32/vs2010/Regal/Regal.vcxproj
  5. +2 −2 nacl-regal.sh
  6. +2 −2 scripts/DispatchDebug.py
  7. +1 −1 scripts/Emu.py
  8. +1 −1 scripts/EmuBin.py
  9. +8 −8 scripts/EmuContextState.py
  10. +78 −78 scripts/EmuDsa.py
  11. +2 −2 scripts/EmuErrorString.py
  12. +6 −6 scripts/EmuExtensionQuery.py
  13. +5 −5 scripts/EmuGetString.py
  14. +51 −51 scripts/EmuIff.py
  15. +2 −2 scripts/EmuLog.py
  16. +9 −9 scripts/EmuMarker.py
  17. +3 −3 scripts/EmuObj.py
  18. +6 −6 scripts/EmuPpa.py
  19. +7 −7 scripts/EmuPpc.py
  20. +18 −18 scripts/EmuVao.py
  21. +140 −102 scripts/Export.py
  22. +7,568 −20,123 src/regal/Regal.cpp
  23. +1 −2 src/regal/RegalBin.h
  24. +4 −7 src/regal/RegalContext.cpp
  25. +2 −2 src/regal/RegalContext.h
  26. +10 −10 src/regal/RegalContextInfo.cpp
  27. +10,047 −7,537 src/regal/RegalDispatchDebug.cpp
  28. +6,812 −6,813 src/regal/RegalDispatchEmu.cpp
  29. +42,676 −47,699 src/regal/RegalDispatchError.cpp
  30. +24,984 −37,666 src/regal/RegalDispatchLoader.cpp
  31. +10,044 −15,067 src/regal/RegalDispatchLog.cpp
  32. +10,663 −10,790 src/regal/RegalDispatchMissing.cpp
  33. +0 −1 src/regal/RegalDispatchNacl.cpp
  34. +0 −251 src/regal/RegalDispatchState.h
  35. +208 −0 src/regal/RegalDispatchStaticES2.cpp
  36. +136 −0 src/regal/RegalDispatcher.cpp
  37. +180 −0 src/regal/RegalDispatcher.h
  38. +21 −21 src/regal/RegalDsa.h
  39. +41 −44 src/regal/RegalIff.cpp
  40. +22 −23 src/regal/RegalIff.h
  41. +2 −3 src/regal/RegalInit.cpp
  42. +6 −6 src/regal/RegalObj.h
  43. +5 −6 src/regal/RegalPpa.h
  44. +6 −6 src/regal/RegalVao.h
  45. +3 −1 win32/vs2010/Regal/Regal.vcxproj
View
2 Makefile
@@ -70,12 +70,14 @@ LIB.SRCS += src/regal/RegalLookup.cpp
LIB.SRCS += src/regal/RegalHelper.cpp
LIB.SRCS += src/regal/RegalContext.cpp
LIB.SRCS += src/regal/RegalContextInfo.cpp
+LIB.SRCS += src/regal/RegalDispatcher.cpp
LIB.SRCS += src/regal/RegalDispatchEmu.cpp
LIB.SRCS += src/regal/RegalDispatchLog.cpp
LIB.SRCS += src/regal/RegalDispatchDebug.cpp
LIB.SRCS += src/regal/RegalDispatchError.cpp
LIB.SRCS += src/regal/RegalDispatchLoader.cpp
LIB.SRCS += src/regal/RegalDispatchNacl.cpp
+LIB.SRCS += src/regal/RegalDispatchStaticES2.cpp
LIB.SRCS += src/regal/RegalDispatchMissing.cpp
LIB.SRCS += src/regal/RegalHttp.cpp
LIB.SRCS += src/regal/RegalFavicon.cpp
View
139 Makefile.nacl
@@ -100,7 +100,7 @@ LIB.SOBJS := $(LIB.SOBJS:.cpp=.o)
CFLAGS += -DREGAL_NO_HTTP
-regal.lib: lib lib/$(LIB.SHARED) lib/$(LIB.STATIC)
+regal.lib: lib lib/$(LIB.SHARED) glu.lib
lib:
mkdir lib
@@ -278,6 +278,141 @@ endif
endif
+#
+# RegalGLU
+#
+
+GLU.SRCS += src/glu/libtess/dict.c
+GLU.SRCS += src/glu/libtess/geom.c
+GLU.SRCS += src/glu/libtess/memalloc.c
+GLU.SRCS += src/glu/libtess/mesh.c
+GLU.SRCS += src/glu/libtess/normal.c
+#GLU.SRCS += src/glu/libtess/priorityq-heap.c
+GLU.SRCS += src/glu/libtess/priorityq.c
+GLU.SRCS += src/glu/libtess/render.c
+GLU.SRCS += src/glu/libtess/sweep.c
+GLU.SRCS += src/glu/libtess/tess.c
+GLU.SRCS += src/glu/libtess/tessmono.c
+GLU.SRCS += src/glu/libutil/error.c
+GLU.SRCS += src/glu/libutil/glue.c
+GLU.SRCS += src/glu/libutil/mipmap.c
+GLU.SRCS += src/glu/libutil/project.c
+GLU.SRCS += src/glu/libutil/quad.c
+GLU.SRCS += src/glu/libutil/registry.c
+
+GLU.SRCS += src/glu/libnurbs/interface/bezierEval.cc
+GLU.SRCS += src/glu/libnurbs/interface/bezierPatch.cc
+GLU.SRCS += src/glu/libnurbs/interface/bezierPatchMesh.cc
+GLU.SRCS += src/glu/libnurbs/interface/glcurveval.cc
+GLU.SRCS += src/glu/libnurbs/interface/glinterface.cc
+GLU.SRCS += src/glu/libnurbs/interface/glrenderer.cc
+GLU.SRCS += src/glu/libnurbs/interface/glsurfeval.cc
+GLU.SRCS += src/glu/libnurbs/interface/incurveeval.cc
+GLU.SRCS += src/glu/libnurbs/interface/insurfeval.cc
+GLU.SRCS += src/glu/libnurbs/internals/arc.cc
+GLU.SRCS += src/glu/libnurbs/internals/arcsorter.cc
+GLU.SRCS += src/glu/libnurbs/internals/arctess.cc
+GLU.SRCS += src/glu/libnurbs/internals/backend.cc
+GLU.SRCS += src/glu/libnurbs/internals/basiccrveval.cc
+GLU.SRCS += src/glu/libnurbs/internals/basicsurfeval.cc
+GLU.SRCS += src/glu/libnurbs/internals/bin.cc
+GLU.SRCS += src/glu/libnurbs/internals/bufpool.cc
+GLU.SRCS += src/glu/libnurbs/internals/cachingeval.cc
+GLU.SRCS += src/glu/libnurbs/internals/ccw.cc
+GLU.SRCS += src/glu/libnurbs/internals/coveandtiler.cc
+GLU.SRCS += src/glu/libnurbs/internals/curve.cc
+GLU.SRCS += src/glu/libnurbs/internals/curvelist.cc
+GLU.SRCS += src/glu/libnurbs/internals/curvesub.cc
+GLU.SRCS += src/glu/libnurbs/internals/dataTransform.cc
+GLU.SRCS += src/glu/libnurbs/internals/displaylist.cc
+GLU.SRCS += src/glu/libnurbs/internals/flist.cc
+GLU.SRCS += src/glu/libnurbs/internals/flistsorter.cc
+GLU.SRCS += src/glu/libnurbs/internals/hull.cc
+GLU.SRCS += src/glu/libnurbs/internals/intersect.cc
+GLU.SRCS += src/glu/libnurbs/internals/knotvector.cc
+GLU.SRCS += src/glu/libnurbs/internals/mapdesc.cc
+GLU.SRCS += src/glu/libnurbs/internals/mapdescv.cc
+GLU.SRCS += src/glu/libnurbs/internals/maplist.cc
+GLU.SRCS += src/glu/libnurbs/internals/mesher.cc
+GLU.SRCS += src/glu/libnurbs/internals/monotonizer.cc
+GLU.SRCS += src/glu/libnurbs/internals/monoTriangulationBackend.cc
+GLU.SRCS += src/glu/libnurbs/internals/mycode.cc
+GLU.SRCS += src/glu/libnurbs/internals/nurbsinterfac.cc
+GLU.SRCS += src/glu/libnurbs/internals/nurbstess.cc
+GLU.SRCS += src/glu/libnurbs/internals/patch.cc
+GLU.SRCS += src/glu/libnurbs/internals/patchlist.cc
+GLU.SRCS += src/glu/libnurbs/internals/quilt.cc
+GLU.SRCS += src/glu/libnurbs/internals/reader.cc
+GLU.SRCS += src/glu/libnurbs/internals/renderhints.cc
+GLU.SRCS += src/glu/libnurbs/internals/slicer.cc
+GLU.SRCS += src/glu/libnurbs/internals/sorter.cc
+GLU.SRCS += src/glu/libnurbs/internals/splitarcs.cc
+GLU.SRCS += src/glu/libnurbs/internals/subdivider.cc
+GLU.SRCS += src/glu/libnurbs/internals/tobezier.cc
+GLU.SRCS += src/glu/libnurbs/internals/trimline.cc
+GLU.SRCS += src/glu/libnurbs/internals/trimregion.cc
+GLU.SRCS += src/glu/libnurbs/internals/trimvertpool.cc
+GLU.SRCS += src/glu/libnurbs/internals/uarray.cc
+GLU.SRCS += src/glu/libnurbs/internals/varray.cc
+GLU.SRCS += src/glu/libnurbs/nurbtess/directedLine.cc
+GLU.SRCS += src/glu/libnurbs/nurbtess/gridWrap.cc
+GLU.SRCS += src/glu/libnurbs/nurbtess/monoChain.cc
+GLU.SRCS += src/glu/libnurbs/nurbtess/monoPolyPart.cc
+GLU.SRCS += src/glu/libnurbs/nurbtess/monoTriangulation.cc
+GLU.SRCS += src/glu/libnurbs/nurbtess/partitionX.cc
+GLU.SRCS += src/glu/libnurbs/nurbtess/partitionY.cc
+GLU.SRCS += src/glu/libnurbs/nurbtess/polyDBG.cc
+GLU.SRCS += src/glu/libnurbs/nurbtess/polyUtil.cc
+GLU.SRCS += src/glu/libnurbs/nurbtess/primitiveStream.cc
+GLU.SRCS += src/glu/libnurbs/nurbtess/quicksort.cc
+GLU.SRCS += src/glu/libnurbs/nurbtess/rectBlock.cc
+GLU.SRCS += src/glu/libnurbs/nurbtess/sampleComp.cc
+GLU.SRCS += src/glu/libnurbs/nurbtess/sampleCompBot.cc
+GLU.SRCS += src/glu/libnurbs/nurbtess/sampleCompRight.cc
+GLU.SRCS += src/glu/libnurbs/nurbtess/sampleCompTop.cc
+GLU.SRCS += src/glu/libnurbs/nurbtess/sampledLine.cc
+GLU.SRCS += src/glu/libnurbs/nurbtess/sampleMonoPoly.cc
+GLU.SRCS += src/glu/libnurbs/nurbtess/searchTree.cc
+
+GLU.SRCS.NAMES := $(notdir $(GLU.SRCS))
+GLU.OBJS := $(addprefix tmp/$(SYSTEM)/glu/shared/,$(GLU.SRCS.NAMES))
+GLU.OBJS := $(GLU.OBJS:.c=.o) $(GLU.OBJS:.cc=.o)
+GLU.OBJS := $(filter %.o,$(GLU.OBJS))
+GLU.CFLAGS := -Isrc/glu/include -Isrc/glu/libnurbs/interface -Isrc/glu/libnurbs/internals -Isrc/glu/libnurbs/nurbtess
+GLU.CFLAGS += -DLIBRARYBUILD
+GLU.LIBS := -Llib
+GLU.LIBS += -lpthread -lm
+GLU.SHARED := libRegalGLU.so
+GLU.STATIC := libRegalGLU.a
+
+glu.lib: lib lib/$(GLU.SHARED)
+
+tmp/$(SYSTEM)/glu/shared/%.o: src/glu/libtess/%.c
+ @mkdir -p $(dir $@)
+ $(CCACHE) $(CC) $(CFLAGS) $(PICFLAG) $(GLU.CFLAGS) $(CFLAGS.SO) -o $@ -c $<
+
+tmp/$(SYSTEM)/glu/shared/%.o: src/glu/libutil/%.c
+ @mkdir -p $(dir $@)
+ $(CCACHE) $(CC) $(CFLAGS) $(PICFLAG) $(GLU.CFLAGS) $(CFLAGS.SO) -o $@ -c $<
+
+tmp/$(SYSTEM)/glu/shared/%.o: src/glu/libnurbs/interface/%.cc
+ @mkdir -p $(dir $@)
+ $(CCACHE) $(CC) $(CFLAGS) $(PICFLAG) $(GLU.CFLAGS) $(CFLAGS.SO) -o $@ -c $<
+
+tmp/$(SYSTEM)/glu/shared/%.o: src/glu/libnurbs/internals/%.cc
+ @mkdir -p $(dir $@)
+ $(CCACHE) $(CC) $(CFLAGS) $(PICFLAG) $(GLU.CFLAGS) $(CFLAGS.SO) -o $@ -c $<
+
+tmp/$(SYSTEM)/glu/shared/%.o: src/glu/libnurbs/nurbtess/%.cc
+ @mkdir -p $(dir $@)
+ $(CCACHE) $(CC) $(CFLAGS) $(PICFLAG) $(GLU.CFLAGS) $(CFLAGS.SO) -o $@ -c $<
+
+lib/$(GLU.SHARED): $(GLU.OBJS)
+ $(CCACHE) $(CC) $(LDFLAGS.SO) $(LDFLAGS.EXTRA) $(LDFLAGS.DYNAMIC) -o $@ $^
+ifneq ($(STRIP),)
+ $(STRIP) -x $@
+endif
+
# Examples
regal.bin: lib bin bin/nacl$(BIN_EXTENSION)
@@ -341,7 +476,7 @@ NACLHELLOWORLD.SRCS.NAMES := $(notdir $(NACLHELLOWORLD.SRCS))
NACLHELLOWORLD.OBJS := $(addprefix tmp/$(SYSTEM)/nacl/static/,$(NACLHELLOWORLD.SRCS.NAMES))
NACLHELLOWORLD.OBJS := $(NACLHELLOWORLD.OBJS:.cpp=.o)
NACLHELLOWORLD.CFLAGS := -Iinclude
-NACLHELLOWORLD.LIBS += -L./lib -lRegal
+NACLHELLOWORLD.LIBS += -L./lib -lRegal -lRegalGLU
NACLHELLOWORLD.LIBS += -lm -lpthread -lppapi -lppapi_gles2
tmp/$(SYSTEM)/nacl/static/%.o: examples/nacl/%.cpp
View
16 build/mac/Regal/Regal.xcodeproj/project.pbxproj
@@ -28,7 +28,6 @@
43A6C20D15C48D200063667E /* RegalDispatchError.h in Headers */ = {isa = PBXBuildFile; fileRef = 43A6C1E015C48D1F0063667E /* RegalDispatchError.h */; };
43A6C20E15C48D200063667E /* RegalDispatchLoader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 43A6C1E115C48D1F0063667E /* RegalDispatchLoader.cpp */; };
43A6C20F15C48D200063667E /* RegalDispatchLog.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 43A6C1E215C48D1F0063667E /* RegalDispatchLog.cpp */; };
- 43A6C21015C48D200063667E /* RegalDispatchState.h in Headers */ = {isa = PBXBuildFile; fileRef = 43A6C1E315C48D1F0063667E /* RegalDispatchState.h */; };
43A6C21115C48D200063667E /* RegalDllMain.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 43A6C1E415C48D1F0063667E /* RegalDllMain.cpp */; };
43A6C21215C48D200063667E /* RegalDsa.h in Headers */ = {isa = PBXBuildFile; fileRef = 43A6C1E515C48D1F0063667E /* RegalDsa.h */; };
43A6C21315C48D200063667E /* RegalEmu.h in Headers */ = {isa = PBXBuildFile; fileRef = 43A6C1E615C48D200063667E /* RegalEmu.h */; };
@@ -59,6 +58,9 @@
43A6C22E15C48D3A0063667E /* mongoose.c in Sources */ = {isa = PBXBuildFile; fileRef = 43A6C22D15C48D3A0063667E /* mongoose.c */; };
BC456F1215D55F8E0080B420 /* RegalDispatchMissing.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC456F1015D55F8E0080B420 /* RegalDispatchMissing.cpp */; };
BC456F1315D55F8E0080B420 /* RegalDispatchNacl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC456F1115D55F8E0080B420 /* RegalDispatchNacl.cpp */; };
+ BCF889A715E079C20093B7D5 /* RegalDispatcher.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCF889A515E079C20093B7D5 /* RegalDispatcher.cpp */; };
+ BCF889A815E079C20093B7D5 /* RegalDispatcher.h in Headers */ = {isa = PBXBuildFile; fileRef = BCF889A615E079C20093B7D5 /* RegalDispatcher.h */; };
+ BCF889AA15E079D80093B7D5 /* RegalDispatchStaticES2.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCF889A915E079D80093B7D5 /* RegalDispatchStaticES2.cpp */; };
/* End PBXBuildFile section */
/* Begin PBXFileReference section */
@@ -84,7 +86,6 @@
43A6C1E015C48D1F0063667E /* RegalDispatchError.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RegalDispatchError.h; path = ../../../src/regal/RegalDispatchError.h; sourceTree = "<group>"; };
43A6C1E115C48D1F0063667E /* RegalDispatchLoader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = RegalDispatchLoader.cpp; path = ../../../src/regal/RegalDispatchLoader.cpp; sourceTree = "<group>"; };
43A6C1E215C48D1F0063667E /* RegalDispatchLog.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = RegalDispatchLog.cpp; path = ../../../src/regal/RegalDispatchLog.cpp; sourceTree = "<group>"; };
- 43A6C1E315C48D1F0063667E /* RegalDispatchState.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RegalDispatchState.h; path = ../../../src/regal/RegalDispatchState.h; sourceTree = "<group>"; };
43A6C1E415C48D1F0063667E /* RegalDllMain.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = RegalDllMain.cpp; path = ../../../src/regal/RegalDllMain.cpp; sourceTree = "<group>"; };
43A6C1E515C48D1F0063667E /* RegalDsa.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RegalDsa.h; path = ../../../src/regal/RegalDsa.h; sourceTree = "<group>"; };
43A6C1E615C48D200063667E /* RegalEmu.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RegalEmu.h; path = ../../../src/regal/RegalEmu.h; sourceTree = "<group>"; };
@@ -115,6 +116,9 @@
43A6C22D15C48D3A0063667E /* mongoose.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = mongoose.c; path = ../../../src/mongoose/mongoose.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>"; };
+ BCF889A515E079C20093B7D5 /* RegalDispatcher.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = RegalDispatcher.cpp; path = ../../../src/regal/RegalDispatcher.cpp; sourceTree = "<group>"; };
+ BCF889A615E079C20093B7D5 /* RegalDispatcher.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RegalDispatcher.h; path = ../../../src/regal/RegalDispatcher.h; sourceTree = "<group>"; };
+ BCF889A915E079D80093B7D5 /* RegalDispatchStaticES2.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = RegalDispatchStaticES2.cpp; path = ../../../src/regal/RegalDispatchStaticES2.cpp; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
@@ -162,6 +166,8 @@
431D3C0915C9B6F0009DD04F /* RegalEnum.h */,
431D3C0A15C9B6F0009DD04F /* RegalFavicon.cpp */,
431D3C0B15C9B6F0009DD04F /* RegalFavicon.h */,
+ BCF889A515E079C20093B7D5 /* RegalDispatcher.cpp */,
+ BCF889A615E079C20093B7D5 /* RegalDispatcher.h */,
43A6C1DD15C48D1F0063667E /* RegalDispatchDebug.cpp */,
43A6C1DE15C48D1F0063667E /* RegalDispatchEmu.cpp */,
43A6C1DF15C48D1F0063667E /* RegalDispatchError.cpp */,
@@ -170,7 +176,7 @@
43A6C1E215C48D1F0063667E /* RegalDispatchLog.cpp */,
BC456F1015D55F8E0080B420 /* RegalDispatchMissing.cpp */,
BC456F1115D55F8E0080B420 /* RegalDispatchNacl.cpp */,
- 43A6C1E315C48D1F0063667E /* RegalDispatchState.h */,
+ BCF889A915E079D80093B7D5 /* RegalDispatchStaticES2.cpp */,
43A6C1E415C48D1F0063667E /* RegalDllMain.cpp */,
43A6C1E515C48D1F0063667E /* RegalDsa.h */,
43A6C1E615C48D200063667E /* RegalEmu.h */,
@@ -226,7 +232,6 @@
43A6C20815C48D200063667E /* RegalDebugInfo.h in Headers */,
43A6C20915C48D200063667E /* RegalDispatch.h in Headers */,
43A6C20D15C48D200063667E /* RegalDispatchError.h in Headers */,
- 43A6C21015C48D200063667E /* RegalDispatchState.h in Headers */,
43A6C21215C48D200063667E /* RegalDsa.h in Headers */,
43A6C21315C48D200063667E /* RegalEmu.h in Headers */,
43A6C21515C48D200063667E /* RegalHelper.h in Headers */,
@@ -247,6 +252,7 @@
43A6C22B15C48D200063667E /* RegalVao.h in Headers */,
431D3C0D15C9B6F0009DD04F /* RegalEnum.h in Headers */,
431D3C0F15C9B6F0009DD04F /* RegalFavicon.h in Headers */,
+ BCF889A815E079C20093B7D5 /* RegalDispatcher.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -324,6 +330,8 @@
431D3C1015C9B6F0009DD04F /* RegalMac.cpp in Sources */,
BC456F1215D55F8E0080B420 /* RegalDispatchMissing.cpp in Sources */,
BC456F1315D55F8E0080B420 /* RegalDispatchNacl.cpp in Sources */,
+ BCF889A715E079C20093B7D5 /* RegalDispatcher.cpp in Sources */,
+ BCF889AA15E079D80093B7D5 /* RegalDispatchStaticES2.cpp in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
View
4 build/win32/vs2010/Regal/Regal.vcxproj
@@ -120,8 +120,8 @@
<ClInclude Include="..\..\..\..\src\regal\RegalContext.h" />
<ClInclude Include="..\..\..\..\src\regal\RegalContextInfo.h" />
<ClInclude Include="..\..\..\..\src\regal\RegalDebugInfo.h" />
+ <ClInclude Include="..\..\..\..\src\regal\RegalDispatcher.h" />
<ClInclude Include="..\..\..\..\src\regal\RegalDispatchError.h" />
- <ClInclude Include="..\..\..\..\src\regal\RegalDispatchState.h" />
<ClInclude Include="..\..\..\..\src\regal\RegalDsa.h" />
<ClInclude Include="..\..\..\..\src\regal\RegalEmu.h" />
<ClInclude Include="..\..\..\..\src\regal\RegalHelper.h" />
@@ -143,11 +143,13 @@
<ClCompile Include="..\..\..\..\src\regal\RegalContextInfo.cpp" />
<ClCompile Include="..\..\..\..\src\regal\RegalDispatchDebug.cpp" />
<ClCompile Include="..\..\..\..\src\regal\RegalDispatchEmu.cpp" />
+ <ClCompile Include="..\..\..\..\src\regal\RegalDispatcher.cpp" />
<ClCompile Include="..\..\..\..\src\regal\RegalDispatchError.cpp" />
<ClCompile Include="..\..\..\..\src\regal\RegalDispatchLoader.cpp" />
<ClCompile Include="..\..\..\..\src\regal\RegalDispatchLog.cpp" />
<ClCompile Include="..\..\..\..\src\regal\RegalDispatchMissing.cpp" />
<ClCompile Include="..\..\..\..\src\regal\RegalDispatchNacl.cpp" />
+ <ClCompile Include="..\..\..\..\src\regal\RegalDispatchStaticES2.cpp" />
<ClCompile Include="..\..\..\..\src\regal\RegalDllMain.cpp" />
<ClCompile Include="..\..\..\..\src\regal\RegalFavicon.cpp" />
<ClCompile Include="..\..\..\..\src\regal\RegalHelper.cpp" />
View
4 nacl-regal.sh
@@ -14,7 +14,7 @@ readonly PACKAGE_NAME=regal
export NACL_GLIBC=1
export NACL_PACKAGES_BITSIZE=64
-source ../../build_tools/common.sh
+source ./build/nacl/common.sh
export CC=${NACLCC}
export CXX=${NACLCXX}
@@ -28,6 +28,6 @@ export FREETYPE_CONFIG=${NACL_SDK_USR_BIN}/freetype-config
export PATH=${NACL_BIN_PATH}:${PATH};
-make -f Makefile.nacl $*
+make -f Makefile SYSTEM=nacl-${NACL_PACKAGES_BITSIZE} $*
exit 0
View
4 scripts/DispatchDebug.py
@@ -3,11 +3,11 @@
debugDispatchFormulae = {
'MatrixMode' : {
'entries' : [ 'glMatrixMode' ],
- 'prefix' : [ 'rCtx->dbg->MatrixMode( rCtx, ${arg0plus} );', ],
+ 'prefix' : [ '_context->dbg->MatrixMode( _context, ${arg0plus} );', ],
},
'ClientActiveTexture' : {
'entries' : [ 'gl(Client|)(ActiveTexture)' ],
- 'prefix' : [ 'rCtx->dbg->${m1}${m2}( rCtx, ${arg0plus} );', ],
+ 'prefix' : [ '_context->dbg->${m1}${m2}( _context, ${arg0plus} );', ],
},
}
View
2 scripts/Emu.py
@@ -119,7 +119,7 @@ def emuCodeGen(emue,section):
for i in emue:
if i != None and i.get(section)!=None:
if i.get('member')!=None:
- tmp.append('if (rCtx->%s) {\n' % i['member'])
+ tmp.append('if (_context->%s) {\n' % i['member'])
tmp.extend([' %s' % j for j in i[section] ])
tmp.append('}\n')
else:
View
2 scripts/EmuBin.py
@@ -3,6 +3,6 @@
binFormulae = {
'ShaderBinary' : {
'entries' : [ 'glShaderBinary(ARB|)' ],
- 'impl' : [ 'rCtx->bin->ShaderBinary( rCtx, ${arg0plus} );', ],
+ 'impl' : [ '_context->bin->ShaderBinary( _context, ${arg0plus} );', ],
}
}
View
16 scripts/EmuContextState.py
@@ -6,29 +6,29 @@
formulae = {
'Begin' : {
'entries' : [ 'glBegin' ],
- 'impl' : [ 'RegalAssert(rCtx);',
- 'rCtx->depthBeginEnd++;'
+ 'impl' : [ 'RegalAssert(_context);',
+ '_context->depthBeginEnd++;'
]
},
'End' : {
'entries' : [ 'glEnd' ],
- 'impl' : [ 'RegalAssert(rCtx);',
- 'rCtx->depthBeginEnd--;'
+ 'impl' : [ 'RegalAssert(_context);',
+ '_context->depthBeginEnd--;'
]
},
'PushAttrib' : {
'entries' : [ 'glPushAttrib' ],
- 'impl' : [ 'RegalAssert(rCtx);',
- 'rCtx->depthPushAttrib++;'
+ 'impl' : [ 'RegalAssert(_context);',
+ '_context->depthPushAttrib++;'
]
},
'PopAttrib' : {
'entries' : [ 'glPopAttrib' ],
- 'impl' : [ 'RegalAssert(rCtx);',
- 'rCtx->depthPushAttrib--;'
+ 'impl' : [ 'RegalAssert(_context);',
+ '_context->depthPushAttrib--;'
]
},
View
156 scripts/EmuDsa.py
@@ -3,40 +3,40 @@
dsaFormulae = {
'SelectorGetCommands' : {
'entries' : [ 'glGet(Boolean|Integer|Float|Double)v' ],
- 'prefix' : [ 'rCtx->dsa->RestoreGet( rCtx, ${arg0} );' ],
+ 'prefix' : [ '_context->dsa->RestoreGet( _context, ${arg0} );' ],
},
'DsaGetCommands1' : {
'entries' : [ 'glGet(Float|Double)(Indexed|i_)v(EXT|)' ],
'impl' : [
- 'if ( ! rCtx->dsa->GetIndexedv( rCtx, ${arg0}, ${arg1}, ${arg2} ) ) {',
- ' rCtx->dsp->emuTbl.glGet${m1}${m2}v${m3}( ${arg0}, ${arg1}, ${arg2} );',
+ 'if ( ! _context->dsa->GetIndexedv( _context, ${arg0}, ${arg1}, ${arg2} ) ) {',
+ ' _context->dispatcher.emulation.glGet${m1}${m2}v${m3}( ${arg0}, ${arg1}, ${arg2} );',
'}',
],
},
'DsaGetCommands2' : {
'entries' : [ 'glGetPointerIndexedvEXT' ],
'impl' : [
- '// if ( ! rCtx->dsa->GetIndexedv( rCtx, ${arg0}, ${arg1}, ${arg2} ) ) {',
- '// rCtx->dsp->emuTbl.glGetPointerIndexedvEXT( ${arg0}, ${arg1}, ${arg2} );',
+ '// if ( ! _context->dsa->GetIndexedv( _context, ${arg0}, ${arg1}, ${arg2} ) ) {',
+ '// _context->dispatcher.emulation.glGetPointerIndexedvEXT( ${arg0}, ${arg1}, ${arg2} );',
'// }',
],
},
'DsaGetCommands3' : {
'entries' : [ 'glGetFramebufferParameterivEXT' ],
'impl' : [
- 'rCtx->dsa->DsaFramebuffer( rCtx, GL_FRAMEBUFFER, ${arg0} );',
- 'rCtx->dsp->emuTbl.glGetIntegerv( ${arg1plus} );',
+ '_context->dsa->DsaFramebuffer( _context, GL_FRAMEBUFFER, ${arg0} );',
+ '_context->dispatcher.emulation.glGetIntegerv( ${arg1plus} );',
],
},
'SelectorIsEnabled' : {
'entries' : [ 'glIsEnabled' ],
- 'prefix' : [ 'rCtx->dsa->RestoreIsEnabled( rCtx, ${arg0} );']
+ 'prefix' : [ '_context->dsa->RestoreIsEnabled( _context, ${arg0} );']
},
'DsaIsEnabled' : {
'entries' : [ 'glIsEnabled(Indexed|i)EXT' ],
'impl' : [
'GLboolean ret;',
- 'ret = rCtx->dsa->IsEnabledIndexed( rCtx, ${arg0}, ${arg1} );',
+ 'ret = _context->dsa->IsEnabledIndexed( _context, ${arg0}, ${arg1} );',
'return ret;',
],
},
@@ -47,13 +47,13 @@
'gl(Rotate|Scale|Translate)(f|d)',
'gl(Push|Pop)Matrix',
],
- 'prefix' : [ 'rCtx->dsa->RestoreMatrixMode( rCtx );' ],
+ 'prefix' : [ '_context->dsa->RestoreMatrixMode( _context );' ],
},
'MatrixMode' : {
'entries' : [ 'glMatrixMode' ],
'impl' : [
- 'if( false == rCtx->dsa->ShadowMatrixMode( ${arg0} ) ) {',
- ' rCtx->dsp->emuTbl.glMatrixMode( ${arg0} );',
+ 'if( false == _context->dsa->ShadowMatrixMode( ${arg0} ) ) {',
+ ' _context->dispatcher.emulation.glMatrixMode( ${arg0} );',
'}',
],
},
@@ -63,8 +63,8 @@
'glMatrix(Push|Pop)()()EXT',
],
'impl' : [
- 'rCtx->dsa->DsaMatrixMode( rCtx, ${arg0} );',
- 'rCtx->dsp->emuTbl.gl${m1}${m2}Matrix${m3}( ${arg1plus} );',
+ '_context->dsa->DsaMatrixMode( _context, ${arg0} );',
+ '_context->dispatcher.emulation.gl${m1}${m2}Matrix${m3}( ${arg1plus} );',
],
},
'MatrixTransform' : {
@@ -73,16 +73,16 @@
'glMatrix(Rotate|Scale|Translate)(f|d)EXT',
],
'impl' : [
- 'rCtx->dsa->DsaMatrixMode( rCtx, ${arg0} );',
- 'rCtx->dsp->emuTbl.gl${m1}${m2}( ${arg1plus} );',
+ '_context->dsa->DsaMatrixMode( _context, ${arg0} );',
+ '_context->dispatcher.emulation.gl${m1}${m2}( ${arg1plus} );',
],
},
'ClientActiveTexture' : {
'entries' : [ 'glClientActiveTexture' ],
'impl' : [
- 'if( false == rCtx->dsa->ShadowClientActiveTexture( ${arg0} ) ) {',
- ' rCtx->dsp->emuTbl.glClientActiveTexture( ${arg0} );',
+ 'if( false == _context->dsa->ShadowClientActiveTexture( ${arg0} ) ) {',
+ ' _context->dispatcher.emulation.glClientActiveTexture( ${arg0} );',
'}',
],
},
@@ -92,36 +92,36 @@
'glTexCoordPointer',
],
'prefix' : [
- 'rCtx->dsa->RestoreClientActiveTexture( rCtx );',
- 'rCtx->dsa->RestoreBuffer( rCtx );',
+ '_context->dsa->RestoreClientActiveTexture( _context );',
+ '_context->dsa->RestoreBuffer( _context );',
],
},
'ClientIndexed' : {
'entries' : [ 'gl(Enable|Disable)ClientState(Indexed|i)EXT' ],
'impl' : [
- 'rCtx->dsa->DsaClientActiveTexture( rCtx, ${arg1} + GL_TEXTURE0 );',
- 'rCtx->dsp->emuTbl.gl${m1}ClientState( ${arg0} );',
+ '_context->dsa->DsaClientActiveTexture( _context, ${arg1} + GL_TEXTURE0 );',
+ '_context->dispatcher.emulation.gl${m1}ClientState( ${arg0} );',
],
},
'ClientTexCoords' : {
'entries' : [ 'glMultiTexCoordPointerEXT' ],
'impl' : [
- 'rCtx->dsa->DsaClientActiveTexture( rCtx, ${arg0} );',
- 'rCtx->dsp->emuTbl.glTexCoordPointer( ${arg1plus} );',
+ '_context->dsa->DsaClientActiveTexture( _context, ${arg0} );',
+ '_context->dispatcher.emulation.glTexCoordPointer( ${arg1plus} );',
],
},
'EnableIndexed' : {
'entries' : [ 'gl(Enable|Disable)IndexedEXT'],
'impl' : [
- 'rCtx->dsa->DsaActiveTexture( rCtx, ${arg1} + GL_TEXTURE0 );',
- 'rCtx->dsp->emuTbl.gl${m1}( ${arg0} );',
+ '_context->dsa->DsaActiveTexture( _context, ${arg1} + GL_TEXTURE0 );',
+ '_context->dispatcher.emulation.gl${m1}( ${arg0} );',
],
},
'ActiveTexture' : {
'entries' : [ 'glActiveTexture' ],
'impl' : [
- 'if( false == rCtx->dsa->ShadowActiveTexture( ${arg0} ) ) {',
- ' rCtx->dsp->emuTbl.glActiveTexture( ${arg0} );',
+ 'if( false == _context->dsa->ShadowActiveTexture( ${arg0} ) ) {',
+ ' _context->dispatcher.emulation.glActiveTexture( ${arg0} );',
'}',
],
},
@@ -134,17 +134,17 @@
'glGenerateMipmap(ARB|EXT|)'
],
'prefix' : [
- 'rCtx->dsa->RestoreTexture( rCtx );',
- 'rCtx->dsa->RestoreActiveTexture( rCtx );',
+ '_context->dsa->RestoreTexture( _context );',
+ '_context->dsa->RestoreActiveTexture( _context );',
],
},
'TexCommands2' : {
'entries' : [ 'glTexGen(i|iv|f|fv)', ],
- 'prefix' : [ 'rCtx->dsa->RestoreActiveTexture( rCtx );', ],
+ 'prefix' : [ '_context->dsa->RestoreActiveTexture( _context );', ],
},
'TexCommands3' : {
'entries' : [ 'gl(Enable|Disable)', ], # check that it's a texture target!
- 'prefix' : [ 'rCtx->dsa->RestoreActiveTexture( rCtx );', ],
+ 'prefix' : [ '_context->dsa->RestoreActiveTexture( _context );', ],
},
'MultiActiveTexCommands' : {
'entries' : [
@@ -163,24 +163,24 @@
},
},
'impl' : [
- 'rCtx->dsa->DsaActiveTexture( rCtx, ${arg0} );',
- 'rCtx->dsp->emuTbl.${nondsa}( ${arg1plus} );',
+ '_context->dsa->DsaActiveTexture( _context, ${arg0} );',
+ '_context->dispatcher.emulation.${nondsa}( ${arg1plus} );',
],
},
'BindTexture' : {
'entries' : [ 'glBindTexture' ],
'impl' : [
- 'if( false == rCtx->dsa->ShadowTexture( ${arg0}, ${arg1} ) ) {',
- ' rCtx->dsp->emuTbl.glBindTexture( ${arg0}, ${arg1} );',
+ 'if( false == _context->dsa->ShadowTexture( ${arg0}, ${arg1} ) ) {',
+ ' _context->dispatcher.emulation.glBindTexture( ${arg0}, ${arg1} );',
'}',
],
},
'BindMultiTexture' : {
'entries' : [ 'glBindMultiTextureEXT' ],
'impl' : [
- 'rCtx->dsa->DsaActiveTexture( rCtx, ${arg0} );',
- 'rCtx->dsa->ShadowDsaTexture( ${arg1plus} );',
- 'rCtx->dsp->emuTbl.glBindTexture( ${arg1plus} );',
+ '_context->dsa->DsaActiveTexture( _context, ${arg0} );',
+ '_context->dsa->ShadowDsaTexture( ${arg1plus} );',
+ '_context->dispatcher.emulation.glBindTexture( ${arg1plus} );',
],
},
'BoundTextureCommands' : {
@@ -200,16 +200,16 @@
},
},
'impl' : [
- 'rCtx->dsa->DsaTexture( rCtx, ${arg1}, ${arg0} );',
- 'rCtx->dsp->emuTbl.${nondsa}( ${arg1plus} );',
+ '_context->dsa->DsaTexture( _context, ${arg1}, ${arg0} );',
+ '_context->dispatcher.emulation.${nondsa}( ${arg1plus} );',
],
},
'UseProgram' : {
'entries' : [ 'glUseProgram' ],
'impl' : [
- 'if( false == rCtx->dsa->ShadowGlslProgram( ${arg0} ) ) {',
- ' rCtx->dsp->emuTbl.glUseProgram( ${arg0} );',
+ 'if( false == _context->dsa->ShadowGlslProgram( ${arg0} ) ) {',
+ ' _context->dispatcher.emulation.glUseProgram( ${arg0} );',
'}',
],
},
@@ -218,24 +218,24 @@
'glUniform(1|2|3|4)(i|f|ui|d)(v|)',
'glUniformMatrix(2|3|4)(x2|x3|x4|)(fv|dv)',
],
- 'prefix' : [ 'rCtx->dsa->RestoreGlslProgram( rCtx );' ],
+ 'prefix' : [ '_context->dsa->RestoreGlslProgram( _context );' ],
},
'DsaProgramCommands' : {
'entries' : [
'glProgramUniform()(1|2|3|4)()(i|iv|f|fv|d|dv|ui|uiv)EXT',
'glProgramUniform(Matrix)(2|3|4)(x2|x3|x4|)(fv|dv)EXT',
],
'impl' : [
- 'rCtx->dsa->DsaGlslProgram( rCtx, ${arg0});',
- 'rCtx->dsp->emuTbl.glUniform${m1}${m2}${m3}${m4}( ${arg1plus} );',
+ '_context->dsa->DsaGlslProgram( _context, ${arg0});',
+ '_context->dispatcher.emulation.glUniform${m1}${m2}${m3}${m4}( ${arg1plus} );',
],
},
'BindAsmProgram' : {
'entries' : [ 'glBindProgramARB' ],
'impl' : [
- 'if( false == rCtx->dsa->ShadowAsmProgram( ${arg0}, ${arg1} ) ) {',
- ' rCtx->dsp->emuTbl.glBindProgramARB( ${arg0}, ${arg1} );',
+ 'if( false == _context->dsa->ShadowAsmProgram( ${arg0}, ${arg1} ) ) {',
+ ' _context->dispatcher.emulation.glBindProgramARB( ${arg0}, ${arg1} );',
'}',
],
},
@@ -244,7 +244,7 @@
'gl(Get|)Program(Env|Local)Parameter(.*)(ARB|NV)',
'gl(Get|)Program(String)(EXT)',
],
- 'prefix' : [ 'rCtx->dsa->RestoreAsmProgram( rCtx, ${arg0} );' ],
+ 'prefix' : [ '_context->dsa->RestoreAsmProgram( _context, ${arg0} );' ],
},
'DsaAsmProgram' : {
'entries' : [
@@ -261,16 +261,16 @@
},
},
'impl' : [
- 'rCtx->dsa->DsaAsmProgram( rCtx, ${arg1}, ${arg0});',
- 'rCtx->dsp->emuTbl.${nondsa}( ${arg1plus} );',
+ '_context->dsa->DsaAsmProgram( _context, ${arg1}, ${arg0});',
+ '_context->dispatcher.emulation.${nondsa}( ${arg1plus} );',
],
},
'BindFramebuffer' : {
'entries' : [ 'glBindFramebuffer' ],
'impl' : [
- 'if( false == rCtx->dsa->ShadowFramebuffer( ${arg0}, ${arg1} ) ) {',
- ' rCtx->dsp->emuTbl.glBindFramebuffer( ${arg0}, ${arg1} );',
+ 'if( false == _context->dsa->ShadowFramebuffer( ${arg0}, ${arg1} ) ) {',
+ ' _context->dispatcher.emulation.glBindFramebuffer( ${arg0}, ${arg1} );',
'}',
],
},
@@ -282,7 +282,7 @@
'glDrawBuffer(s|)(ARB|EXT|NV|)'
'glGet(Renderbuffer|FramebufferAttachment)Parameteriv(ARB|EXT|)',
],
- 'prefix' : [ 'rCtx->dsa->RestoreFramebuffer( rCtx );' ],
+ 'prefix' : [ '_context->dsa->RestoreFramebuffer( _context );' ],
},
'SelectorFramebufferCommands2' : {
'entries' : [
@@ -299,53 +299,53 @@
},
},
'impl' : [
- 'rCtx->dsa->DsaFramebuffer( rCtx, GL_FRAMEBUFFER, ${arg0});',
- 'rCtx->dsp->emuTbl.${nondsa}( GL_FRAMEBUFFER, ${arg1plus} );',
+ '_context->dsa->DsaFramebuffer( _context, GL_FRAMEBUFFER, ${arg0});',
+ '_context->dispatcher.emulation.${nondsa}( GL_FRAMEBUFFER, ${arg1plus} );',
],
},
'SelectorFramebufferCommands3' : {
'entries' : [ 'glFramebuffer(DrawBuffer|ReadBuffer)(s|)EXT' ],
'impl' : [
- 'rCtx->dsa->DsaFramebuffer( rCtx, GL_FRAMEBUFFER, ${arg0});',
- 'rCtx->dsp->emuTbl.gl${m1}${m2}( ${arg1plus} );',
+ '_context->dsa->DsaFramebuffer( _context, GL_FRAMEBUFFER, ${arg0});',
+ '_context->dispatcher.emulation.gl${m1}${m2}( ${arg1plus} );',
],
},
'SelectorFramebufferCommands4' : {
'entries' : [ 'glCheckNamedFramebufferStatusEXT' ],
'impl' : [
- 'rCtx->dsa->DsaFramebuffer( rCtx, GL_FRAMEBUFFER, ${arg0});',
- 'return rCtx->dsp->emuTbl.glCheckFramebufferStatus( ${arg1plus} );',
+ '_context->dsa->DsaFramebuffer( _context, GL_FRAMEBUFFER, ${arg0});',
+ 'return _context->dispatcher.emulation.glCheckFramebufferStatus( ${arg1plus} );',
],
},
'ClientAttribDefault' : {
'entries' : ['glClientAttribDefaultEXT'],
- 'impl' : [ 'rCtx->dsa->ClientAttribDefault( rCtx, ${arg0} );' ],
+ 'impl' : [ '_context->dsa->ClientAttribDefault( _context, ${arg0} );' ],
},
'PushClientAttribDefault' : {
'entries' : ['glPushClientAttribDefaultEXT'],
'impl' : [
- 'rCtx->dsp->emuTbl.glPushClientAttrib( ${arg0} );',
- 'rCtx->dsa->ClientAttribDefault( rCtx, ${arg0} );',
+ '_context->dispatcher.emulation.glPushClientAttrib( ${arg0} );',
+ '_context->dsa->ClientAttribDefault( _context, ${arg0} );',
],
},
'BindVertexArray' : {
'entries' : [ 'glBindVertexArray' ],
'impl' : [
- 'if( false == rCtx->dsa->ShadowVao( ${arg0} ) ) {',
- ' rCtx->dsp->emuTbl.glBindVertexArray( ${arg0} );',
+ 'if( false == _context->dsa->ShadowVao( ${arg0} ) ) {',
+ ' _context->dispatcher.emulation.glBindVertexArray( ${arg0} );',
'}',
],
},
# TODO - GL_ARB_base_instance ?
'RestoreEverything' : {
'entries' : [ 'glBegin', 'gl(Multi|)Draw(Arrays|Element|Elements)(Instanced|Indirect|BaseVertex|InstancedBaseVertex|Array|)(ARB|EXT|AMD|ATI|APPLE|)' ],
- 'prefix' : [ 'rCtx->dsa->Restore( rCtx );' ],
+ 'prefix' : [ '_context->dsa->Restore( _context );' ],
},
'BindBuffer' : {
'entries' : [ 'glBindBuffer' ],
'impl' : [
- 'if( false == rCtx->dsa->ShadowBuffer( ${arg0}, ${arg1} ) ) {',
- ' rCtx->dsp->emuTbl.glBindBuffer( ${arg0}, ${arg1} );',
+ 'if( false == _context->dsa->ShadowBuffer( ${arg0}, ${arg1} ) ) {',
+ ' _context->dispatcher.emulation.glBindBuffer( ${arg0}, ${arg1} );',
'}',
],
},
@@ -356,7 +356,7 @@
'glGetBuffer(Parameteriv|Pointerv)',
'gl(Vertex|Normal|Color|SecondaryColor)Pointer'
],
- 'prefix' : [ 'rCtx->dsa->RestoreBuffer( rCtx );' ],
+ 'prefix' : [ '_context->dsa->RestoreBuffer( _context );' ],
},
'DsaBufferCommands' : {
'entries' : [
@@ -365,31 +365,31 @@
'gl(Get)Named()Buffer(Parameteriv|Pointerv)EXT',
],
'impl' : [
- 'rCtx->dsa->DsaBuffer( rCtx, ${arg0});',
- 'rCtx->dsp->emuTbl.gl${m1}${m2}Buffer${m3}( GL_ARRAY_BUFFER, ${arg1plus} );',
+ '_context->dsa->DsaBuffer( _context, ${arg0});',
+ '_context->dispatcher.emulation.gl${m1}${m2}Buffer${m3}( GL_ARRAY_BUFFER, ${arg1plus} );',
],
},
'DsaBufferCommands2' : {
'entries' : [ 'gl(Map)NamedBuffer(Range|)EXT' ],
'impl' : [
- 'rCtx->dsa->DsaBuffer( rCtx, ${arg0});',
- 'return rCtx->dsp->emuTbl.gl${m1}Buffer${m2}( GL_ARRAY_BUFFER, ${arg1plus} );',
+ '_context->dsa->DsaBuffer( _context, ${arg0});',
+ 'return _context->dispatcher.emulation.gl${m1}Buffer${m2}( GL_ARRAY_BUFFER, ${arg1plus} );',
],
},
'DsaBufferCommands3' : {
'entries' : [ 'glUnmapNamedBufferEXT' ],
'impl' : [
- 'rCtx->dsa->DsaBuffer( rCtx, ${arg0});',
- 'return rCtx->dsp->emuTbl.glUnmapBuffer( GL_ARRAY_BUFFER );',
+ '_context->dsa->DsaBuffer( _context, ${arg0});',
+ 'return _context->dispatcher.emulation.glUnmapBuffer( GL_ARRAY_BUFFER );',
],
},
'DsaBufferPointerCommands' : {
'entries' : [ ],
# 'entries' : [ 'glVertexArray(Vertex|Color|EdgeFlag|Index|Normal|TexCoord|MultiTexCoord|FogCoord|SecondaryColor|VertexAttrib|VertexAttribI)OffsetEXT' ],
'impl' : [
- 'rCtx->dsa->DsaVao( rCtx, ${arg0} );'
- 'rCtx->dsa->DsaBuffer( rCtx, ${arg1} );',
- 'rCtx->dsp->emuTbl.gl${m1}Pointer( ${arg2plus} );',
+ '_context->dsa->DsaVao( _context, ${arg0} );'
+ '_context->dsa->DsaBuffer( _context, ${arg1} );',
+ '_context->dispatcher.emulation.gl${m1}Pointer( ${arg2plus} );',
],
}
}
View
4 scripts/EmuErrorString.py
@@ -3,9 +3,9 @@
formulae = {
'ErrorString' : {
'entries' : [ 'glErrorStringREGAL' ],
- 'impl' : [ 'RegalAssert(rCtx->info);',
+ 'impl' : [ 'RegalAssert(_context->info);',
'// Emulate GL_REGAL_error_string, if necessary.',
- 'if (!rCtx->info->gl_regal_error_string)',
+ 'if (!_context->info->gl_regal_error_string)',
' return Token::GLerrorToString(error);' ]
}
}
View
12 scripts/EmuExtensionQuery.py
@@ -3,16 +3,16 @@
formulae = {
'GetExtension' : {
'entries' : [ 'glGetExtensionREGAL' ],
- 'impl' : [ 'RegalAssert(rCtx->info);',
+ 'impl' : [ 'RegalAssert(_context->info);',
'// Emulate GL_REGAL_extension_query, if necessary.',
- 'if (!rCtx->info->gl_regal_extension_query)',
- ' return rCtx->info->getExtension(ext) ? GL_TRUE : GL_FALSE;' ]
+ 'if (!_context->info->gl_regal_extension_query)',
+ ' return _context->info->getExtension(ext) ? GL_TRUE : GL_FALSE;' ]
},
'IsSupported' : {
'entries' : [ 'glIsSupportedREGAL' ],
- 'impl' : [ 'RegalAssert(rCtx->info);',
+ 'impl' : [ 'RegalAssert(_context->info);',
'// Emulate GL_REGAL_extension_query, if necessary.',
- 'if (!rCtx->info->gl_regal_extension_query)',
- ' return rCtx->info->isSupported(ext) ? GL_TRUE : GL_FALSE;' ]
+ 'if (!_context->info->gl_regal_extension_query)',
+ ' return _context->info->isSupported(ext) ? GL_TRUE : GL_FALSE;' ]
},
}
View
10 scripts/EmuGetString.py
@@ -3,13 +3,13 @@
formulae = {
'GetString' : {
'entries' : [ 'glGetString' ],
- 'impl' : [ 'RegalAssert(rCtx->info);',
+ 'impl' : [ 'RegalAssert(_context->info);',
'// Regal interceptions',
'switch (name) {',
- ' case GL_VENDOR: return reinterpret_cast<const GLubyte *>(rCtx->info->regalVendor.c_str());',
- ' case GL_RENDERER: return reinterpret_cast<const GLubyte *>(rCtx->info->regalRenderer.c_str());',
- ' case GL_VERSION: return reinterpret_cast<const GLubyte *>(rCtx->info->regalVersion.c_str());',
- ' case GL_EXTENSIONS: return reinterpret_cast<const GLubyte *>(rCtx->info->regalExtensions.c_str());',
+ ' case GL_VENDOR: return reinterpret_cast<const GLubyte *>(_context->info->regalVendor.c_str());',
+ ' case GL_RENDERER: return reinterpret_cast<const GLubyte *>(_context->info->regalRenderer.c_str());',
+ ' case GL_VERSION: return reinterpret_cast<const GLubyte *>(_context->info->regalVersion.c_str());',
+ ' case GL_EXTENSIONS: return reinterpret_cast<const GLubyte *>(_context->info->regalExtensions.c_str());',
' default:',
' break;',
'}' ]
View
102 scripts/EmuIff.py
@@ -3,70 +3,70 @@
iffFormulae = {
'VaPointerOverride' : {
'entries' : [ 'gl(Vertex|Normal|Color|SecondaryColor|FogCoord|EdgeFlag|TexCoord)Pointer' ],
- 'impl' : [ 'rCtx->iff->${m1}Pointer( rCtx, ${arg0plus} );' ],
+ 'impl' : [ '_context->iff->${m1}Pointer( _context, ${arg0plus} );' ],
},
'VaClientStateOverride' : {
'entries' : [ 'gl(Enable|Disable)ClientState' ],
- 'impl' : [ 'rCtx->iff->${m1}ClientState( rCtx, ${arg0} );' ],
+ 'impl' : [ '_context->iff->${m1}ClientState( _context, ${arg0} );' ],
},
'IsEnabled' : {
'entries' : [ 'glIsEnabled' ],
'impl' : [
'{',
' GLboolean enabled;',
- ' if ( !rCtx->iff->IsEnabled( rCtx, ${arg0plus}, enabled ) )',
- ' return rCtx->dsp->emuTbl.glIsEnabled( ${arg0plus} );',
+ ' if ( !_context->iff->IsEnabled( _context, ${arg0plus}, enabled ) )',
+ ' return _context->dispatcher.emulation.glIsEnabled( ${arg0plus} );',
' return enabled;',
'}',
]
},
'ImmShadowVao' : {
'entries' : [ 'glBindVertexArray.*', ],
- 'prefix' : [ 'rCtx->iff->ShadowVao( rCtx, ${arg0} ); ', ],
+ 'prefix' : [ '_context->iff->ShadowVao( _context, ${arg0} ); ', ],
},
'IsVertexArray' : {
'entries' : [ 'glIsVertexArray(ARB|)' ],
- 'impl' : [ 'return rCtx->iff->IsVertexArray( rCtx, ${arg0} );' ],
+ 'impl' : [ 'return _context->iff->IsVertexArray( _context, ${arg0} );' ],
},
'DeleteVertexArrays' : {
'entries' : [ 'glDeleteVertexArrays(ARB|)' ],
- 'impl' : [ 'rCtx->iff->DeleteVertexArrays( rCtx, ${arg0}, ${arg1} );' ],
+ 'impl' : [ '_context->iff->DeleteVertexArrays( _context, ${arg0}, ${arg1} );' ],
},
'ImmShadowClientActiveTexture' : {
'entries' : [ 'glClientActiveTexture(|ARB)', ],
- 'prefix' : [ 'rCtx->iff->ShadowClientActiveTexture( ${arg0} ); ', ],
+ 'prefix' : [ '_context->iff->ShadowClientActiveTexture( ${arg0} ); ', ],
},
'ImmBegin' : {
'entries' : [ 'glBegin' ],
- 'impl' : [ 'rCtx->iff->Begin( rCtx, ${arg0} );', ],
+ 'impl' : [ '_context->iff->Begin( _context, ${arg0} );', ],
},
'ImmEnd' : {
'entries' : [ 'glEnd' ],
- 'impl' : [ 'rCtx->iff->End( rCtx );', ],
+ 'impl' : [ '_context->iff->End( _context );', ],
},
'ImmAttr' : {
'entries' : [ 'glVertexAttrib(1|2|3|4)(N|)(b|d|f|i|s|ub|us)(v|)' ],
- 'impl' : [ 'rCtx->iff->Attr${m2}<${m1}>( rCtx, ${arg0plus} );', ],
+ 'impl' : [ '_context->iff->Attr${m2}<${m1}>( _context, ${arg0plus} );', ],
},
'ImmFixedAttrf' : {
'entries' : [ 'gl(SecondaryColor|Color|Normal|FogCoord)(2|3|4)(d|f)(v|)(EXT)?' ],
- 'impl' : [ 'rCtx->iff->Attr<${m2}>( rCtx, rCtx->iff->AttrIndex( RFF2A_${m1} ), ${arg0plus} );', ],
+ 'impl' : [ '_context->iff->Attr<${m2}>( _context, _context->iff->AttrIndex( RFF2A_${m1} ), ${arg0plus} );', ],
},
'ImmVertex' : {
'entries' : [ 'gl(Vertex)(2|3|4)(d|f|i|s)(v|)' ],
- 'impl' : [ 'rCtx->iff->Attr<${m2}>( rCtx, rCtx->iff->AttrIndex( RFF2A_${m1} ), ${arg0plus} );', ],
+ 'impl' : [ '_context->iff->Attr<${m2}>( _context, _context->iff->AttrIndex( RFF2A_${m1} ), ${arg0plus} );', ],
},
'ImmFixedAttri' : {
'entries' : [ 'gl(SecondaryColor|Color|Normal)(2|3|4)(b|i|s|ub|ui|us)(v|)(EXT)?' ],
- 'impl' : [ 'rCtx->iff->AttrN<${m2}>( rCtx, rCtx->iff->AttrIndex( RFF2A_${m1} ), ${arg0plus} );', ],
+ 'impl' : [ '_context->iff->AttrN<${m2}>( _context, _context->iff->AttrIndex( RFF2A_${m1} ), ${arg0plus} );', ],
},
'ImmTexCoord' : {
'entries' : [ 'glTexCoord(1|2|3|4)(d|f|i|s)(v|)' ],
- 'impl' : [ 'rCtx->iff->Attr<${m1}>( rCtx, rCtx->iff->AttrIndex( RFF2A_TexCoord ), ${arg0plus} );', ],
+ 'impl' : [ '_context->iff->Attr<${m1}>( _context, _context->iff->AttrIndex( RFF2A_TexCoord ), ${arg0plus} );', ],
},
'ImmMultiTexCoord' : {
'entries' : [ 'glMultiTexCoord(1|2|3|4)(d|f|i|s)(v|)' ],
- 'impl' : [ 'rCtx->iff->Attr<${m1}>( rCtx, rCtx->iff->AttrIndex( RFF2A_TexCoord, ${arg0} - GL_TEXTURE0 ), ${arg1plus} );', ],
+ 'impl' : [ '_context->iff->Attr<${m1}>( _context, _context->iff->AttrIndex( RFF2A_TexCoord, ${arg0} - GL_TEXTURE0 ), ${arg1plus} );', ],
},
'ImmRestore' : {
'entries' : [
@@ -76,114 +76,114 @@
# 'gl(Vertex|Normal|Color|SecondaryColor|FogCoord|TexCoord)Pointer',
'glGetVertexAttrib(d|f|i|Pointer)v(ARB|)',
],
- 'prefix' : [ 'rCtx->iff->RestoreVao( rCtx );' ],
+ 'prefix' : [ '_context->iff->RestoreVao( _context );' ],
},
'FfnShadowARB' : {
'entries' : [ 'glActiveTexture(|ARB)' ],
'impl' : [
- 'if( ! rCtx->iff->ShadowActiveTexture( ${arg0plus} ) ) {',
- ' rCtx->dsp->emuTbl.glActiveTexture${m1}( ${arg0plus} );',
+ 'if( ! _context->iff->ShadowActiveTexture( ${arg0plus} ) ) {',
+ ' _context->dispatcher.emulation.glActiveTexture${m1}( ${arg0plus} );',
'}',
],
},
'FfnShadeModel' : {
'entries' : [ 'glShadeModel' ],
- 'prefix' : [ 'rCtx->iff->ShadeModel( ${arg0plus} );', ],
+ 'prefix' : [ '_context->iff->ShadeModel( ${arg0plus} );', ],
},
'FfnShadow' : {
'entries' : [ 'gl(MatrixMode|UseProgram|Enable|Disable)' ],
'impl' : [
- 'if( ! rCtx->iff->Shadow${m1}( ${arg0plus} ) ) {',
- ' rCtx->dsp->emuTbl.gl${m1}( ${arg0plus} );',
+ 'if( ! _context->iff->Shadow${m1}( ${arg0plus} ) ) {',
+ ' _context->dispatcher.emulation.gl${m1}( ${arg0plus} );',
'}',
],
},
'FfnShadowIndexed' : {
'entries' : [ 'gl(Enable|Disable)(i|IndexedEXT)' ],
- 'impl' : [ 'rCtx->iff->${m1}Indexed( ${arg0plus} );', ],
+ 'impl' : [ '_context->iff->${m1}Indexed( ${arg0plus} );', ],
},
'FfnShadowTexBinding' : {
'entries' : [ 'glBind(Multi|)Texture(EXT|)' ],
- 'prefix' : [ 'rCtx->iff->Shadow${m1}TexBinding( ${arg0plus} );', ],
+ 'prefix' : [ '_context->iff->Shadow${m1}TexBinding( ${arg0plus} );', ],
},
'FfnShadowDsaTexInfo' : {
'entries' : [ 'gl(MultiTex|Texture)Image.*EXT' ],
- 'prefix' : [ 'rCtx->iff->Shadow${m1}Info( ${arg0}, ${arg1}, ${arg3} );', ],
+ 'prefix' : [ '_context->iff->Shadow${m1}Info( ${arg0}, ${arg1}, ${arg3} );', ],
},
'FfnShadowTexInfo' : {
'entries' : [ 'glTexImage(1|2|3|4)D(Multisample)?(EXT|ARB|SGIS|)' ],
- 'prefix' : [ 'rCtx->iff->ShadowTexInfo( ${arg0}, ${arg2} );', ],
+ 'prefix' : [ '_context->iff->ShadowTexInfo( ${arg0}, ${arg2} );', ],
},
'FfnShadowTexInfo2' : {
'entries' : [ 'glTexImage(1|2|3|4)DMultisampleCoverageNV' ],
- 'prefix' : [ 'rCtx->iff->ShadowTexInfo( ${arg0}, ${arg3} );', ],
+ 'prefix' : [ '_context->iff->ShadowTexInfo( ${arg0}, ${arg3} );', ],
},
'FfnTexEnv' : {
'entries' : [ 'gl(Multi|)TexEnv(i|f)(v|)(EXT|)' ],
- 'impl' : [ 'rCtx->iff->TexEnv( ${arg0plus} );', ],
+ 'impl' : [ '_context->iff->TexEnv( ${arg0plus} );', ],
},
'FfnGetTexEnv' : {
'entries' : [ 'glGetTexEnv(i|f)(v|)(EXT|)' ],
- 'impl' : [ 'rCtx->iff->GetTexEnv( ${arg0plus} );', ],
+ 'impl' : [ '_context->iff->GetTexEnv( ${arg0plus} );', ],
},
'FfnLightMatModel' : {
'entries' : [ 'gl(Light|Material|GetMaterial|LightModel)(i|f)(v|)' ],
- 'impl' : [ 'rCtx->iff->${m1}( ${arg0plus} );', ],
+ 'impl' : [ '_context->iff->${m1}( ${arg0plus} );', ],
},
'FfnColorMaterial' : {
'entries' : [ 'glColorMaterial' ],
- 'impl' : [ 'rCtx->iff->ColorMaterial( ${arg0plus} );', ],
+ 'impl' : [ '_context->iff->ColorMaterial( ${arg0plus} );', ],
},
'FfnTexGen' : {
'entries' : [ 'glTexGen(i|f|d)(v|)' ],
- 'impl' : [ 'rCtx->iff->TexGen( ${arg0plus} );', ],
+ 'impl' : [ '_context->iff->TexGen( ${arg0plus} );', ],
},
'FfnAlphaFunc' : {
'entries' : [ 'glAlphaFunc' ],
- 'impl' : [ 'rCtx->iff->AlphaFunc( ${arg0plus} );', ],
+ 'impl' : [ '_context->iff->AlphaFunc( ${arg0plus} );', ],
},
'FfnClipPlane' : {
'entries' : [ 'glClipPlane' ],
- 'impl' : [ 'rCtx->iff->ClipPlane( ${arg0plus} );', ],
+ 'impl' : [ '_context->iff->ClipPlane( ${arg0plus} );', ],
},
'FfnFog' : {
'entries' : [ 'glFog(f|i)(v|)' ],
- 'impl' : [ 'rCtx->iff->Fog( ${arg0plus} );', ],
+ 'impl' : [ '_context->iff->Fog( ${arg0plus} );', ],
},
'FfnGet' : {
'entries' : [ 'glGet(Integer|Float|Double)v' ],
'impl' : [
- 'rCtx->iff->RestoreVao( rCtx );',
- 'if ( ! rCtx->iff->Get( rCtx, ${arg0plus} ) ) {',
- ' rCtx->dsp->emuTbl.glGet${m1}v( ${arg0plus} );',
+ '_context->iff->RestoreVao( _context );',
+ 'if ( ! _context->iff->Get( _context, ${arg0plus} ) ) {',
+ ' _context->dispatcher.emulation.glGet${m1}v( ${arg0plus} );',
'}',
],
},
'FfnGetMultiTexGenv' : {
'entries' : [ 'glGetMultiTexGen(d|f|i)vEXT' ],
'impl' : [
- 'rCtx->iff->RestoreVao( rCtx );',
- 'if ( ! rCtx->iff->GetMultiTexGenv( rCtx, ${arg0plus} ) ) {',
- ' rCtx->dsp->emuTbl.glGetMultiTexGen${m1}vEXT( ${arg0plus} );',
+ '_context->iff->RestoreVao( _context );',
+ 'if ( ! _context->iff->GetMultiTexGenv( _context, ${arg0plus} ) ) {',
+ ' _context->dispatcher.emulation.glGetMultiTexGen${m1}vEXT( ${arg0plus} );',
'}',
],
},
'FfnGetTexGenv' : {
'entries' : [ 'glGetTexGen(d|f|i)v' ],
'impl' : [
- 'rCtx->iff->RestoreVao( rCtx );',
- 'if ( ! rCtx->iff->GetTexGenv( rCtx, ${arg0plus} ) ) {',
- ' rCtx->dsp->emuTbl.glGetTexGen${m1}v( ${arg0plus} );',
+ '_context->iff->RestoreVao( _context );',
+ 'if ( ! _context->iff->GetTexGenv( _context, ${arg0plus} ) ) {',
+ ' _context->dispatcher.emulation.glGetTexGen${m1}v( ${arg0plus} );',
'}',
],
},
# TODO - GL_ARB_base_instance ?
'FfnPreDraw' : {
'entries' : [ 'gl(Multi|)Draw(Arrays|Element|Elements)(Instanced|Indirect|BaseVertex|InstancedBaseVertex|Array|)(ARB|EXT|AMD|ATI|APPLE|)' ],
- 'prefix' : [ 'rCtx->iff->PreDraw( rCtx );', ],
+ 'prefix' : [ '_context->iff->PreDraw( _context );', ],
},
'FfnModifyMatrix' : {
'entries' : [
@@ -198,27 +198,27 @@
'gl(Matrix)(Ortho|Frustum)()()EXT',
'gl(Matrix)(Push|Pop)()()EXT',
],
- 'impl' : [ 'rCtx->iff->${m1}${m2}${m3}( ${arg0plus} );' ],
+ 'impl' : [ '_context->iff->${m1}${m2}${m3}( ${arg0plus} );' ],
},
'EnableArray' : {
'entries' : [ 'gl(Enable|Disable)VertexAttribArray(ARB|)' ],
'prefix' : [
- 'rCtx->iff->RestoreVao( rCtx );',
- 'rCtx->iff->${m1}Array( rCtx, ${arg0} );',
+ '_context->iff->RestoreVao( _context );',
+ '_context->iff->${m1}Array( _context, ${arg0} );',
],
},
'ShaderSource' : {
'entries' : [ 'glShaderSource', ],
- 'impl' : [ 'rCtx->iff->ShaderSource( rCtx, ${arg0plus} );', ],
+ 'impl' : [ '_context->iff->ShaderSource( _context, ${arg0plus} );', ],
},
'LinkProgram' : {
'entries' : [ 'glLinkProgram', ],
- 'impl' : [ 'rCtx->iff->LinkProgram( rCtx, ${arg0} );', ],
+ 'impl' : [ '_context->iff->LinkProgram( _context, ${arg0} );', ],
},
'CreateShader' : {
'entries' : [ 'glCreateShader', ],
- 'impl' : [ 'return rCtx->iff->CreateShader( rCtx, ${arg0} );', ],
+ 'impl' : [ 'return _context->iff->CreateShader( _context, ${arg0} );', ],
},
}
View
4 scripts/EmuLog.py
@@ -52,9 +52,9 @@
'entries' : [ 'glLogMessageCallbackREGAL' ],
'impl' : [
'// Emulate GL_REGAL_log, if necessary.',
- 'if (!rCtx->info->gl_regal_log)',
+ 'if (!_context->info->gl_regal_log)',
'{',
- ' rCtx->logCallback = callback;',
+ ' _context->logCallback = callback;',
' return;',
'}',
],
View
18 scripts/EmuMarker.py
@@ -3,20 +3,20 @@
formulae = {
'Insert' : {
'entries' : [ 'glInsertEventMarkerEXT' ],
- 'impl' : [ 'rCtx->marker->InsertEventMarker( rCtx, ${arg0plus} );',
- 'RegalAssert(rCtx->info);',
- 'if (!rCtx->info->gl_ext_debug_marker) return;' ]
+ 'impl' : [ '_context->marker->InsertEventMarker( _context, ${arg0plus} );',
+ 'RegalAssert(_context->info);',
+ 'if (!_context->info->gl_ext_debug_marker) return;' ]
},
'Push' : {
'entries' : [ 'glPushGroupMarkerEXT' ],
- 'impl' : [ 'rCtx->marker->PushGroupMarker( rCtx, ${arg0plus} );',
- 'RegalAssert(rCtx->info);',
- 'if (!rCtx->info->gl_ext_debug_marker) return;' ]
+ 'impl' : [ '_context->marker->PushGroupMarker( _context, ${arg0plus} );',
+ 'RegalAssert(_context->info);',
+ 'if (!_context->info->gl_ext_debug_marker) return;' ]
},
'Pop' : {
'entries' : [ 'glPopGroupMarkerEXT' ],
- 'impl' : [ 'rCtx->marker->PopGroupMarker( rCtx );',
- 'RegalAssert(rCtx->info);',
- 'if (!rCtx->info->gl_ext_debug_marker) return;' ]
+ 'impl' : [ '_context->marker->PopGroupMarker( _context );',
+ 'RegalAssert(_context->info);',
+ 'if (!_context->info->gl_ext_debug_marker) return;' ]
}
}
View
6 scripts/EmuObj.py
@@ -3,14 +3,14 @@
objFormulae = {
'Buffers' : {
'entries' : [ 'gl(GenBuffers|DeleteBuffers|BindBuffer)(ARB|)' ],
- 'impl' : [ 'rCtx->obj->${m1}( rCtx, ${arg0plus} );', ],
+ 'impl' : [ '_context->obj->${m1}( _context, ${arg0plus} );', ],
},
'VAOs' : {
'entries' : [ 'gl(GenVertexArrays|DeleteVertexArrays|BindVertexArray|IsVertexArray)(ARB|)' ],
- 'impl' : [ 'rCtx->obj->${m1}( rCtx, ${arg0plus} );', ],
+ 'impl' : [ '_context->obj->${m1}( _context, ${arg0plus} );', ],
},
'IsObj' : {
'entries' : [ 'glIs(Buffer|VertexArray)(ARB|)' ],
- 'impl' : [ 'return rCtx->obj->Is${m1}( rCtx, ${arg0plus} );', ],
+ 'impl' : [ 'return _context->obj->Is${m1}( _context, ${arg0plus} );', ],
},
}
View
12 scripts/EmuPpa.py
@@ -3,26 +3,26 @@
ppaFormulae = {
'PushAtrrib' : {
'entries' : [ 'glPushAttrib' ],
- 'impl' : [ 'rCtx->ppa->PushAttrib( rCtx, ${arg0} );', ],
+ 'impl' : [ '_context->ppa->PushAttrib( _context, ${arg0} );', ],
},
'PopAttrib' : {
'entries' : [ 'glPopAttrib' ],
- 'impl' : [ 'rCtx->ppa->PopAttrib( rCtx );', ],
+ 'impl' : [ '_context->ppa->PopAttrib( _context );', ],
},
'Enable' : {
'entries' : [ 'gl(Enable|Disable)' ],
- 'prefix' : [ 'rCtx->ppa->${m1}( ${arg0plus} );', ],
+ 'prefix' : [ '_context->ppa->${m1}( ${arg0plus} );', ],
},
'TrackDepth' : {
'entries' : [ '(glClearDepth|glDepthFunc|glDepthMask)' ],
- 'prefix' : [ 'rCtx->ppa->${m1}( ${arg0plus} );', ],
+ 'prefix' : [ '_context->ppa->${m1}( ${arg0plus} );', ],
},
'TrackStencil' : {
'entries' : [ '(glClearStencil|glStencilFunc|glStencilFuncSeparate|glStencilMask|glStencilMaskSeparate|glStencilOp|glStencilOpSeparate)' ],
- 'prefix' : [ 'rCtx->ppa->${m1}( ${arg0plus} );', ],
+ 'prefix' : [ '_context->ppa->${m1}( ${arg0plus} );', ],
},
'TrackPolygon' : {
'entries' : [ '(glCullFace|glFrontFace|glPolygonMode|glPolygonOffset)' ],
- 'prefix' : [ 'rCtx->ppa->${m1}( ${arg0plus} );', ],
+ 'prefix' : [ '_context->ppa->${m1}( ${arg0plus} );', ],
},
}
View
14 scripts/EmuPpc.py
@@ -81,23 +81,23 @@
'entries' : [ 'glGet(Boolean|Double|Float|Integer|Integer64)v' ],
'impl' : [
'if ( !rCtx->ppc->Get( ${arg0plus} ) ) {',
- ' rCtx->dsp->emuTbl.glGet${m1}v( ${arg0plus} );',
+ ' rCtx->dispatcher.emulation.glGet${m1}v( ${arg0plus} );',
'}',
]
},
'GetIndexed' : {
'entries' : [ 'glGet(Boolean|Double|Float|Integer|Integer64)i_v' ],
'impl' : [
'if ( !rCtx->ppc->GetIndexed( ${arg0plus} ) ) {',
- ' rCtx->dsp->emuTbl.glGet${m1}i_v( ${arg0plus} );',
+ ' rCtx->dispatcher.emulation.glGet${m1}i_v( ${arg0plus} );',
'}',
]
},
'GetPointerv' : {
'entries' : [ 'glGetPointerv' ],
'impl' : [
'if ( !rCtx->ppc->GetPointerv( ${arg0plus} ) ) {',
- ' rCtx->dsp->emuTbl.glGetPointerv( ${arg0plus} );',
+ ' rCtx->dispatcher.emulation.glGetPointerv( ${arg0plus} );',
'}',
]
},
@@ -107,7 +107,7 @@
'{',
' GLboolean enabled;',
' if ( !rCtx->ppc->IsEnabled( ${arg0plus}, enabled ) )',
- ' return rCtx->dsp->emuTbl.glIsEnabled( ${arg0plus} );',
+ ' return rCtx->dispatcher.emulation.glIsEnabled( ${arg0plus} );',
' return enabled;',
'}',
]
@@ -118,7 +118,7 @@
'//{',
' GLboolean enabled;',
' if ( !rCtx->ppc->IsEnabledIndexed( ${arg0plus}, enabled ) )',
- ' return rCtx->dsp->emuTbl.glIsEnabledi( ${arg0plus} );',
+ ' return rCtx->dispatcher.emulation.glIsEnabledi( ${arg0plus} );',
' return enabled;',
'//}',
]
@@ -127,15 +127,15 @@
'entries' : [ 'glGetVertexAttribPointerv(ARB|)' ],
'impl' : [
'if ( !rCtx->ppc->GetVertexAttribPointerv( ${arg0plus} ) ) {',
- ' rCtx->dsp->emuTbl.glGetVertexAttribPointerv${m1}( ${arg0plus} );',
+ ' rCtx->dispatcher.emulation.glGetVertexAttribPointerv${m1}( ${arg0plus} );',
'}',
]
},
'GetVertexAttribv' : {
'entries' : [ 'glGetVertexAttrib(d|f|i)v(ARB|)' ],
'impl' : [
'if ( !rCtx->ppc->GetVertexAttribv( ${arg0plus} ) ) {',
- ' rCtx->dsp->emuTbl.glGetVertexAttrib${m1}v${m2}( ${arg0plus} );',
+ ' rCtx->dispatcher.emulation.glGetVertexAttrib${m1}v${m2}( ${arg0plus} );',
'}',
]
},
View
36 scripts/EmuVao.py
@@ -4,74 +4,74 @@
# TODO - GL_ARB_base_instance ?
'Validate' : {
'entries' : [ 'gl(Multi|)Draw(Arrays|Element|Elements)(Instanced|Indirect|BaseVertex|InstancedBaseVertex|Array|)(ARB|EXT|AMD|ATI|APPLE|)' ],
- 'prefix' : [ '// rCtx->vao->Validate( rCtx );' ],
+ 'prefix' : [ '// _context->vao->Validate( _context );' ],
},
'BufferBinding' : {
'entries' : [ 'glBindBuffer(ARB|)' ],
- 'prefix' : [ 'rCtx->vao->ShadowBufferBinding( ${arg0}, ${arg1} );' ],
+ 'prefix' : [ '_context->vao->ShadowBufferBinding( ${arg0}, ${arg1} );' ],
},
'BindVertexArray' : {
'entries' : [ 'glBindVertexArray(ARB|)' ],
- 'impl' : [ 'rCtx->vao->BindVertexArray( rCtx, ${arg0} );' ],
+ 'impl' : [ '_context->vao->BindVertexArray( _context, ${arg0} );' ],
},
'GenVertexArrays' : {
'entries' : [ 'glGenVertexArrays(ARB|)' ],
- 'impl' : [ 'rCtx->vao->GenVertexArrays( ${arg0}, ${arg1} );' ],
+ 'impl' : [ '_context->vao->GenVertexArrays( ${arg0}, ${arg1} );' ],
},
'DeleteVertexArrays' : {
'entries' : [ 'glDeleteVertexArrays(ARB|)' ],
- 'impl' : [ 'rCtx->vao->DeleteVertexArrays( ${arg0}, ${arg1} );' ],
+ 'impl' : [ '_context->vao->DeleteVertexArrays( ${arg0}, ${arg1} );' ],
},
'IsVertexArray' : {
'entries' : [ 'glIsVertexArray(ARB|)' ],
- 'impl' : [ 'return rCtx->vao->IsVertexArray( ${arg0} );' ],
+ 'impl' : [ 'return _context->vao->IsVertexArray( ${arg0} );' ],
},
'EnableVertexAttribArray' : {
'entries' : [ 'gl(Enable|Disable)VertexAttribArray(ARB|)' ],
- 'impl' : [ 'return rCtx->vao->${m1}VertexAttribArray( rCtx, ${arg0} );' ],
+ 'impl' : [ 'return _context->vao->${m1}VertexAttribArray( _context, ${arg0} );' ],
},
'EnableDisableClientState' : {
'entries' : [ 'gl(Enable|Disable)ClientState' ],
- 'impl' : [ 'rCtx->vao->${m1}ClientState( rCtx, ${arg0} );' ],
+ 'impl' : [ '_context->vao->${m1}ClientState( _context, ${arg0} );' ],
},
'AttribPointer' : {
'entries' : [ 'glVertexAttribPointer(ARB|)' ],
- 'impl' : [ 'return rCtx->vao->AttribPointer( rCtx, ${arg0}, ${arg1plus} );' ],
+ 'impl' : [ 'return _context->vao->AttribPointer( _context, ${arg0}, ${arg1plus} );' ],
},
'GetAttrib' : {
'entries' : [ 'glGetVertexAttrib(d|f|i|Pointer)v(ARB|)' ],
- 'impl' : [ 'rCtx->vao->GetAttrib( ${arg0}, ${arg1}, ${arg2} );' ],
+ 'impl' : [ '_context->vao->GetAttrib( ${arg0}, ${arg1}, ${arg2} );' ],
},
'GetVertexAttribPointerv' : {
'entries' : [ 'glGetVertexAttribPointerv(ARB|)' ],
'impl' : [
- 'if ( !rCtx->vao->GetVertexAttribPointerv( ${arg0}, ${arg1plus} ) ) {',
- ' rCtx->dsp->emuTbl.glGetVertexAttribPointerv${m1}( ${arg0}, ${arg1plus} );',
+ 'if ( !_context->vao->GetVertexAttribPointerv( ${arg0}, ${arg1plus} ) ) {',
+ ' _context->dispatcher.emulation.glGetVertexAttribPointerv${m1}( ${arg0}, ${arg1plus} );',
'}',
]
},
'Get' : {
'entries' : [ 'glGet(Boolean|Double|Float|Integer|Integer64)v' ],
'impl' : [
- 'if( !rCtx->vao->Get( ${arg0}, ${arg1} ) ) {',
- ' rCtx->dsp->emuTbl.glGet${m1}v( ${arg0}, ${arg1} );',
+ 'if( !_context->vao->Get( ${arg0}, ${arg1} ) ) {',
+ ' _context->dispatcher.emulation.glGet${m1}v( ${arg0}, ${arg1} );',
'}',
]
},
'InterleavedArrays' : {
'entries' : [ 'glInterleavedArrays' ],
- 'impl' : [ 'rCtx->vao->InterleavedArrays( rCtx, ${arg0}, ${arg1plus} );' ],
+ 'impl' : [ '_context->vao->InterleavedArrays( _context, ${arg0}, ${arg1plus} );' ],
},
'Pointer4' : {
'entries' : [ 'gl(Color|SecondaryColor|TexCoord|Vertex)Pointer' ],
- 'impl' : [ 'rCtx->vao->${m1}Pointer( rCtx, ${arg0}, ${arg1}, ${arg2}, ${arg3} );' ],
+ 'impl' : [ '_context->vao->${m1}Pointer( _context, ${arg0}, ${arg1}, ${arg2}, ${arg3} );' ],
},
'Pointer3' : {
'entries' : [ 'gl(FogCoord|Normal)Pointer' ],
- 'impl' : [ 'rCtx->vao->${m1}Pointer( rCtx, ${arg0}, ${arg1}, ${arg2} );' ],
+ 'impl' : [ '_context->vao->${m1}Pointer( _context, ${arg0}, ${arg1}, ${arg2} );' ],
},
'ClientActiveTexture' : {
'entries' : [ 'glClientActiveTexture' ],
- 'prefix' : [ 'rCtx->vao->ClientActiveTexture( rCtx, ${arg0} );' ],
+ 'prefix' : [ '_context->vao->ClientActiveTexture( _context, ${arg0} );' ],
},
}
View
242 scripts/Export.py
@@ -171,6 +171,15 @@ def traverse(apis, args):
def generate(apis, args):
traverse(apis, args)
+ generateSource(apis, args)
+ generateEmuSource( apis, args )
+ generateDispatchLog( apis, args )
+ generateErrorSource( apis, args )
+ generateDebugSource( apis, args )
+ generateLoaderSource( apis, args )
+ generateMissingSource( apis, args )
+ generateNaclSource( apis, args )
+ generateStaticES2Source( apis, args )
generatePublicHeader(apis, args)
generateDispatchHeader(apis, args)
generateContextHeader(apis, args)
@@ -186,14 +195,6 @@ def generate(apis, args):
additional_exports = ['RegalSetErrorCallback', 'RegalMakeCurrent']
generateDefFile( apis, args, additional_exports)
- generateLoaderSource( apis, args )
- generateErrorSource( apis, args )
- generateDebugSource( apis, args )
- generateEmuSource( apis, args )
- generateDispatchLog( apis, args )
- generateNaclSource( apis, args )
- generateMissingSource( apis, args )
- generateSource(apis, args)
##############################################################################################
@@ -424,6 +425,7 @@ def generateDispatchHeader(apis, args):
REGAL_GLOBAL_BEGIN
#include "RegalPrivate.h"
+#include "RegalDispatcher.h"
#include "RegalDispatchError.h"
#if defined(__native_client__)
@@ -438,7 +440,6 @@ def generateDispatchHeader(apis, args):
struct DebugInfo;
struct ContextInfo;
-struct DispatchState;
${EMU_FORWARD_DECLARE}
@@ -449,7 +450,7 @@ def generateDispatchHeader(apis, args):
void Init();
- DispatchState *dsp;
+ Dispatcher dispatcher;
DispatchErrorState err;
DebugInfo *dbg;
ContextInfo *info;
@@ -487,7 +488,6 @@ def generateDispatchHeader(apis, args):
#include "RegalConfig.h"
#include "RegalContext.h"
-#include "RegalDispatchState.h"
#include "RegalDebugInfo.h"
#include "RegalContextInfo.h"
${EMU_INCLUDES}
@@ -499,7 +499,7 @@ def generateDispatchHeader(apis, args):
using namespace Logging;
RegalContext::RegalContext()
-: dsp(new DispatchState()),
+: dispatcher(),
dbg(NULL),
info(NULL),
${EMU_MEMBER_CONSTRUCT}
@@ -514,12 +514,10 @@ def generateDispatchHeader(apis, args):
depthPushAttrib(0)
{
ITrace("RegalContext::RegalContext");
- dsp->Init();
if (Config::enableDebug) {
- dbg = new DebugInfo();
- dbg->Init(this);
+ dbg = new DebugInfo();
+ dbg->Init(this);
}
- RegalAssert(dsp);
}
void
@@ -557,7 +555,6 @@ def generateDispatchHeader(apis, args):
RegalContext::~RegalContext()
{
ITrace("RegalContext::~RegalContext");
- delete dsp;
delete info;
${EMU_MEMBER_CLEANUP}
}
@@ -613,6 +610,8 @@ def generateContextSource(apis, args):
memberInit += ' %s = new %s;\n'%(i['member'],i['type'])
emuMemberCleanup += ' delete %s;\n' % i['member']
+ emuMemberConstruct += ' emuLevel(0),\n'
+
emuMemberInit += ' // emu\n'
emuMemberInit += ' emuLevel = %d;\n' % ( len( emu ) - 1 )
emuMemberCleanup += ' // emu\n'
@@ -768,8 +767,8 @@ def generateContextSource(apis, args):
inline string getString(const RegalContext &context, const GLenum e)
{
ITrace("getString ",toString(e));
- RegalAssert(context.dsp->driverTbl.glGetString);
- const GLubyte *str = context.dsp->driverTbl.glGetString(e);
+ RegalAssert(context.dispatcher.driver.glGetString);
+ const GLubyte *str = context.dispatcher.driver.glGetString(e);
return str ? string(reinterpret_cast<const char *>(str)) : string();
}
@@ -805,8 +804,8 @@ def generateContextSource(apis, args):
if (!gles && gl_version_major>=3)
{
GLint flags = 0;
- RegalAssert(context.dsp->driverTbl.glGetIntegerv);
- context.dsp->driverTbl.glGetIntegerv(GL_CONTEXT_PROFILE_MASK, &flags);
+ RegalAssert(context.dispatcher.driver.glGetIntegerv);
+ context.dispatcher.driver.glGetIntegerv(GL_CONTEXT_PROFILE_MASK, &flags);
core = flags & GL_CONTEXT_CORE_PROFILE_BIT ? GL_TRUE : GL_FALSE;
}
@@ -818,14 +817,14 @@ def generateContextSource(apis, args):
if (core)
{
- RegalAssert(context.dsp->driverTbl.glGetStringi);
- RegalAssert(context.dsp->driverTbl.glGetIntegerv);
+ RegalAssert(context.dispatcher.driver.glGetStringi);
+ RegalAssert(context.dispatcher.driver.glGetIntegerv);
GLint n = 0;
- context.dsp->driverTbl.glGetIntegerv(GL_NUM_EXTENSIONS, &n);
+ context.dispatcher.driver.glGetIntegerv(GL_NUM_EXTENSIONS, &n);
for (GLint i=0; i<n; ++i)
- extList.push_back(reinterpret_cast<const char *>(context.dsp->driverTbl.glGetStringi(GL_EXTENSIONS,i)));
+ extList.push_back(reinterpret_cast<const char *>(context.dispatcher.driver.glGetStringi(GL_EXTENSIONS,i)));
extensions = extList.join(" ");
}
else
@@ -901,8 +900,8 @@ def generateContextSource(apis, args):
${EXT_INIT}
- RegalAssert(context.dsp->driverTbl.glGetIntegerv);
- context.dsp->driverTbl.glGetIntegerv( GL_MAX_VERTEX_ATTRIBS, reinterpret_cast<GLint *>(&maxVertexAttribs));
+ RegalAssert(context.dispatcher.driver.glGetIntegerv);
+ context.dispatcher.driver.glGetIntegerv( GL_MAX_VERTEX_ATTRIBS, reinterpret_cast<GLint *>(&maxVertexAttribs));
if (maxVertexAttribs > REGAL_MAX_VERTEX_ATTRIBS)
maxVertexAttribs = REGAL_MAX_VERTEX_ATTRIBS;
@@ -1588,7 +1587,6 @@ def generateEnumHeader(apis, args):
#include "RegalToken.h"
#include "RegalHelper.h"
#include "RegalPrivate.h"
-#include "RegalDispatchState.h"
using namespace REGAL_NAMESPACE_INTERNAL;
using namespace ::REGAL_NAMESPACE_INTERNAL::Logging;
@@ -1661,15 +1659,13 @@ def generateDispatchLog(apis, args):
code += 'static %sREGAL_CALL %s%s(%s) \n{\n' % (rType, 'log_', name, params)
code += ' %s\n' % debugPrintFunction( function, 'GTrace' )
- code += ' RegalContext * rCtx = GET_REGAL_CONTEXT();\n'
- code += ' RegalAssert(rCtx);\n'
- code += ' RegalAssert(rCtx->dsp);\n'
- code += ' DispatchStateScopedStepDown stepDown(rCtx->dsp);\n'
- code += ' RegalAssert(rCtx->dsp->curr);\n'
+ code += ' RegalContext *_context = GET_REGAL_CONTEXT();\n'
+ code += ' RegalAssert(_context);\n'
+ code += ' Dispatcher::ScopedStep stepDown(_context->dispatcher);\n'
code += ' '
if not typeIsVoid(rType):
code += '%s ret = '%(rType)
- code += 'rCtx->dsp->driverTbl.%s(%s);\n' % ( name, callParams )
+ code += '_context->dispatcher.call(&_context->dispatcher.table().%s)(%s);\n' % ( name, callParams )
if not typeIsVoid(rType):
code += ' return ret;\n'
code += '}\n\n'
@@ -1805,7 +1801,6 @@ def generateSource(apis, args):
#include "RegalHelper.h"
#include "RegalPrivate.h"
#include "RegalContext.h"
-#include "RegalDispatchState.h"
${LOCAL_INCLUDE}
REGAL_GLOBAL_END
@@ -2020,6 +2015,59 @@ def generateNaclSource(apis, args):
##############################################################################################
+def apiStaticES2FuncInitCode(apis, args):
+
+ code = ''
+
+ code += '#ifdef REGAL_NAMESPACE\n'
+ code += '#undef REGAL_NAMESPACE\n'
+ code += '\n'
+
+ code = '// OpenGL ES 2.0 only\n'
+
+ for api in apis:
+
+ if api.name=='gl':
+
+ for function in api.functions:
+ if not function.needsContext:
+ continue
+ if getattr(function,'esVersions',None)==None or 2.0 not in function.esVersions:
+ continue
+
+ name = function.name
+ params = paramsDefaultCode(function.parameters, True)
+ callParams = paramsNameCode(function.parameters)
+ rType = typeCode(function.ret.type)
+
+ code += ' tbl.%s = %s;\n' % ( name, name )
+
+ return code
+
+def generateStaticES2Source(apis, args):
+
+ funcInit = apiStaticES2FuncInitCode( apis, args )
+
+ # Output
+
+ substitute = {}
+
+ substitute['LICENSE'] = regalLicense
+ substitute['DISPATCH_NAME'] = 'StaticES2'
+ substitute['LOCAL_INCLUDE'] = ''
+ substitute['LOCAL_CODE'] = ''
+ substitute['AUTOGENERATED'] = autoGeneratedMessage
+ substitute['COPYRIGHT'] = args.copyright
+ substitute['API_DISPATCH_FUNC_DEFINE'] = ''
+ substitute['API_DISPATCH_FUNC_INIT'] = funcInit
+ substitute['IFDEF'] = '#if REGAL_STATIC_ES2\n'
+ substitute['ENDIF'] = '#endif\n'
+
+ outputCode( '%s/RegalDispatchStaticES2.cpp' % args.outdir, dispatchSourceTemplate.substitute(substitute))
+
+
+##############################################################################################
+
# CodeGen for missing dispatch functions
def apiMissingFuncDefineCode(apis, args):
@@ -2062,14 +2110,13 @@ def apiMissingFuncDefineCode(apis, args):
code += '%sREGAL_CALL %s%s(%s) \n{\n' % (rType, 'missing_', name, params)
for param in function.parameters:
- code += ' UNUSED_PARAMETER(%s);\n' % param.name
- code += ' Warning( "%s not available." );\n' % name
+ code += ' UNUSED_PARAMETER(%s);\n' % param.name
+ code += ' Warning( "%s not available." );\n' % name
if not typeIsVoid(rType):
if rType[-1] != '*':
- code += ' %s ret = (%s)0;\n' % ( rType, rType )
+ code += ' return (%s)0;\n' % ( rType )
else:
- code += ' %s ret = NULL;\n' % rType
- code += ' return ret;\n'
+ code += ' return NULL;\n'
code += '}\n\n'
if api.name in cond:
@@ -2534,9 +2581,9 @@ def apiFuncDefineCode(apis, args):
emue = [ emuFindEntry( function, i['formulae'], i['member'] ) for i in emuRegal ]
if function.needsContext:
- c += ' RegalContext * rCtx = GET_REGAL_CONTEXT();\n'
+ c += ' RegalContext *_context = GET_REGAL_CONTEXT();\n'
c += ' %s\n' % debugPrintFunction( function, 'RTrace' )
- c += ' if (!rCtx) return'
+ c += ' if (!_context) return'
if typeIsVoid(rType):
c += ';\n'
else:
@@ -2545,18 +2592,12 @@ def apiFuncDefineCode(apis, args):
else:
c += ' NULL;\n'
- c += ' RegalAssert(rCtx);\n'
- c += ' RegalAssert(rCtx->dsp);\n'
- c += ' RegalAssert(rCtx->dsp->curr);\n'
- c += ' RegalAssert(rCtx->dsp->curr->%s);\n' % ( name)
- c += ' RegalAssert(rCtx->dsp->curr->%s != %s);\n' % ( name, name)
-
c += listToString(indent(emuCodeGen(emue,'impl'),' '))
c += ' '
if not typeIsVoid(rType):
c += 'return '
- c += 'rCtx->dsp->curr->%s(%s);\n' % ( name, callParams )
+ c += '_context->dispatcher.call(&_context->dispatcher.table().%s)(%s);\n' % ( name, callParams )
else:
c += ' %s\n' % debugPrintFunction(function, 'RTrace' )
c += ' if (dispatchTableGlobal.%s == NULL) {\n' % name
@@ -2644,25 +2685,22 @@ def apiLoaderFuncDefineCode(apis, args):
categoryPrev = category
- code += 'extern %sREGAL_CALL %s%s(%s);\n\n' % (rType, 'missing_', name, params)
-
code += 'static %sREGAL_CALL %s%s(%s) \n{\n' % (rType, 'loader_', name, params)
- code += ' RegalContext * rCtx = GET_REGAL_CONTEXT();\n'
- code += ' RegalAssert(rCtx);\n'
- code += ' RegalAssert(rCtx->dsp);\n'
- code += ' DispatchTable & driverTbl = rCtx->dsp->driverTbl;\n'
- code += ' GetProcAddress( driverTbl.%s, "%s");\n' % (name, name)
- code += ' if ( !driverTbl.%s ) {\n' % name
- code += ' driverTbl.%s = missing_%s;\n' % (name, name)
- code += ' }\n'
- code += ' // If emu table is using the loader, update its entry too.\n'
- code += ' if (rCtx->dsp->emuTbl.%s == loader_%s) {\n' % (name, name)
- code += ' rCtx->dsp->emuTbl.%s = driverTbl.%s;\n' % (name, name)
- code += ' }\n'
- code += ' '
+ code += ' RegalContext * _context = GET_REGAL_CONTEXT();\n'
+ code += ' RegalAssert(_context);\n'
+ code += ' DispatchTable &_driver = _context->dispatcher.driver;\n'
+ code += ' GetProcAddress(_driver.%s, "%s");\n' % (name, name)
+ code += ' if (_driver.%s) {\n ' % name
if not typeIsVoid(rType):
code += 'return '
- code += 'driverTbl.%s(%s);\n' % ( name, callParams )
+ code += '_driver.%s(%s);\n' % ( name, callParams )
+ if typeIsVoid(rType):
+ code += ' return;\n'
+ code += ' }\n'
+ code += ' Dispatcher::ScopedStep stepDown(_context->dispatcher);\n '
+ if not typeIsVoid(rType):
+ code += 'return '
+ code += '_context->dispatcher.call(&_context->dispatcher.table().%s)(%s);\n'%(name, callParams)
code += '}\n\n'
if api.name in cond:
@@ -2721,30 +2759,30 @@ def apiEmuFuncDefineCode(apis, args):
continue
code += '\nstatic %sREGAL_CALL %s%s(%s) \n{\n' % (rType, 'emu_', name, params)
- code += ' RegalContext * rCtx = GET_REGAL_CONTEXT();\n'
+ code += ' RegalContext *_context = GET_REGAL_CONTEXT();\n'
#code += ' RegalCheckGLError( rCtx );\n'
code += '\n'
level = [ (emu[i], emuFindEntry( function, emu[i]['formulae'], emu[i]['member'] )) for i in range( len( emue ) - 1 ) ]
if not all(i[1]==None or not 'prefix' in i[1] and not 'impl' in i[1] for i in level):
code += ' // prefix\n'
- code += ' switch( rCtx->emuLevel ) {\n'
+ code += ' switch( _context->emuLevel ) {\n'
for i in level:
l,e = i[0], i[1]
code += ' case %d :\n' % l['level']
if l['ifdef']:
code += ' #if %s\n' % l['ifdef']
if e != None and 'prefix' in e :
if l['member'] :
- code += ' if (rCtx->%s) {\n' % l['member']
- code += ' RegalEmuScopedActivate activate( rCtx, rCtx->%s );\n' % l['member']
+ code += ' if (_context->%s) {\n' % l['member']
+ code += ' RegalEmuScopedActivate activate( _context, _context->%s );\n' % l['member']
for j in e['prefix'] :
code += ' %s\n' % j
if l['member'] :
code += ' }\n'
if e!= None and 'impl' in e and l['member']:
- code += ' if (rCtx->%s) break;\n' % l['member'];
+ code += ' if (_context->%s) break;\n' % l['member'];
if l['ifdef']:
code += ' #endif\n'
code += ' default:\n'
@@ -2753,16 +2791,16 @@ def apiEmuFuncDefineCode(apis, args):
if not all(i[1]==None or not