Update all "TODO", add some comments.

git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@21137 e7fa87d3-cd2b-0410-9028-fcbf551c1848
This commit is contained in:
John Kessenich 2013-04-12 17:17:07 +00:00
parent 0108aa1183
commit b49a191532
8 changed files with 35 additions and 29 deletions

View File

@ -153,7 +153,7 @@ inline TTypeList* NewPoolTTypeList()
} }
// //
// TODO: TArraySizes memory: This could be replaced by something smaller. // TODO: memory: TArraySizes can be replaced by something smaller.
// Almost all arrays could be handled by two sizes each fitting // Almost all arrays could be handled by two sizes each fitting
// in 16 bits, needing a real vector only in the cases where there // in 16 bits, needing a real vector only in the cases where there
// are more than 3 sizes or a size needing more than 16 bits. // are more than 3 sizes or a size needing more than 16 bits.

View File

@ -1064,12 +1064,12 @@ void TBuiltIns::addQueryFunctions(TSampler sampler, TString& typeName, int versi
builtInStrings[EShLangFragment].push_back(s); builtInStrings[EShLangFragment].push_back(s);
builtInStrings[EShLangVertex].push_back(s); builtInStrings[EShLangVertex].push_back(s);
// TODO: Functionality: version 420 imaging functions // TODO: 4.2 Functionality: imaging functions
} }
void TBuiltIns::addImageFunctions(TSampler sampler, TString& typeName, int version, EProfile profile) void TBuiltIns::addImageFunctions(TSampler sampler, TString& typeName, int version, EProfile profile)
{ {
// TODO: Functionality: version 420 imaging functions // TODO: 4.2 Functionality: imaging functions
} }
void TBuiltIns::addSamplingFunctions(TSampler sampler, TString& typeName, int version, EProfile profile) void TBuiltIns::addSamplingFunctions(TSampler sampler, TString& typeName, int version, EProfile profile)
@ -1462,7 +1462,7 @@ void IdentifyBuiltIns(int version, EProfile profile, EShLanguage language, TSymb
case EShLangTessControl: case EShLangTessControl:
case EShLangTessEvaluation: case EShLangTessEvaluation:
case EShLangGeometry: case EShLangGeometry:
// TODO: support these stages // TODO: desktop functionality: support new stages
default: default:
assert(false && "Language not supported"); assert(false && "Language not supported");

View File

@ -55,7 +55,7 @@
// //
void TIntermMethod::traverse(TIntermTraverser* it) void TIntermMethod::traverse(TIntermTraverser* it)
{ {
// TODO: current tree should always resolve all methods as constants // TODO: functionality: current tree should always resolve all methods as constants
// 4.3 will leave some length methods as methods // 4.3 will leave some length methods as methods
} }

View File

@ -1268,7 +1268,7 @@ void TIntermTyped::propagatePrecision(TPrecisionQualifier newPrecision)
} }
} }
// TODO: propagate precision for // TODO: functionality: propagate precision for
// comma operator: just through the last operand // comma operator: just through the last operand
// ":?" and ",": where is this triggered? // ":?" and ",": where is this triggered?
// built-in function calls: how much to propagate to arguments? // built-in function calls: how much to propagate to arguments?

View File

