Add renderer backend feature reporting
This commit is contained in:
@@ -365,7 +365,7 @@ if(TARGET pano_cli)
|
||||
COMMAND pano_cli record-render --width 32 --height 16)
|
||||
set_tests_properties(pano_cli_record_render_smoke PROPERTIES
|
||||
LABELS "renderer;integration;desktop-fast"
|
||||
PASS_REGULAR_EXPRESSION "\"backend\":\"recording\".*\"width\":32.*\"height\":16.*\"createdResources\":7.*\"labeledCommandDescriptors\":16.*\"commands\":25.*\"renderPasses\":1.*\"depthClears\":1.*\"stencilClears\":0.*\"drawCommands\":1.*\"drawVertices\":3.*\"drawIndices\":3.*\"scissorCommands\":1.*\"blendCommands\":1.*\"depthCommands\":1.*\"uniformCommands\":1.*\"uniformBytes\":64.*\"bindTextureCommands\":1.*\"bindSamplerCommands\":1.*\"boundTextureBytes\":2048.*\"uploadCommands\":1.*\"uploadBytes\":4.*\"mipmapCommands\":1.*\"mipmapLevels\":3.*\"mipmapBytes\":84.*\"transitionCommands\":4.*\"transitionToUpload\":1.*\"transitionToShaderRead\":2.*\"copyCommands\":1.*\"copySourceBytes\":2048.*\"copyDestinationBytes\":2048.*\"readbackCommands\":1.*\"readbackBytes\":2048.*\"captureCommands\":1.*\"captureBytes\":2048.*\"blitCommands\":1.*\"blitSourceBytes\":2048.*\"blitDestinationBytes\":2048.*\"traceMarkers\":1.*\"traceBeginScopes\":1.*\"traceEndScopes\":1")
|
||||
PASS_REGULAR_EXPRESSION "\"backend\":\"recording\".*\"framebufferFetch\":false.*\"explicitTextureTransitions\":true.*\"textureCopy\":true.*\"renderTargetBlit\":true.*\"frameCapture\":true.*\"float16RenderTargets\":false.*\"float32RenderTargets\":false.*\"width\":32.*\"height\":16.*\"createdResources\":7.*\"labeledCommandDescriptors\":16.*\"commands\":25.*\"renderPasses\":1.*\"depthClears\":1.*\"stencilClears\":0.*\"drawCommands\":1.*\"drawVertices\":3.*\"drawIndices\":3.*\"scissorCommands\":1.*\"blendCommands\":1.*\"depthCommands\":1.*\"uniformCommands\":1.*\"uniformBytes\":64.*\"bindTextureCommands\":1.*\"bindSamplerCommands\":1.*\"boundTextureBytes\":2048.*\"uploadCommands\":1.*\"uploadBytes\":4.*\"mipmapCommands\":1.*\"mipmapLevels\":3.*\"mipmapBytes\":84.*\"transitionCommands\":4.*\"transitionToUpload\":1.*\"transitionToShaderRead\":2.*\"copyCommands\":1.*\"copySourceBytes\":2048.*\"copyDestinationBytes\":2048.*\"readbackCommands\":1.*\"readbackBytes\":2048.*\"captureCommands\":1.*\"captureBytes\":2048.*\"blitCommands\":1.*\"blitSourceBytes\":2048.*\"blitDestinationBytes\":2048.*\"traceMarkers\":1.*\"traceBeginScopes\":1.*\"traceEndScopes\":1")
|
||||
|
||||
add_test(NAME pano_cli_record_render_rejects_oversized_target
|
||||
COMMAND "${CMAKE_COMMAND}"
|
||||
|
||||
@@ -43,6 +43,7 @@ using pp::renderer::RecordingRenderDevice;
|
||||
using pp::renderer::RecordingRenderTarget;
|
||||
using pp::renderer::RecordingShaderProgram;
|
||||
using pp::renderer::RecordingTexture2D;
|
||||
using pp::renderer::RenderDeviceFeatures;
|
||||
using pp::renderer::RenderPassDesc;
|
||||
using pp::renderer::SamplerAddressMode;
|
||||
using pp::renderer::sampler_address_mode_name;
|
||||
@@ -596,6 +597,19 @@ public:
|
||||
return "fake";
|
||||
}
|
||||
|
||||
[[nodiscard]] RenderDeviceFeatures features() const noexcept override
|
||||
{
|
||||
return RenderDeviceFeatures {
|
||||
.framebuffer_fetch = true,
|
||||
.explicit_texture_transitions = true,
|
||||
.texture_copy = true,
|
||||
.render_target_blit = true,
|
||||
.frame_capture = true,
|
||||
.float16_render_targets = true,
|
||||
.float32_render_targets = true,
|
||||
};
|
||||
}
|
||||
|
||||
[[nodiscard]] pp::foundation::Result<std::unique_ptr<pp::renderer::ITexture2D>> create_texture(
|
||||
TextureDesc desc) noexcept override
|
||||
{
|
||||
@@ -1552,6 +1566,14 @@ void renderer_interfaces_support_backend_neutral_dispatch(pp::tests::Harness& h)
|
||||
FakeMesh mesh;
|
||||
|
||||
PP_EXPECT(h, device.backend_name() == std::string_view("fake"));
|
||||
const auto features = device.features();
|
||||
PP_EXPECT(h, features.framebuffer_fetch);
|
||||
PP_EXPECT(h, features.explicit_texture_transitions);
|
||||
PP_EXPECT(h, features.texture_copy);
|
||||
PP_EXPECT(h, features.render_target_blit);
|
||||
PP_EXPECT(h, features.frame_capture);
|
||||
PP_EXPECT(h, features.float16_render_targets);
|
||||
PP_EXPECT(h, features.float32_render_targets);
|
||||
PP_EXPECT(h, device.trace()->begin_scope("renderer", "dispatch").ok());
|
||||
PP_EXPECT(h, device.trace()->marker("renderer", "begin").ok());
|
||||
PP_EXPECT(h, device.trace()->end_scope().ok());
|
||||
@@ -1690,7 +1712,15 @@ void render_devices_create_validated_resources(pp::tests::Harness& h)
|
||||
.debug_name = "factory-mesh",
|
||||
});
|
||||
const auto readback = device.create_readback_buffer(8U * 4U * 4U);
|
||||
const auto features = device.features();
|
||||
|
||||
PP_EXPECT(h, !features.framebuffer_fetch);
|
||||
PP_EXPECT(h, features.explicit_texture_transitions);
|
||||
PP_EXPECT(h, features.texture_copy);
|
||||
PP_EXPECT(h, features.render_target_blit);
|
||||
PP_EXPECT(h, features.frame_capture);
|
||||
PP_EXPECT(h, !features.float16_render_targets);
|
||||
PP_EXPECT(h, !features.float32_render_targets);
|
||||
PP_EXPECT(h, texture.ok());
|
||||
PP_EXPECT(h, texture.value()->desc().extent.width == 8U);
|
||||
PP_EXPECT(h, !has_texture_usage(texture.value()->desc().usage, TextureUsage::render_target));
|
||||
|
||||
@@ -36,6 +36,15 @@ void detects_common_extension_capabilities(pp::tests::Harness& h)
|
||||
PP_EXPECT(h, capabilities.map_buffer_alignment);
|
||||
PP_EXPECT(h, !capabilities.float32_textures);
|
||||
PP_EXPECT(h, !capabilities.float16_textures);
|
||||
|
||||
const auto features = pp::renderer::gl::render_device_features(capabilities);
|
||||
PP_EXPECT(h, features.framebuffer_fetch);
|
||||
PP_EXPECT(h, !features.explicit_texture_transitions);
|
||||
PP_EXPECT(h, features.texture_copy);
|
||||
PP_EXPECT(h, features.render_target_blit);
|
||||
PP_EXPECT(h, features.frame_capture);
|
||||
PP_EXPECT(h, !features.float16_render_targets);
|
||||
PP_EXPECT(h, !features.float32_render_targets);
|
||||
}
|
||||
|
||||
void treats_desktop_gl_float_rendering_as_core(pp::tests::Harness& h)
|
||||
@@ -47,6 +56,10 @@ void treats_desktop_gl_float_rendering_as_core(pp::tests::Harness& h)
|
||||
PP_EXPECT(h, capabilities.float32_textures);
|
||||
PP_EXPECT(h, capabilities.float32_linear);
|
||||
PP_EXPECT(h, capabilities.float16_textures);
|
||||
|
||||
const auto features = pp::renderer::gl::render_device_features(capabilities);
|
||||
PP_EXPECT(h, features.float16_render_targets);
|
||||
PP_EXPECT(h, features.float32_render_targets);
|
||||
}
|
||||
|
||||
void detects_gles_texture_float_extensions(pp::tests::Harness& h)
|
||||
|
||||
Reference in New Issue
Block a user