Skip to content

Commit

Permalink
fix warnings and add gitignores
Browse files Browse the repository at this point in the history
  • Loading branch information
Jon Daniel committed Dec 19, 2023
1 parent eae7923 commit 63df88b
Show file tree
Hide file tree
Showing 7 changed files with 145 additions and 48 deletions.
99 changes: 99 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,102 @@ build/
*~
*.swp
*.swo
CMakeCache.txt
cmake_install.cmake
test/cmake_install.cmake
test/core/cmake_install.cmake
install_manifest.txt
CTestTestfile.cmake
test/CTestTestfile.cmake
test/core/CTestTestfile.cmake
Makefile
test/Makefile
test/core/Makefile
test/bug/Makefile
gli/Makefile
gliConfig.cmake
gliTargets.cmake
gliVersion.cmake
CMakeFiles/
gli/CMakeFiles/
gli/gli_dummy
test/bug/CMakeFiles/
test/bug/test-bug
test/core/CMakeFiles/
test/core/test-core_convert
test/core/test-texture_lod_sampler2d_array
test/core/test-texture_lod_sampler_cube
test/core/test-texture_lod_sampler2d
test/core/test-texture_lod_sampler_cube_array
test/core/test-texture_lod_sampler3d
test/core/test-texture_lod_sampler1d_array
test/core/test-texture_lod_sampler1d
test/core/test-core_sampler_texel
test/core/test-core_texture
test/core/test-generate_mipmaps_sampler2d_array
test/core/test-generate_mipmaps_sampler2d
test/core/test-generate_mipmaps_sampler_cube
test/core/test-generate_mipmaps_sampler3d
test/core/test-generate_mipmaps_sampler1d_array
test/core/test-generate_mipmaps_sampler1d
test/core/test-generate_mipmaps_sampler_cube_array
test/core/test-core_sampler_clear
test/core/test-core_filter_2d
test/core/test-core_filter_3d
test/core/test-core_sampler_wrap
test/core/test-core_filter_1d
test/core/test-convert_sampler2d_array
test/core/test-convert_sampler1d
test/core/test-convert_sampler1d_array
test/core/test-convert_sampler_cube_array
test/core/test-convert_sampler2d
test/core/test-convert_sampler3d
test/core/test-convert_sampler_cube
test/core/test-core_texture_cube_array
test/core/test-core_texture_2d_array
test/core/test-core_texture_2d
test/core/test-core_texture_cube
test/core/test-core_texture_3d
test/core/test-core_texture_1d_array
test/core/test-core_texture_1d
test/core/test-core_clear
test/core/test-core_fetch
test/core/test-core_comparison
test/core/test-core_load
test/core/test-test_view
test/core/test-core_save
test/core/test-test_duplicate
test/core/test-core_convert_access
test/core/test-core_load_dds
test/core/test-core_load_gen_1d
test/core/test-core_load_gen_1d_array
test/core/test-core_load_gen_rect
test/core/test-core_load_gen_3d
test/core/test-core_load_gen_2d_array
test/core/test-core_load_gen_cube_array
test/core/test-core_load_gen_2d
test/core/test-core_load_gen_cube
test/core/test-core_load_ktx
test/core/test-test_copy
test/core/test-transform
test/core/test-core_flip
test/core/test-reduce
test/core/test-test_make_texture
test/core/test-core_swizzle
test/core/test-test_copy_sub
test/core/test-core
test/core/test-gl
test/core/test-test_size
test/core/test-core_addressing
test/core/test-core_image
test/core/test-core_storage
test/core/test-core_format
test/core/test2d.dds
test/core/test2d.kmg
test/core/test2d.ktx
test/core/test2d_array.dds
test/core/test2d_array.kmg
test/core/test2d_array.ktx
test/core/test3d.dds
test/core/test3d.kmg
test/core/test3d.ktx
12 changes: 6 additions & 6 deletions test/core/core_convert.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ namespace rgba_dxt1unorm

