gfx-blur-*: Add debug markers for performance tracking

This commit is contained in:
Michael Fabian 'Xaymar' Dirks 2020-04-25 11:36:19 +02:00
parent 4947d46aa1
commit 6e8135dc98
5 changed files with 43 additions and 15 deletions

View file

@ -246,6 +246,8 @@ double_t gfx::blur::box_linear::get_step_scale_y()
std::shared_ptr<::gs::texture> gfx::blur::box_linear::render() std::shared_ptr<::gs::texture> gfx::blur::box_linear::render()
{ {
auto gctx = gs::context(); auto gctx = gs::context();
auto gdmp = gs::debug_marker(gs::debug_color_azure_radiance, "Box Linear Blur");
float_t width = float_t(_input_texture->get_width()); float_t width = float_t(_input_texture->get_width());
float_t height = float_t(_input_texture->get_height()); float_t height = float_t(_input_texture->get_height());
@ -273,6 +275,7 @@ std::shared_ptr<::gs::texture> gfx::blur::box_linear::render()
effect.get_parameter("pSizeInverseMul").set_float(float_t(1.0f / (float_t(_size) * 2.0f + 1.0f))); effect.get_parameter("pSizeInverseMul").set_float(float_t(1.0f / (float_t(_size) * 2.0f + 1.0f)));
{ {
auto gdm = gs::debug_marker(gs::debug_color_azure_radiance, "Horizontal");
auto op = _rendertarget2->render(uint32_t(width), uint32_t(height)); auto op = _rendertarget2->render(uint32_t(width), uint32_t(height));
gs_ortho(0, 1., 0, 1., 0, 1.); gs_ortho(0, 1., 0, 1., 0, 1.);
while (gs_effect_loop(effect.get_object(), "Draw")) { while (gs_effect_loop(effect.get_object(), "Draw")) {
@ -285,6 +288,7 @@ std::shared_ptr<::gs::texture> gfx::blur::box_linear::render()
effect.get_parameter("pImageTexel").set_float2(0., float_t(1.f / height)); effect.get_parameter("pImageTexel").set_float2(0., float_t(1.f / height));
{ {
auto gdm = gs::debug_marker(gs::debug_color_azure_radiance, "Vertical");
auto op = _rendertarget->render(uint32_t(width), uint32_t(height)); auto op = _rendertarget->render(uint32_t(width), uint32_t(height));
gs_ortho(0, 1., 0, 1., 0, 1.); gs_ortho(0, 1., 0, 1., 0, 1.);
while (gs_effect_loop(effect.get_object(), "Draw")) { while (gs_effect_loop(effect.get_object(), "Draw")) {
@ -323,6 +327,8 @@ void gfx::blur::box_linear_directional::set_angle(double_t angle)
std::shared_ptr<::gs::texture> gfx::blur::box_linear_directional::render() std::shared_ptr<::gs::texture> gfx::blur::box_linear_directional::render()
{ {
auto gctx = gs::context(); auto gctx = gs::context();
auto gdmp = gs::debug_marker(gs::debug_color_azure_radiance, "Box Linear Directional Blur");
float_t width = float_t(_input_texture->get_width()); float_t width = float_t(_input_texture->get_width());
float_t height = float_t(_input_texture->get_height()); float_t height = float_t(_input_texture->get_height());

View file

@ -254,6 +254,8 @@ double_t gfx::blur::box::get_step_scale_y()
std::shared_ptr<::gs::texture> gfx::blur::box::render() std::shared_ptr<::gs::texture> gfx::blur::box::render()
{ {
auto gctx = gs::context(); auto gctx = gs::context();
auto gdmp = gs::debug_marker(gs::debug_color_azure_radiance, "Box Blur");
float_t width = float_t(_input_texture->get_width()); float_t width = float_t(_input_texture->get_width());
float_t height = float_t(_input_texture->get_height()); float_t height = float_t(_input_texture->get_height());
@ -281,6 +283,7 @@ std::shared_ptr<::gs::texture> gfx::blur::box::render()
effect.get_parameter("pSizeInverseMul").set_float(float_t(1.0f / (float_t(_size) * 2.0f + 1.0f))); effect.get_parameter("pSizeInverseMul").set_float(float_t(1.0f / (float_t(_size) * 2.0f + 1.0f)));
{ {
auto gdm = gs::debug_marker(gs::debug_color_azure_radiance, "Horizontal");
auto op = _rendertarget2->render(uint32_t(width), uint32_t(height)); auto op = _rendertarget2->render(uint32_t(width), uint32_t(height));
gs_ortho(0, 1., 0, 1., 0, 1.); gs_ortho(0, 1., 0, 1., 0, 1.);
while (gs_effect_loop(effect.get_object(), "Draw")) { while (gs_effect_loop(effect.get_object(), "Draw")) {
@ -293,6 +296,7 @@ std::shared_ptr<::gs::texture> gfx::blur::box::render()
effect.get_parameter("pImageTexel").set_float2(0.f, float_t(1.f / height)); effect.get_parameter("pImageTexel").set_float2(0.f, float_t(1.f / height));
{ {
auto gdm = gs::debug_marker(gs::debug_color_azure_radiance, "Vertical");
auto op = _rendertarget->render(uint32_t(width), uint32_t(height)); auto op = _rendertarget->render(uint32_t(width), uint32_t(height));
gs_ortho(0, 1., 0, 1., 0, 1.); gs_ortho(0, 1., 0, 1., 0, 1.);
while (gs_effect_loop(effect.get_object(), "Draw")) { while (gs_effect_loop(effect.get_object(), "Draw")) {
@ -331,6 +335,8 @@ void gfx::blur::box_directional::set_angle(double_t angle)
std::shared_ptr<::gs::texture> gfx::blur::box_directional::render() std::shared_ptr<::gs::texture> gfx::blur::box_directional::render()
{ {
auto gctx = gs::context(); auto gctx = gs::context();
auto gdmp = gs::debug_marker(gs::debug_color_azure_radiance, "Box Directional Blur");
float_t width = float_t(_input_texture->get_width()); float_t width = float_t(_input_texture->get_width());
float_t height = float_t(_input_texture->get_height()); float_t height = float_t(_input_texture->get_height());
@ -401,6 +407,8 @@ void gfx::blur::box_rotational::set_angle(double_t angle)
std::shared_ptr<::gs::texture> gfx::blur::box_rotational::render() std::shared_ptr<::gs::texture> gfx::blur::box_rotational::render()
{ {
auto gctx = gs::context(); auto gctx = gs::context();
auto gdmp = gs::debug_marker(gs::debug_color_azure_radiance, "Box Rotational Blur");
float_t width = float_t(_input_texture->get_width()); float_t width = float_t(_input_texture->get_width());
float_t height = float_t(_input_texture->get_height()); float_t height = float_t(_input_texture->get_height());
@ -462,6 +470,8 @@ void gfx::blur::box_zoom::get_center(double_t& x, double_t& y)
std::shared_ptr<::gs::texture> gfx::blur::box_zoom::render() std::shared_ptr<::gs::texture> gfx::blur::box_zoom::render()
{ {
auto gctx = gs::context(); auto gctx = gs::context();
auto gdmp = gs::debug_marker(gs::debug_color_azure_radiance, "Box Zoom Blur");
float_t width = float_t(_input_texture->get_width()); float_t width = float_t(_input_texture->get_width());
float_t height = float_t(_input_texture->get_height()); float_t height = float_t(_input_texture->get_height());

View file

@ -223,6 +223,8 @@ void gfx::blur::dual_filtering::get_step_scale(double_t&, double_t&) {}
std::shared_ptr<::gs::texture> gfx::blur::dual_filtering::render() std::shared_ptr<::gs::texture> gfx::blur::dual_filtering::render()
{ {
auto gctx = gs::context(); auto gctx = gs::context();
auto gdmp = gs::debug_marker(gs::debug_color_azure_radiance, "Dual-Filtering Blur");
auto effect = _data->get_effect(); auto effect = _data->get_effect();
if (!effect) { if (!effect) {
return _input_texture; return _input_texture;

View file

@ -292,6 +292,7 @@ double_t gfx::blur::gaussian_linear::get_step_scale_y()
std::shared_ptr<::gs::texture> gfx::blur::gaussian_linear::render() std::shared_ptr<::gs::texture> gfx::blur::gaussian_linear::render()
{ {
auto gctx = gs::context(); auto gctx = gs::context();
auto gdmp = gs::debug_marker(gs::debug_color_azure_radiance, "Gaussian Linear Blur");
gs::effect effect = _data->get_effect(); gs::effect effect = _data->get_effect();
auto kernel = _data->get_kernel(size_t(_size)); auto kernel = _data->get_kernel(size_t(_size));
@ -327,6 +328,7 @@ std::shared_ptr<::gs::texture> gfx::blur::gaussian_linear::render()
effect.get_parameter("pImageTexel").set_float2(float_t(1.f / width), 0.f); effect.get_parameter("pImageTexel").set_float2(float_t(1.f / width), 0.f);
{ {
auto gdm = gs::debug_marker(gs::debug_color_azure_radiance, "Horizontal");
auto op = _rendertarget2->render(uint32_t(width), uint32_t(height)); auto op = _rendertarget2->render(uint32_t(width), uint32_t(height));
gs_ortho(0, 1., 0, 1., 0, 1.); gs_ortho(0, 1., 0, 1., 0, 1.);
while (gs_effect_loop(effect.get_object(), "Draw")) { while (gs_effect_loop(effect.get_object(), "Draw")) {
@ -343,6 +345,7 @@ std::shared_ptr<::gs::texture> gfx::blur::gaussian_linear::render()
effect.get_parameter("pImageTexel").set_float2(0.f, float_t(1.f / height)); effect.get_parameter("pImageTexel").set_float2(0.f, float_t(1.f / height));
{ {
auto gdm = gs::debug_marker(gs::debug_color_azure_radiance, "Vertical");
auto op = _rendertarget2->render(uint32_t(width), uint32_t(height)); auto op = _rendertarget2->render(uint32_t(width), uint32_t(height));
gs_ortho(0, 1., 0, 1., 0, 1.); gs_ortho(0, 1., 0, 1., 0, 1.);
while (gs_effect_loop(effect.get_object(), "Draw")) { while (gs_effect_loop(effect.get_object(), "Draw")) {
@ -385,6 +388,7 @@ void gfx::blur::gaussian_linear_directional::set_angle(double_t angle)
std::shared_ptr<::gs::texture> gfx::blur::gaussian_linear_directional::render() std::shared_ptr<::gs::texture> gfx::blur::gaussian_linear_directional::render()
{ {
auto gctx = gs::context(); auto gctx = gs::context();
auto gdmp = gs::debug_marker(gs::debug_color_azure_radiance, "Gaussian Linear Directional Blur");
gs::effect effect = _data->get_effect(); gs::effect effect = _data->get_effect();
auto kernel = _data->get_kernel(size_t(_size)); auto kernel = _data->get_kernel(size_t(_size));

View file

@ -298,6 +298,7 @@ double_t gfx::blur::gaussian::get_step_scale_y()
std::shared_ptr<::gs::texture> gfx::blur::gaussian::render() std::shared_ptr<::gs::texture> gfx::blur::gaussian::render()
{ {
auto gctx = gs::context(); auto gctx = gs::context();
auto gdmp = gs::debug_marker(gs::debug_color_azure_radiance, "Gaussian Blur");
gs::effect effect = _data->get_effect(); gs::effect effect = _data->get_effect();
auto kernel = _data->get_kernel(size_t(_size)); auto kernel = _data->get_kernel(size_t(_size));
@ -333,6 +334,7 @@ std::shared_ptr<::gs::texture> gfx::blur::gaussian::render()
effect.get_parameter("pImageTexel").set_float2(float_t(1.f / width), 0.f); effect.get_parameter("pImageTexel").set_float2(float_t(1.f / width), 0.f);
{ {
auto gdm = gs::debug_marker(gs::debug_color_azure_radiance, "Horizontal");
auto op = _rendertarget2->render(uint32_t(width), uint32_t(height)); auto op = _rendertarget2->render(uint32_t(width), uint32_t(height));
gs_ortho(0, 1., 0, 1., 0, 1.); gs_ortho(0, 1., 0, 1., 0, 1.);
while (gs_effect_loop(effect.get_object(), "Draw")) { while (gs_effect_loop(effect.get_object(), "Draw")) {
@ -349,6 +351,7 @@ std::shared_ptr<::gs::texture> gfx::blur::gaussian::render()
effect.get_parameter("pImageTexel").set_float2(0.f, float_t(1.f / height)); effect.get_parameter("pImageTexel").set_float2(0.f, float_t(1.f / height));
{ {
auto gdm = gs::debug_marker(gs::debug_color_azure_radiance, "Vertical");
auto op = _rendertarget2->render(uint32_t(width), uint32_t(height)); auto op = _rendertarget2->render(uint32_t(width), uint32_t(height));
gs_ortho(0, 1., 0, 1., 0, 1.); gs_ortho(0, 1., 0, 1., 0, 1.);
while (gs_effect_loop(effect.get_object(), "Draw")) { while (gs_effect_loop(effect.get_object(), "Draw")) {
@ -391,6 +394,7 @@ void gfx::blur::gaussian_directional::set_angle(double_t angle)
std::shared_ptr<::gs::texture> gfx::blur::gaussian_directional::render() std::shared_ptr<::gs::texture> gfx::blur::gaussian_directional::render()
{ {
auto gctx = gs::context(); auto gctx = gs::context();
auto gdmp = gs::debug_marker(gs::debug_color_azure_radiance, "Gaussian Directional Blur");
gs::effect effect = _data->get_effect(); gs::effect effect = _data->get_effect();
auto kernel = _data->get_kernel(size_t(_size)); auto kernel = _data->get_kernel(size_t(_size));
@ -445,6 +449,7 @@ std::shared_ptr<::gs::texture> gfx::blur::gaussian_directional::render()
std::shared_ptr<::gs::texture> gfx::blur::gaussian_rotational::render() std::shared_ptr<::gs::texture> gfx::blur::gaussian_rotational::render()
{ {
auto gctx = gs::context(); auto gctx = gs::context();
auto gdmp = gs::debug_marker(gs::debug_color_azure_radiance, "Gaussian Rotational Blur");
gs::effect effect = _data->get_effect(); gs::effect effect = _data->get_effect();
auto kernel = _data->get_kernel(size_t(_size)); auto kernel = _data->get_kernel(size_t(_size));
@ -522,6 +527,7 @@ void gfx::blur::gaussian_rotational::set_angle(double_t angle)
std::shared_ptr<::gs::texture> gfx::blur::gaussian_zoom::render() std::shared_ptr<::gs::texture> gfx::blur::gaussian_zoom::render()
{ {
auto gctx = gs::context(); auto gctx = gs::context();
auto gdmp = gs::debug_marker(gs::debug_color_azure_radiance, "Gaussian Zoom Blur");
gs::effect effect = _data->get_effect(); gs::effect effect = _data->get_effect();
auto kernel = _data->get_kernel(size_t(_size)); auto kernel = _data->get_kernel(size_t(_size));