Commit 4806a9be by Lingfeng Yang

Add GL_OES_EGL_image_external_essl3

Bug b/120382288 Change-Id: I506920a1ff5f68c2ece7c3e8327525c0bd5609ce Reviewed-on: https://swiftshader-review.googlesource.com/c/23889Tested-by: 's avatarLingfeng Yang <lfy@google.com> Reviewed-by: 's avatarAlexis Hétu <sugoi@google.com>
parent c3bea872
......@@ -66,6 +66,7 @@ ShBuiltInResources::ShBuiltInResources()
OES_standard_derivatives = 0;
OES_fragment_precision_high = 0;
OES_EGL_image_external = 0;
OES_EGL_image_external_essl3 = 0;
MaxCallStackDepth = UINT_MAX;
}
......
......@@ -57,6 +57,7 @@ struct ShBuiltInResources
int OES_standard_derivatives;
int OES_fragment_precision_high;
int OES_EGL_image_external;
int OES_EGL_image_external_essl3;
int EXT_draw_buffers;
int ARB_texture_rectangle;
......
......@@ -265,6 +265,18 @@ void InsertBuiltInFunctions(GLenum type, const ShBuiltInResources &resources, TS
symbolTable.insertBuiltIn(ESSL1_BUILTINS, float4, "texture3D", samplerExternalOES, float3);
}
if(resources.OES_EGL_image_external_essl3)
{
TType *samplerExternalOES = new TType(EbtSamplerExternalOES);
symbolTable.insertBuiltIn(ESSL3_BUILTINS, float4, "texture", samplerExternalOES, float2);
symbolTable.insertBuiltIn(ESSL3_BUILTINS, float4, "textureProj", samplerExternalOES, float3);
symbolTable.insertBuiltIn(ESSL3_BUILTINS, float4, "textureProj", samplerExternalOES, float4);
symbolTable.insertBuiltIn(ESSL3_BUILTINS, int2, "textureSize", samplerExternalOES, int1);
symbolTable.insertBuiltIn(ESSL3_BUILTINS, float4, "texelFetch", samplerExternalOES, int2, int1);
}
if(type == GL_FRAGMENT_SHADER)
{
symbolTable.insertBuiltIn(ESSL1_BUILTINS, float4, "texture2D", sampler2D, float2, float1);
......@@ -513,6 +525,8 @@ void InitExtensionBehavior(const ShBuiltInResources& resources,
extBehavior["GL_FRAGMENT_PRECISION_HIGH"] = EBhUndefined;
if(resources.OES_EGL_image_external)
extBehavior["GL_OES_EGL_image_external"] = EBhUndefined;
if(resources.OES_EGL_image_external_essl3)
extBehavior["GL_OES_EGL_image_external_essl3"] = EBhUndefined;
if(resources.EXT_draw_buffers)
extBehavior["GL_EXT_draw_buffers"] = EBhUndefined;
if(resources.ARB_texture_rectangle)
......
......@@ -4464,6 +4464,7 @@ const GLubyte *Context::getExtensions(GLuint index, GLuint *numExt) const
"GL_OES_depth_texture_cube_map",
"GL_OES_EGL_image",
"GL_OES_EGL_image_external",
"GL_OES_EGL_image_external_essl3", // client version is always 3, so this is fine
"GL_OES_EGL_sync",
"GL_OES_element_index_uint",
"GL_OES_fbo_render_mipmap",
......
......@@ -180,6 +180,7 @@ TranslatorASM *Shader::createCompiler(GLenum shaderType)
resources.OES_standard_derivatives = 1;
resources.OES_fragment_precision_high = 1;
resources.OES_EGL_image_external = 1;
resources.OES_EGL_image_external_essl3 = 1;
resources.EXT_draw_buffers = 1;
resources.ARB_texture_rectangle = 1;
resources.MaxCallStackDepth = 64;
......
......@@ -118,6 +118,7 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size)
resources.OES_standard_derivatives = 1;
resources.OES_fragment_precision_high = 1;
resources.OES_EGL_image_external = 1;
resources.OES_EGL_image_external_essl3 = 1;
resources.EXT_draw_buffers = 1;
resources.ARB_texture_rectangle = 1;
resources.MaxCallStackDepth = 16;
......@@ -233,4 +234,4 @@ int main(int argc, char *argv[])
return 0;
}
#endif
\ No newline at end of file
#endif
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