Commit dff6d00a by Maxime Grégoire

Revert "LibGL shader modification, LibGL texture1D and textureRectangle added"

Change-Id: Ie564566cbaa9ea5e87f1417aa2d84faa6b10a89f Reviewed-on: https://swiftshader-review.googlesource.com/3719Reviewed-by: 's avatarMaxime Grégoire <mgregoire@google.com> Tested-by: 's avatarMaxime Grégoire <mgregoire@google.com>
parent df041005
...@@ -129,21 +129,10 @@ enum TQualifier : unsigned char ...@@ -129,21 +129,10 @@ enum TQualifier : unsigned char
EvqInOut, EvqInOut,
EvqConstReadOnly, EvqConstReadOnly,
// built-ins read by fragment shader
EvqMultiTexCoord0,
EvqMultiTexCoord1,
EvqMultiTexCoord2,
EvqMultiTexCoord3,
EvqMultiTexCoord4,
EvqMultiTexCoord5,
EvqMultiTexCoord6,
EvqMultiTexCoord7,
// built-ins written by vertex shader // built-ins written by vertex shader
EvqPosition, EvqPosition,
EvqPointSize, EvqPointSize,
EvqInstanceID, EvqInstanceID,
EvqTexCoords,
// built-ins read by fragment shader // built-ins read by fragment shader
EvqFragCoord, EvqFragCoord,
...@@ -213,15 +202,6 @@ inline const char *getQualifierString(TQualifier qualifier) ...@@ -213,15 +202,6 @@ inline const char *getQualifierString(TQualifier qualifier)
case EvqPointSize: return "PointSize"; break; case EvqPointSize: return "PointSize"; break;
case EvqInstanceID: return "InstanceID"; break; case EvqInstanceID: return "InstanceID"; break;
case EvqFragCoord: return "FragCoord"; break; case EvqFragCoord: return "FragCoord"; break;
case EvqMultiTexCoord0: return "MultiTexCoord0"; break;
case EvqMultiTexCoord1: return "MultiTexCoord1"; break;
case EvqMultiTexCoord2: return "MultiTexCoord2"; break;
case EvqMultiTexCoord3: return "MultiTexCoord3"; break;
case EvqMultiTexCoord4: return "MultiTexCoord4"; break;
case EvqMultiTexCoord5: return "MultiTexCoord5"; break;
case EvqMultiTexCoord6: return "MultiTexCoord6"; break;
case EvqMultiTexCoord7: return "MultiTexCoord7"; break;
case EvqTexCoords: return "TexCoords"; break;
case EvqFrontFacing: return "FrontFacing"; break; case EvqFrontFacing: return "FrontFacing"; break;
case EvqFragColor: return "FragColor"; break; case EvqFragColor: return "FragColor"; break;
case EvqFragData: return "FragData"; break; case EvqFragData: return "FragData"; break;
......
...@@ -15,22 +15,22 @@ ...@@ -15,22 +15,22 @@
namespace namespace
{ {
class TScopedPoolAllocator { class TScopedPoolAllocator {
public: public:
TScopedPoolAllocator(TPoolAllocator* allocator, bool pushPop) TScopedPoolAllocator(TPoolAllocator* allocator, bool pushPop)
: mAllocator(allocator), mPushPopAllocator(pushPop) { : mAllocator(allocator), mPushPopAllocator(pushPop) {
if(mPushPopAllocator) mAllocator->push(); if (mPushPopAllocator) mAllocator->push();
SetGlobalPoolAllocator(mAllocator); SetGlobalPoolAllocator(mAllocator);
} }
~TScopedPoolAllocator() { ~TScopedPoolAllocator() {
SetGlobalPoolAllocator(NULL); SetGlobalPoolAllocator(NULL);
if(mPushPopAllocator) mAllocator->pop(); if (mPushPopAllocator) mAllocator->pop();
} }
private: private:
TPoolAllocator* mAllocator; TPoolAllocator* mAllocator;
bool mPushPopAllocator; bool mPushPopAllocator;
}; };
} // namespace } // namespace
// //
...@@ -45,7 +45,6 @@ ShBuiltInResources::ShBuiltInResources() ...@@ -45,7 +45,6 @@ ShBuiltInResources::ShBuiltInResources()
MaxVertexTextureImageUnits = 0; MaxVertexTextureImageUnits = 0;
MaxCombinedTextureImageUnits = 8; MaxCombinedTextureImageUnits = 8;
MaxTextureImageUnits = 8; MaxTextureImageUnits = 8;
MaxTextureCoords = 8;
MaxFragmentUniformVectors = 16; MaxFragmentUniformVectors = 16;
MaxDrawBuffers = 1; MaxDrawBuffers = 1;
MaxVertexOutputVectors = 16; MaxVertexOutputVectors = 16;
...@@ -82,7 +81,7 @@ bool TCompiler::Init(const ShBuiltInResources& resources) ...@@ -82,7 +81,7 @@ bool TCompiler::Init(const ShBuiltInResources& resources)
TScopedPoolAllocator scopedAlloc(&allocator, false); TScopedPoolAllocator scopedAlloc(&allocator, false);
// Generate built-in symbol table. // Generate built-in symbol table.
if(!InitBuiltInSymbolTable(resources)) if (!InitBuiltInSymbolTable(resources))
return false; return false;
InitExtensionBehavior(resources, extensionBehavior); InitExtensionBehavior(resources, extensionBehavior);
...@@ -96,13 +95,13 @@ bool TCompiler::compile(const char* const shaderStrings[], ...@@ -96,13 +95,13 @@ bool TCompiler::compile(const char* const shaderStrings[],
TScopedPoolAllocator scopedAlloc(&allocator, true); TScopedPoolAllocator scopedAlloc(&allocator, true);
clearResults(); clearResults();
if(numStrings == 0) if (numStrings == 0)
return true; return true;
// First string is path of source file if flag is set. The actual source follows. // First string is path of source file if flag is set. The actual source follows.
const char* sourcePath = NULL; const char* sourcePath = NULL;
int firstSource = 0; int firstSource = 0;
if(compileOptions & SH_SOURCE_PATH) if (compileOptions & SH_SOURCE_PATH)
{ {
sourcePath = shaderStrings[0]; sourcePath = shaderStrings[0];
++firstSource; ++firstSource;
...@@ -110,14 +109,14 @@ bool TCompiler::compile(const char* const shaderStrings[], ...@@ -110,14 +109,14 @@ bool TCompiler::compile(const char* const shaderStrings[],
TIntermediate intermediate(infoSink); TIntermediate intermediate(infoSink);
TParseContext parseContext(symbolTable, extensionBehavior, intermediate, TParseContext parseContext(symbolTable, extensionBehavior, intermediate,
shaderType, compileOptions, false, shaderType, compileOptions, true,
sourcePath, infoSink); sourcePath, infoSink);
SetGlobalParseContext(&parseContext); SetGlobalParseContext(&parseContext);
// We preserve symbols at the built-in level from compile-to-compile. // We preserve symbols at the built-in level from compile-to-compile.
// Start pushing the user-defined symbols at global level. // Start pushing the user-defined symbols at global level.
symbolTable.push(); symbolTable.push();
if(!symbolTable.atGlobalLevel()) if (!symbolTable.atGlobalLevel())
infoSink.info.message(EPrefixInternalError, "Wrong symbol table level"); infoSink.info.message(EPrefixInternalError, "Wrong symbol table level");
// Parse shader. // Parse shader.
...@@ -127,26 +126,26 @@ bool TCompiler::compile(const char* const shaderStrings[], ...@@ -127,26 +126,26 @@ bool TCompiler::compile(const char* const shaderStrings[],
shaderVersion = parseContext.getShaderVersion(); shaderVersion = parseContext.getShaderVersion();
if(success) { if (success) {
TIntermNode* root = parseContext.treeRoot; TIntermNode* root = parseContext.treeRoot;
success = intermediate.postProcess(root); success = intermediate.postProcess(root);
if(success) if (success)
success = validateCallDepth(root, infoSink); success = validateCallDepth(root, infoSink);
if(success && (compileOptions & SH_VALIDATE_LOOP_INDEXING)) if (success && (compileOptions & SH_VALIDATE_LOOP_INDEXING))
success = validateLimitations(root); success = validateLimitations(root);
if(success && (compileOptions & SH_INTERMEDIATE_TREE)) if (success && (compileOptions & SH_INTERMEDIATE_TREE))
intermediate.outputTree(root); intermediate.outputTree(root);
if(success && (compileOptions & SH_OBJECT_CODE)) if (success && (compileOptions & SH_OBJECT_CODE))
success = translate(root); success = translate(root);
} }
// Ensure symbol table is returned to the built-in level, // Ensure symbol table is returned to the built-in level,
// throwing away all but the built-ins. // throwing away all but the built-ins.
while(!symbolTable.atBuiltInLevel()) while (!symbolTable.atBuiltInLevel())
symbolTable.pop(); symbolTable.pop();
return success; return success;
...@@ -175,7 +174,6 @@ bool TCompiler::InitBuiltInSymbolTable(const ShBuiltInResources &resources) ...@@ -175,7 +174,6 @@ bool TCompiler::InitBuiltInSymbolTable(const ShBuiltInResources &resources)
{ {
case GL_FRAGMENT_SHADER: case GL_FRAGMENT_SHADER:
symbolTable.setDefaultPrecision(integer, EbpMedium); symbolTable.setDefaultPrecision(integer, EbpMedium);
symbolTable.setDefaultPrecision(floatingPoint, EbpHigh);
break; break;
case GL_VERTEX_SHADER: case GL_VERTEX_SHADER:
symbolTable.setDefaultPrecision(integer, EbpHigh); symbolTable.setDefaultPrecision(integer, EbpHigh);
......
...@@ -37,7 +37,6 @@ struct ShBuiltInResources ...@@ -37,7 +37,6 @@ struct ShBuiltInResources
int MaxVertexTextureImageUnits; int MaxVertexTextureImageUnits;
int MaxCombinedTextureImageUnits; int MaxCombinedTextureImageUnits;
int MaxTextureImageUnits; int MaxTextureImageUnits;
int MaxTextureCoords;
int MaxFragmentUniformVectors; int MaxFragmentUniformVectors;
int MaxDrawBuffers; int MaxDrawBuffers;
int MaxVertexOutputVectors; int MaxVertexOutputVectors;
......
...@@ -123,7 +123,6 @@ void InsertBuiltInFunctions(GLenum type, const ShBuiltInResources &resources, TS ...@@ -123,7 +123,6 @@ void InsertBuiltInFunctions(GLenum type, const ShBuiltInResources &resources, TS
symbolTable.insertBuiltIn(COMMON_BUILTINS, EOpFaceForward, genType, "faceforward", genType, genType, genType); symbolTable.insertBuiltIn(COMMON_BUILTINS, EOpFaceForward, genType, "faceforward", genType, genType, genType);
symbolTable.insertBuiltIn(COMMON_BUILTINS, EOpReflect, genType, "reflect", genType, genType); symbolTable.insertBuiltIn(COMMON_BUILTINS, EOpReflect, genType, "reflect", genType, genType);
symbolTable.insertBuiltIn(COMMON_BUILTINS, EOpRefract, genType, "refract", genType, genType, float1); symbolTable.insertBuiltIn(COMMON_BUILTINS, EOpRefract, genType, "refract", genType, genType, float1);
symbolTable.insertBuiltIn(COMMON_BUILTINS, EOpFtransform, float4, "ftransform", 0);
TType *mat2 = new TType(EbtFloat, 2, 2); TType *mat2 = new TType(EbtFloat, 2, 2);
TType *mat2x3 = new TType(EbtFloat, 2, 3); TType *mat2x3 = new TType(EbtFloat, 2, 3);
...@@ -244,7 +243,7 @@ void InsertBuiltInFunctions(GLenum type, const ShBuiltInResources &resources, TS ...@@ -244,7 +243,7 @@ void InsertBuiltInFunctions(GLenum type, const ShBuiltInResources &resources, TS
{ {
symbolTable.insertBuiltIn(ESSL1_BUILTINS, EOpDFdx, "GL_OES_standard_derivatives", genType, "dFdx", genType); symbolTable.insertBuiltIn(ESSL1_BUILTINS, EOpDFdx, "GL_OES_standard_derivatives", genType, "dFdx", genType);
symbolTable.insertBuiltIn(ESSL1_BUILTINS, EOpDFdy, "GL_OES_standard_derivatives", genType, "dFdy", genType); symbolTable.insertBuiltIn(ESSL1_BUILTINS, EOpDFdy, "GL_OES_standard_derivatives", genType, "dFdy", genType);
symbolTable.insertBuiltIn(ESSL1_BUILTINS, EOpFwidth, "GL_OES_standard_derivatives", genType, "fwidth", genType); symbolTable.insertBuiltIn(ESSL1_BUILTINS, EOpFwidth,"GL_OES_standard_derivatives", genType, "fwidth", genType);
} }
} }
...@@ -294,9 +293,9 @@ void InsertBuiltInFunctions(GLenum type, const ShBuiltInResources &resources, TS ...@@ -294,9 +293,9 @@ void InsertBuiltInFunctions(GLenum type, const ShBuiltInResources &resources, TS
// Depth range in window coordinates // Depth range in window coordinates
// //
TTypeList *members = NewPoolTTypeList(); TTypeList *members = NewPoolTTypeList();
TTypeLine near = { new TType(EbtFloat, EbpHigh, EvqGlobal, 1), 0 }; TTypeLine near = {new TType(EbtFloat, EbpHigh, EvqGlobal, 1), 0};
TTypeLine far = { new TType(EbtFloat, EbpHigh, EvqGlobal, 1), 0 }; TTypeLine far = {new TType(EbtFloat, EbpHigh, EvqGlobal, 1), 0};
TTypeLine diff = { new TType(EbtFloat, EbpHigh, EvqGlobal, 1), 0 }; TTypeLine diff = {new TType(EbtFloat, EbpHigh, EvqGlobal, 1), 0};
near.type->setFieldName("near"); near.type->setFieldName("near");
far.type->setFieldName("far"); far.type->setFieldName("far");
diff.type->setFieldName("diff"); diff.type->setFieldName("diff");
...@@ -318,7 +317,6 @@ void InsertBuiltInFunctions(GLenum type, const ShBuiltInResources &resources, TS ...@@ -318,7 +317,6 @@ void InsertBuiltInFunctions(GLenum type, const ShBuiltInResources &resources, TS
symbolTable.insertConstInt(COMMON_BUILTINS, "gl_MaxCombinedTextureImageUnits", resources.MaxCombinedTextureImageUnits); symbolTable.insertConstInt(COMMON_BUILTINS, "gl_MaxCombinedTextureImageUnits", resources.MaxCombinedTextureImageUnits);
symbolTable.insertConstInt(COMMON_BUILTINS, "gl_MaxTextureImageUnits", resources.MaxTextureImageUnits); symbolTable.insertConstInt(COMMON_BUILTINS, "gl_MaxTextureImageUnits", resources.MaxTextureImageUnits);
symbolTable.insertConstInt(COMMON_BUILTINS, "gl_MaxFragmentUniformVectors", resources.MaxFragmentUniformVectors); symbolTable.insertConstInt(COMMON_BUILTINS, "gl_MaxFragmentUniformVectors", resources.MaxFragmentUniformVectors);
symbolTable.insertConstInt(ESSL1_BUILTINS, "gl_MaxTextureCoords", resources.MaxTextureCoords);
symbolTable.insertConstInt(ESSL1_BUILTINS, "gl_MaxVaryingVectors", resources.MaxVaryingVectors); symbolTable.insertConstInt(ESSL1_BUILTINS, "gl_MaxVaryingVectors", resources.MaxVaryingVectors);
symbolTable.insertConstInt(ESSL1_BUILTINS, "gl_MaxDrawBuffers", resources.MaxDrawBuffers); symbolTable.insertConstInt(ESSL1_BUILTINS, "gl_MaxDrawBuffers", resources.MaxDrawBuffers);
symbolTable.insertConstInt(ESSL3_BUILTINS, "gl_MaxVertexOutputVectors", resources.MaxVertexOutputVectors); symbolTable.insertConstInt(ESSL3_BUILTINS, "gl_MaxVertexOutputVectors", resources.MaxVertexOutputVectors);
...@@ -345,26 +343,13 @@ void IdentifyBuiltIns(GLenum shaderType, ...@@ -345,26 +343,13 @@ void IdentifyBuiltIns(GLenum shaderType,
symbolTable.insert(ESSL1_BUILTINS, *new TVariable(NewPoolTString("gl_FragData[gl_MaxDrawBuffers]"), TType(EbtFloat, EbpMedium, EvqFragData, 4))); symbolTable.insert(ESSL1_BUILTINS, *new TVariable(NewPoolTString("gl_FragData[gl_MaxDrawBuffers]"), TType(EbtFloat, EbpMedium, EvqFragData, 4)));
break; break;
case GL_VERTEX_SHADER: case GL_VERTEX_SHADER:
symbolTable.insert(COMMON_BUILTINS, *new TVariable(NewPoolTString("gl_MultiTexCoord0"), TType(EbtFloat, EbpMedium, EvqMultiTexCoord0, 4))); symbolTable.insert(COMMON_BUILTINS, *new TVariable(NewPoolTString("gl_Position"), TType(EbtFloat, EbpHigh, EvqPosition, 4)));
symbolTable.insert(COMMON_BUILTINS, *new TVariable(NewPoolTString("gl_MultiTexCoord1"), TType(EbtFloat, EbpMedium, EvqMultiTexCoord1, 4)));
symbolTable.insert(COMMON_BUILTINS, *new TVariable(NewPoolTString("gl_MultiTexCoord2"), TType(EbtFloat, EbpMedium, EvqMultiTexCoord2, 4)));
symbolTable.insert(COMMON_BUILTINS, *new TVariable(NewPoolTString("gl_MultiTexCoord3"), TType(EbtFloat, EbpMedium, EvqMultiTexCoord3, 4)));
symbolTable.insert(COMMON_BUILTINS, *new TVariable(NewPoolTString("gl_MultiTexCoord4"), TType(EbtFloat, EbpMedium, EvqMultiTexCoord4, 4)));
symbolTable.insert(COMMON_BUILTINS, *new TVariable(NewPoolTString("gl_MultiTexCoord5"), TType(EbtFloat, EbpMedium, EvqMultiTexCoord5, 4)));
symbolTable.insert(COMMON_BUILTINS, *new TVariable(NewPoolTString("gl_MultiTexCoord6"), TType(EbtFloat, EbpMedium, EvqMultiTexCoord6, 4)));
symbolTable.insert(COMMON_BUILTINS, *new TVariable(NewPoolTString("gl_MultiTexCoord7"), TType(EbtFloat, EbpMedium, EvqMultiTexCoord7, 4)));
symbolTable.insert(COMMON_BUILTINS, *new TVariable(NewPoolTString("gl_Position"), TType(EbtFloat, EbpMedium, EvqPosition, 4)));
symbolTable.insert(COMMON_BUILTINS, *new TVariable(NewPoolTString("gl_PointSize"), TType(EbtFloat, EbpMedium, EvqPointSize, 1))); symbolTable.insert(COMMON_BUILTINS, *new TVariable(NewPoolTString("gl_PointSize"), TType(EbtFloat, EbpMedium, EvqPointSize, 1)));
symbolTable.insert(ESSL3_BUILTINS, *new TVariable(NewPoolTString("gl_InstanceID"), TType(EbtInt, EbpHigh, EvqInstanceID, 1))); symbolTable.insert(ESSL3_BUILTINS, *new TVariable(NewPoolTString("gl_InstanceID"), TType(EbtInt, EbpHigh, EvqInstanceID, 1)));
break; break;
default: assert(false && "Language not supported"); default: assert(false && "Language not supported");
} }
// Set up gl_TexCoord
TType texCoord(EbtFloat, EbpMedium, EvqTexCoords, 4, 1, true);
texCoord.setArraySize(resources.MaxTextureCoords);
symbolTable.insert(ESSL1_BUILTINS, *new TVariable(NewPoolTString("gl_TexCoord"), texCoord));
// Finally add resource-specific variables. // Finally add resource-specific variables.
switch(shaderType) switch(shaderType)
{ {
...@@ -376,7 +361,6 @@ void IdentifyBuiltIns(GLenum shaderType, ...@@ -376,7 +361,6 @@ void IdentifyBuiltIns(GLenum shaderType,
symbolTable.insert(ESSL1_BUILTINS, *new TVariable(NewPoolTString("gl_FragData"), fragData)); symbolTable.insert(ESSL1_BUILTINS, *new TVariable(NewPoolTString("gl_FragData"), fragData));
} }
break; break;
case GL_VERTEX_SHADER: break;
default: break; default: break;
} }
} }
......
...@@ -652,12 +652,6 @@ namespace glsl ...@@ -652,12 +652,6 @@ namespace glsl
case EOpFwidth: if(visit == PostVisit) emit(sw::Shader::OPCODE_FWIDTH, result, arg); break; case EOpFwidth: if(visit == PostVisit) emit(sw::Shader::OPCODE_FWIDTH, result, arg); break;
case EOpAny: if(visit == PostVisit) emit(sw::Shader::OPCODE_ANY, result, arg); break; case EOpAny: if(visit == PostVisit) emit(sw::Shader::OPCODE_ANY, result, arg); break;
case EOpAll: if(visit == PostVisit) emit(sw::Shader::OPCODE_ALL, result, arg); break; case EOpAll: if(visit == PostVisit) emit(sw::Shader::OPCODE_ALL, result, arg); break;
case EOpFtransform:
if(visit == PostVisit)
{
emit(sw::Shader::OPCODE_NOP, result, arg);
}
break;
case EOpTranspose: case EOpTranspose:
if(visit == PostVisit) if(visit == PostVisit)
{ {
...@@ -1084,7 +1078,6 @@ namespace glsl ...@@ -1084,7 +1078,6 @@ namespace glsl
case EOpFaceForward: if(visit == PostVisit) emit(sw::Shader::OPCODE_FORWARD(dim(arg[0])), result, arg[0], arg[1], arg[2]); break; case EOpFaceForward: if(visit == PostVisit) emit(sw::Shader::OPCODE_FORWARD(dim(arg[0])), result, arg[0], arg[1], arg[2]); break;
case EOpReflect: if(visit == PostVisit) emit(sw::Shader::OPCODE_REFLECT(dim(arg[0])), result, arg[0], arg[1]); break; case EOpReflect: if(visit == PostVisit) emit(sw::Shader::OPCODE_REFLECT(dim(arg[0])), result, arg[0], arg[1]); break;
case EOpRefract: if(visit == PostVisit) emit(sw::Shader::OPCODE_REFRACT(dim(arg[0])), result, arg[0], arg[1], arg[2]); break; case EOpRefract: if(visit == PostVisit) emit(sw::Shader::OPCODE_REFRACT(dim(arg[0])), result, arg[0], arg[1], arg[2]); break;
case EOpFtransform: break;
case EOpMul: case EOpMul:
if(visit == PostVisit) if(visit == PostVisit)
{ {
...@@ -1877,15 +1870,6 @@ namespace glsl ...@@ -1877,15 +1870,6 @@ namespace glsl
case EvqFragCoord: return sw::Shader::PARAMETER_MISCTYPE; case EvqFragCoord: return sw::Shader::PARAMETER_MISCTYPE;
case EvqFrontFacing: return sw::Shader::PARAMETER_MISCTYPE; case EvqFrontFacing: return sw::Shader::PARAMETER_MISCTYPE;
case EvqPointCoord: return sw::Shader::PARAMETER_INPUT; case EvqPointCoord: return sw::Shader::PARAMETER_INPUT;
case EvqMultiTexCoord0: return sw::Shader::PARAMETER_INPUT;
case EvqMultiTexCoord1: return sw::Shader::PARAMETER_INPUT;
case EvqMultiTexCoord2: return sw::Shader::PARAMETER_INPUT;
case EvqMultiTexCoord3: return sw::Shader::PARAMETER_INPUT;
case EvqMultiTexCoord4: return sw::Shader::PARAMETER_INPUT;
case EvqMultiTexCoord5: return sw::Shader::PARAMETER_INPUT;
case EvqMultiTexCoord6: return sw::Shader::PARAMETER_INPUT;
case EvqMultiTexCoord7: return sw::Shader::PARAMETER_INPUT;
case EvqTexCoords: return sw::Shader::PARAMETER_TEXTURE;
case EvqFragColor: return sw::Shader::PARAMETER_COLOROUT; case EvqFragColor: return sw::Shader::PARAMETER_COLOROUT;
case EvqFragData: return sw::Shader::PARAMETER_COLOROUT; case EvqFragData: return sw::Shader::PARAMETER_COLOROUT;
default: UNREACHABLE(); default: UNREACHABLE();
...@@ -1919,15 +1903,6 @@ namespace glsl ...@@ -1919,15 +1903,6 @@ namespace glsl
case EvqPosition: return varyingRegister(operand); case EvqPosition: return varyingRegister(operand);
case EvqPointSize: return varyingRegister(operand); case EvqPointSize: return varyingRegister(operand);
case EvqInstanceID: vertexShader->instanceIdDeclared = true; return 0; case EvqInstanceID: vertexShader->instanceIdDeclared = true; return 0;
case EvqMultiTexCoord0: return 0; //UNIMPLEMENTED();
case EvqMultiTexCoord1: return 0; //UNIMPLEMENTED();
case EvqMultiTexCoord2: return 0; //UNIMPLEMENTED();
case EvqMultiTexCoord3: return 0; //UNIMPLEMENTED();
case EvqMultiTexCoord4: return 0; //UNIMPLEMENTED();
case EvqMultiTexCoord5: return 0; //UNIMPLEMENTED();
case EvqMultiTexCoord6: return 0; //UNIMPLEMENTED();
case EvqMultiTexCoord7: return 0; //UNIMPLEMENTED();
case EvqTexCoords: return 0;
case EvqFragCoord: pixelShader->vPosDeclared = true; return 0; case EvqFragCoord: pixelShader->vPosDeclared = true; return 0;
case EvqFrontFacing: pixelShader->vFaceDeclared = true; return 1; case EvqFrontFacing: pixelShader->vFaceDeclared = true; return 1;
case EvqPointCoord: return varyingRegister(operand); case EvqPointCoord: return varyingRegister(operand);
......
...@@ -320,14 +320,6 @@ bool TParseContext::lValueErrorCheck(int line, const char* op, TIntermTyped* nod ...@@ -320,14 +320,6 @@ bool TParseContext::lValueErrorCheck(int line, const char* op, TIntermTyped* nod
case EvqCentroidIn: case EvqCentroidIn:
case EvqVaryingIn: message = "can't modify a varying"; break; case EvqVaryingIn: message = "can't modify a varying"; break;
case EvqInput: message = "can't modify an input"; break; case EvqInput: message = "can't modify an input"; break;
case EvqMultiTexCoord0: message = "can't modify gl_MultiTexCoord0"; break;
case EvqMultiTexCoord1: message = "can't modify gl_MultiTexCoord1"; break;
case EvqMultiTexCoord2: message = "can't modify gl_MultiTexCoord2"; break;
case EvqMultiTexCoord3: message = "can't modify gl_MultiTexCoord3"; break;
case EvqMultiTexCoord4: message = "can't modify gl_MultiTexCoord4"; break;
case EvqMultiTexCoord5: message = "can't modify gl_MultiTexCoord5"; break;
case EvqMultiTexCoord6: message = "can't modify gl_MultiTexCoord6"; break;
case EvqMultiTexCoord7: message = "can't modify gl_MultiTexCoord7"; break;
case EvqFragCoord: message = "can't modify gl_FragCoord"; break; case EvqFragCoord: message = "can't modify gl_FragCoord"; break;
case EvqFrontFacing: message = "can't modify gl_FrontFacing"; break; case EvqFrontFacing: message = "can't modify gl_FrontFacing"; break;
case EvqPointCoord: message = "can't modify gl_PointCoord"; break; case EvqPointCoord: message = "can't modify gl_PointCoord"; break;
......
...@@ -346,28 +346,28 @@ public: ...@@ -346,28 +346,28 @@ public:
void insertBuiltIn(ESymbolLevel level, TOperator op, const char *ext, TType *rvalue, const char *name, TType *ptype1, TType *ptype2 = 0, TType *ptype3 = 0, TType *ptype4 = 0) void insertBuiltIn(ESymbolLevel level, TOperator op, const char *ext, TType *rvalue, const char *name, TType *ptype1, TType *ptype2 = 0, TType *ptype3 = 0, TType *ptype4 = 0)
{ {
if(ptype1 && ptype1->getBasicType() == EbtGSampler2D) if(ptype1->getBasicType() == EbtGSampler2D)
{ {
bool gvec4 = (rvalue->getBasicType() == EbtGVec4); bool gvec4 = (rvalue->getBasicType() == EbtGVec4);
insertBuiltIn(level, gvec4 ? new TType(EbtFloat, 4) : rvalue, name, new TType(EbtSampler2D), ptype2, ptype3, ptype4); insertBuiltIn(level, gvec4 ? new TType(EbtFloat, 4) : rvalue, name, new TType(EbtSampler2D), ptype2, ptype3, ptype4);
insertBuiltIn(level, gvec4 ? new TType(EbtInt, 4) : rvalue, name, new TType(EbtISampler2D), ptype2, ptype3, ptype4); insertBuiltIn(level, gvec4 ? new TType(EbtInt, 4) : rvalue, name, new TType(EbtISampler2D), ptype2, ptype3, ptype4);
insertBuiltIn(level, gvec4 ? new TType(EbtUInt, 4) : rvalue, name, new TType(EbtUSampler2D), ptype2, ptype3, ptype4); insertBuiltIn(level, gvec4 ? new TType(EbtUInt, 4) : rvalue, name, new TType(EbtUSampler2D), ptype2, ptype3, ptype4);
} }
else if(ptype1 && ptype1->getBasicType() == EbtGSampler3D) else if(ptype1->getBasicType() == EbtGSampler3D)
{ {
bool gvec4 = (rvalue->getBasicType() == EbtGVec4); bool gvec4 = (rvalue->getBasicType() == EbtGVec4);
insertBuiltIn(level, gvec4 ? new TType(EbtFloat, 4) : rvalue, name, new TType(EbtSampler3D), ptype2, ptype3, ptype4); insertBuiltIn(level, gvec4 ? new TType(EbtFloat, 4) : rvalue, name, new TType(EbtSampler3D), ptype2, ptype3, ptype4);
insertBuiltIn(level, gvec4 ? new TType(EbtInt, 4) : rvalue, name, new TType(EbtISampler3D), ptype2, ptype3, ptype4); insertBuiltIn(level, gvec4 ? new TType(EbtInt, 4) : rvalue, name, new TType(EbtISampler3D), ptype2, ptype3, ptype4);
insertBuiltIn(level, gvec4 ? new TType(EbtUInt, 4) : rvalue, name, new TType(EbtUSampler3D), ptype2, ptype3, ptype4); insertBuiltIn(level, gvec4 ? new TType(EbtUInt, 4) : rvalue, name, new TType(EbtUSampler3D), ptype2, ptype3, ptype4);
} }
else if(ptype1 && ptype1->getBasicType() == EbtGSamplerCube) else if(ptype1->getBasicType() == EbtGSamplerCube)
{ {
bool gvec4 = (rvalue->getBasicType() == EbtGVec4); bool gvec4 = (rvalue->getBasicType() == EbtGVec4);
insertBuiltIn(level, gvec4 ? new TType(EbtFloat, 4) : rvalue, name, new TType(EbtSamplerCube), ptype2, ptype3, ptype4); insertBuiltIn(level, gvec4 ? new TType(EbtFloat, 4) : rvalue, name, new TType(EbtSamplerCube), ptype2, ptype3, ptype4);
insertBuiltIn(level, gvec4 ? new TType(EbtInt, 4) : rvalue, name, new TType(EbtISamplerCube), ptype2, ptype3, ptype4); insertBuiltIn(level, gvec4 ? new TType(EbtInt, 4) : rvalue, name, new TType(EbtISamplerCube), ptype2, ptype3, ptype4);
insertBuiltIn(level, gvec4 ? new TType(EbtUInt, 4) : rvalue, name, new TType(EbtUSamplerCube), ptype2, ptype3, ptype4); insertBuiltIn(level, gvec4 ? new TType(EbtUInt, 4) : rvalue, name, new TType(EbtUSamplerCube), ptype2, ptype3, ptype4);
} }
else if(ptype1 && ptype1->getBasicType() == EbtGSampler2DArray) else if(ptype1->getBasicType() == EbtGSampler2DArray)
{ {
bool gvec4 = (rvalue->getBasicType() == EbtGVec4); bool gvec4 = (rvalue->getBasicType() == EbtGVec4);
insertBuiltIn(level, gvec4 ? new TType(EbtFloat, 4) : rvalue, name, new TType(EbtSampler2DArray), ptype2, ptype3, ptype4); insertBuiltIn(level, gvec4 ? new TType(EbtFloat, 4) : rvalue, name, new TType(EbtSampler2DArray), ptype2, ptype3, ptype4);
...@@ -393,11 +393,8 @@ public: ...@@ -393,11 +393,8 @@ public:
{ {
TFunction *function = new TFunction(NewPoolTString(name), *rvalue, op, ext); TFunction *function = new TFunction(NewPoolTString(name), *rvalue, op, ext);
if(ptype1) TParameter param1 = {0, ptype1};
{
TParameter param1 = { 0, ptype1 };
function->addParameter(param1); function->addParameter(param1);
}
if(ptype2) if(ptype2)
{ {
......
...@@ -298,7 +298,6 @@ bool TOutputTraverser::visitAggregate(Visit visit, TIntermAggregate* node) ...@@ -298,7 +298,6 @@ bool TOutputTraverser::visitAggregate(Visit visit, TIntermAggregate* node)
case EOpFaceForward: out << "face-forward"; break; case EOpFaceForward: out << "face-forward"; break;
case EOpReflect: out << "reflect"; break; case EOpReflect: out << "reflect"; break;
case EOpRefract: out << "refract"; break; case EOpRefract: out << "refract"; break;
case EOpFtransform: out << "ftransform"; break;
case EOpMul: out << "component-wise multiply"; break; case EOpMul: out << "component-wise multiply"; break;
case EOpOuterProduct: out << "outer product"; break; case EOpOuterProduct: out << "outer product"; break;
......
...@@ -155,7 +155,6 @@ enum TOperator { ...@@ -155,7 +155,6 @@ enum TOperator {
EOpFaceForward, EOpFaceForward,
EOpReflect, EOpReflect,
EOpRefract, EOpRefract,
EOpFtransform,
EOpDFdx, // Fragment only, OES_standard_derivatives extension EOpDFdx, // Fragment only, OES_standard_derivatives extension
EOpDFdy, // Fragment only, OES_standard_derivatives extension EOpDFdy, // Fragment only, OES_standard_derivatives extension
......
...@@ -31,7 +31,6 @@ ...@@ -31,7 +31,6 @@
#include <map> #include <map>
#include <string> #include <string>
#include <list> #include <list>
#include <stack>
namespace gl namespace gl
{ {
...@@ -294,7 +293,6 @@ class Shader; ...@@ -294,7 +293,6 @@ class Shader;
class Program; class Program;
class Texture; class Texture;
class Texture2D; class Texture2D;
class Texture1D;
class TextureCubeMap; class TextureCubeMap;
class Framebuffer; class Framebuffer;
class Renderbuffer; class Renderbuffer;
...@@ -311,15 +309,12 @@ class Query; ...@@ -311,15 +309,12 @@ class Query;
enum enum
{ {
MAX_TEXTURE_COORDS = 8, MAX_VERTEX_ATTRIBS = 9,
MAX_CLIENT_ATTRIB_STACK_DEPTH = 16,
MAX_TEXTURE_STACK_DEPTH = 10,
MAX_VERTEX_ATTRIBS = 16,
MAX_UNIFORM_VECTORS = 256, // Device limit MAX_UNIFORM_VECTORS = 256, // Device limit
MAX_VERTEX_UNIFORM_VECTORS = 256 - 3, // Reserve space for gl_DepthRange MAX_VERTEX_UNIFORM_VECTORS = 256 - 3, // Reserve space for gl_DepthRange
MAX_VARYING_VECTORS = 10, MAX_VARYING_VECTORS = 10,
MAX_TEXTURE_IMAGE_UNITS = 16, MAX_TEXTURE_IMAGE_UNITS = 2,
MAX_VERTEX_TEXTURE_IMAGE_UNITS = 4, MAX_VERTEX_TEXTURE_IMAGE_UNITS = 1,
MAX_COMBINED_TEXTURE_IMAGE_UNITS = MAX_TEXTURE_IMAGE_UNITS + MAX_VERTEX_TEXTURE_IMAGE_UNITS, MAX_COMBINED_TEXTURE_IMAGE_UNITS = MAX_TEXTURE_IMAGE_UNITS + MAX_VERTEX_TEXTURE_IMAGE_UNITS,
MAX_FRAGMENT_UNIFORM_VECTORS = 224 - 3, // Reserve space for gl_DepthRange MAX_FRAGMENT_UNIFORM_VECTORS = 224 - 3, // Reserve space for gl_DepthRange
MAX_DRAW_BUFFERS = 1, MAX_DRAW_BUFFERS = 1,
...@@ -495,29 +490,6 @@ struct State ...@@ -495,29 +490,6 @@ struct State
GLint unpackAlignment; GLint unpackAlignment;
GLint packAlignment; GLint packAlignment;
bool unpackSwapBytes;
bool unpackLsbFirst;
GLint unpackRowLength;
GLint unpackSkipRows;
GLint unpackSkipPixels;
GLint unpackSkipImages;
GLint unpackImageHeight;
GLenum textureEnvMode;
};
struct ClientAttributes
{
GLint unpackAlignment;
GLint packAlignment;
bool unpackSwapBytes;
bool unpackLsbFirst;
GLint unpackRowLength;
GLint unpackSkipRows;
GLint unpackSkipPixels;
GLint unpackSkipImages;
GLint unpackImageHeight;
GLbitfield mask;
}; };
class Context class Context
...@@ -611,20 +583,6 @@ public: ...@@ -611,20 +583,6 @@ public:
void setPackAlignment(GLint alignment); void setPackAlignment(GLint alignment);
GLint getPackAlignment() const; GLint getPackAlignment() const;
void setUnpackSwapBytes(bool swapBytes);
bool getUnpackSwapBytes() const;
void setUnpackLsbFirst(bool length);
bool getUnpackLsbFirst() const;
void setUnpackRowLength(GLint length);
GLint getUnpackRowLength() const;
void setUnpackSkipRows(GLint skipRows);
GLint getUnpackSkipRows() const;
void setUnpackSkipPixels(GLint skipRows);
GLint getUnpackSkipPixels() const;
void setUnpackSkipImages(GLint skipImage);
GLint getUnpackSkipImages() const;
void setUnpackImageHeight(GLint imageHeight);
GLint getUnpackImageHeight() const;
// These create and destroy methods are merely pass-throughs to // These create and destroy methods are merely pass-throughs to
// ResourceManager, which owns these object types // ResourceManager, which owns these object types
...@@ -654,7 +612,6 @@ public: ...@@ -654,7 +612,6 @@ public:
void bindArrayBuffer(GLuint buffer); void bindArrayBuffer(GLuint buffer);
void bindElementArrayBuffer(GLuint buffer); void bindElementArrayBuffer(GLuint buffer);
void bindTexture1D(GLuint texture);
void bindTexture2D(GLuint texture); void bindTexture2D(GLuint texture);
void bindTextureCubeMap(GLuint texture); void bindTextureCubeMap(GLuint texture);
void bindReadFramebuffer(GLuint framebuffer); void bindReadFramebuffer(GLuint framebuffer);
...@@ -686,7 +643,6 @@ public: ...@@ -686,7 +643,6 @@ public:
Texture2D *getTexture2D(GLenum target); Texture2D *getTexture2D(GLenum target);
TextureCubeMap *getTextureCubeMap(); TextureCubeMap *getTextureCubeMap();
Texture *getSamplerTexture(unsigned int sampler, TextureType type); Texture *getSamplerTexture(unsigned int sampler, TextureType type);
Texture1D *getTexture1D();
Framebuffer *getReadFramebuffer(); Framebuffer *getReadFramebuffer();
Framebuffer *getDrawFramebuffer(); Framebuffer *getDrawFramebuffer();
...@@ -703,9 +659,6 @@ public: ...@@ -703,9 +659,6 @@ public:
void finish(); void finish();
void flush(); void flush();
void setTextureEnvMode(GLenum texEnvMode);
GLenum getTextureEnvMode();
void recordInvalidEnum(); void recordInvalidEnum();
void recordInvalidValue(); void recordInvalidValue();
void recordInvalidOperation(); void recordInvalidOperation();
...@@ -732,9 +685,6 @@ public: ...@@ -732,9 +685,6 @@ public:
void frustum(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar); void frustum(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar);
void ortho(double left, double right, double bottom, double top, double zNear, double zFar); // FIXME: GLdouble void ortho(double left, double right, double bottom, double top, double zNear, double zFar); // FIXME: GLdouble
void pushClientAttrib(GLbitfield mask);
void popClientAttrib();
void setLighting(bool enabled); void setLighting(bool enabled);
void setFog(bool enabled); void setFog(bool enabled);
void setAlphaTest(bool enabled); void setAlphaTest(bool enabled);
...@@ -743,10 +693,6 @@ public: ...@@ -743,10 +693,6 @@ public:
void setShadeModel(GLenum mode); void setShadeModel(GLenum mode);
void setLight(int index, bool enable); void setLight(int index, bool enable);
void setNormalizeNormals(bool enable); void setNormalizeNormals(bool enable);
void setRectangleTextureEnable(bool enable);
bool getRectangleTextureEnable();
void set1DTextureEnable(bool enable);
bool get1DTextureEnable();
GLuint genLists(GLsizei range); GLuint genLists(GLsizei range);
void newList(GLuint list, GLenum mode); void newList(GLuint list, GLenum mode);
...@@ -756,7 +702,6 @@ public: ...@@ -756,7 +702,6 @@ public:
GLuint getListIndex() {return listIndex;} GLuint getListIndex() {return listIndex;}
GLenum getListMode() {return listMode;} GLenum getListMode() {return listMode;}
void listCommand(Command *command); void listCommand(Command *command);
void shareDisplayListSpace(HGLRC hglrc);
void captureAttribs(); void captureAttribs();
void captureDrawArrays(GLenum mode, GLint first, GLsizei count); void captureDrawArrays(GLenum mode, GLint first, GLsizei count);
...@@ -797,7 +742,6 @@ private: ...@@ -797,7 +742,6 @@ private:
BindingPointer<Texture2D> mTexture2DZero; BindingPointer<Texture2D> mTexture2DZero;
BindingPointer<Texture2D> mProxyTexture2DZero; BindingPointer<Texture2D> mProxyTexture2DZero;
BindingPointer<TextureCubeMap> mTextureCubeMapZero; BindingPointer<TextureCubeMap> mTextureCubeMapZero;
BindingPointer<Texture1D> mTexture1DZero;
typedef std::map<GLint, Framebuffer*> FramebufferMap; typedef std::map<GLint, Framebuffer*> FramebufferMap;
FramebufferMap mFramebufferMap; FramebufferMap mFramebufferMap;
...@@ -845,16 +789,12 @@ private: ...@@ -845,16 +789,12 @@ private:
sw::MatrixStack projection; sw::MatrixStack projection;
sw::MatrixStack texture[8]; sw::MatrixStack texture[8];
std::stack<ClientAttributes> *clientAttribStack;
GLenum listMode; GLenum listMode;
//std::map<GLuint, GLuint> listMap; //std::map<GLuint, GLuint> listMap;
std::map<GLuint, DisplayList*> displayList; std::map<GLuint, DisplayList*> displayList;
DisplayList *list; DisplayList *list;
GLuint listIndex; GLuint listIndex;
GLuint firstFreeIndex; GLuint firstFreeIndex;
bool sharedList;
HGLRC sharedContextHandle;
GLenum clientTexture; GLenum clientTexture;
......
...@@ -157,9 +157,6 @@ namespace gl ...@@ -157,9 +157,6 @@ namespace gl
setSpecularMaterialSource(sw::MATERIAL_MATERIAL); setSpecularMaterialSource(sw::MATERIAL_MATERIAL);
setAmbientMaterialSource(sw::MATERIAL_COLOR1); setAmbientMaterialSource(sw::MATERIAL_COLOR1);
setEmissiveMaterialSource(sw::MATERIAL_MATERIAL); setEmissiveMaterialSource(sw::MATERIAL_MATERIAL);
rectangleTextureEnable = false;
oneDTextureEnable = false;
} }
Device::~Device() Device::~Device()
...@@ -444,26 +441,6 @@ namespace gl ...@@ -444,26 +441,6 @@ namespace gl
scissorEnable = enable; scissorEnable = enable;
} }
void Device::setRectangleTextureEnable(bool enable)
{
rectangleTextureEnable = enable;
}
bool Device::getRectangleTextureEnable()
{
return rectangleTextureEnable;
}
void Device::set1DTextureEnable(bool enable)
{
oneDTextureEnable = enable;
}
bool Device::get1DTextureEnable()
{
return oneDTextureEnable;
}
void Device::setRenderTarget(Image *renderTarget) void Device::setRenderTarget(Image *renderTarget)
{ {
if(renderTarget) if(renderTarget)
......
...@@ -59,10 +59,6 @@ namespace gl ...@@ -59,10 +59,6 @@ namespace gl
virtual void setPixelShader(sw::PixelShader *shader); virtual void setPixelShader(sw::PixelShader *shader);
virtual void setPixelShaderConstantF(unsigned int startRegister, const float *constantData, unsigned int count); virtual void setPixelShaderConstantF(unsigned int startRegister, const float *constantData, unsigned int count);
virtual void setScissorEnable(bool enable); virtual void setScissorEnable(bool enable);
virtual void setRectangleTextureEnable(bool enable);
virtual bool getRectangleTextureEnable();
virtual void set1DTextureEnable(bool enable);
virtual bool get1DTextureEnable();
virtual void setRenderTarget(Image *renderTarget); virtual void setRenderTarget(Image *renderTarget);
virtual void setScissorRect(const sw::Rect &rect); virtual void setScissorRect(const sw::Rect &rect);
virtual void setVertexShader(sw::VertexShader *shader); virtual void setVertexShader(sw::VertexShader *shader);
......
...@@ -323,11 +323,7 @@ void ResourceManager::checkTextureAllocation(GLuint texture, TextureType type) ...@@ -323,11 +323,7 @@ void ResourceManager::checkTextureAllocation(GLuint texture, TextureType type)
{ {
Texture *textureObject; Texture *textureObject;
if(type == TEXTURE_1D) if(type == TEXTURE_2D)
{
textureObject = new Texture1D(texture);
}
else if(type == TEXTURE_2D)
{ {
textureObject = new Texture2D(texture); textureObject = new Texture2D(texture);
} }
......
...@@ -37,7 +37,6 @@ enum TextureType ...@@ -37,7 +37,6 @@ enum TextureType
TEXTURE_2D, TEXTURE_2D,
PROXY_TEXTURE_2D, PROXY_TEXTURE_2D,
TEXTURE_CUBE, TEXTURE_CUBE,
TEXTURE_1D,
TEXTURE_TYPE_COUNT, TEXTURE_TYPE_COUNT,
TEXTURE_UNKNOWN TEXTURE_UNKNOWN
......
...@@ -167,7 +167,6 @@ TranslatorASM *Shader::createCompiler(GLenum shaderType) ...@@ -167,7 +167,6 @@ TranslatorASM *Shader::createCompiler(GLenum shaderType)
resources.MaxVertexTextureImageUnits = MAX_VERTEX_TEXTURE_IMAGE_UNITS; resources.MaxVertexTextureImageUnits = MAX_VERTEX_TEXTURE_IMAGE_UNITS;
resources.MaxCombinedTextureImageUnits = MAX_COMBINED_TEXTURE_IMAGE_UNITS; resources.MaxCombinedTextureImageUnits = MAX_COMBINED_TEXTURE_IMAGE_UNITS;
resources.MaxTextureImageUnits = MAX_TEXTURE_IMAGE_UNITS; resources.MaxTextureImageUnits = MAX_TEXTURE_IMAGE_UNITS;
resources.MaxTextureCoords = MAX_TEXTURE_COORDS;
resources.MaxFragmentUniformVectors = MAX_FRAGMENT_UNIFORM_VECTORS; resources.MaxFragmentUniformVectors = MAX_FRAGMENT_UNIFORM_VECTORS;
resources.MaxDrawBuffers = MAX_DRAW_BUFFERS; resources.MaxDrawBuffers = MAX_DRAW_BUFFERS;
resources.OES_standard_derivatives = 1; resources.OES_standard_derivatives = 1;
......
...@@ -168,11 +168,11 @@ GLfloat Texture::getMaxAnisotropy() const ...@@ -168,11 +168,11 @@ GLfloat Texture::getMaxAnisotropy() const
return mMaxAnisotropy; return mMaxAnisotropy;
} }
void Texture::setImage(GLenum format, GLenum type, GLint unpackAlignment, const void *pixels, Image *image, int xOffset) void Texture::setImage(GLenum format, GLenum type, GLint unpackAlignment, const void *pixels, Image *image)
{ {
if(pixels && image) if(pixels && image)
{ {
image->loadImageData(xOffset/*0*/, 0, 0, image->getWidth(), image->getHeight(), 1, format, type, unpackAlignment, pixels); image->loadImageData(0, 0, 0, image->getWidth(), image->getHeight(), 1, format, type, unpackAlignment, pixels);
} }
} }
...@@ -184,7 +184,7 @@ void Texture::setCompressedImage(GLsizei imageSize, const void *pixels, Image *i ...@@ -184,7 +184,7 @@ void Texture::setCompressedImage(GLsizei imageSize, const void *pixels, Image *i
} }
} }
void Texture::subImage(GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, GLint unpackAlignment, const void *pixels, Image *image, bool is2DTexture) void Texture::subImage(GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, GLint unpackAlignment, const void *pixels, Image *image)
{ {
if(!image) if(!image)
{ {
...@@ -201,7 +201,7 @@ void Texture::subImage(GLint xoffset, GLint yoffset, GLsizei width, GLsizei heig ...@@ -201,7 +201,7 @@ void Texture::subImage(GLint xoffset, GLint yoffset, GLsizei width, GLsizei heig
return error(GL_INVALID_OPERATION); return error(GL_INVALID_OPERATION);
} }
if(format != image->getFormat() && is2DTexture) if(format != image->getFormat())
{ {
return error(GL_INVALID_OPERATION); return error(GL_INVALID_OPERATION);
} }
...@@ -367,7 +367,7 @@ int Texture2D::getLevelCount() const ...@@ -367,7 +367,7 @@ int Texture2D::getLevelCount() const
return levels; return levels;
} }
void Texture2D::setImage(GLint level, GLsizei width, GLsizei height, GLenum format, GLenum type, GLint unpackAlignment, const void *pixels, int xOffset) void Texture2D::setImage(GLint level, GLsizei width, GLsizei height, GLenum format, GLenum type, GLint unpackAlignment, const void *pixels)
{ {
if(image[level]) if(image[level])
{ {
...@@ -381,7 +381,7 @@ void Texture2D::setImage(GLint level, GLsizei width, GLsizei height, GLenum form ...@@ -381,7 +381,7 @@ void Texture2D::setImage(GLint level, GLsizei width, GLsizei height, GLenum form
return error(GL_OUT_OF_MEMORY); return error(GL_OUT_OF_MEMORY);
} }
Texture::setImage(format, type, unpackAlignment, pixels, image[level], xOffset); Texture::setImage(format, type, unpackAlignment, pixels, image[level]);
} }
void Texture2D::setCompressedImage(GLint level, GLenum format, GLsizei width, GLsizei height, GLsizei imageSize, const void *pixels) void Texture2D::setCompressedImage(GLint level, GLenum format, GLsizei width, GLsizei height, GLsizei imageSize, const void *pixels)
...@@ -1038,57 +1038,4 @@ Image *TextureCubeMap::getRenderTarget(GLenum target, unsigned int level) ...@@ -1038,57 +1038,4 @@ Image *TextureCubeMap::getRenderTarget(GLenum target, unsigned int level)
return image[face][level]; return image[face][level];
} }
Texture1D::Texture1D(GLuint name) : Texture2D(name)
{
}
Texture1D::~Texture1D()
{
}
GLenum Texture1D::getTarget() const
{
return GL_TEXTURE_1D;
}
GLenum Texture1D::getFormat(GLenum target, GLint level) const
{
ASSERT(target == GL_TEXTURE_1D);
return image[level] ? image[level]->getFormat() : 0;
}
GLenum Texture1D::getType(GLenum target, GLint level) const
{
ASSERT(target == GL_TEXTURE_1D);
return image[level] ? image[level]->getType() : 0;
}
GLsizei Texture1D::getWidth(GLenum target, GLint level) const
{
ASSERT(target == GL_TEXTURE_1D || target == GL_PROXY_TEXTURE_1D);
return image[level] ? image[level]->getWidth() : 0;
}
GLsizei Texture1D::getHeight(GLenum target, GLint level) const
{
ASSERT(target == GL_TEXTURE_1D || target == GL_PROXY_TEXTURE_1D);
return image[level] ? image[level]->getHeight() : 0;
}
sw::Format Texture1D::getInternalFormat(GLenum target, GLint level) const
{
ASSERT(target == GL_TEXTURE_1D || target == GL_PROXY_TEXTURE_1D);
return image[level] ? image[level]->getInternalFormat() : sw::FORMAT_NULL;
}
void Texture1D::subImage(GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, GLint unpackAlignment, const void *pixels)
{
Texture::subImage(xoffset, yoffset, width, height, format, type, unpackAlignment, pixels, image[level], false);
}
bool Texture1D::isCompressed(GLenum target, GLint level) const
{
return IsCompressed(getFormat(target, level));
}
} }
...@@ -88,8 +88,8 @@ public: ...@@ -88,8 +88,8 @@ public:
virtual void copySubImage(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height, Framebuffer *source) = 0; virtual void copySubImage(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height, Framebuffer *source) = 0;
protected: protected:
void setImage(GLenum format, GLenum type, GLint unpackAlignment, const void *pixels, Image *image, int xOffset = 0); void setImage(GLenum format, GLenum type, GLint unpackAlignment, const void *pixels, Image *image);
void subImage(GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, GLint unpackAlignment, const void *pixels, Image *image, bool is2DTexture = true); void subImage(GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, GLint unpackAlignment, const void *pixels, Image *image);
void setCompressedImage(GLsizei imageSize, const void *pixels, Image *image); void setCompressedImage(GLsizei imageSize, const void *pixels, Image *image);
void subImageCompressed(GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void *pixels, Image *image); void subImageCompressed(GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void *pixels, Image *image);
...@@ -126,7 +126,7 @@ public: ...@@ -126,7 +126,7 @@ public:
virtual sw::Format getInternalFormat(GLenum target, GLint level) const; virtual sw::Format getInternalFormat(GLenum target, GLint level) const;
virtual int getLevelCount() const; virtual int getLevelCount() const;
void setImage(GLint level, GLsizei width, GLsizei height, GLenum format, GLenum type, GLint unpackAlignment, const void *pixels, int xOffset = 0); void setImage(GLint level, GLsizei width, GLsizei height, GLenum format, GLenum type, GLint unpackAlignment, const void *pixels);
void setCompressedImage(GLint level, GLenum format, GLsizei width, GLsizei height, GLsizei imageSize, const void *pixels); void setCompressedImage(GLint level, GLenum format, GLsizei width, GLsizei height, GLsizei imageSize, const void *pixels);
void subImage(GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, GLint unpackAlignment, const void *pixels); void subImage(GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, GLint unpackAlignment, const void *pixels);
void subImageCompressed(GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void *pixels); void subImageCompressed(GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void *pixels);
...@@ -216,21 +216,6 @@ private: ...@@ -216,21 +216,6 @@ private:
unsigned int mFaceProxyRefs[6]; unsigned int mFaceProxyRefs[6];
}; };
class Texture1D : public Texture2D
{
public:
explicit Texture1D(GLuint name);
virtual ~Texture1D();
virtual GLenum getTarget() const;
virtual GLenum getFormat(GLenum target, GLint level) const;
virtual GLenum getType(GLenum target, GLint level) const;
virtual GLsizei getWidth(GLenum target, GLint level) const;
virtual GLsizei getHeight(GLenum target, GLint level) const;
virtual sw::Format getInternalFormat(GLenum target, GLint level) const;
virtual void subImage(GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, GLint unpackAlignment, const void *pixels);
virtual bool isCompressed(GLenum target, GLint level) const;
};
} }
#endif // LIBGL_TEXTURE_H_ #endif // LIBGL_TEXTURE_H_
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -368,6 +368,5 @@ EXPORTS ...@@ -368,6 +368,5 @@ EXPORTS
wglUseFontBitmapsW @366 wglUseFontBitmapsW @366
wglUseFontOutlinesA @367 wglUseFontOutlinesA @367
wglUseFontOutlinesW @368 wglUseFontOutlinesW @368
wglCreateContextAttribsARB @369
Register Register
\ No newline at end of file
...@@ -309,7 +309,7 @@ namespace gl ...@@ -309,7 +309,7 @@ namespace gl
bool IsTextureTarget(GLenum target) bool IsTextureTarget(GLenum target)
{ {
return target == GL_TEXTURE_1D || target == GL_TEXTURE_RECTANGLE || target == GL_TEXTURE_2D || IsCubemapTextureTarget(target); return target == GL_TEXTURE_2D || IsCubemapTextureTarget(target);
} }
// Verify that format/type are one of the combinations from table 3.4. // Verify that format/type are one of the combinations from table 3.4.
...@@ -617,59 +617,6 @@ namespace es2sw ...@@ -617,59 +617,6 @@ namespace es2sw
} }
} }
void ConvertTextureOperations(GLenum texEnvMode, GLenum texFormat, sw::TextureStage::StageOperation *rgbOperation, sw::TextureStage::StageOperation *alphaOperation)
{
switch(texEnvMode)
{
case GL_MODULATE:
switch(texFormat)
{
case GL_LUMINANCE_ALPHA:
*rgbOperation = sw::TextureStage::STAGE_MODULATE;
*alphaOperation = sw::TextureStage::STAGE_MODULATE;
break;
case GL_RGB:
*rgbOperation = sw::TextureStage::STAGE_MODULATE;
*alphaOperation = sw::TextureStage::STAGE_SELECTARG2;
break;
case GL_RGBA:
*rgbOperation = sw::TextureStage::STAGE_MODULATE;
*alphaOperation = sw::TextureStage::STAGE_MODULATE;
break;
case GL_ALPHA:
case GL_LUMINANCE:
UNIMPLEMENTED();
// Default operations for compatibility
*rgbOperation = sw::TextureStage::STAGE_MODULATE;
*alphaOperation = sw::TextureStage::STAGE_MODULATE;
break;
default: UNREACHABLE();
}
break;
case GL_REPLACE:
*rgbOperation = sw::TextureStage::STAGE_SELECTARG1;
*alphaOperation = sw::TextureStage::STAGE_SELECTARG1;
break;
case GL_ADD:
*rgbOperation = sw::TextureStage::STAGE_ADD;
*alphaOperation = sw::TextureStage::STAGE_SELECTARG1;
break;
case GL_DECAL:
case GL_BLEND:
// Default operations for compatibility
*rgbOperation = sw::TextureStage::STAGE_MODULATE;
*alphaOperation = sw::TextureStage::STAGE_MODULATE;
UNIMPLEMENTED();
break;
default:
UNREACHABLE();
}
}
bool ConvertPrimitiveType(GLenum primitiveType, GLsizei elementCount, gl::PrimitiveType &swPrimitiveType, int &primitiveCount) bool ConvertPrimitiveType(GLenum primitiveType, GLsizei elementCount, gl::PrimitiveType &swPrimitiveType, int &primitiveCount)
{ {
switch(primitiveType) switch(primitiveType)
......
...@@ -69,7 +69,6 @@ namespace es2sw ...@@ -69,7 +69,6 @@ namespace es2sw
void ConvertMinFilter(GLenum texFilter, sw::FilterType *minFilter, sw::MipmapType *mipFilter, float maxAnisotropy); void ConvertMinFilter(GLenum texFilter, sw::FilterType *minFilter, sw::MipmapType *mipFilter, float maxAnisotropy);
bool ConvertPrimitiveType(GLenum primitiveType, GLsizei elementCount, gl::PrimitiveType &swPrimitiveType, int &primitiveCount); bool ConvertPrimitiveType(GLenum primitiveType, GLsizei elementCount, gl::PrimitiveType &swPrimitiveType, int &primitiveCount);
sw::Format ConvertRenderbufferFormat(GLenum format); sw::Format ConvertRenderbufferFormat(GLenum format);
void ConvertTextureOperations(GLenum texEnvMode, GLenum texFormat, sw::TextureStage::StageOperation *rgbOperation, sw::TextureStage::StageOperation *alphaOperation);
} }
namespace sw2es namespace sw2es
......
...@@ -284,8 +284,6 @@ namespace sw ...@@ -284,8 +284,6 @@ namespace sw
// Set fixed-function pixel pipeline states, return true when modified // Set fixed-function pixel pipeline states, return true when modified
bool setDepthBufferEnable(bool depthBufferEnable); bool setDepthBufferEnable(bool depthBufferEnable);
void setRectangleTextureEnable(bool rectangleTextureEnable);
bool setAlphaBlendEnable(bool alphaBlendEnable); bool setAlphaBlendEnable(bool alphaBlendEnable);
bool setSourceBlendFactor(BlendFactor sourceBlendFactor); bool setSourceBlendFactor(BlendFactor sourceBlendFactor);
bool setDestBlendFactor(BlendFactor destBlendFactor); bool setDestBlendFactor(BlendFactor destBlendFactor);
......
...@@ -213,16 +213,6 @@ namespace sw ...@@ -213,16 +213,6 @@ namespace sw
updateLighting = true; updateLighting = true;
} }
void VertexProcessor::setRectangleTextureEnable(bool enable)
{
rectangleTextureEnable = enable;
}
bool VertexProcessor::getRectangleTextureEnable()
{
return rectangleTextureEnable;
}
void VertexProcessor::setSpecularEnable(bool specularEnable) void VertexProcessor::setSpecularEnable(bool specularEnable)
{ {
context->setSpecularEnable(specularEnable); context->setSpecularEnable(specularEnable);
......
...@@ -196,9 +196,6 @@ namespace sw ...@@ -196,9 +196,6 @@ namespace sw
virtual void setLightEnable(unsigned int light, bool lightEnable); virtual void setLightEnable(unsigned int light, bool lightEnable);
virtual void setSpecularEnable(bool specularEnable); virtual void setSpecularEnable(bool specularEnable);
void setRectangleTextureEnable(bool enable);
bool getRectangleTextureEnable();
virtual void setGlobalAmbient(const Color<float> &globalAmbient); virtual void setGlobalAmbient(const Color<float> &globalAmbient);
virtual void setLightPosition(unsigned int light, const Point &lightPosition); virtual void setLightPosition(unsigned int light, const Point &lightPosition);
virtual void setLightViewPosition(unsigned int light, const Point &lightPosition); virtual void setLightViewPosition(unsigned int light, const Point &lightPosition);
...@@ -299,8 +296,6 @@ namespace sw ...@@ -299,8 +296,6 @@ namespace sw
bool updateBaseMatrix; bool updateBaseMatrix;
bool updateProjectionMatrix; bool updateProjectionMatrix;
bool updateLighting; bool updateLighting;
bool rectangleTextureEnable;
bool oneDTextureEnable;
}; };
} }
......
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