// Test converting through the convertFunc interface
// sampling at the corners of each level
for(int Level = 0; Level < TextureDecompressed.levels(); ++Level)
for(gli::texture::size_type Level = 0; Level < TextureDecompressed.levels(); ++Level)
{
gli::extent2d TexelCoord;
gli::extent2d LevelExtent = TextureDecompressed.extent(Level);
Expand Down Expand Up @@ -425,7 +425,7 @@ namespace rgba_dxt3unorm

// Test converting through the convertFunc interface
// sampling at the corners of each level
for(int Level = 0; Level < TextureDecompressed.levels(); ++Level)
for(gli::texture::size_type Level = 0; Level < TextureDecompressed.levels(); ++Level)
{
gli::extent2d TexelCoord;
gli::extent2d LevelExtent = TextureDecompressed.extent(Level);
Expand Down Expand Up @@ -518,7 +518,7 @@ namespace rgba_dxt5unorm

// Test converting through the convertFunc interface
// sampling at the corners of each level
for(int Level = 0; Level < TextureDecompressed.levels(); ++Level)
for(gli::texture::size_type Level = 0; Level < TextureDecompressed.levels(); ++Level)
{
gli::extent2d TexelCoord;
gli::extent2d LevelExtent = TextureDecompressed.extent(Level);
Expand Down Expand Up @@ -612,7 +612,7 @@ namespace r_bc4unorm

// Test converting through the convertFunc interface
// sampling at the corners of each level
for(int Level = 0; Level < TextureDecompressed.levels(); ++Level)
for(gli::texture::size_type Level = 0; Level < TextureDecompressed.levels(); ++Level)
{
gli::extent2d TexelCoord;
gli::extent2d LevelExtent = TextureDecompressed.extent(Level);
Expand Down Expand Up @@ -680,7 +680,7 @@ namespace rg_bc5unorm
uint32_t offByAlot = 0;
uint32_t onPoint = 0;

for(size_t Level = 0; Level < TextureCompressed.levels(); ++Level)
for(gli::texture::size_type Level = 0; Level < TextureCompressed.levels(); ++Level)
{
gli::extent2d TexelCoord;
gli::extent2d BlockCoord;
Expand Down Expand Up @@ -724,7 +724,7 @@ namespace rg_bc5unorm

// Test converting through the convertFunc interface
// sampling at the corners of each level
for(int Level = 0; Level < TextureDecompressed.levels(); ++Level)
for(gli::texture::size_type Level = 0; Level < TextureDecompressed.levels(); ++Level)
{
gli::extent2d TexelCoord;
gli::extent2d LevelExtent = TextureDecompressed.extent(Level);
Expand Down
56 changes: 28 additions & 28 deletions test/core/core_texture.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ namespace perf_generic_creation
}

std::clock_t TimeEnd = std::clock();
printf("Generic texture creation performance test: %d\n", TimeEnd - TimeBegin);
printf("Generic texture creation performance test: %f\n", difftime(TimeEnd, TimeBegin));

return Error;
}
Expand All @@ -394,7 +394,7 @@ namespace perf_2d_array_creation
}

std::clock_t TimeEnd = std::clock();
printf("2D array texture creation performance test: %d\n", TimeEnd - TimeBegin);
printf("2D array texture creation performance test: %f\n", difftime(TimeEnd, TimeBegin));

return Error;
}
Expand All @@ -416,7 +416,7 @@ namespace perf_2d_creation
}

std::clock_t TimeEnd = std::clock();
printf("2D texture creation performance test: %d\n", TimeEnd - TimeBegin);
printf("2D texture creation performance test: %f\n", difftime(TimeEnd, TimeBegin));

return Error;
}
Expand All @@ -438,7 +438,7 @@ namespace perf_cube_array_creation
}

std::clock_t TimeEnd = std::clock();
printf("Cube array texture creation performance test: %d\n", TimeEnd - TimeBegin);
printf("Cube array texture creation performance test: %f\n", difftime(TimeEnd, TimeBegin));

return Error;
}
Expand Down Expand Up @@ -473,7 +473,7 @@ namespace perf_cube_array_access

std::clock_t TimeEnd = std::clock();

printf("Cube array texture data access performance test: %d\n", TimeEnd - TimeBegin);
printf("Cube array texture data access performance test: %f\n", difftime(TimeEnd, TimeBegin));
}

