Path: blob/main_old/src/tests/gles1_conformance_tests/CovglTests.cpp
1693 views
//1// Copyright 2020 The ANGLE Project Authors. All rights reserved.2// Use of this source code is governed by a BSD-style license that can be3// found in the LICENSE file.4//5// CovglTests.cpp:6// GLES1 conformance covgl tests.7// Function prototypes taken from tproto.h and turned into gtest tests using a macro.8//910#include "test_utils/ANGLETest.h"11#include "test_utils/gl_raii.h"1213#ifdef __cplusplus14extern "C" {15#endif1617#if !defined(GL_OES_VERSION_1_1) && defined(GL_VERSION_ES_CM_1_1) && defined(GL_VERSION_ES_CL_1_1)18# if GL_VERSION_ES_CM_1_1 || GL_VERSION_ES_CL_1_119# define GL_OES_VERSION_1_120# endif21#endif2223// ES 1.024extern void StateReset(void);25extern void ProbeError(void (*)(void));26extern GLboolean tkCheckExtension(const char *name);2728extern void CallActiveTexture(void);29extern void CallAlphaFunc(void);30extern void CallBlendFunc(void);31extern void CallBindDeleteTexture(void);32extern void CallClear(void);33extern void CallClearColor(void);34extern void CallClearDepth(void);35extern void CallClearStencil(void);36extern void CallClientActiveTexture(void);37extern void CallColor(void);38extern void CallColorMask(void);39extern void CallColorPointer(void);40extern void CallCompressedTexImage2D(void);41extern void CallCompressedTexSubImage2D(void);42extern void CallCopyTexImage2D(void);43extern void CallCopyTexSubImage2D(void);44extern void CallCullFace(void);45extern void CallDepthFunc(void);46extern void CallDepthMask(void);47extern void CallDepthRange(void);48extern void CallDrawArrays(void);49extern void CallDrawElements(void);5051#ifdef GL_OES_draw_texture52extern void CallDrawTex(void);53#endif /* GL_OES_draw_texture */5455extern void CallEdgeFlag(void);56extern void CallEnableDisable(void);57extern void CallEnableDisableClientState(void);58extern void CallFinish(void);59extern void CallFlush(void);60extern void CallFog(void);61extern void CallFrontFace(void);62extern void CallFrustum(void);63extern void CallGenTextures(void);64extern void CallGet(void);65extern void CallGetError(void);66extern void CallGetString(void);67#ifdef GL_OES_VERSION_1_168extern void CallGetTexEnv(void);69extern void CallGetLight(void);70extern void CallGetMaterial(void);71extern void CallGetClipPlane(void);72extern void CallGetPointer(void);73#endif /* GL_OES_VERSION_1_1 */7475#ifdef GL_OES_VERSION_1_176extern void CallGetBufferParameter(void);77extern void CallGetTexParameter(void);78#endif /* GL_OES_VERSION_1_1 */7980extern void CallHint(void);81extern void CallLight(void);82extern void CallLightModel(void);83extern void CallLineWidth(void);84extern void CallLoadIdentity(void);85extern void CallLoadMatrix(void);86extern void CallLogicOp(void);87extern void CallMaterial(void);88extern void CallMatrixMode(void);89extern void CallMultiTexCoord(void);90extern void CallMultMatrix(void);91extern void CallNormal(void);92extern void CallNormalPointer(void);93extern void CallOrtho(void);94extern void CallPixelStore(void);95#ifdef GL_OES_VERSION_1_196extern void CallPointParameter(void);97#endif /* GL_OES_VERSION_1_1 */98extern void CallPointSize(void);99extern void CallPolygonOffset(void);100extern void CallPopMatrix(void);101extern void CallPushMatrix(void);102extern void CallReadPixels(void);103extern void CallRotate(void);104extern void CallSampleCoverage(void);105extern void CallScale(void);106extern void CallScissor(void);107extern void CallShadeModel(void);108extern void CallStencilFunc(void);109extern void CallStencilMask(void);110extern void CallStencilOp(void);111#ifdef GL_OES_VERSION_1_1112extern void CallIsTexture(void);113extern void CallIsEnabled(void);114#endif /* GL_OES_VERSION_1_1 */115extern void CallTexCoord(void);116extern void CallTexCoordPointer(void);117extern void CallTexEnv(void);118extern void CallTexImage2D(void);119extern void CallTexParameter(void);120extern void CallTexSubImage2D(void);121extern void CallTranslate(void);122extern void CallVertexPointer(void);123extern void CallViewport(void);124125#ifdef GL_OES_VERSION_1_1126extern void CallBindDeleteBuffer(void);127extern void CallBufferData(void);128extern void CallBufferSubData(void);129extern void CallGenBuffers(void);130extern void CallIsBuffer(void);131extern void CallPointSizePointerOES(void);132extern void CallClipPlane(void);133#endif /* GL_OES_VERSION_1_1 */134135#ifdef GL_OES_matrix_palette136extern void CallCurrentPaletteMatrixOES(void);137extern void CallLoadPaletteFromModelViewMatrixOES(void);138extern void CallMatrixIndexPointerOES(void);139extern void CallWeightPointerOES(void);140#endif /* GL_OES_matrix_palette */141142#ifdef GL_OES_query_matrix143extern void CallQueryMatrix(void);144#endif145146void ProbeEnumANGLE(void)147{148ASSERT_GL_NO_ERROR();149}150151#ifdef __cplusplus152}153154#endif155156namespace angle157{158class GLES1CovglTest : public ANGLETest159{160protected:161GLES1CovglTest()162{163setWindowWidth(48);164setWindowHeight(48);165setConfigRedBits(8);166setConfigGreenBits(8);167setConfigBlueBits(8);168setConfigAlphaBits(8);169setConfigDepthBits(24);170setConfigStencilBits(8);171}172173void testSetUp() override174{175StateReset();176glViewport(0, 0, 48, 48);177glScissor(0, 0, 48, 48);178}179};180181TEST_P(GLES1CovglTest, Get)182{183ProbeError(CallGet);184}185186TEST_P(GLES1CovglTest, GetError)187{188ProbeError(CallGetError);189}190TEST_P(GLES1CovglTest, GetString)191{192ProbeError(CallGetString);193}194195#ifdef GL_OES_VERSION_1_1196TEST_P(GLES1CovglTest, GetTexEnv)197{198ProbeError(CallGetTexEnv);199}200TEST_P(GLES1CovglTest, GetLight)201{202ProbeError(CallGetLight);203}204TEST_P(GLES1CovglTest, GetMaterial)205{206ProbeError(CallGetMaterial);207}208TEST_P(GLES1CovglTest, GetClipPlane)209{210ProbeError(CallGetClipPlane);211}212TEST_P(GLES1CovglTest, GetPointer)213{214ProbeError(CallGetPointer);215}216TEST_P(GLES1CovglTest, GetTexParameter)217{218ProbeError(CallGetTexParameter);219}220TEST_P(GLES1CovglTest, GetBufferParameter)221{222ProbeError(CallGetBufferParameter);223}224#endif /* GL_OES_VERSION_1_1 */225226TEST_P(GLES1CovglTest, EnableDisable)227{228ProbeError(CallEnableDisable);229}230231TEST_P(GLES1CovglTest, Hint)232{233ProbeError(CallHint);234}235236TEST_P(GLES1CovglTest, Viewport)237{238ProbeError(CallViewport);239}240TEST_P(GLES1CovglTest, Ortho)241{242ProbeError(CallOrtho);243}244TEST_P(GLES1CovglTest, Frustum)245{246ProbeError(CallFrustum);247}248TEST_P(GLES1CovglTest, Scissor)249{250ProbeError(CallScissor);251}252253TEST_P(GLES1CovglTest, LoadIdentity)254{255ProbeError(CallLoadIdentity);256}257TEST_P(GLES1CovglTest, MatrixMode)258{259ProbeError(CallMatrixMode);260}261TEST_P(GLES1CovglTest, PushMatrix)262{263ProbeError(CallPushMatrix);264}265TEST_P(GLES1CovglTest, LoadMatrix)266{267ProbeError(CallLoadMatrix);268}269TEST_P(GLES1CovglTest, MultMatrix)270{271ProbeError(CallMultMatrix);272}273TEST_P(GLES1CovglTest, Rotate)274{275ProbeError(CallRotate);276}277TEST_P(GLES1CovglTest, Scale)278{279ProbeError(CallScale);280}281TEST_P(GLES1CovglTest, Translate)282{283ProbeError(CallTranslate);284}285TEST_P(GLES1CovglTest, PopMatrix)286{287ProbeError(CallPopMatrix);288}289290TEST_P(GLES1CovglTest, Clear)291{292ProbeError(CallClear);293}294TEST_P(GLES1CovglTest, ClearColor)295{296ProbeError(CallClearColor);297}298TEST_P(GLES1CovglTest, ClearDepth)299{300ProbeError(CallClearDepth);301}302TEST_P(GLES1CovglTest, ClearStencil)303{304ProbeError(CallClearStencil);305}306307TEST_P(GLES1CovglTest, ColorMask)308{309ProbeError(CallColorMask);310}311TEST_P(GLES1CovglTest, Color)312{313ProbeError(CallColor);314}315316TEST_P(GLES1CovglTest, Normal)317{318ProbeError(CallNormal);319}320321TEST_P(GLES1CovglTest, AlphaFunc)322{323ProbeError(CallAlphaFunc);324}325TEST_P(GLES1CovglTest, BlendFunc)326{327ProbeError(CallBlendFunc);328}329TEST_P(GLES1CovglTest, DepthFunc)330{331ProbeError(CallDepthFunc);332}333TEST_P(GLES1CovglTest, DepthMask)334{335ProbeError(CallDepthMask);336}337TEST_P(GLES1CovglTest, DepthRange)338{339ProbeError(CallDepthRange);340}341TEST_P(GLES1CovglTest, LogicOp)342{343ProbeError(CallLogicOp);344}345TEST_P(GLES1CovglTest, StencilFunc)346{347ProbeError(CallStencilFunc);348}349TEST_P(GLES1CovglTest, StencilMask)350{351ProbeError(CallStencilMask);352}353TEST_P(GLES1CovglTest, StencilOp)354{355ProbeError(CallStencilOp);356}357358TEST_P(GLES1CovglTest, PixelStore)359{360ProbeError(CallPixelStore);361}362TEST_P(GLES1CovglTest, ReadPixels)363{364ProbeError(CallReadPixels);365}366367TEST_P(GLES1CovglTest, Fog)368{369ProbeError(CallFog);370}371TEST_P(GLES1CovglTest, LightModel)372{373ProbeError(CallLightModel);374}375TEST_P(GLES1CovglTest, Light)376{377ProbeError(CallLight);378}379TEST_P(GLES1CovglTest, Material)380{381ProbeError(CallMaterial);382}383384#ifdef GL_OES_VERSION_1_1385TEST_P(GLES1CovglTest, IsTexture)386{387ProbeError(CallIsTexture);388}389TEST_P(GLES1CovglTest, IsEnabled)390{391ProbeError(CallIsEnabled);392}393#endif /* GL_OES_VERSION_1_1 */394395TEST_P(GLES1CovglTest, TexEnv)396{397ProbeError(CallTexEnv);398}399TEST_P(GLES1CovglTest, TexParameter)400{401ProbeError(CallTexParameter);402}403TEST_P(GLES1CovglTest, TexImage2D)404{405ProbeError(CallTexImage2D);406}407TEST_P(GLES1CovglTest, TexSubImage2D)408{409ProbeError(CallTexSubImage2D);410}411TEST_P(GLES1CovglTest, GenTextures)412{413ProbeError(CallGenTextures);414}415TEST_P(GLES1CovglTest, BindDeleteTexture)416{417ProbeError(CallBindDeleteTexture);418}419TEST_P(GLES1CovglTest, CopyTexImage2D)420{421ProbeError(CallCopyTexImage2D);422}423TEST_P(GLES1CovglTest, CopyTexSubImage2D)424{425ProbeError(CallCopyTexSubImage2D);426}427TEST_P(GLES1CovglTest, CompressedTexImage2D)428{429ProbeError(CallCompressedTexImage2D);430}431TEST_P(GLES1CovglTest, CompressedTexSubImage2D)432{433ProbeError(CallCompressedTexSubImage2D);434}435436#ifdef GL_OES_VERSION_1_1437TEST_P(GLES1CovglTest, BindDeleteBuffer)438{439ProbeError(CallBindDeleteBuffer);440}441TEST_P(GLES1CovglTest, IsBuffer)442{443ProbeError(CallIsBuffer);444}445TEST_P(GLES1CovglTest, BufferData)446{447ProbeError(CallBufferData);448}449TEST_P(GLES1CovglTest, BufferSubData)450{451ProbeError(CallBufferSubData);452}453TEST_P(GLES1CovglTest, GenBuffers)454{455ProbeError(CallGenBuffers);456}457#endif /* GL_OES_VERSION_1_1 */458459TEST_P(GLES1CovglTest, ShadeModel)460{461ProbeError(CallShadeModel);462}463TEST_P(GLES1CovglTest, PointSize)464{465ProbeError(CallPointSize);466}467TEST_P(GLES1CovglTest, LineWidth)468{469ProbeError(CallLineWidth);470}471TEST_P(GLES1CovglTest, CullFace)472{473ProbeError(CallCullFace);474}475TEST_P(GLES1CovglTest, FrontFace)476{477ProbeError(CallFrontFace);478}479TEST_P(GLES1CovglTest, PolygonOffset)480{481ProbeError(CallPolygonOffset);482}483484#ifdef GL_OES_VERSION_1_1485TEST_P(GLES1CovglTest, PointParameter)486{487ProbeError(CallPointParameter);488}489#endif /* GL_OES_VERSION_1_1 */490491TEST_P(GLES1CovglTest, Flush)492{493ProbeError(CallFlush);494}495TEST_P(GLES1CovglTest, Finish)496{497ProbeError(CallFinish);498}499500TEST_P(GLES1CovglTest, ColorPointer)501{502ProbeError(CallColorPointer);503}504TEST_P(GLES1CovglTest, DrawArrays)505{506ProbeError(CallDrawArrays);507}508TEST_P(GLES1CovglTest, DrawElements)509{510ProbeError(CallDrawElements);511}512#ifdef GL_OES_draw_texture513TEST_P(GLES1CovglTest, DrawTex)514{515ANGLE_SKIP_TEST_IF(!tkCheckExtension("GL_OES_draw_texture"));516517ProbeError(CallDrawTex);518}519#endif /*GL_OES_draw_texture */520TEST_P(GLES1CovglTest, NormalPointer)521{522ProbeError(CallNormalPointer);523}524TEST_P(GLES1CovglTest, TexCoordPointer)525{526ProbeError(CallTexCoordPointer);527}528TEST_P(GLES1CovglTest, VertexPointer)529{530ProbeError(CallVertexPointer);531}532#ifdef GL_OES_VERSION_1_1533TEST_P(GLES1CovglTest, PointSizePointerOES)534{535ProbeError(CallPointSizePointerOES);536}537#endif538TEST_P(GLES1CovglTest, EnableDisableClientState)539{540ProbeError(CallEnableDisableClientState);541}542543TEST_P(GLES1CovglTest, ActiveTexture)544{545ProbeError(CallActiveTexture);546}547TEST_P(GLES1CovglTest, ClientActiveTexture)548{549ProbeError(CallClientActiveTexture);550}551TEST_P(GLES1CovglTest, MultiTexCoord)552{553ProbeError(CallMultiTexCoord);554}555556TEST_P(GLES1CovglTest, SampleCoverage)557{558ProbeError(CallSampleCoverage);559}560561#ifdef GL_OES_query_matrix562TEST_P(GLES1CovglTest, QueryMatrix)563{564ANGLE_SKIP_TEST_IF(!tkCheckExtension("GL_OES_query_matrix"));565ProbeError(CallQueryMatrix);566}567#endif568569#ifdef GL_OES_matrix_palette570TEST_P(GLES1CovglTest, CurrentPaletteMatrixOES)571{572ANGLE_SKIP_TEST_IF(!tkCheckExtension("GL_OES_matrix_palette"));573ProbeError(CallCurrentPaletteMatrixOES);574}575TEST_P(GLES1CovglTest, LoadPaletteFromModelViewMatrixOES)576{577ANGLE_SKIP_TEST_IF(!tkCheckExtension("GL_OES_matrix_palette"));578ProbeError(CallLoadPaletteFromModelViewMatrixOES);579}580TEST_P(GLES1CovglTest, MatrixIndexPointerOES)581{582ANGLE_SKIP_TEST_IF(!tkCheckExtension("GL_OES_matrix_palette"));583ProbeError(CallMatrixIndexPointerOES);584}585TEST_P(GLES1CovglTest, WeightPointerOES)586{587ANGLE_SKIP_TEST_IF(!tkCheckExtension("GL_OES_matrix_palette"));588ProbeError(CallWeightPointerOES);589}590#endif591592#ifdef GL_OES_VERSION_1_1593TEST_P(GLES1CovglTest, ClipPlane)594{595ProbeError(CallClipPlane);596}597#endif598599ANGLE_INSTANTIATE_TEST(GLES1CovglTest, ES1_OPENGL(), ES1_VULKAN());600} // namespace angle601602// Included here to fix a compile error due to white box tests using angle_end2end_tests_main.603void RegisterContextCompatibilityTests() {}604605606