Move OpenGL texture upload mapping
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
#include "test_harness.h"
|
||||
|
||||
#include <array>
|
||||
#include <cstdint>
|
||||
#include <string_view>
|
||||
|
||||
namespace {
|
||||
@@ -68,6 +69,21 @@ void ignores_gles_texture_extensions_for_webgl_runtime(pp::tests::Harness& h)
|
||||
PP_EXPECT(h, !capabilities.float16_textures);
|
||||
}
|
||||
|
||||
void selects_texture_upload_type_from_internal_format(pp::tests::Harness& h)
|
||||
{
|
||||
constexpr std::uint32_t gl_unsigned_byte = 0x1401U;
|
||||
constexpr std::uint32_t gl_float = 0x1406U;
|
||||
constexpr std::uint32_t gl_half_float = 0x140BU;
|
||||
constexpr std::uint32_t gl_rgba8 = 0x8058U;
|
||||
constexpr std::uint32_t gl_rgba32f = 0x8814U;
|
||||
constexpr std::uint32_t gl_rgba16f = 0x881AU;
|
||||
|
||||
PP_EXPECT(h, pp::renderer::gl::texture_upload_type_for_internal_format(gl_rgba8) == gl_unsigned_byte);
|
||||
PP_EXPECT(h, pp::renderer::gl::texture_upload_type_for_internal_format(gl_rgba32f) == gl_float);
|
||||
PP_EXPECT(h, pp::renderer::gl::texture_upload_type_for_internal_format(gl_rgba16f) == gl_half_float);
|
||||
PP_EXPECT(h, pp::renderer::gl::texture_upload_type_for_internal_format(0U) == gl_unsigned_byte);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
int main()
|
||||
@@ -77,5 +93,6 @@ int main()
|
||||
harness.run("treats_desktop_gl_float_rendering_as_core", treats_desktop_gl_float_rendering_as_core);
|
||||
harness.run("detects_gles_texture_float_extensions", detects_gles_texture_float_extensions);
|
||||
harness.run("ignores_gles_texture_extensions_for_webgl_runtime", ignores_gles_texture_extensions_for_webgl_runtime);
|
||||
harness.run("selects_texture_upload_type_from_internal_format", selects_texture_upload_type_from_internal_format);
|
||||
return harness.finish();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user