Permalink
Browse files

Initial import from TransGaming

git-svn-id: http://angleproject.googlecode.com/svn/trunk@2 736b8ea6-26fd-11df-bfd4-992fa37f6226
  • Loading branch information...
1 parent 48bf6b6 commit 884de05c828c6907b372b071a2bd505fbcd41f89 daniel@transgaming.com committed Mar 8, 2010
Showing with 34,230 additions and 0 deletions.
  1. +18 −0 .gitignore
  2. +38 −0 ANGLE.sln
  3. +15 −0 AUTHORS
  4. +18 −0 CONTRIBUTORS
  5. +36 −0 Common/debug.cpp
  6. +130 −0 Compiler/BaseTypes.h
  7. +47 −0 Compiler/CodeGen.cpp
  8. +164 −0 Compiler/Common.h
  9. +474 −0 Compiler/Compiler.vcproj
  10. +287 −0 Compiler/ConstantUnion.h
  11. +79 −0 Compiler/InfoSink.cpp
  12. +109 −0 Compiler/InfoSink.h
  13. +616 −0 Compiler/Initialize.cpp
  14. +35 −0 Compiler/Initialize.h
  15. +119 −0 Compiler/InitializeDll.cpp
  16. +19 −0 Compiler/InitializeDll.h
  17. +15 −0 Compiler/InitializeGlobals.h
  18. +17 −0 Compiler/InitializeParseContext.h
  19. +293 −0 Compiler/IntermTraverse.cpp
  20. +1,483 −0 Compiler/Intermediate.cpp
  21. +63 −0 Compiler/Link.cpp
  22. +56 −0 Compiler/MMap.h
  23. +1,184 −0 Compiler/OutputHLSL.cpp
  24. +42 −0 Compiler/OutputHLSL.h
  25. +1,436 −0 Compiler/ParseHelper.cpp
  26. +121 −0 Compiler/ParseHelper.h
  27. +314 −0 Compiler/PoolAlloc.cpp
  28. +321 −0 Compiler/PoolAlloc.h
  29. +740 −0 Compiler/Preprocessor/atom.c
  30. +68 −0 Compiler/Preprocessor/atom.h
  31. +104 −0 Compiler/Preprocessor/compile.h
  32. +1,009 −0 Compiler/Preprocessor/cpp.c
  33. +91 −0 Compiler/Preprocessor/cpp.h
  34. +157 −0 Compiler/Preprocessor/cppstruct.c
  35. +163 −0 Compiler/Preprocessor/memory.c
  36. +61 −0 Compiler/Preprocessor/memory.h
  37. +98 −0 Compiler/Preprocessor/parser.h
  38. +56 −0 Compiler/Preprocessor/preprocess.h
  39. +766 −0 Compiler/Preprocessor/scanner.c
  40. +90 −0 Compiler/Preprocessor/scanner.h
  41. +87 −0 Compiler/Preprocessor/slglobals.h
  42. +290 −0 Compiler/Preprocessor/symbols.c
  43. +117 −0 Compiler/Preprocessor/symbols.h
  44. +444 −0 Compiler/Preprocessor/tokens.c
  45. +94 −0 Compiler/Preprocessor/tokens.h
  46. +58 −0 Compiler/QualifierAlive.cpp
  47. +7 −0 Compiler/QualifierAlive.h
  48. +76 −0 Compiler/RemoveTree.cpp
  49. +7 −0 Compiler/RemoveTree.h
  50. +21 −0 Compiler/ResourceLimits.h
  51. +139 −0 Compiler/ShHandle.h
  52. +587 −0 Compiler/ShaderLang.cpp
  53. +179 −0 Compiler/ShaderLang.h
  54. +211 −0 Compiler/SymbolTable.cpp
  55. +300 −0 Compiler/SymbolTable.h
  56. BIN Compiler/Tools/bison.exe
  57. +334 −0 Compiler/Tools/bison.hairy
  58. +699 −0 Compiler/Tools/bison.simple
  59. BIN Compiler/Tools/flex.exe
  60. +300 −0 Compiler/Types.h
  61. +605 −0 Compiler/glslang.l
  62. +2,204 −0 Compiler/glslang.y
  63. +455 −0 Compiler/intermOut.cpp
  64. +508 −0 Compiler/intermediate.h
  65. +58 −0 Compiler/localintermediate.h
  66. +41 −0 Compiler/osinclude.h
  67. +57 −0 Compiler/ossource.cpp
  68. +227 −0 Compiler/parseConst.cpp
  69. +1 −0 Compiler/unistd.h
  70. +115 −0 Include/Config.h
  71. +292 −0 Include/Context.h
  72. +74 −0 Include/Display.h
  73. +329 −0 Include/EGL/egl.h
  74. +137 −0 Include/EGL/eglext.h
  75. +113 −0 Include/EGL/eglplatform.h
  76. +620 −0 Include/GLES2/gl2.h
  77. +610 −0 Include/GLES2/gl2ext.h
  78. +51 −0 Include/GLES2/gl2extimg.h
  79. +29 −0 Include/GLES2/gl2platform.h
  80. +269 −0 Include/KHR/khrplatform.h
  81. +62 −0 Include/Surface.h
  82. +14 −0 Include/angleutils.h
  83. +69 −0 Include/debug.h
  84. +32 −0 LICENSE
  85. +408 −0 libEGL/Config.cpp
  86. +338 −0 libEGL/Display.cpp
  87. +174 −0 libEGL/Surface.cpp
  88. +1,026 −0 libEGL/libEGL.cpp
  89. +36 −0 libEGL/libEGL.def
  90. +266 −0 libEGL/libEGL.vcproj
  91. +116 −0 libEGL/main.cpp
  92. +48 −0 libEGL/main.h
  93. +120 −0 libGLESv2/Buffer.cpp
  94. +47 −0 libGLESv2/Buffer.h
  95. +1,819 −0 libGLESv2/Context.cpp
  96. +233 −0 libGLESv2/Framebuffer.cpp
  97. +62 −0 libGLESv2/Framebuffer.h
  98. +942 −0 libGLESv2/Program.cpp
  99. +129 −0 libGLESv2/Program.h
  100. +264 −0 libGLESv2/Renderbuffer.cpp
  101. +108 −0 libGLESv2/Renderbuffer.h
  102. +337 −0 libGLESv2/Shader.cpp
  103. +114 −0 libGLESv2/Shader.h
  104. +671 −0 libGLESv2/Texture.cpp
  105. +141 −0 libGLESv2/Texture.h
  106. +3,836 −0 libGLESv2/libGLESv2.cpp
  107. +153 −0 libGLESv2/libGLESv2.def
  108. +331 −0 libGLESv2/libGLESv2.vcproj
  109. +136 −0 libGLESv2/main.cpp
  110. +45 −0 libGLESv2/main.h
  111. +53 −0 libGLESv2/mathutil.h
  112. +358 −0 libGLESv2/utilities.cpp
  113. +45 −0 libGLESv2/utilities.h
