Move OpenGL runtime classification into renderer backend

This commit is contained in:
2026-06-04 19:28:34 +02:00
parent 0489c4229e
commit 11c7d87330
7 changed files with 53 additions and 16 deletions

View File

@@ -1035,6 +1035,16 @@ void ignores_gles_texture_extensions_for_webgl_runtime(pp::tests::Harness& h)
PP_EXPECT(h, !capabilities.float16_textures);
}
void classifies_current_build_opengl_runtime(pp::tests::Harness& h)
{
const auto runtime = pp::renderer::gl::opengl_runtime_for_current_build();
PP_EXPECT(h, runtime.desktop_gl || runtime.gles);
PP_EXPECT(h, !(runtime.desktop_gl && runtime.gles));
if (runtime.web)
PP_EXPECT(h, runtime.gles);
}
void selects_texture_upload_type_from_internal_format(pp::tests::Harness& h)
{
constexpr std::uint32_t gl_unsigned_byte = 0x1401U;
@@ -4092,6 +4102,7 @@ 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("classifies_current_build_opengl_runtime", classifies_current_build_opengl_runtime);
harness.run("selects_texture_upload_type_from_internal_format", selects_texture_upload_type_from_internal_format);
harness.run("maps_image_channel_count_to_texture_format", maps_image_channel_count_to_texture_format);
harness.run("maps_renderer_texture_formats_to_opengl_tokens", maps_renderer_texture_formats_to_opengl_tokens);