src/third_party/angle/src/tests/gl_tests/S3TCTextureSizesTest.cpp
// Test DXT1 formats with POT sizes on all mips
Test DXT1 formats with POT sizes on all mips
Test DXT1 formats with POT sizes on all mips
TEST_P(S3TCTextureSizesTest, POT)
{
    ANGLE_SKIP_TEST_IF(!IsGLExtensionEnabled("GL_EXT_texture_compression_dxt1"));
    GLTexture texture;
    glBindTexture(GL_TEXTURE_2D, texture);
    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
    glUseProgram(mTextureProgram);
    glUniform1i(mTextureUniformLocation, 0);
    glCompressedTexImage2D(GL_TEXTURE_2D, 0, GL_COMPRESSED_RGBA_S3TC_DXT1_EXT, 8, 8, 0, 32,
                           k12x12DXT1Data.data());
    drawQuad(mTextureProgram, "position", 0.5f);
    EXPECT_PIXEL_COLOR_EQ(getWindowWidth() / 2, getWindowHeight() / 2, GLColor(0, 0, 123, 255));
    glCompressedTexImage2D(GL_TEXTURE_2D, 0, GL_COMPRESSED_RGBA_S3TC_DXT1_EXT, 8, 4, 0, 16,
                           k12x12DXT1Data.data());
    drawQuad(mTextureProgram, "position", 0.5f);
    EXPECT_PIXEL_COLOR_EQ(getWindowWidth() / 2, getWindowHeight() / 2, GLColor(0, 0, 123, 255));
    glCompressedTexImage2D(GL_TEXTURE_2D, 0, GL_COMPRESSED_RGBA_S3TC_DXT1_EXT, 8, 4, 0, 16,
                           k12x12DXT1Data.data());
    drawQuad(mTextureProgram, "position", 0.5f);
    EXPECT_PIXEL_COLOR_EQ(getWindowWidth() / 2, getWindowHeight() / 2, GLColor(0, 0, 123, 255));
    glCompressedTexImage2D(GL_TEXTURE_2D, 0, GL_COMPRESSED_RGBA_S3TC_DXT1_EXT, 4, 4, 0, 8,
                           k12x12DXT1Data.data());
    drawQuad(mTextureProgram, "position", 0.5f);
    EXPECT_PIXEL_COLOR_EQ(getWindowWidth() / 2, getWindowHeight() / 2, GLColor(123, 0, 0, 255));
    EXPECT_GL_NO_ERROR();
}
TEST_P ( S3TCTextureSizesTest , POT ) { ANGLE_SKIP_TEST_IF ( ! IsGLExtensionEnabled ( " " ) ) ; GLTexture texture ; glBindTexture ( GL_TEXTURE_2D , texture ) ; glTexParameteri ( GL_TEXTURE_2D , GL_TEXTURE_MIN_FILTER , GL_NEAREST ) ; glTexParameteri ( GL_TEXTURE_2D , GL_TEXTURE_MAG_FILTER , GL_NEAREST ) ; glTexParameteri ( GL_TEXTURE_2D , GL_TEXTURE_WRAP_S , GL_CLAMP_TO_EDGE ) ; glTexParameteri ( GL_TEXTURE_2D , GL_TEXTURE_WRAP_T , GL_CLAMP_TO_EDGE ) ; glUseProgram ( mTextureProgram ) ; glUniform1i ( mTextureUniformLocation , 0 ) ; glCompressedTexImage2D ( GL_TEXTURE_2D , 0 , GL_COMPRESSED_RGBA_S3TC_DXT1_EXT , 8 , 8 , 0 , 32 , k12x12DXT1Data . data ( ) ) ; drawQuad ( mTextureProgram , " " , 0.5f ) ; EXPECT_PIXEL_COLOR_EQ ( getWindowWidth ( ) / 2 , getWindowHeight ( ) / 2 , GLColor ( 0 , 0 , 123 , 255 ) ) ; glCompressedTexImage2D ( GL_TEXTURE_2D , 0 , GL_COMPRESSED_RGBA_S3TC_DXT1_EXT , 8 , 4 , 0 , 16 , k12x12DXT1Data . data ( ) ) ; drawQuad ( mTextureProgram , " " , 0.5f ) ; EXPECT_PIXEL_COLOR_EQ ( getWindowWidth ( ) / 2 , getWindowHeight ( ) / 2 , GLColor ( 0 , 0 , 123 , 255 ) ) ; glCompressedTexImage2D ( GL_TEXTURE_2D , 0 , GL_COMPRESSED_RGBA_S3TC_DXT1_EXT , 8 , 4 , 0 , 16 , k12x12DXT1Data . data ( ) ) ; drawQuad ( mTextureProgram , " " , 0.5f ) ; EXPECT_PIXEL_COLOR_EQ ( getWindowWidth ( ) / 2 , getWindowHeight ( ) / 2 , GLColor ( 0 , 0 , 123 , 255 ) ) ; glCompressedTexImage2D ( GL_TEXTURE_2D , 0 , GL_COMPRESSED_RGBA_S3TC_DXT1_EXT , 4 , 4 , 0 , 8 , k12x12DXT1Data . data ( ) ) ; drawQuad ( mTextureProgram , " " , 0.5f ) ; EXPECT_PIXEL_COLOR_EQ ( getWindowWidth ( ) / 2 , getWindowHeight ( ) / 2 , GLColor ( 123 , 0 , 0 , 255 ) ) ; EXPECT_GL_NO_ERROR ( ) ; }
Test DXT1 formats with POT sizes on all mips
Test DXT1 formats with POT sizes on all mips