View
@@ -0,0 +1,18 @@
+Debug
+Release
+ANGLE.ncb
+ANGLE.suo
+Compiler/Compiler.vcproj.*
+Compiler/Gen_glslang.cpp
+Compiler/Gen_glslang_tab.cpp
+Compiler/glslang.output
+Compiler/glslang_tab.h
+Compiler/Debug
+Compiler/Release
+libEGL/Debug
+libEGL/Release
+libEGL/libEGL.vcproj.*
+libGLESv2/Debug
+libGLESv2/Release
+libGLESv2/libGLESv2.vcproj.*
+
View
@@ -0,0 +1,38 @@
+
+Microsoft Visual Studio Solution File, Format Version 10.00
+# Visual C++ Express 2008
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libEGL", "libEGL\libEGL.vcproj", "{E746FCA9-64C3-433E-85E8-9A5A67AB7ED6}"
+ ProjectSection(ProjectDependencies) = postProject
+ {B5871A7A-968C-42E3-A33B-981E6F448E78} = {B5871A7A-968C-42E3-A33B-981E6F448E78}
+ EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libGLESv2", "libGLESv2\libGLESv2.vcproj", "{B5871A7A-968C-42E3-A33B-981E6F448E78}"
+ ProjectSection(ProjectDependencies) = postProject
+ {5B3A6DB8-1E7E-40D7-92B9-DA8AAE619FAD} = {5B3A6DB8-1E7E-40D7-92B9-DA8AAE619FAD}
+ EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Compiler", "Compiler\Compiler.vcproj", "{5B3A6DB8-1E7E-40D7-92B9-DA8AAE619FAD}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Win32 = Debug|Win32
+ Release|Win32 = Release|Win32
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {E746FCA9-64C3-433E-85E8-9A5A67AB7ED6}.Debug|Win32.ActiveCfg = Debug|Win32
+ {E746FCA9-64C3-433E-85E8-9A5A67AB7ED6}.Debug|Win32.Build.0 = Debug|Win32
+ {E746FCA9-64C3-433E-85E8-9A5A67AB7ED6}.Release|Win32.ActiveCfg = Release|Win32
+ {E746FCA9-64C3-433E-85E8-9A5A67AB7ED6}.Release|Win32.Build.0 = Release|Win32
+ {B5871A7A-968C-42E3-A33B-981E6F448E78}.Debug|Win32.ActiveCfg = Debug|Win32
+ {B5871A7A-968C-42E3-A33B-981E6F448E78}.Debug|Win32.Build.0 = Debug|Win32
+ {B5871A7A-968C-42E3-A33B-981E6F448E78}.Release|Win32.ActiveCfg = Release|Win32
+ {B5871A7A-968C-42E3-A33B-981E6F448E78}.Release|Win32.Build.0 = Release|Win32
+ {5B3A6DB8-1E7E-40D7-92B9-DA8AAE619FAD}.Debug|Win32.ActiveCfg = Debug|Win32
+ {5B3A6DB8-1E7E-40D7-92B9-DA8AAE619FAD}.Debug|Win32.Build.0 = Debug|Win32
+ {5B3A6DB8-1E7E-40D7-92B9-DA8AAE619FAD}.Release|Win32.ActiveCfg = Release|Win32
+ {5B3A6DB8-1E7E-40D7-92B9-DA8AAE619FAD}.Release|Win32.Build.0 = Release|Win32
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+EndGlobal
View
15 AUTHORS
@@ -0,0 +1,15 @@
+# This is the official list of The ANGLE Project Authors
+# for copyright purposes.
+# This file is distinct from the CONTRIBUTORS files.
+# See the latter for an explanation.
+
+# Names should be added to this file as
+# Name or Organization <email address>
+# The email address is not required for organizations.
+
+TransGaming Inc.
+
+Google Inc.
+
+3DLabs Inc. Ltd.
+
View
@@ -0,0 +1,18 @@
+# This is the official list of people who can contribute
+# (and who have contributed) code to the ANGLE project
+# repository.
+# The AUTHORS file lists the copyright holders; this file
+# lists people. For example, Google employees are listed here
+# but not in AUTHORS, because Google holds the copyright.
+#
+
+TransGaming Inc.
+ Nicolas Capens
+ Daniel Koch
+ Andrew Lewycky
+ Gavriel State
+ Shannon Woods
+
+Google Inc.
+ Henry Bridge
+ Vangelis Kokkevis
View
@@ -0,0 +1,36 @@
+//
+// Copyright (c) 2002-2010 The ANGLE Project Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+//
+
+// debug.cpp: Debugging utilities.
+
+#include "debug.h"
+
+#include <stdio.h>
+#include <stdarg.h>
+
+namespace gl
+{
+void trace(const char *format, ...)
+{
+ if (true)
+ {
+ if (format)
+ {
+ FILE *file = fopen("debug.txt", "a");
+
+ if (file)
+ {
+ va_list vararg;
+ va_start(vararg, format);
+ vfprintf(file, format, vararg);
+ va_end(vararg);
+
+ fclose(file);
+ }
+ }
+ }
+}
+}
View
@@ -0,0 +1,130 @@
+//
+// Copyright (c) 2002-2010 The ANGLE Project Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+//
+
+#ifndef _BASICTYPES_INCLUDED_
+#define _BASICTYPES_INCLUDED_
+
+//
+// Precision qualifiers
+//
+enum TPrecision
+{
+ EbpHigh,
+ EbpMedium,
+ EbpLow,
+};
+
+__inline const char* getPrecisionString(TPrecision p)
+{
+ switch(p)
+ {
+ case EbpHigh: return "highp"; break;
+ case EbpMedium: return "mediump"; break;
+ case EbpLow: return "lowp"; break;
+ default: return "unknown precision";
+ }
+}
+
+//
+// Basic type. Arrays, vectors, etc., are orthogonal to this.
+//
+enum TBasicType
+{
+ EbtVoid,
+ EbtFloat,
+ EbtInt,
+ EbtBool,
+ EbtGuardSamplerBegin, // non type: see implementation of IsSampler()
+ EbtSampler2D,
+ EbtSamplerCube,
+ EbtGuardSamplerEnd, // non type: see implementation of IsSampler()
+ EbtStruct,
+ EbtAddress, // should be deprecated??
+};
+
+__inline bool IsSampler(TBasicType type)
+{
+ return type > EbtGuardSamplerBegin && type < EbtGuardSamplerEnd;
+}
+
+//
+// Qualifiers and built-ins. These are mainly used to see what can be read
+// or written, and by the machine dependent translator to know which registers
+// to allocate variables in. Since built-ins tend to go to different registers
+// than varying or uniform, it makes sense they are peers, not sub-classes.
+//
+enum TQualifier
+{
+ EvqTemporary, // For temporaries (within a function), read/write
+ EvqGlobal, // For globals read/write
+ EvqConst, // User defined constants and non-output parameters in functions
+ EvqAttribute, // Readonly
+ EvqVaryingIn, // readonly, fragment shaders only
+ EvqVaryingOut, // vertex shaders only read/write
+ EvqInvariantVaryingIn, // readonly, fragment shaders only
+ EvqInvariantVaryingOut, // vertex shaders only read/write
+ EvqUniform, // Readonly, vertex and fragment
+
+ // pack/unpack input and output
+ EvqInput,
+ EvqOutput,
+
+ // parameters
+ EvqIn,
+ EvqOut,
+ EvqInOut,
+ EvqConstReadOnly,
+
+ // built-ins written by vertex shader
+ EvqPosition,
+ EvqPointSize,
+
+ // built-ins read by fragment shader
+ EvqFragCoord,
+ EvqFrontFacing,
+ EvqPointCoord,
+
+ // built-ins written by fragment shader
+ EvqFragColor,
+ EvqFragData,
+
+ // end of list
+ EvqLast,
+};
+
+//
+// This is just for debug print out, carried along with the definitions above.
+//
+__inline const char* getQualifierString(TQualifier q)
+{
+ switch(q)
+ {
+ case EvqTemporary: return "Temporary"; break;
+ case EvqGlobal: return "Global"; break;
+ case EvqConst: return "const"; break;
+ case EvqConstReadOnly: return "const"; break;
+ case EvqAttribute: return "attribute"; break;
+ case EvqVaryingIn: return "varying"; break;
+ case EvqVaryingOut: return "varying"; break;
+ case EvqInvariantVaryingIn: return "invariant varying"; break;
+ case EvqInvariantVaryingOut:return "invariant varying"; break;
+ case EvqUniform: return "uniform"; break;
+ case EvqIn: return "in"; break;
+ case EvqOut: return "out"; break;
+ case EvqInOut: return "inout"; break;
+ case EvqInput: return "input"; break;
+ case EvqOutput: return "output"; break;
+ case EvqPosition: return "Position"; break;
+ case EvqPointSize: return "PointSize"; break;
+ case EvqFragCoord: return "FragCoord"; break;
+ case EvqFrontFacing: return "FrontFacing"; break;
+ case EvqFragColor: return "FragColor"; break;
+ case EvqFragData: return "FragData"; break;
+ default: return "unknown qualifier";
+ }
+}
+
+#endif // _BASICTYPES_INCLUDED_
View
@@ -0,0 +1,47 @@
+//
+// Copyright (c) 2002-2010 The ANGLE Project Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+//
+
+#include "Common.h"
+#include "ShHandle.h"
+
+//
+// Here is where real machine specific high-level data would be defined.
+//
+class TGenericCompiler : public TCompiler {
+public:
+ TGenericCompiler(EShLanguage l, int dOptions) : TCompiler(l, infoSink), debugOptions(dOptions) { }
+ virtual bool compile(TIntermNode* root);
+ TInfoSink infoSink;
+ int debugOptions;
+};
+
+//
+// This function must be provided to create the actual
+// compile object used by higher level code. It returns
+// a subclass of TCompiler.
+//
+TCompiler* ConstructCompiler(EShLanguage language, int debugOptions)
+{
+ return new TGenericCompiler(language, debugOptions);
+}
+
+//
+// Delete the compiler made by ConstructCompiler
+//
+void DeleteCompiler(TCompiler* compiler)
+{
+ delete compiler;
+}
+
+//
+// Generate code from the given parse tree
+//
+bool TGenericCompiler::compile(TIntermNode *root)
+{
+ haveValidObjectCode = true;
+
+ return haveValidObjectCode;
+}
Oops, something went wrong.

0 comments on commit 884de05

Please sign in to comment.