Commit c0b6c639 by Yizhou Jiang Committed by Commit Bot

Implement GetTexLevelParameter api of texture multisample extension

This patch adds GetTexLevelParameterivANGLE and GetTexLevelParameterfvANGLE. TEST=TextureMultisampleTest.GetTexLevelParameter* TEST=NegativeTextureMultisampleTest.Negtive* BUG=angleproject:2275 Change-Id: Id702ba31df36ab65f46b697d480b5bf01b87e360 Reviewed-on: https://chromium-review.googlesource.com/c/1295830Reviewed-by: 's avatarGeoff Lang <geofflang@chromium.org> Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Commit-Queue: Yizhou Jiang <yizhou.jiang@intel.com>
parent 502d2e21
......@@ -631,6 +631,10 @@ typedef void(GL_APIENTRYP PFNGLTEXSTORAGE2DMULTISAMPLEANGLE)(GLenum target,
GLsizei width,
GLsizei height,
GLboolean fixedsamplelocations);
typedef void(GL_APIENTRYP PFNGLGETTEXLEVELPARAMETERFVANGLE)(GLenum target, GLint level,
GLenum pname, GLfloat *params);
typedef void(GL_APIENTRYP PFNGLGETTEXLEVELPARAMETERIVANGLE)(GLenum target, GLint level,
GLenum pname, GLint *params);
#ifdef GL_GLEXT_PROTOTYPES
GL_APICALL void GL_APIENTRY glTexStorage2DMultisampleANGLE(GLenum target,
GLsizei samples,
......@@ -638,6 +642,10 @@ GL_APICALL void GL_APIENTRY glTexStorage2DMultisampleANGLE(GLenum target,
GLsizei width,
GLsizei height,
GLboolean fixedsamplelocations);
GL_APICALL void GL_APIENTRY glGetTexLevelParameterfvANGLE(GLenum target, GLint level,
GLenum pname, GLfloat *params);
GL_APICALL void GL_APIENTRY glGetTexLevelParameterivANGLE(GLenum target, GLint level,
GLenum pname, GLint *params);
#endif
#endif // !GL_ANGLE_texture_multisample
......
......@@ -325,6 +325,8 @@ typedef void (GL_APIENTRYP PFNGLFRAMEBUFFERTEXTUREMULTIVIEWSIDEBYSIDEANGLECONTEX
typedef void (GL_APIENTRYP PFNGLCOPYTEXTURE3DANGLECONTEXTANGLE)(GLeglContext ctx, GLuint sourceId, GLint sourceLevel, GLenum destTarget, GLuint destId, GLint destLevel, GLint internalFormat, GLenum destType, GLboolean unpackFlipY, GLboolean unpackPremultiplyAlpha, GLboolean unpackUnmultiplyAlpha);
typedef void (GL_APIENTRYP PFNGLCOPYSUBTEXTURE3DANGLECONTEXTANGLE)(GLeglContext ctx, GLuint sourceId, GLint sourceLevel, GLenum destTarget, GLuint destId, GLint destLevel, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLint z, GLint width, GLint height, GLint depth, GLboolean unpackFlipY, GLboolean unpackPremultiplyAlpha, GLboolean unpackUnmultiplyAlpha);
typedef void (GL_APIENTRYP PFNGLTEXSTORAGE2DMULTISAMPLEANGLECONTEXTANGLE)(GLeglContext ctx, GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations);
typedef void (GL_APIENTRYP PFNGLGETTEXLEVELPARAMETERIVANGLECONTEXTANGLE)(GLeglContext ctx, GLenum target, GLint level, GLenum pname, GLint * params);
typedef void (GL_APIENTRYP PFNGLGETTEXLEVELPARAMETERFVANGLECONTEXTANGLE)(GLeglContext ctx, GLenum target, GLint level, GLenum pname, GLfloat * params);
#ifdef GL_GLEXT_PROTOTYPES
GL_APICALL void GL_APIENTRY glActiveTextureContextANGLE(GLeglContext ctx, GLenum texture);
GL_APICALL void GL_APIENTRY glAttachShaderContextANGLE(GLeglContext ctx, GLuint program, GLuint shader);
......@@ -643,4 +645,6 @@ GL_APICALL void GL_APIENTRY glFramebufferTextureMultiviewSideBySideANGLEContextA
GL_APICALL void GL_APIENTRY glCopyTexture3DANGLEContextANGLE(GLeglContext ctx, GLuint sourceId, GLint sourceLevel, GLenum destTarget, GLuint destId, GLint destLevel, GLint internalFormat, GLenum destType, GLboolean unpackFlipY, GLboolean unpackPremultiplyAlpha, GLboolean unpackUnmultiplyAlpha);
GL_APICALL void GL_APIENTRY glCopySubTexture3DANGLEContextANGLE(GLeglContext ctx, GLuint sourceId, GLint sourceLevel, GLenum destTarget, GLuint destId, GLint destLevel, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLint z, GLint width, GLint height, GLint depth, GLboolean unpackFlipY, GLboolean unpackPremultiplyAlpha, GLboolean unpackUnmultiplyAlpha);
GL_APICALL void GL_APIENTRY glTexStorage2DMultisampleANGLEContextANGLE(GLeglContext ctx, GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations);
GL_APICALL void GL_APIENTRY glGetTexLevelParameterivANGLEContextANGLE(GLeglContext ctx, GLenum target, GLint level, GLenum pname, GLint * params);
GL_APICALL void GL_APIENTRY glGetTexLevelParameterfvANGLEContextANGLE(GLeglContext ctx, GLenum target, GLint level, GLenum pname, GLfloat * params);
#endif
......@@ -211,12 +211,18 @@
"glGetTexLevelParameterfvRobustANGLE": {
"target": "TextureTarget"
},
"glGetTexLevelParameterfvANGLE": {
"target": "TextureTarget"
},
"glGetTexLevelParameteriv": {
"target": "TextureTarget"
},
"glGetTexLevelParameterivRobustANGLE": {
"target": "TextureTarget"
},
"glGetTexLevelParameterivANGLE": {
"target": "TextureTarget"
},
"glGetTexParameterfv": {
"target": "TextureType"
},
......
......@@ -857,6 +857,20 @@
<param><ptype>GLsizei</ptype> <name>height</name></param>
<param><ptype>GLboolean</ptype> <name>fixedsamplelocations</name></param>
</command>
<command>
<proto>void <name>glGetTexLevelParameterivANGLE</name></proto>
<param><ptype>GLenum</ptype> <name>target</name></param>
<param><ptype>GLint</ptype> <name>level</name></param>
<param><ptype>GLenum</ptype> <name>pname</name></param>
<param><ptype>GLint *</ptype> <name>params</name></param>
</command>
<command>
<proto>void <name>glGetTexLevelParameterfvANGLE</name></proto>
<param><ptype>GLenum</ptype> <name>target</name></param>
<param><ptype>GLint</ptype> <name>level</name></param>
<param><ptype>GLenum</ptype> <name>pname</name></param>
<param><ptype>GLfloat *</ptype> <name>params</name></param>
</command>
</commands>
<!-- SECTION: ANGLE extension interface definitions -->
<extensions>
......@@ -998,6 +1012,8 @@
<extension name="GL_ANGLE_texture_multisample" supported='gl'>
<require>
<command name="glTexStorage2DMultisampleANGLE"/>
<command name="glGetTexLevelParameterivANGLE"/>
<command name="glGetTexLevelParameterfvANGLE"/>
</require>
</extension>
</extensions>
......
......@@ -48,7 +48,7 @@
"GL copy conversion table:src/libANGLE/gen_copy_conversion_table.py":
"ac1afe23d9578bd1d2ef74f4a7aa927a",
"GL entry point:scripts/entry_point_packed_gl_enums.json":
"cc1985ce86341a3ff0f5a278eae0fa8f",
"f16b55c293b38a18e0e9d693bdaa341d",
"GL entry point:scripts/generate_entry_points.py":
"24661bb77e40e05ae8de8459e350d373",
"GL entry point:scripts/gl.xml":
......@@ -84,7 +84,7 @@
"Vulkan mandatory format support table:src/libANGLE/renderer/vulkan/vk_mandatory_format_support_data.json":
"fa2bd54c1bb0ab2cf1d386061a4bc5c5",
"Vulkan mandatory format support table:third_party/vulkan-headers/src/registry/vk.xml":
"cd73387d7cdaa5d403eab411194342b3",
"36d0ec2733888108d2acb56134df6b22",
"packed enum:src/common/gen_packed_gl_enums.py":
"a9b1c38b4e4d8a1038e743be323f1a51",
"packed enum:src/common/packed_egl_enums.json":
......@@ -94,7 +94,7 @@
"proc table:src/libGLESv2/gen_proc_table.py":
"027bfd5a8a8dffe91f492bf199029cde",
"proc table:src/libGLESv2/proc_table_data.json":
"8e3456750bc5511a677b75b8458d1a7e",
"9bc7a48223f99e16f11b14ccaeedb09d",
"uniform type:src/common/gen_uniform_type_table.py":
"59cb4ffd0f584c4bd37f2f4ff59a2b93"
}
\ No newline at end of file
......@@ -6656,4 +6656,74 @@ bool ValidateTexStorage2DMultisampleBase(Context *context,
return ValidateTexStorageMultisample(context, target, samples, internalFormat, width, height);
}
bool ValidateGetTexLevelParameterBase(Context *context,
TextureTarget target,
GLint level,
GLenum pname,
GLsizei *length)
{
if (length)
{
*length = 0;
}
TextureType type = TextureTargetToType(target);
if (!ValidTexLevelDestinationTarget(context, type))
{
ANGLE_VALIDATION_ERR(context, InvalidEnum(), InvalidTextureTarget);
return false;
}
if (context->getTargetTexture(type) == nullptr)
{
context->handleError(InvalidEnum() << "No texture bound.");
return false;
}
if (!ValidMipLevel(context, type, level))
{
context->handleError(InvalidValue());
return false;
}
switch (pname)
{
case GL_TEXTURE_RED_TYPE:
case GL_TEXTURE_GREEN_TYPE:
case GL_TEXTURE_BLUE_TYPE:
case GL_TEXTURE_ALPHA_TYPE:
case GL_TEXTURE_DEPTH_TYPE:
break;
case GL_TEXTURE_RED_SIZE:
case GL_TEXTURE_GREEN_SIZE:
case GL_TEXTURE_BLUE_SIZE:
case GL_TEXTURE_ALPHA_SIZE:
case GL_TEXTURE_DEPTH_SIZE:
case GL_TEXTURE_STENCIL_SIZE:
case GL_TEXTURE_SHARED_SIZE:
break;
case GL_TEXTURE_INTERNAL_FORMAT:
case GL_TEXTURE_WIDTH:
case GL_TEXTURE_HEIGHT:
case GL_TEXTURE_DEPTH:
break;
case GL_TEXTURE_SAMPLES:
case GL_TEXTURE_FIXED_SAMPLE_LOCATIONS:
break;
case GL_TEXTURE_COMPRESSED:
break;
default:
ANGLE_VALIDATION_ERR(context, InvalidEnum(), InvalidPname);
return false;
}
if (length)
{
*length = 1;
}
return true;
}
} // namespace gl
......@@ -714,6 +714,12 @@ bool ValidateTexStorage2DMultisampleBase(Context *context,
GLsizei width,
GLsizei height);
bool ValidateGetTexLevelParameterBase(Context *context,
TextureTarget target,
GLint level,
GLenum pname,
GLsizei *length);
// Utility macro for handling implementation methods inside Validation.
#define ANGLE_HANDLE_VALIDATION_ERR(X) \
context->handleError(X); \
......
......@@ -4220,4 +4220,36 @@ bool ValidateTexStorage2DMultisampleANGLE(Context *context,
height);
}
bool ValidateGetTexLevelParameterfvANGLE(Context *context,
TextureTarget target,
GLint level,
GLenum pname,
GLfloat *params)
{
if (!context->getExtensions().textureMultisample)
{
ANGLE_VALIDATION_ERR(context, InvalidOperation(),
MultisampleTextureExtensionOrES31Required);
return false;
}
return ValidateGetTexLevelParameterBase(context, target, level, pname, nullptr);
}
bool ValidateGetTexLevelParameterivANGLE(Context *context,
TextureTarget target,
GLint level,
GLenum pname,
GLint *params)
{
if (!context->getExtensions().textureMultisample)
{
ANGLE_VALIDATION_ERR(context, InvalidOperation(),
MultisampleTextureExtensionOrES31Required);
return false;
}
return ValidateGetTexLevelParameterBase(context, target, level, pname, nullptr);
}
} // namespace gl
......@@ -656,6 +656,17 @@ bool ValidateTexStorage2DMultisampleANGLE(Context *context,
GLsizei width,
GLsizei height,
GLboolean fixedSampleLocations);
bool ValidateGetTexLevelParameterivANGLE(Context *context,
TextureTarget target,
GLint level,
GLenum pname,
GLint *params);
bool ValidateGetTexLevelParameterfvANGLE(Context *context,
TextureTarget target,
GLint level,
GLenum pname,
GLfloat *params);
} // namespace gl
#endif // LIBANGLE_VALIDATION_ES3_H_
......@@ -891,11 +891,11 @@ bool ValidateProgramUniformMatrix4x3fv(Context *context,
transpose);
}
bool ValidateGetTexLevelParameterBase(Context *context,
TextureTarget target,
GLint level,
GLenum pname,
GLsizei *length)
bool ValidateGetTexLevelParameterfv(Context *context,
TextureTarget target,
GLint level,
GLenum pname,
GLfloat *params)
{
if (context->getClientVersion() < ES_3_1)
{
......@@ -903,83 +903,6 @@ bool ValidateGetTexLevelParameterBase(Context *context,
return false;
}
if (length)
{
*length = 0;
}
TextureType type = TextureTargetToType(target);
if (!ValidTexLevelDestinationTarget(context, type))
{
ANGLE_VALIDATION_ERR(context, InvalidEnum(), InvalidTextureTarget);
return false;
}
if (context->getTargetTexture(type) == nullptr)
{
context->handleError(InvalidEnum() << "No texture bound.");
return false;
}
if (!ValidMipLevel(context, type, level))
{
context->handleError(InvalidValue());
return false;
}
switch (pname)
{
case GL_TEXTURE_RED_TYPE:
case GL_TEXTURE_GREEN_TYPE:
case GL_TEXTURE_BLUE_TYPE:
case GL_TEXTURE_ALPHA_TYPE:
case GL_TEXTURE_DEPTH_TYPE:
break;
case GL_TEXTURE_RED_SIZE:
case GL_TEXTURE_GREEN_SIZE:
case GL_TEXTURE_BLUE_SIZE:
case GL_TEXTURE_ALPHA_SIZE:
case GL_TEXTURE_DEPTH_SIZE:
case GL_TEXTURE_STENCIL_SIZE:
case GL_TEXTURE_SHARED_SIZE:
break;
case GL_TEXTURE_INTERNAL_FORMAT:
case GL_TEXTURE_WIDTH:
case GL_TEXTURE_HEIGHT:
case GL_TEXTURE_DEPTH:
break;
case GL_TEXTURE_SAMPLES:
case GL_TEXTURE_FIXED_SAMPLE_LOCATIONS:
break;
case GL_TEXTURE_COMPRESSED:
break;
case GL_MEMORY_SIZE_ANGLE:
if (!context->getExtensions().memorySize)
{
ANGLE_VALIDATION_ERR(context, InvalidEnum(), ExtensionNotEnabled);
return false;
}
break;
default:
ANGLE_VALIDATION_ERR(context, InvalidEnum(), InvalidPname);
return false;
}
if (length)
{
*length = 1;
}
return true;
}
bool ValidateGetTexLevelParameterfv(Context *context,
TextureTarget target,
GLint level,
GLenum pname,
GLfloat *params)
{
return ValidateGetTexLevelParameterBase(context, target, level, pname, nullptr);
}
......@@ -1001,6 +924,12 @@ bool ValidateGetTexLevelParameteriv(Context *context,
GLenum pname,
GLint *params)
{
if (context->getClientVersion() < ES_3_1)
{
ANGLE_VALIDATION_ERR(context, InvalidOperation(), ES31Required);
return false;
}
return ValidateGetTexLevelParameterBase(context, target, level, pname, nullptr);
}
......
......@@ -310,8 +310,10 @@ enum class EntryPoint
GetTexGenivOES,
GetTexGenxvOES,
GetTexLevelParameterfv,
GetTexLevelParameterfvANGLE,
GetTexLevelParameterfvRobustANGLE,
GetTexLevelParameteriv,
GetTexLevelParameterivANGLE,
GetTexLevelParameterivRobustANGLE,
GetTexParameterIivOES,
GetTexParameterIivRobustANGLE,
......
......@@ -1904,6 +1904,52 @@ void GL_APIENTRY TexStorage2DMultisampleANGLE(GLenum target,
}
}
void GL_APIENTRY GetTexLevelParameterivANGLE(GLenum target,
GLint level,
GLenum pname,
GLint *params)
{
ANGLE_SCOPED_GLOBAL_LOCK();
EVENT(
"(GLenum target = 0x%X, GLint level = %d, GLenum pname = 0x%X, GLint * params = "
"0x%016" PRIxPTR ")",
target, level, pname, (uintptr_t)params);
Context *context = GetValidGlobalContext();
if (context)
{
TextureTarget targetPacked = FromGLenum<TextureTarget>(target);
if (context->skipValidation() ||
ValidateGetTexLevelParameterivANGLE(context, targetPacked, level, pname, params))
{
context->getTexLevelParameteriv(targetPacked, level, pname, params);
}
}
}
void GL_APIENTRY GetTexLevelParameterfvANGLE(GLenum target,
GLint level,
GLenum pname,
GLfloat *params)
{
ANGLE_SCOPED_GLOBAL_LOCK();
EVENT(
"(GLenum target = 0x%X, GLint level = %d, GLenum pname = 0x%X, GLfloat * params = "
"0x%016" PRIxPTR ")",
target, level, pname, (uintptr_t)params);
Context *context = GetValidGlobalContext();
if (context)
{
TextureTarget targetPacked = FromGLenum<TextureTarget>(target);
if (context->skipValidation() ||
ValidateGetTexLevelParameterfvANGLE(context, targetPacked, level, pname, params))
{
context->getTexLevelParameterfv(targetPacked, level, pname, params);
}
}
}
// GL_ANGLE_translated_shader_source
void GL_APIENTRY GetTranslatedShaderSourceANGLE(GLuint shader,
GLsizei bufsize,
......@@ -17578,4 +17624,54 @@ void GL_APIENTRY TexStorage2DMultisampleANGLEContextANGLE(GLeglContext ctx,
}
}
}
void GL_APIENTRY GetTexLevelParameterivANGLEContextANGLE(GLeglContext ctx,
GLenum target,
GLint level,
GLenum pname,
GLint *params)
{
ANGLE_SCOPED_GLOBAL_LOCK();
EVENT(
"(GLenum target = 0x%X, GLint level = %d, GLenum pname = 0x%X, GLint * params = "
"0x%016" PRIxPTR ")",
target, level, pname, (uintptr_t)params);
Context *context = static_cast<gl::Context *>(ctx);
if (context)
{
ASSERT(context == GetValidGlobalContext());
TextureTarget targetPacked = FromGLenum<TextureTarget>(target);
if (context->skipValidation() ||
ValidateGetTexLevelParameterivANGLE(context, targetPacked, level, pname, params))
{
context->getTexLevelParameteriv(targetPacked, level, pname, params);
}
}
}
void GL_APIENTRY GetTexLevelParameterfvANGLEContextANGLE(GLeglContext ctx,
GLenum target,
GLint level,
GLenum pname,
GLfloat *params)
{
ANGLE_SCOPED_GLOBAL_LOCK();
EVENT(
"(GLenum target = 0x%X, GLint level = %d, GLenum pname = 0x%X, GLfloat * params = "
"0x%016" PRIxPTR ")",
target, level, pname, (uintptr_t)params);
Context *context = static_cast<gl::Context *>(ctx);
if (context)
{
ASSERT(context == GetValidGlobalContext());
TextureTarget targetPacked = FromGLenum<TextureTarget>(target);
if (context->skipValidation() ||
ValidateGetTexLevelParameterfvANGLE(context, targetPacked, level, pname, params))
{
context->getTexLevelParameterfv(targetPacked, level, pname, params);
}
}
}
} // namespace gl
......@@ -473,6 +473,14 @@ ANGLE_EXPORT void GL_APIENTRY TexStorage2DMultisampleANGLE(GLenum target,
GLsizei width,
GLsizei height,
GLboolean fixedsamplelocations);
ANGLE_EXPORT void GL_APIENTRY GetTexLevelParameterivANGLE(GLenum target,
GLint level,
GLenum pname,
GLint *params);
ANGLE_EXPORT void GL_APIENTRY GetTexLevelParameterfvANGLE(GLenum target,
GLint level,
GLenum pname,
GLfloat *params);
// GL_ANGLE_translated_shader_source
ANGLE_EXPORT void GL_APIENTRY GetTranslatedShaderSourceANGLE(GLuint shader,
......@@ -3446,6 +3454,16 @@ TexStorage2DMultisampleANGLEContextANGLE(GLeglContext ctx,
GLsizei width,
GLsizei height,
GLboolean fixedsamplelocations);
ANGLE_EXPORT void GL_APIENTRY GetTexLevelParameterivANGLEContextANGLE(GLeglContext ctx,
GLenum target,
GLint level,
GLenum pname,
GLint *params);
ANGLE_EXPORT void GL_APIENTRY GetTexLevelParameterfvANGLEContextANGLE(GLeglContext ctx,
GLenum target,
GLint level,
GLenum pname,
GLfloat *params);
} // namespace gl
#endif // LIBGLESV2_ENTRY_POINTS_GLES_EXT_AUTOGEN_H_
......@@ -3188,6 +3188,22 @@ void GL_APIENTRY glTexStorage2DMultisampleANGLE(GLenum target,
fixedsamplelocations);
}
void GL_APIENTRY glGetTexLevelParameterivANGLE(GLenum target,
GLint level,
GLenum pname,
GLint *params)
{
return gl::GetTexLevelParameterivANGLE(target, level, pname, params);
}
void GL_APIENTRY glGetTexLevelParameterfvANGLE(GLenum target,
GLint level,
GLenum pname,
GLfloat *params)
{
return gl::GetTexLevelParameterfvANGLE(target, level, pname, params);
}
// GL_ANGLE_translated_shader_source
void GL_APIENTRY glGetTranslatedShaderSourceANGLE(GLuint shader,
GLsizei bufsize,
......@@ -9021,4 +9037,22 @@ void GL_APIENTRY glTexStorage2DMultisampleANGLEContextANGLE(GLeglContext ctx,
height, fixedsamplelocations);
}
void GL_APIENTRY glGetTexLevelParameterivANGLEContextANGLE(GLeglContext ctx,
GLenum target,
GLint level,
GLenum pname,
GLint *params)
{
return gl::GetTexLevelParameterivANGLEContextANGLE(ctx, target, level, pname, params);
}
void GL_APIENTRY glGetTexLevelParameterfvANGLEContextANGLE(GLeglContext ctx,
GLenum target,
GLint level,
GLenum pname,
GLfloat *params)
{
return gl::GetTexLevelParameterfvANGLEContextANGLE(ctx, target, level, pname, params);
}
} // extern "C"
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -661,11 +661,15 @@ ProcEntry g_procTable[] = {
{"glGetTexEnvxv", P(gl::GetTexEnvxv)},
{"glGetTexEnvxvContextANGLE", P(gl::GetTexEnvxvContextANGLE)},
{"glGetTexLevelParameterfv", P(gl::GetTexLevelParameterfv)},
{"glGetTexLevelParameterfvANGLE", P(gl::GetTexLevelParameterfvANGLE)},
{"glGetTexLevelParameterfvANGLEContextANGLE", P(gl::GetTexLevelParameterfvANGLEContextANGLE)},
{"glGetTexLevelParameterfvContextANGLE", P(gl::GetTexLevelParameterfvContextANGLE)},
{"glGetTexLevelParameterfvRobustANGLE", P(gl::GetTexLevelParameterfvRobustANGLE)},
{"glGetTexLevelParameterfvRobustANGLEContextANGLE",
P(gl::GetTexLevelParameterfvRobustANGLEContextANGLE)},
{"glGetTexLevelParameteriv", P(gl::GetTexLevelParameteriv)},
{"glGetTexLevelParameterivANGLE", P(gl::GetTexLevelParameterivANGLE)},
{"glGetTexLevelParameterivANGLEContextANGLE", P(gl::GetTexLevelParameterivANGLEContextANGLE)},
{"glGetTexLevelParameterivContextANGLE", P(gl::GetTexLevelParameterivContextANGLE)},
{"glGetTexLevelParameterivRobustANGLE", P(gl::GetTexLevelParameterivRobustANGLE)},
{"glGetTexLevelParameterivRobustANGLEContextANGLE",
......@@ -1264,5 +1268,5 @@ ProcEntry g_procTable[] = {
{"glWeightPointerOES", P(gl::WeightPointerOES)},
{"glWeightPointerOESContextANGLE", P(gl::WeightPointerOESContextANGLE)}};
size_t g_numProcs = 1196;
size_t g_numProcs = 1200;
} // namespace egl
......@@ -733,7 +733,9 @@
],
"GL_ANGLE_texture_multisample": [
"glTexStorage2DMultisampleANGLE"
"glTexStorage2DMultisampleANGLE",
"glGetTexLevelParameterfvANGLE",
"glGetTexLevelParameterivANGLE"
],
"EGL 1.0": [
......
......@@ -69,6 +69,9 @@ class TextureMultisampleTest : public ANGLETest
GLsizei height,
GLboolean fixedsamplelocations);
void getTexLevelParameterfv(GLenum target, GLint level, GLenum pname, GLfloat *params);
void getTexLevelParameteriv(GLenum target, GLint level, GLenum pname, GLint *params);
GLuint mFramebuffer = 0;
GLuint mTexture = 0;
......@@ -211,6 +214,37 @@ void TextureMultisampleTest::texStorageMultisample(GLenum target,
}
}
void TextureMultisampleTest::getTexLevelParameterfv(GLenum target,
GLint level,
GLenum pname,
GLfloat *params)
{
if (getClientMajorVersion() <= 3 && getClientMinorVersion() < 1 &&
ensureExtensionEnabled("GL_ANGLE_texture_multisample"))
{
glGetTexLevelParameterfvANGLE(target, level, pname, params);
}
else
{
glGetTexLevelParameterfv(target, level, pname, params);
}
}
void TextureMultisampleTest::getTexLevelParameteriv(GLenum target,
GLint level,
GLenum pname,
GLint *params)
{
if (getClientMajorVersion() <= 3 && getClientMinorVersion() < 1 &&
ensureExtensionEnabled("GL_ANGLE_texture_multisample"))
{
glGetTexLevelParameterivANGLE(target, level, pname, params);
}
else
{
glGetTexLevelParameteriv(target, level, pname, params);
}
}
// Tests that if es version < 3.1, GL_TEXTURE_2D_MULTISAMPLE is not supported in
// GetInternalformativ. Checks that the number of samples returned is valid in case of ES >= 3.1.
TEST_P(TextureMultisampleTest, MultisampleTargetGetInternalFormativBase)
......@@ -245,6 +279,7 @@ TEST_P(TextureMultisampleTest, MultisampleTargetFramebufferTexture2D)
glBindFramebuffer(GL_FRAMEBUFFER, mFramebuffer);
glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D_MULTISAMPLE,
mTexture, 0);
ASSERT_GL_NO_ERROR();
}
......@@ -321,6 +356,27 @@ TEST_P(TextureMultisampleTest, MaxDepthTextureSamples)
EXPECT_NE(std::numeric_limits<GLint>::max(), maxDepthTextureSamples);
}
// Tests that getTexLevelParameter is supported by ES 3.1 or ES 3.0 and ANGLE_texture_multisample
TEST_P(TextureMultisampleTest, GetTexLevelParameter)
{
ANGLE_SKIP_TEST_IF(lessThanES31MultisampleExtNotSupported());
glBindTexture(GL_TEXTURE_2D_MULTISAMPLE, mTexture);
texStorageMultisample(GL_TEXTURE_2D_MULTISAMPLE, 4, GL_RGBA8, 1, 1, GL_TRUE);
ASSERT_GL_NO_ERROR();
GLfloat levelSamples = 0;
getTexLevelParameterfv(GL_TEXTURE_2D_MULTISAMPLE, 0, GL_TEXTURE_SAMPLES, &levelSamples);
EXPECT_EQ(levelSamples, 4);
GLint fixedSampleLocation = false;
getTexLevelParameteriv(GL_TEXTURE_2D_MULTISAMPLE, 0, GL_TEXTURE_FIXED_SAMPLE_LOCATIONS,
&fixedSampleLocation);
EXPECT_EQ(fixedSampleLocation, 1);
ASSERT_GL_NO_ERROR();
}
// The value of sample position should be equal to standard pattern on D3D.
TEST_P(TextureMultisampleTest, CheckSamplePositions)
{
......@@ -376,16 +432,16 @@ TEST_P(TextureMultisampleTest, SimpleTexelFetch)
GLint samplesToUse = getSamplesToUse(GL_TEXTURE_2D_MULTISAMPLE_ANGLE, testFormats);
glBindTexture(GL_TEXTURE_2D_MULTISAMPLE_ANGLE, mTexture);
texStorageMultisample(GL_TEXTURE_2D_MULTISAMPLE_ANGLE, samplesToUse, GL_RGBA8, kWidth,
kHeight, GL_TRUE);
texStorageMultisample(GL_TEXTURE_2D_MULTISAMPLE_ANGLE, samplesToUse, GL_RGBA8, kWidth, kHeight,
GL_TRUE);
ASSERT_GL_NO_ERROR();
// Clear texture zero to green.
glBindFramebuffer(GL_FRAMEBUFFER, mFramebuffer);
GLColor clearColor = GLColor::green;
glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0,
GL_TEXTURE_2D_MULTISAMPLE_ANGLE, mTexture, 0);
glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D_MULTISAMPLE_ANGLE,
mTexture, 0);
GLenum status = glCheckFramebufferStatus(GL_FRAMEBUFFER);
ASSERT_GLENUM_EQ(GL_FRAMEBUFFER_COMPLETE, status);
glClearColor(clearColor.R / 255.0f, clearColor.G / 255.0f, clearColor.B / 255.0f,
......@@ -437,6 +493,15 @@ TEST_P(NegativeTextureMultisampleTest, Negtive)
GLint params = 0;
glGetTexParameteriv(GL_TEXTURE_2D_MULTISAMPLE, GL_TEXTURE_IMMUTABLE_FORMAT, &params);
ASSERT_GL_ERROR(GL_INVALID_ENUM);
GLfloat levelSamples = 0;
getTexLevelParameterfv(GL_TEXTURE_2D_MULTISAMPLE, 0, GL_TEXTURE_SAMPLES, &levelSamples);
ASSERT_GL_ERROR(GL_INVALID_OPERATION);
GLint fixedSampleLocation = false;
getTexLevelParameteriv(GL_TEXTURE_2D_MULTISAMPLE, 0, GL_TEXTURE_FIXED_SAMPLE_LOCATIONS,
&fixedSampleLocation);
ASSERT_GL_ERROR(GL_INVALID_OPERATION);
}
// Tests that GL_TEXTURE_2D_MULTISAMPLE_ARRAY is not supported in GetInternalformativ when the
......
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