{
Expand All @@ -492,7 +492,7 @@ namespace perf_cube_array_access

std::clock_t TimeEnd = std::clock();

printf("Cube array texture size performance test: %d\n", TimeEnd - TimeBegin);
printf("Cube array texture size performance test: %f\n", difftime(TimeEnd, TimeBegin));
}

{
Expand All @@ -512,7 +512,7 @@ namespace perf_cube_array_access

std::clock_t TimeEnd = std::clock();

printf("Cube array texture extent access performance test: %d\n", TimeEnd - TimeBegin);
printf("Cube array texture extent access performance test: %f\n", difftime(TimeEnd, TimeBegin));
}

{
Expand All @@ -535,7 +535,7 @@ namespace perf_cube_array_access

std::clock_t TimeEnd = std::clock();

printf("Cube array texture extent and size access performance test: %d\n", TimeEnd - TimeBegin);
printf("Cube array texture extent and size access performance test: %f\n", difftime(TimeEnd, TimeBegin));
}

{
Expand All @@ -560,7 +560,7 @@ namespace perf_cube_array_access

std::clock_t TimeEnd = std::clock();

printf("Cube array texture all access performance test: %d\n", TimeEnd - TimeBegin);
printf("Cube array texture all access performance test: %f\n", difftime(TimeEnd, TimeBegin));
}

return Error;
Expand Down Expand Up @@ -596,7 +596,7 @@ namespace perf_texture2d_access

std::clock_t TimeEnd = std::clock();

printf("2d texture data access performance test: %d\n", TimeEnd - TimeBegin);
printf("2d texture data access performance test: %f\n", difftime(TimeEnd, TimeBegin));
}

{
Expand All @@ -615,7 +615,7 @@ namespace perf_texture2d_access

std::clock_t TimeEnd = std::clock();

printf("2d texture size performance test: %d\n", TimeEnd - TimeBegin);
printf("2d texture size performance test: %f\n", difftime(TimeEnd, TimeBegin));
}

{
Expand All @@ -635,7 +635,7 @@ namespace perf_texture2d_access

std::clock_t TimeEnd = std::clock();

printf("2d texture extent access performance test: %d\n", TimeEnd - TimeBegin);
printf("2d texture extent access performance test: %f\n", difftime(TimeEnd, TimeBegin));
}

{
Expand All @@ -658,7 +658,7 @@ namespace perf_texture2d_access

std::clock_t TimeEnd = std::clock();

printf("2d texture extent and size access performance test: %d\n", TimeEnd - TimeBegin);
printf("2d texture extent and size access performance test: %f\n", difftime(TimeEnd, TimeBegin));
}

{
Expand All @@ -683,7 +683,7 @@ namespace perf_texture2d_access

std::clock_t TimeEnd = std::clock();

printf("2d texture all access performance test: %d\n", TimeEnd - TimeBegin);
printf("2d texture all access performance test: %f\n", difftime(TimeEnd, TimeBegin));
}

return Error;
Expand All @@ -704,16 +704,16 @@ namespace perf_texture_load
for(gli::texture2d::size_type LevelIndex = 0, LevelCount = Texture.levels(); LevelIndex < LevelCount; ++LevelIndex)
{
gli::texture2d::extent_type const Extent = Texture.extent(LevelIndex);
for(gli::size_t y = 0; y < Extent.y; ++y)
for(gli::size_t x = 0; x < Extent.x; ++x)
for(int y = 0; y < Extent.y; ++y)
for(int x = 0; x < Extent.x; ++x)
{
gli::u8 Texel = Texture.load<gli::u8>(gli::texture2d::extent_type(x, y), LevelIndex);
Error += Texel == gli::u8(255) ? 0 : 1;
}
}

std::clock_t TimeEnd = std::clock();
printf("2D texture load performance test: %d\n", TimeEnd - TimeBegin);
printf("2D texture load performance test: %f\n", difftime(TimeEnd, TimeBegin));