@ -64,7 +64,7 @@ TParseContext::TParseContext(TSymbolTable& symt, TIntermediate& interm, int v, E
defaultPrecision[EbtInt] = EpqMedium; defaultPrecision[EbtInt] = EpqMedium;
defaultPrecision[EbtUint] = EpqMedium; defaultPrecision[EbtUint] = EpqMedium;
defaultPrecision[EbtSampler] = EpqLow; defaultPrecision[EbtSampler] = EpqLow;
// TODO: give error when using float in frag shader without default precision // TODO: semantics: give error when using float in frag shader without default precision
break; break;
default: default:
error(1, "INTERNAL ERROR", "unexpected language", ""); error(1, "INTERNAL ERROR", "unexpected language", "");
@ -457,7 +457,7 @@ bool TParseContext::reservedErrorCheck(int line, const TString& identifier)
if (identifier.find("__") != TString::npos) { if (identifier.find("__") != TString::npos) {
//error(line, "Two consecutive underscores are reserved for future use.", identifier.c_str(), "", ""); //error(line, "Two consecutive underscores are reserved for future use.", identifier.c_str(), "", "");
//return true; //return true;
// TODO: make this an error // TODO: semantics: make this an error
infoSink.info.message(EPrefixWarning, "Two consecutive underscores are reserved for future use.", line); infoSink.info.message(EPrefixWarning, "Two consecutive underscores are reserved for future use.", line);
return false; return false;
} }
@ -1151,9 +1151,9 @@ void TParseContext::setLayoutQualifier(int line, TPublicType& publicType, TStrin
else else
error(line, "there is no such layout identifier taking an assigned value", id.c_str(), ""); error(line, "there is no such layout identifier taking an assigned value", id.c_str(), "");
// TODO: error check: make sure locations are non-overlapping across the whole stage // TODO: semantics: error check: make sure locations are non-overlapping across the whole stage
// TODO: error check: if more than one fragment output, all must have a location // TODO: semantics: error check: if more than one fragment output, all must have a location
// TODO: error check: output arrays can only be indexed with a constant (es 300) // TODO: semantics: error check: output arrays can only be indexed with a constant (es 300)
} }
// Merge any layout qualifier information from src into dst, leaving everything else in dst alone // Merge any layout qualifier information from src into dst, leaving everything else in dst alone
@ -1574,6 +1574,12 @@ void TParseContext::addBlock(int line, TPublicType& publicType, const TString& b
} }
} }
//
// Take the sequence of statements that has been built up since the last case/default,
// put it on the list of top-level nodes for the current (inner-most) switch statement,
// and follow that by the case/default we are on now. (See switch topology comment on
// TIntermSwitch.)
//
void TParseContext::wrapupSwitchSubsequence(TIntermAggregate* statements, TIntermNode* branchNode) void TParseContext::wrapupSwitchSubsequence(TIntermAggregate* statements, TIntermNode* branchNode)
{ {
TIntermSequence* switchSequence = switchSequenceStack.back(); TIntermSequence* switchSequence = switchSequenceStack.back();
@ -1590,6 +1596,10 @@ void TParseContext::wrapupSwitchSubsequence(TIntermAggregate* statements, TInter
switchSequence->push_back(branchNode); switchSequence->push_back(branchNode);
} }
//
// Turn the top-level node sequence built up of wrapupSwitchSubsequence9)
// into a switch node.
//
TIntermNode* TParseContext::addSwitch(int line, TIntermTyped* expression, TIntermAggregate* lastStatements) TIntermNode* TParseContext::addSwitch(int line, TIntermTyped* expression, TIntermAggregate* lastStatements)
{ {
profileRequires(line, EEsProfile, 300, 0, "switch statements"); profileRequires(line, EEsProfile, 300, 0, "switch statements");

View File

@ -81,7 +81,7 @@ const int VersionCount = 12;
// Each has a different set of built-ins, and we want to preserve that from // Each has a different set of built-ins, and we want to preserve that from
// compile to compile. // compile to compile.
// //
// TODO: thread safety: ensure the built-in symbol table levels are reado only. // TODO: quality: thread safety: ensure the built-in symbol table levels are reado only.
TSymbolTable* SharedSymbolTables[VersionCount][EProfileCount][EShLangCount] = {}; TSymbolTable* SharedSymbolTables[VersionCount][EProfileCount][EShLangCount] = {};
TPoolAllocator* PerProcessGPA = 0; TPoolAllocator* PerProcessGPA = 0;
@ -278,7 +278,7 @@ void ScanVersion(const char* const shaderStrings[], int numStrings, int& version
const char* s = &shaderStrings[0][0]; const char* s = &shaderStrings[0][0];
// TODO: ES error check: #version must be on first line // TODO: semantics: ES error check: #version must be on first line
while (ConsumeWhitespaceComment(s)) while (ConsumeWhitespaceComment(s))
; ;
@ -390,7 +390,7 @@ int ShInitialize()
if (! InitProcess()) if (! InitProcess())
return 0; return 0;
// TODO: Thread safety: // TODO: Quality: Thread safety:
// This method should be called once per process. If it's called by multiple threads, then // This method should be called once per process. If it's called by multiple threads, then
// we need to have thread synchronization code around the initialization of per process // we need to have thread synchronization code around the initialization of per process
// global pool allocator // global pool allocator

View File

@ -59,9 +59,6 @@ U [uU]
F [fF] F [fF]
LF [lL][fF] LF [lL][fF]
/* TODO: double literals, which will likely require pre-processor rework */
/* TODO: unsigned int literals, which will likely require pre-processor rework */
%option nounput %option nounput
%{ %{
#include <stdio.h> #include <stdio.h>
@ -107,10 +104,10 @@ int yy_input(char* buf, int max_size);
%% %%
<*>"//"[^\n]*"\n" { /* CPP should have taken care of this */ }; <*>"//"[^\n]*"\n" { /* CPP should have taken care of this */ };
"attribute" { pyylval->lex.line = yylineno; return(ATTRIBUTE); } // TODO ES 30 reserved "attribute" { pyylval->lex.line = yylineno; return(ATTRIBUTE); } // TODO: semantics: ES 30 reserved
"const" { pyylval->lex.line = yylineno; return(CONST); } "const" { pyylval->lex.line = yylineno; return(CONST); }
"uniform" { pyylval->lex.line = yylineno; return(UNIFORM); } "uniform" { pyylval->lex.line = yylineno; return(UNIFORM); }
"varying" { pyylval->lex.line = yylineno; return(VARYING); } // TODO ES 30 reserved "varying" { pyylval->lex.line = yylineno; return(VARYING); } // TODO: semantics: ES 30 reserved
"buffer" { pyylval->lex.line = yylineno; return(BUFFER); } "buffer" { pyylval->lex.line = yylineno; return(BUFFER); }
"shared" { pyylval->lex.line = yylineno; return(SHARED); } "shared" { pyylval->lex.line = yylineno; return(SHARED); }

View File

@ -378,7 +378,7 @@ postfix_expression
// we later see the function calling syntax. Save away the name for now. // we later see the function calling syntax. Save away the name for now.
// //
// TODO: if next token is not "(", then this is an error // TODO: semantics: if next token is not "(", then this is an error
if (*$3.string == "length") { if (*$3.string == "length") {
parseContext.profileRequires($3.line, ENoProfile, 120, "GL_3DL_array_objects", ".length"); parseContext.profileRequires($3.line, ENoProfile, 120, "GL_3DL_array_objects", ".length");
@ -505,7 +505,7 @@ function_call
TFunction* fnCall = $1.function; TFunction* fnCall = $1.function;
TOperator op = fnCall->getBuiltInOp(); TOperator op = fnCall->getBuiltInOp();
if (op == EOpArrayLength) { if (op == EOpArrayLength) {
// TODO: check for no arguments to .length() // TODO: semantics: check for no arguments to .length()
int length; int length;
if ($1.intermNode->getAsTyped() == 0 || ! $1.intermNode->getAsTyped()->getType().isArray() || $1.intermNode->getAsTyped()->getType().getArraySize() == 0) { if ($1.intermNode->getAsTyped() == 0 || ! $1.intermNode->getAsTyped()->getType().isArray() || $1.intermNode->getAsTyped()->getType().getArraySize() == 0) {
parseContext.error($1.line, "", fnCall->getName().c_str(), "array must be declared with a size before using this method"); parseContext.error($1.line, "", fnCall->getName().c_str(), "array must be declared with a size before using this method");
@ -596,7 +596,7 @@ function_call
} }
; ;
// TODO: can we eliminate function_call_or_method and function_call_generic? // TODO: clean up: can we eliminate function_call_or_method and function_call_generic?
function_call_or_method function_call_or_method
: function_call_generic { : function_call_generic {
$$ = $1; $$ = $1;
@ -1182,7 +1182,7 @@ constant_expression
declaration declaration
: function_prototype SEMICOLON { : function_prototype SEMICOLON {
$$ = 0; $$ = 0;
// TODO: subroutines: make the identifier a user type for this signature // TODO: 4.0 functionality: subroutines: make the identifier a user type for this signature
} }
| init_declarator_list SEMICOLON { | init_declarator_list SEMICOLON {
if ($1.intermAggregate) if ($1.intermAggregate)
@ -1795,7 +1795,7 @@ storage_qualifier
if (parseContext.globalErrorCheck($1.line, parseContext.symbolTable.atGlobalLevel(), "buffer")) if (parseContext.globalErrorCheck($1.line, parseContext.symbolTable.atGlobalLevel(), "buffer"))
parseContext.recover(); parseContext.recover();
$$.init($1.line); $$.init($1.line);
$$.qualifier.storage = EvqUniform; // TODO: functionality: implement BUFFER $$.qualifier.storage = EvqUniform; // TODO: 4.0 functionality: implement BUFFER
} }
| SHARED { | SHARED {
$$.init($1.line); $$.init($1.line);
@ -1832,7 +1832,7 @@ storage_qualifier
parseContext.recover(); parseContext.recover();
$$.init($1.line); $$.init($1.line);
$$.qualifier.storage = EvqUniform; $$.qualifier.storage = EvqUniform;
// TODO: subroutine semantics // TODO: 4.0 semantics: subroutines
// 1) make sure each identifier is a type declared earlier with SUBROUTINE // 1) make sure each identifier is a type declared earlier with SUBROUTINE
// 2) save all of the identifiers for future comparison with the declared function // 2) save all of the identifiers for future comparison with the declared function
} }
@ -1840,10 +1840,9 @@ storage_qualifier
type_name_list type_name_list
: TYPE_NAME { : TYPE_NAME {
// TODO: add subroutine type to list // TODO: 4.0 functionality: subroutine type to list
} }
| type_name_list COMMA TYPE_NAME { | type_name_list COMMA TYPE_NAME {
// TODO: add subroutine type to list
} }
; ;
@ -2129,7 +2128,7 @@ type_specifier_nonarray
$$.setMatrix(4, 4); $$.setMatrix(4, 4);
} }
| ATOMIC_UINT { | ATOMIC_UINT {
// TODO: add type // TODO: 4.2 functionality: add type
$$.init($1.line, parseContext.symbolTable.atGlobalLevel()); $$.init($1.line, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtInt; $$.basicType = EbtInt;
} }
@ -2678,7 +2677,7 @@ initializer_list
$$ = $1; $$ = $1;
} }
| initializer_list COMMA initializer { | initializer_list COMMA initializer {
// TODO: implement the list // TODO: 4.2 functionality: implement the initializer list
$$ = $3; $$ = $3;
} }
; ;