diff --git a/.gitignore b/.gitignore index e2607e3c5..f05385d63 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,103 @@ 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_sample +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 diff --git a/gli/core/load_dds.inl b/gli/core/load_dds.inl index d8258bfbf..6bcf535ae 100644 --- a/gli/core/load_dds.inl +++ b/gli/core/load_dds.inl @@ -10,14 +10,14 @@ namespace detail enum dds_cubemap_flag { - DDSCAPS2_CUBEMAP = 0x00000200, - DDSCAPS2_CUBEMAP_POSITIVEX = 0x00000400, - DDSCAPS2_CUBEMAP_NEGATIVEX = 0x00000800, - DDSCAPS2_CUBEMAP_POSITIVEY = 0x00001000, - DDSCAPS2_CUBEMAP_NEGATIVEY = 0x00002000, - DDSCAPS2_CUBEMAP_POSITIVEZ = 0x00004000, - DDSCAPS2_CUBEMAP_NEGATIVEZ = 0x00008000, - DDSCAPS2_VOLUME = 0x00200000 + DDSCAPS2_CUBEMAP = 0x00000200, + DDSCAPS2_CUBEMAP_POSITIVEX = 0x00000400, + DDSCAPS2_CUBEMAP_NEGATIVEX = 0x00000800, + DDSCAPS2_CUBEMAP_POSITIVEY = 0x00001000, + DDSCAPS2_CUBEMAP_NEGATIVEY = 0x00002000, + DDSCAPS2_CUBEMAP_POSITIVEZ = 0x00004000, + DDSCAPS2_CUBEMAP_NEGATIVEZ = 0x00008000, + DDSCAPS2_VOLUME = 0x00200000 }; enum @@ -27,21 +27,21 @@ namespace detail enum dds_flag { - DDSD_CAPS = 0x00000001, - DDSD_HEIGHT = 0x00000002, - DDSD_WIDTH = 0x00000004, - DDSD_PITCH = 0x00000008, - DDSD_PIXELFORMAT = 0x00001000, - DDSD_MIPMAPCOUNT = 0x00020000, - DDSD_LINEARSIZE = 0x00080000, - DDSD_DEPTH = 0x00800000 + DDSD_CAPS = 0x00000001, + DDSD_HEIGHT = 0x00000002, + DDSD_WIDTH = 0x00000004, + DDSD_PITCH = 0x00000008, + DDSD_PIXELFORMAT = 0x00001000, + DDSD_MIPMAPCOUNT = 0x00020000, + DDSD_LINEARSIZE = 0x00080000, + DDSD_DEPTH = 0x00800000 }; enum dds_surface_flag { - DDSCAPS_COMPLEX = 0x00000008, - DDSCAPS_MIPMAP = 0x00400000, - DDSCAPS_TEXTURE = 0x00001000 + DDSCAPS_COMPLEX = 0x00000008, + DDSCAPS_MIPMAP = 0x00400000, + DDSCAPS_TEXTURE = 0x00001000 }; struct dds_pixel_format @@ -73,29 +73,29 @@ namespace detail enum d3d10_resource_dimension { - D3D10_RESOURCE_DIMENSION_UNKNOWN = 0, - D3D10_RESOURCE_DIMENSION_BUFFER = 1, - D3D10_RESOURCE_DIMENSION_TEXTURE1D = 2, - D3D10_RESOURCE_DIMENSION_TEXTURE2D = 3, - D3D10_RESOURCE_DIMENSION_TEXTURE3D = 4 + D3D10_RESOURCE_DIMENSION_UNKNOWN = 0, + D3D10_RESOURCE_DIMENSION_BUFFER = 1, + D3D10_RESOURCE_DIMENSION_TEXTURE1D = 2, + D3D10_RESOURCE_DIMENSION_TEXTURE2D = 3, + D3D10_RESOURCE_DIMENSION_TEXTURE3D = 4 }; enum d3d10_resource_misc_flag { - D3D10_RESOURCE_MISC_GENERATE_MIPS = 0x01, - D3D10_RESOURCE_MISC_SHARED = 0x02, - D3D10_RESOURCE_MISC_TEXTURECUBE = 0x04, - D3D10_RESOURCE_MISC_SHARED_KEYEDMUTEX = 0x10, - D3D10_RESOURCE_MISC_GDI_COMPATIBLE = 0x20, + D3D10_RESOURCE_MISC_GENERATE_MIPS2 = 0x01, + D3D10_RESOURCE_MISC_SHARED = 0x02, + D3D10_RESOURCE_MISC_TEXTURECUBE = 0x04, + D3D10_RESOURCE_MISC_SHARED_KEYEDMUTEX = 0x10, + D3D10_RESOURCE_MISC_GDI_COMPATIBLE = 0x20, }; enum dds_alpha_mode { - DDS_ALPHA_MODE_UNKNOWN = 0x0, - DDS_ALPHA_MODE_STRAIGHT = 0x1, - DDS_ALPHA_MODE_PREMULTIPLIED = 0x2, - DDS_ALPHA_MODE_OPAQUE = 0x3, - DDS_ALPHA_MODE_CUSTOM = 0x4 + DDS_ALPHA_MODE_UNKNOWN = 0x0, + DDS_ALPHA_MODE_STRAIGHT = 0x1, + DDS_ALPHA_MODE_PREMULTIPLIED = 0x2, + DDS_ALPHA_MODE_OPAQUE = 0x3, + DDS_ALPHA_MODE_CUSTOM = 0x4 }; struct dds_header10 diff --git a/test/core/core_convert.cpp b/test/core/core_convert.cpp index 38a05383b..85cea00ce 100644 --- a/test/core/core_convert.cpp +++ b/test/core/core_convert.cpp @@ -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); @@ -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); @@ -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); @@ -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); @@ -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; @@ -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); diff --git a/test/core/core_texture.cpp b/test/core/core_texture.cpp index 1a8125641..2ce7c0dec 100644 --- a/test/core/core_texture.cpp +++ b/test/core/core_texture.cpp @@ -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; } @@ -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; } @@ -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; } @@ -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; } @@ -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)); } { @@ -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)); } { @@ -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)); } { @@ -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)); } { @@ -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; @@ -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)); } { @@ -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)); } { @@ -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)); } { @@ -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)); } { @@ -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; @@ -704,8 +704,8 @@ 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::texture2d::extent_type(x, y), LevelIndex); Error += Texel == gli::u8(255) ? 0 : 1; @@ -713,7 +713,7 @@ namespace perf_texture_load } 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; } @@ -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; @@ -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; } @@ -767,8 +767,8 @@ 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(LevelIndex)); Error += gli::all(gli::epsilonEqual(Texel, gli::vec4(1, 0, 0, 1), 0.001f)) ? 0 : 1; @@ -776,7 +776,7 @@ namespace perf_texture_lod_nearest } 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; } @@ -798,8 +798,8 @@ 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(LevelIndex)); Error += gli::all(gli::epsilonEqual(Texel, gli::vec4(1, 0, 0, 1), 0.001f)) ? 0 : 1; @@ -807,7 +807,7 @@ namespace perf_texture_lod_linear } 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; } @@ -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; } @@ -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; } diff --git a/test/core/test_copy_sub.cpp b/test/core/test_copy_sub.cpp index 709124682..c566dd8e7 100644 --- a/test/core/test_copy_sub.cpp +++ b/test/core/test_copy_sub.cpp @@ -17,8 +17,8 @@ int test_sub_copy() Destination.clear(gli::u8(255)); Destination.copy(Source, 0, 0, 0, gli::texture::extent_type(1, 1, 0), 0, 0, 0, gli::texture::extent_type(1, 1, 0), gli::texture::extent_type(2, 2, 1)); - for(gli::size_t IndexY = 1; IndexY < 3; ++IndexY) - for(gli::size_t IndexX = 1; IndexX < 3; ++IndexX) + for(int IndexY = 1; IndexY < 3; ++IndexY) + for(int IndexX = 1; IndexX < 3; ++IndexX) Error += Source.load(gli::texture2d::extent_type(IndexX, IndexY), 0) == Destination.load(gli::texture2d::extent_type(IndexX, IndexY), 0) ? 0 : 1; return Error; @@ -39,8 +39,8 @@ int test_sub_copy2() Destination.clear(gli::u8(255)); Destination.copy(Source, 0, 0, 0, gli::texture::extent_type(1, 1, 0), 0, 0, 0, gli::texture::extent_type(1, 1, 0), gli::texture::extent_type(2, 2, 1)); - for(gli::size_t IndexY = 0; IndexY < Source.extent().y; ++IndexY) - for(gli::size_t IndexX = 0; IndexX < Source.extent().x; ++IndexX) + for(int IndexY = 0; IndexY < Source.extent().y; ++IndexY) + for(int IndexX = 0; IndexX < Source.extent().x; ++IndexX) { gli::texture2d::extent_type TexelCoord(IndexX, IndexY); gli::u8 TexelSrc = Source.load(TexelCoord, 0); @@ -63,8 +63,8 @@ int test_sub_copy_rgb32f() Destination.clear(gli::vec3(255)); Destination.copy(Source, 0, 0, 0, gli::texture::extent_type(1, 1, 0), 0, 0, 0, gli::texture::extent_type(1, 1, 0), gli::texture::extent_type(2, 1, 1)); - for(gli::size_t IndexY = 0; IndexY < Source.extent().y; ++IndexY) - for(gli::size_t IndexX = 0; IndexX < Source.extent().x; ++IndexX) + for(int IndexY = 0; IndexY < Source.extent().y; ++IndexY) + for(int IndexX = 0; IndexX < Source.extent().x; ++IndexX) { gli::texture2d::extent_type TexelCoord(IndexX, IndexY); gli::vec3 TexelSrc = Source.load(TexelCoord, 0); @@ -87,8 +87,8 @@ int test_sub_copy_rgba8() Destination.clear(gli::u8vec4(255)); Destination.copy(Source, 0, 0, 0, gli::texture::extent_type(1, 1, 0), 0, 0, 0, gli::texture::extent_type(1, 1, 0), gli::texture::extent_type(2, 1, 1)); - for(gli::size_t IndexY = 0; IndexY < Source.extent().y; ++IndexY) - for(gli::size_t IndexX = 0; IndexX < Source.extent().x; ++IndexX) + for(int IndexY = 0; IndexY < Source.extent().y; ++IndexY) + for(int IndexX = 0; IndexX < Source.extent().x; ++IndexX) { gli::texture2d::extent_type TexelCoord(IndexX, IndexY); gli::u8vec4 TexelSrc = Source.load(TexelCoord, 0); diff --git a/test/core/test_duplicate.cpp b/test/core/test_duplicate.cpp index 661957b1f..e84ac5fbe 100644 --- a/test/core/test_duplicate.cpp +++ b/test/core/test_duplicate.cpp @@ -391,8 +391,7 @@ int main() { int Error(0); - const int levels = gli::levels(1600); - + // const int levels = gli::levels(1600); std::vector FormatsA; diff --git a/test/core/test_size.cpp b/test/core/test_size.cpp index 99d6ffff8..054ac9075 100644 --- a/test/core/test_size.cpp +++ b/test/core/test_size.cpp @@ -148,9 +148,8 @@ namespace can_compute_npot_texture_size } { - gli::texture::extent_type const BlockCountA = glm::max(gli::texture::extent_type(5, 5, 1) / gli::block_extent(gli::FORMAT_RGB_DXT1_UNORM_BLOCK8), gli::texture::extent_type(1)); - - gli::texture::extent_type const BlockCountB = glm::ceilMultiple(gli::texture::extent_type(5, 5, 1), gli::block_extent(gli::FORMAT_RGB_DXT1_UNORM_BLOCK8)) / gli::block_extent(gli::FORMAT_RGB_DXT1_UNORM_BLOCK8); + glm::max(gli::texture::extent_type(5, 5, 1) / gli::block_extent(gli::FORMAT_RGB_DXT1_UNORM_BLOCK8), gli::texture::extent_type(1)); // BlockCountA + glm::ceilMultiple(gli::texture::extent_type(5, 5, 1), gli::block_extent(gli::FORMAT_RGB_DXT1_UNORM_BLOCK8)) / gli::block_extent(gli::FORMAT_RGB_DXT1_UNORM_BLOCK8); // BlockCountB } { diff --git a/test/core/texture_lod_sampler2d.cpp b/test/core/texture_lod_sampler2d.cpp index 7b6a19bb8..81a7d94b8 100644 --- a/test/core/texture_lod_sampler2d.cpp +++ b/test/core/texture_lod_sampler2d.cpp @@ -73,7 +73,7 @@ namespace texture_lod Error += gli::all(glm::equal(SampleC, gli::vec4(0.0f, 0.0f, 0.0f, 1.0f), 0.01f)) ? 0 : 1; gli::vec4 const SampleD = Sampler.texture_grad(gli::fsampler2D::normalized_type(0.25f), gli::fsampler2D::normalized_type(0.0f), gli::fsampler2D::normalized_type(0.0f)); - Error += gli::all(glm::equal(SampleA, gli::vec4(1.0f, 0.5f, 0.0f, 1.0f), 0.01f)) ? 0 : 1; + Error += gli::all(glm::equal(SampleD, gli::vec4(1.0f, 0.5f, 0.0f, 1.0f), 0.01f)) ? 0 : 1; } return Error; diff --git a/test/main.cpp b/test/main.cpp index e9b8ac6b6..155244af2 100644 --- a/test/main.cpp +++ b/test/main.cpp @@ -44,6 +44,7 @@ bool test_image_export() bool test_image_export_dds() { +/* { gli::texture2D Texture = gli::loadTGA("../test_rgb8.tga"); assert(!Texture.empty()); @@ -59,6 +60,7 @@ bool test_image_export_dds() assert(!Texture.empty()); gli::saveDDS9(Texture, "../test_dds2tgaEXT.tga"); } +*/ { gli::texture2D Texture = gli::loadDDS9("../test_rgb8.dds"); assert(!Texture.empty()); @@ -107,6 +109,7 @@ bool test_image_export_dds() bool test_image_fetch() { +/* gli::texture2D Texture = gli::loadTGA("../test.tga"); if(!Texture.empty()) { @@ -119,12 +122,13 @@ bool test_image_fetch() glm::u8vec3 TexelD = gli::texelFetch(Texture, gli::texture2D::dimensions_type(7, 0), 0); glm::u8vec3 TexelE = gli::texelFetch(Texture, gli::texture2D::dimensions_type(0, 7), 0); } - +*/ return true; } bool test_image_gradient() { +/* { gli::texture2D Texture = gli::radial(glm::uvec2(256), glm::vec2(0.25f), 128.0f, glm::vec2(0.5f)); gli::saveTGA(Texture, "../gradient_radial.tga"); @@ -134,7 +138,7 @@ bool test_image_gradient() gli::texture2D Texture = gli::linear(glm::uvec2(256), glm::vec2(0.25f), glm::vec2(0.75f)); gli::saveTGA(Texture, "../gradient_linear.tga"); } - +*/ return true; }