return Error;
}
Expand All @@ -735,8 +735,8 @@ namespace perf_texture_fetch
for(gli::texture2d::size_type LevelIndex = 0, LevelCount = Texture.levels(); LevelIndex < LevelCount; ++LevelIndex)
{
gli::texture2d::extent_type const Extent = Texture.extent(LevelIndex);
for(gli::size_t y = 0; y < Extent.y; ++y)
for(gli::size_t x = 0; x < Extent.x; ++x)
for(int y = 0; y < Extent.y; ++y)
for(int x = 0; x < Extent.x; ++x)
{
gli::vec4 const& Texel = Sampler.texel_fetch(gli::texture2d::extent_type(x, y), LevelIndex);
Error += gli::all(gli::epsilonEqual(Texel, gli::vec4(1, 0, 0, 1), 0.001f)) ? 0 : 1;
Expand All @@ -745,7 +745,7 @@ namespace perf_texture_fetch
}

std::clock_t TimeEnd = std::clock();
printf("2D texture fetch performance test: %d\n", TimeEnd - TimeBegin);
printf("2D texture fetch performance test: %f\n", difftime(TimeEnd, TimeBegin));

return Error;
}
Expand All @@ -767,16 +767,16 @@ namespace perf_texture_lod_nearest
for(gli::texture2d::size_type LevelIndex = 0, LevelCount = Texture.levels(); LevelIndex < LevelCount; ++LevelIndex)
{
gli::texture2d::extent_type const Extent = Texture.extent(LevelIndex);
for(gli::size_t y = 0; y < Extent.y; ++y)
for(gli::size_t x = 0; x < Extent.x; ++x)
for(int y = 0; y < Extent.y; ++y)
for(int x = 0; x < Extent.x; ++x)
{
gli::vec4 const& Texel = Sampler.texture_lod(glm::vec2(x, y) / glm::vec2(Extent), static_cast<float>(LevelIndex));
Error += gli::all(gli::epsilonEqual(Texel, gli::vec4(1, 0, 0, 1), 0.001f)) ? 0 : 1;
}
}

std::clock_t TimeEnd = std::clock();
printf("2D texture lod nearest performance test: %d\n", TimeEnd - TimeBegin);
printf("2D texture lod nearest performance test: %f\n", difftime(TimeEnd, TimeBegin));

return Error;
}
Expand All @@ -798,16 +798,16 @@ namespace perf_texture_lod_linear
for(gli::texture2d::size_type LevelIndex = 0, LevelCount = Texture.levels(); LevelIndex < LevelCount; ++LevelIndex)
{
gli::texture2d::extent_type const Extent = Texture.extent(LevelIndex);
for(gli::size_t y = 0; y < Extent.y; ++y)
for(gli::size_t x = 0; x < Extent.x; ++x)
for(int y = 0; y < Extent.y; ++y)
for(int x = 0; x < Extent.x; ++x)
{
gli::vec4 const& Texel = Sampler.texture_lod(glm::vec2(x, y) / glm::vec2(Extent), static_cast<float>(LevelIndex));
Error += gli::all(gli::epsilonEqual(Texel, gli::vec4(1, 0, 0, 1), 0.001f)) ? 0 : 1;
}
}

std::clock_t TimeEnd = std::clock();
printf("2D texture lod linear performance test: %d\n", TimeEnd - TimeBegin);
printf("2D texture lod linear performance test: %f\n", difftime(TimeEnd, TimeBegin));

return Error;
}
Expand All @@ -829,7 +829,7 @@ namespace perf_generate_mipmaps_nearest

std::clock_t TimeEnd = std::clock();

printf("2D texture generate mipmaps nearest performance test: %d\n", TimeEnd - TimeBegin);
printf("2D texture generate mipmaps nearest performance test: %f\n", difftime(TimeEnd, TimeBegin));

return Error;
}
Expand All @@ -851,7 +851,7 @@ namespace perf_generate_mipmaps_linear

std::clock_t TimeEnd = std::clock();

printf("2D texture generate mipmaps linear performance test: %d\n", TimeEnd - TimeBegin);
printf("2D texture generate mipmaps linear performance test: %f\n", difftime(TimeEnd, TimeBegin));

return Error;
}
Expand Down
Loading

0 comments on commit 63df88b

Please sign in to comment.