Commit 585982e3 by John Kessenich

Add getStage() and getIntermediate() methods for consumers. Also removed dead…

Add getStage() and getIntermediate() methods for consumers. Also removed dead options and update test file. git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@26126 e7fa87d3-cd2b-0410-9028-fcbf551c1848
parent f5dd2f5c
...@@ -867,7 +867,6 @@ char** ReadFileData(const char* fileName) ...@@ -867,7 +867,6 @@ char** ReadFileData(const char* fileName)
const int maxSourceStrings = 5; const int maxSourceStrings = 5;
char** return_data = (char**)malloc(sizeof(char *) * (maxSourceStrings+1)); char** return_data = (char**)malloc(sizeof(char *) * (maxSourceStrings+1));
//return_data[MAX_SOURCE_STRINGS]=NULL;
if (errorCode) { if (errorCode) {
printf("Error: unable to open input file: %s\n", fileName); printf("Error: unable to open input file: %s\n", fileName);
return 0; return 0;
...@@ -878,10 +877,9 @@ char** ReadFileData(const char* fileName) ...@@ -878,10 +877,9 @@ char** ReadFileData(const char* fileName)
fseek(in, 0, SEEK_SET); fseek(in, 0, SEEK_SET);
if (!(fdata = (char*)malloc(count+2))) { if (!(fdata = (char*)malloc(count+2))) {
printf("Error allocating memory\n"); printf("Error allocating memory\n");
return 0; return 0;
} }
if (fread(fdata,1,count, in)!=count) { if (fread(fdata,1,count, in)!=count) {
printf("Error reading input file: %s\n", fileName); printf("Error reading input file: %s\n", fileName);
......
...@@ -4,26 +4,21 @@ WARNING: 0:3: varying deprecated in version 130; may be removed in future releas ...@@ -4,26 +4,21 @@ WARNING: 0:3: varying deprecated in version 130; may be removed in future releas
WARNING: 0:4: varying deprecated in version 130; may be removed in future release WARNING: 0:4: varying deprecated in version 130; may be removed in future release
0:? Sequence 0:? Sequence
0:8 Function Definition: main( (void) 0:6 Function Definition: main( (void)
0:8 Function Parameters: 0:6 Function Parameters:
0:10 Sequence 0:8 Sequence
0:10 move second child to first child (float) 0:8 move second child to first child (float)
0:10 'gl_FragDepth' (gl_FragDepth float) 0:8 'gl_FragDepth' (gl_FragDepth float)
0:10 'Depth' (smooth in float) 0:8 'Depth' (smooth in float)
0:11 move second child to first child (4-component vector of float) 0:9 move second child to first child (4-component vector of float)
0:11 'gl_FragColor' (fragColor 4-component vector of float) 0:9 'gl_FragColor' (fragColor 4-component vector of float)
0:11 'Color' (smooth in 4-component vector of float) 0:9 'Color' (smooth in 4-component vector of float)
0:12 move second child to first child (4-component vector of float)
0:12 'foo' (out 4-component vector of float)
0:12 'Color' (smooth in 4-component vector of float)
0:? Linker Objects 0:? Linker Objects
0:? 'Color' (smooth in 4-component vector of float) 0:? 'Color' (smooth in 4-component vector of float)
0:? 'Depth' (smooth in float) 0:? 'Depth' (smooth in float)
0:? 'foo' (out 4-component vector of float)
Linked fragment stage: Linked fragment stage:
ERROR: Linking fragment stage: Cannot use gl_FragColor or gl_FragData when using user-defined outputs
...@@ -126,6 +126,7 @@ public: ...@@ -126,6 +126,7 @@ public:
int getVersion() const { return version; } int getVersion() const { return version; }
void setProfile(EProfile p) { profile = p; } void setProfile(EProfile p) { profile = p; }
EProfile getProfile() const { return profile; } EProfile getProfile() const { return profile; }
EShLanguage getStage() const { return language; }
void setTreeRoot(TIntermNode* r) { treeRoot = r; } void setTreeRoot(TIntermNode* r) { treeRoot = r; }
TIntermNode* getTreeRoot() const { return treeRoot; } TIntermNode* getTreeRoot() const { return treeRoot; }
void addMainCount() { ++numMains; } void addMainCount() { ++numMains; }
......
...@@ -223,21 +223,6 @@ SH_IMPORT_EXPORT int ShExcludeAttributes(const ShHandle, int *attributes, int co ...@@ -223,21 +223,6 @@ SH_IMPORT_EXPORT int ShExcludeAttributes(const ShHandle, int *attributes, int co
// //
SH_IMPORT_EXPORT int ShGetUniformLocation(const ShHandle uniformMap, const char* name); SH_IMPORT_EXPORT int ShGetUniformLocation(const ShHandle uniformMap, const char* name);
// These are currently unused in the front end, but consumers of the front-end still
// be rely on them:
enum TDebugOptions {
EDebugOpNone = 0x000,
EDebugOpIntermediate = 0x001,
EDebugOpAssembly = 0x002,
EDebugOpObjectCode = 0x004,
EDebugOpLinkMaps = 0x008,
EDebugOpSuppressInfolog = 0x010,
EDebugOpMemoryLeakMode = 0x020,
EDebugOpTexturePrototypes = 0x040,
EDebugOpRelaxedErrors = 0x080,
EDebugOpGiveWarnings = 0x100,
};
#ifdef __cplusplus #ifdef __cplusplus
} // end extern "C" } // end extern "C"
#endif #endif
...@@ -282,7 +267,7 @@ void FinalizeProcess(); ...@@ -282,7 +267,7 @@ void FinalizeProcess();
// provide the shader through setStrings(), then call parse(), then query // provide the shader through setStrings(), then call parse(), then query
// the info logs. // the info logs.
// //
// N.B.: Does not yet support having the same TShader instance being linked multiple programs. // N.B.: Does not yet support having the same TShader instance being linked into multiple programs.
// //
// N.B.: Destruct a linked program *before* destructing the shaders linked into it. // N.B.: Destruct a linked program *before* destructing the shaders linked into it.
// //
...@@ -292,9 +277,12 @@ public: ...@@ -292,9 +277,12 @@ public:
virtual ~TShader(); virtual ~TShader();
void setStrings(const char* const* s, int n) { strings = s; numStrings = n; } void setStrings(const char* const* s, int n) { strings = s; numStrings = n; }
bool parse(const TBuiltInResource*, int defaultVersion, bool forwardCompatible, EShMessages); bool parse(const TBuiltInResource*, int defaultVersion, bool forwardCompatible, EShMessages);
const char* getInfoLog(); const char* getInfoLog();
const char* getInfoDebugLog(); const char* getInfoDebugLog();
EShLanguage getStage() const { return stage; }
protected: protected:
TPoolAllocator* pool; TPoolAllocator* pool;
EShLanguage stage; EShLanguage stage;
...@@ -329,6 +317,8 @@ public: ...@@ -329,6 +317,8 @@ public:
const char* getInfoLog(); const char* getInfoLog();
const char* getInfoDebugLog(); const char* getInfoDebugLog();
TIntermediate* getIntermediate(EShLanguage stage) const { return intermediate[stage]; }
// Reflection Interface // Reflection Interface
bool buildReflection(); // call first, to do liveness analysis, index mapping, etc.; returns false on failure bool buildReflection(); // call first, to do liveness analysis, index mapping, etc.; returns false on failure
int getNumLiveUniformVariables(); // can be used for glGetProgramiv(GL_ACTIVE_UNIFORMS) int getNumLiveUniformVariables(); // can be used for glGetProgramiv(GL_ACTIVE_UNIFORMS)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment