diff options
Diffstat (limited to 'Source/ThirdParty/ANGLE/src/compiler/Initialize.cpp')
-rw-r--r-- | Source/ThirdParty/ANGLE/src/compiler/Initialize.cpp | 54 |
1 files changed, 33 insertions, 21 deletions
diff --git a/Source/ThirdParty/ANGLE/src/compiler/Initialize.cpp b/Source/ThirdParty/ANGLE/src/compiler/Initialize.cpp index 12b53fe..f3a19dc 100644 --- a/Source/ThirdParty/ANGLE/src/compiler/Initialize.cpp +++ b/Source/ThirdParty/ANGLE/src/compiler/Initialize.cpp @@ -19,7 +19,7 @@ // Prototypes for built-in functions seen by both vertex and fragment shaders. // //============================================================================ -static TString BuiltInFunctionsCommon() +static TString BuiltInFunctionsCommon(const ShBuiltInResources& resources) { TString s; @@ -311,6 +311,26 @@ static TString BuiltInFunctionsCommon() s.append(TString("bvec4 not(bvec4 x);")); // + // Texture Functions. + // + s.append(TString("vec4 texture2D(sampler2D sampler, vec2 coord);")); + s.append(TString("vec4 texture2DProj(sampler2D sampler, vec3 coord);")); + s.append(TString("vec4 texture2DProj(sampler2D sampler, vec4 coord);")); + s.append(TString("vec4 textureCube(samplerCube sampler, vec3 coord);")); + + if (resources.OES_EGL_image_external) { + s.append(TString("vec4 texture2D(samplerExternalOES sampler, vec2 coord);")); + s.append(TString("vec4 texture2DProj(samplerExternalOES sampler, vec3 coord);")); + s.append(TString("vec4 texture2DProj(samplerExternalOES sampler, vec4 coord);")); + } + + if (resources.ARB_texture_rectangle) { + s.append(TString("vec4 texture2DRect(sampler2DRect sampler, vec2 coord);")); + s.append(TString("vec4 texture2DRectProj(sampler2DRect sampler, vec3 coord);")); + s.append(TString("vec4 texture2DRectProj(sampler2DRect sampler, vec4 coord);")); + } + + // // Noise functions. // //s.append(TString("float noise1(float x);")); @@ -353,17 +373,10 @@ static TString BuiltInFunctionsVertex(const ShBuiltInResources& resources) // // Texture Functions. // - if (resources.MaxVertexTextureImageUnits > 0) { - s.append(TString("vec4 texture2D(sampler2D sampler, vec2 coord);")); - s.append(TString("vec4 texture2DProj(sampler2D sampler, vec3 coord);")); - s.append(TString("vec4 texture2DProj(sampler2D sampler, vec4 coord);")); - s.append(TString("vec4 textureCube(samplerCube sampler, vec3 coord);")); - - s.append(TString("vec4 texture2DLod(sampler2D sampler, vec2 coord, float lod);")); - s.append(TString("vec4 texture2DProjLod(sampler2D sampler, vec3 coord, float lod);")); - s.append(TString("vec4 texture2DProjLod(sampler2D sampler, vec4 coord, float lod);")); - s.append(TString("vec4 textureCubeLod(samplerCube sampler, vec3 coord, float lod);")); - } + s.append(TString("vec4 texture2DLod(sampler2D sampler, vec2 coord, float lod);")); + s.append(TString("vec4 texture2DProjLod(sampler2D sampler, vec3 coord, float lod);")); + s.append(TString("vec4 texture2DProjLod(sampler2D sampler, vec4 coord, float lod);")); + s.append(TString("vec4 textureCubeLod(samplerCube sampler, vec3 coord, float lod);")); return s; } @@ -380,11 +393,6 @@ static TString BuiltInFunctionsFragment(const ShBuiltInResources& resources) // // Texture Functions. // - s.append(TString("vec4 texture2D(sampler2D sampler, vec2 coord);")); - s.append(TString("vec4 texture2DProj(sampler2D sampler, vec3 coord);")); - s.append(TString("vec4 texture2DProj(sampler2D sampler, vec4 coord);")); - s.append(TString("vec4 textureCube(samplerCube sampler, vec3 coord);")); - s.append(TString("vec4 texture2D(sampler2D sampler, vec2 coord, float bias);")); s.append(TString("vec4 texture2DProj(sampler2D sampler, vec3 coord, float bias);")); s.append(TString("vec4 texture2DProj(sampler2D sampler, vec4 coord, float bias);")); @@ -490,14 +498,14 @@ void TBuiltIns::initialize(ShShaderType type, ShShaderSpec spec, switch (type) { case SH_FRAGMENT_SHADER: builtInStrings.push_back(DefaultPrecisionFragment()); - builtInStrings.push_back(BuiltInFunctionsCommon()); + builtInStrings.push_back(BuiltInFunctionsCommon(resources)); builtInStrings.push_back(BuiltInFunctionsFragment(resources)); builtInStrings.push_back(StandardUniforms()); break; case SH_VERTEX_SHADER: builtInStrings.push_back(DefaultPrecisionVertex()); - builtInStrings.push_back(BuiltInFunctionsCommon()); + builtInStrings.push_back(BuiltInFunctionsCommon(resources)); builtInStrings.push_back(BuiltInFunctionsVertex(resources)); builtInStrings.push_back(StandardUniforms()); break; @@ -614,7 +622,7 @@ void IdentifyBuiltIns(ShShaderType type, ShShaderSpec spec, switch(type) { case SH_FRAGMENT_SHADER: { // Set up gl_FragData. The array size. - TType fragData(EbtFloat, EbpMedium, EvqFragColor, 4, false, true); + TType fragData(EbtFloat, EbpMedium, EvqFragData, 4, false, true); fragData.setArraySize(resources.MaxDrawBuffers); symbolTable.insert(*new TVariable(NewPoolTString("gl_FragData"), fragData)); } @@ -627,5 +635,9 @@ void InitExtensionBehavior(const ShBuiltInResources& resources, TExtensionBehavior& extBehavior) { if (resources.OES_standard_derivatives) - extBehavior["GL_OES_standard_derivatives"] = EBhDisable; + extBehavior["GL_OES_standard_derivatives"] = EBhUndefined; + if (resources.OES_EGL_image_external) + extBehavior["GL_OES_EGL_image_external"] = EBhUndefined; + if (resources.ARB_texture_rectangle) + extBehavior["GL_ARB_texture_rectangle"] = EBhUndefined; } |