mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-11-10 02:40:11 +00:00
vulkan: Add infrastructure for printing ops
... and add a GSK_DEBUG=verbose setting making use of it.
This commit is contained in:
parent
73f1dfc762
commit
d86d4c5597
@ -12,6 +12,7 @@ static const GdkDebugKey gsk_debug_keys[] = {
|
||||
{ "surface", GSK_DEBUG_SURFACE, "Information about surfaces" },
|
||||
{ "fallback", GSK_DEBUG_FALLBACK, "Information about fallbacks" },
|
||||
{ "glyphcache", GSK_DEBUG_GLYPH_CACHE, "Information about glyph caching" },
|
||||
{ "verbose", GSK_DEBUG_VERBOSE, "Print verbose output while rendering" },
|
||||
{ "geometry", GSK_DEBUG_GEOMETRY, "Show borders (when using cairo)" },
|
||||
{ "full-redraw", GSK_DEBUG_FULL_REDRAW, "Force full redraws" },
|
||||
{ "sync", GSK_DEBUG_SYNC, "Sync after each frame" },
|
||||
|
@ -14,6 +14,7 @@ typedef enum {
|
||||
GSK_DEBUG_VULKAN = 1 << 5,
|
||||
GSK_DEBUG_FALLBACK = 1 << 6,
|
||||
GSK_DEBUG_GLYPH_CACHE = 1 << 7,
|
||||
GSK_DEBUG_VERBOSE = 1 << 8,
|
||||
/* flags below may affect behavior */
|
||||
GSK_DEBUG_GEOMETRY = 1 << 9,
|
||||
GSK_DEBUG_FULL_REDRAW = 1 << 10,
|
||||
|
@ -34,6 +34,19 @@ gsk_vulkan_blend_mode_op_finish (GskVulkanOp *op)
|
||||
g_object_unref (self->bottom.image);
|
||||
}
|
||||
|
||||
static void
|
||||
gsk_vulkan_blend_mode_op_print (GskVulkanOp *op,
|
||||
GString *string,
|
||||
guint indent)
|
||||
{
|
||||
GskVulkanBlendModeOp *self = (GskVulkanBlendModeOp *) op;
|
||||
|
||||
print_indent (string, indent);
|
||||
print_rect (string, &self->bounds);
|
||||
g_string_append_printf (string, "blend-mode %d%% ", self->blend_mode);
|
||||
print_newline (string);
|
||||
}
|
||||
|
||||
static void
|
||||
gsk_vulkan_blend_mode_op_upload (GskVulkanOp *op,
|
||||
GskVulkanRenderPass *pass,
|
||||
@ -114,6 +127,7 @@ static const GskVulkanShaderOpClass GSK_VULKAN_BLEND_MODE_OP_CLASS = {
|
||||
"blend-mode",
|
||||
&gsk_vulkan_blend_mode_info,
|
||||
gsk_vulkan_blend_mode_op_finish,
|
||||
gsk_vulkan_blend_mode_op_print,
|
||||
gsk_vulkan_blend_mode_op_upload,
|
||||
gsk_vulkan_blend_mode_op_count_vertex_data,
|
||||
gsk_vulkan_blend_mode_op_collect_vertex_data,
|
||||
|
@ -29,6 +29,20 @@ gsk_vulkan_blur_op_finish (GskVulkanOp *op)
|
||||
g_object_unref (self->image);
|
||||
}
|
||||
|
||||
static void
|
||||
gsk_vulkan_blur_op_print (GskVulkanOp *op,
|
||||
GString *string,
|
||||
guint indent)
|
||||
{
|
||||
GskVulkanBlurOp *self = (GskVulkanBlurOp *) op;
|
||||
|
||||
print_indent (string, indent);
|
||||
print_rect (string, &self->rect);
|
||||
g_string_append_printf (string, "blur %g",
|
||||
self->radius);
|
||||
print_newline (string);
|
||||
}
|
||||
|
||||
static void
|
||||
gsk_vulkan_blur_op_upload (GskVulkanOp *op,
|
||||
GskVulkanRenderPass *pass,
|
||||
@ -101,6 +115,7 @@ static const GskVulkanOpClass GSK_VULKAN_BLUR_OP_CLASS = {
|
||||
"blur",
|
||||
&gsk_vulkan_blur_info,
|
||||
gsk_vulkan_blur_op_finish,
|
||||
gsk_vulkan_blur_op_print,
|
||||
gsk_vulkan_blur_op_upload,
|
||||
gsk_vulkan_blur_op_count_vertex_data,
|
||||
gsk_vulkan_blur_op_collect_vertex_data,
|
||||
|
@ -25,6 +25,34 @@ gsk_vulkan_border_op_finish (GskVulkanOp *op)
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
gsk_vulkan_border_op_print (GskVulkanOp *op,
|
||||
GString *string,
|
||||
guint indent)
|
||||
{
|
||||
GskVulkanBorderOp *self = (GskVulkanBorderOp *) op;
|
||||
|
||||
print_indent (string, indent);
|
||||
print_rounded_rect (string, &self->outline);
|
||||
g_string_append (string, "border ");
|
||||
print_rgba (string, &self->colors[0]);
|
||||
if (!gdk_rgba_equal (&self->colors[3], &self->colors[0]) ||
|
||||
!gdk_rgba_equal (&self->colors[2], &self->colors[0]) ||
|
||||
!gdk_rgba_equal (&self->colors[1], &self->colors[0]))
|
||||
{
|
||||
print_rgba (string, &self->colors[1]);
|
||||
print_rgba (string, &self->colors[2]);
|
||||
print_rgba (string, &self->colors[3]);
|
||||
}
|
||||
g_string_append_printf (string, "%g ", self->widths[0]);
|
||||
if (self->widths[0] != self->widths[1] ||
|
||||
self->widths[0] != self->widths[2] ||
|
||||
self->widths[0] != self->widths[3])
|
||||
g_string_append_printf (string, "%g %g %g ", self->widths[1], self->widths[2], self->widths[3]);
|
||||
|
||||
print_newline (string);
|
||||
}
|
||||
|
||||
static void
|
||||
gsk_vulkan_border_op_upload (GskVulkanOp *op,
|
||||
GskVulkanRenderPass *pass,
|
||||
@ -95,6 +123,7 @@ static const GskVulkanOpClass GSK_VULKAN_BORDER_OP_CLASS = {
|
||||
"border",
|
||||
&gsk_vulkan_border_info,
|
||||
gsk_vulkan_border_op_finish,
|
||||
gsk_vulkan_border_op_print,
|
||||
gsk_vulkan_border_op_upload,
|
||||
gsk_vulkan_border_op_count_vertex_data,
|
||||
gsk_vulkan_border_op_collect_vertex_data,
|
||||
|
@ -30,6 +30,19 @@ gsk_vulkan_color_matrix_op_finish (GskVulkanOp *op)
|
||||
g_object_unref (self->image);
|
||||
}
|
||||
|
||||
static void
|
||||
gsk_vulkan_color_matrix_op_print (GskVulkanOp *op,
|
||||
GString *string,
|
||||
guint indent)
|
||||
{
|
||||
GskVulkanColorMatrixOp *self = (GskVulkanColorMatrixOp *) op;
|
||||
|
||||
print_indent (string, indent);
|
||||
print_rect (string, &self->rect);
|
||||
g_string_append (string, "color-matrix ");
|
||||
print_newline (string);
|
||||
}
|
||||
|
||||
static void
|
||||
gsk_vulkan_color_matrix_op_upload (GskVulkanOp *op,
|
||||
GskVulkanRenderPass *pass,
|
||||
@ -109,6 +122,7 @@ static const GskVulkanOpClass GSK_VULKAN_COLOR_MATRIX_OP_CLASS = {
|
||||
"color-matrix",
|
||||
&gsk_vulkan_color_matrix_info,
|
||||
gsk_vulkan_color_matrix_op_finish,
|
||||
gsk_vulkan_color_matrix_op_print,
|
||||
gsk_vulkan_color_matrix_op_upload,
|
||||
gsk_vulkan_color_matrix_op_count_vertex_data,
|
||||
gsk_vulkan_color_matrix_op_collect_vertex_data,
|
||||
|
@ -2,6 +2,8 @@
|
||||
|
||||
#include "gskvulkancoloropprivate.h"
|
||||
|
||||
#include "gskvulkanprivate.h"
|
||||
|
||||
#include "vulkan/resources/color.vert.h"
|
||||
|
||||
typedef struct _GskVulkanColorOp GskVulkanColorOp;
|
||||
@ -49,6 +51,20 @@ gsk_vulkan_color_op_count_vertex_data (GskVulkanOp *op,
|
||||
return n_bytes;
|
||||
}
|
||||
|
||||
static void
|
||||
gsk_vulkan_color_op_print (GskVulkanOp *op,
|
||||
GString *string,
|
||||
guint indent)
|
||||
{
|
||||
GskVulkanColorOp *self = (GskVulkanColorOp *) op;
|
||||
|
||||
print_indent (string, indent);
|
||||
print_rect (string, &self->rect);
|
||||
g_string_append (string, "color ");
|
||||
print_rgba (string, &self->color);
|
||||
print_newline (string);
|
||||
}
|
||||
|
||||
static void
|
||||
gsk_vulkan_color_op_collect_vertex_data (GskVulkanOp *op,
|
||||
GskVulkanRenderPass *pass,
|
||||
@ -92,6 +108,7 @@ static const GskVulkanOpClass GSK_VULKAN_COLOR_OP_CLASS = {
|
||||
"color",
|
||||
&gsk_vulkan_color_info,
|
||||
gsk_vulkan_color_op_finish,
|
||||
gsk_vulkan_color_op_print,
|
||||
gsk_vulkan_color_op_upload,
|
||||
gsk_vulkan_color_op_count_vertex_data,
|
||||
gsk_vulkan_color_op_collect_vertex_data,
|
||||
|
@ -34,6 +34,19 @@ gsk_vulkan_cross_fade_op_finish (GskVulkanOp *op)
|
||||
g_object_unref (self->end.image);
|
||||
}
|
||||
|
||||
static void
|
||||
gsk_vulkan_cross_fade_op_print (GskVulkanOp *op,
|
||||
GString *string,
|
||||
guint indent)
|
||||
{
|
||||
GskVulkanCrossFadeOp *self = (GskVulkanCrossFadeOp *) op;
|
||||
|
||||
print_indent (string, indent);
|
||||
print_rect (string, &self->bounds);
|
||||
g_string_append_printf (string, "cross-fade %d%% ", (int) (self->progress * 100 + 0.5));
|
||||
print_newline (string);
|
||||
}
|
||||
|
||||
static void
|
||||
gsk_vulkan_cross_fade_op_upload (GskVulkanOp *op,
|
||||
GskVulkanRenderPass *pass,
|
||||
@ -114,6 +127,7 @@ static const GskVulkanOpClass GSK_VULKAN_CROSS_FADE_OP_CLASS = {
|
||||
"cross-fade",
|
||||
&gsk_vulkan_cross_fade_info,
|
||||
gsk_vulkan_cross_fade_op_finish,
|
||||
gsk_vulkan_cross_fade_op_print,
|
||||
gsk_vulkan_cross_fade_op_upload,
|
||||
gsk_vulkan_cross_fade_op_count_vertex_data,
|
||||
gsk_vulkan_cross_fade_op_collect_vertex_data,
|
||||
|
@ -37,6 +37,20 @@ gsk_vulkan_glyph_op_upload (GskVulkanOp *op,
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
gsk_vulkan_glyph_op_print (GskVulkanOp *op,
|
||||
GString *string,
|
||||
guint indent)
|
||||
{
|
||||
GskVulkanGlyphOp *self = (GskVulkanGlyphOp *) op;
|
||||
|
||||
print_indent (string, indent);
|
||||
print_rect (string, &self->rect);
|
||||
g_string_append (string, "glyph ");
|
||||
print_rgba (string, &self->color);
|
||||
print_newline (string);
|
||||
}
|
||||
|
||||
static inline gsize
|
||||
round_up (gsize number, gsize divisor)
|
||||
{
|
||||
@ -99,6 +113,7 @@ static const GskVulkanOpClass GSK_VULKAN_GLYPH_OP_CLASS = {
|
||||
"glyph",
|
||||
&gsk_vulkan_glyph_info,
|
||||
gsk_vulkan_glyph_op_finish,
|
||||
gsk_vulkan_glyph_op_print,
|
||||
gsk_vulkan_glyph_op_upload,
|
||||
gsk_vulkan_glyph_op_count_vertex_data,
|
||||
gsk_vulkan_glyph_op_collect_vertex_data,
|
||||
|
@ -84,5 +84,14 @@ VkImageView gsk_vulkan_image_get_image_view (GskVulk
|
||||
VkFormat gsk_vulkan_image_get_vk_format (GskVulkanImage *self);
|
||||
GdkMemoryFormat gsk_vulkan_image_get_format (GskVulkanImage *self);
|
||||
|
||||
static inline void
|
||||
print_image (GString *string,
|
||||
GskVulkanImage *image)
|
||||
{
|
||||
g_string_append_printf (string, "%zux%zu ",
|
||||
gsk_vulkan_image_get_width (image),
|
||||
gsk_vulkan_image_get_height (image));
|
||||
}
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
|
@ -27,6 +27,21 @@ gsk_vulkan_inset_shadow_op_finish (GskVulkanOp *op)
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
gsk_vulkan_inset_shadow_op_print (GskVulkanOp *op,
|
||||
GString *string,
|
||||
guint indent)
|
||||
{
|
||||
GskVulkanInsetShadowOp *self = (GskVulkanInsetShadowOp *) op;
|
||||
|
||||
print_indent (string, indent);
|
||||
print_rounded_rect (string, &self->outline);
|
||||
g_string_append (string, "inset-shadow ");
|
||||
if (self->blur_radius > 0)
|
||||
g_string_append_printf (string, "blur %gpx ", self->blur_radius);
|
||||
print_newline (string);
|
||||
}
|
||||
|
||||
static void
|
||||
gsk_vulkan_inset_shadow_op_upload (GskVulkanOp *op,
|
||||
GskVulkanRenderPass *pass,
|
||||
@ -95,6 +110,7 @@ static const GskVulkanOpClass GSK_VULKAN_INSET_SHADOW_OP_CLASS = {
|
||||
"inset-shadow",
|
||||
&gsk_vulkan_inset_shadow_info,
|
||||
gsk_vulkan_inset_shadow_op_finish,
|
||||
gsk_vulkan_inset_shadow_op_print,
|
||||
gsk_vulkan_inset_shadow_op_upload,
|
||||
gsk_vulkan_inset_shadow_op_count_vertex_data,
|
||||
gsk_vulkan_inset_shadow_op_collect_vertex_data,
|
||||
|
@ -31,6 +31,19 @@ gsk_vulkan_linear_gradient_op_finish (GskVulkanOp *op)
|
||||
g_free (self->stops);
|
||||
}
|
||||
|
||||
static void
|
||||
gsk_vulkan_linear_gradient_op_print (GskVulkanOp *op,
|
||||
GString *string,
|
||||
guint indent)
|
||||
{
|
||||
GskVulkanLinearGradientOp *self = (GskVulkanLinearGradientOp *) op;
|
||||
|
||||
print_indent (string, indent);
|
||||
print_rect (string, &self->rect);
|
||||
g_string_append_printf (string, "linear-gradient (%zu stops)", self->n_stops);
|
||||
print_newline (string);
|
||||
}
|
||||
|
||||
static void
|
||||
gsk_vulkan_linear_gradient_op_upload (GskVulkanOp *op,
|
||||
GskVulkanRenderPass *pass,
|
||||
@ -108,6 +121,7 @@ static const GskVulkanOpClass GSK_VULKAN_LINEAR_GRADIENT_OP_CLASS = {
|
||||
"linear",
|
||||
&gsk_vulkan_linear_info,
|
||||
gsk_vulkan_linear_gradient_op_finish,
|
||||
gsk_vulkan_linear_gradient_op_print,
|
||||
gsk_vulkan_linear_gradient_op_upload,
|
||||
gsk_vulkan_linear_gradient_op_count_vertex_data,
|
||||
gsk_vulkan_linear_gradient_op_collect_vertex_data,
|
||||
|
@ -32,6 +32,38 @@ gsk_vulkan_mask_op_finish (GskVulkanOp *op)
|
||||
g_object_unref (self->mask.image);
|
||||
}
|
||||
|
||||
static void
|
||||
gsk_vulkan_mask_op_print (GskVulkanOp *op,
|
||||
GString *string,
|
||||
guint indent)
|
||||
{
|
||||
GskVulkanMaskOp *self = (GskVulkanMaskOp *) op;
|
||||
|
||||
print_indent (string, indent);
|
||||
print_rect (string, &self->source.rect);
|
||||
g_string_append (string, "mask ");
|
||||
print_rect (string, &self->mask.rect);
|
||||
switch (self->mask_mode)
|
||||
{
|
||||
case GSK_MASK_MODE_ALPHA:
|
||||
g_string_append (string, "alpha ");
|
||||
break;
|
||||
case GSK_MASK_MODE_INVERTED_ALPHA:
|
||||
g_string_append (string, "inverted-alpha ");
|
||||
break;
|
||||
case GSK_MASK_MODE_LUMINANCE:
|
||||
g_string_append (string, "luminance ");
|
||||
break;
|
||||
case GSK_MASK_MODE_INVERTED_LUMINANCE:
|
||||
g_string_append (string, "inverted-luminance ");
|
||||
break;
|
||||
default:
|
||||
g_assert_not_reached ();
|
||||
break;
|
||||
}
|
||||
print_newline (string);
|
||||
}
|
||||
|
||||
static void
|
||||
gsk_vulkan_mask_op_upload (GskVulkanOp *op,
|
||||
GskVulkanRenderPass *pass,
|
||||
@ -106,6 +138,7 @@ static const GskVulkanOpClass GSK_VULKAN_COLOR_MASK_OP_CLASS = {
|
||||
"mask",
|
||||
&gsk_vulkan_mask_info,
|
||||
gsk_vulkan_mask_op_finish,
|
||||
gsk_vulkan_mask_op_print,
|
||||
gsk_vulkan_mask_op_upload,
|
||||
gsk_vulkan_mask_op_count_vertex_data,
|
||||
gsk_vulkan_mask_op_collect_vertex_data,
|
||||
|
@ -3,6 +3,7 @@
|
||||
#include "gskvulkanoffscreenopprivate.h"
|
||||
|
||||
#include "gskrendernodeprivate.h"
|
||||
#include "gskvulkanprivate.h"
|
||||
|
||||
#include "gdk/gdkvulkancontextprivate.h"
|
||||
|
||||
@ -25,6 +26,22 @@ gsk_vulkan_offscreen_op_finish (GskVulkanOp *op)
|
||||
gsk_vulkan_render_pass_free (self->render_pass);
|
||||
}
|
||||
|
||||
static void
|
||||
gsk_vulkan_offscreen_op_print (GskVulkanOp *op,
|
||||
GString *string,
|
||||
guint indent)
|
||||
{
|
||||
GskVulkanOffscreenOp *self = (GskVulkanOffscreenOp *) op;
|
||||
|
||||
print_indent (string, indent);
|
||||
g_string_append_printf (string, "offscreen %zux%zu ",
|
||||
gsk_vulkan_image_get_width (self->image),
|
||||
gsk_vulkan_image_get_height (self->image));
|
||||
print_newline (string);
|
||||
|
||||
gsk_vulkan_render_pass_print (self->render_pass, string, indent + 1);
|
||||
}
|
||||
|
||||
static void
|
||||
gsk_vulkan_offscreen_op_upload (GskVulkanOp *op,
|
||||
GskVulkanRenderPass *pass,
|
||||
@ -76,6 +93,7 @@ static const GskVulkanOpClass GSK_VULKAN_OFFSCREEN_OP_CLASS = {
|
||||
NULL,
|
||||
NULL,
|
||||
gsk_vulkan_offscreen_op_finish,
|
||||
gsk_vulkan_offscreen_op_print,
|
||||
gsk_vulkan_offscreen_op_upload,
|
||||
gsk_vulkan_offscreen_op_count_vertex_data,
|
||||
gsk_vulkan_offscreen_op_collect_vertex_data,
|
||||
|
@ -21,6 +21,14 @@ gsk_vulkan_op_finish (GskVulkanOp *op)
|
||||
op->op_class->finish (op);
|
||||
}
|
||||
|
||||
void
|
||||
gsk_vulkan_op_print (GskVulkanOp *op,
|
||||
GString *string,
|
||||
guint indent)
|
||||
{
|
||||
op->op_class->print (op, string, indent);
|
||||
}
|
||||
|
||||
void
|
||||
gsk_vulkan_op_upload (GskVulkanOp *op,
|
||||
GskVulkanRenderPass *pass,
|
||||
|
@ -25,6 +25,10 @@ struct _GskVulkanOpClass
|
||||
|
||||
void (* finish) (GskVulkanOp *op);
|
||||
|
||||
void (* print) (GskVulkanOp *op,
|
||||
GString *string,
|
||||
guint indent);
|
||||
|
||||
void (* upload) (GskVulkanOp *op,
|
||||
GskVulkanRenderPass *pass,
|
||||
GskVulkanRender *render,
|
||||
@ -50,6 +54,10 @@ GskVulkanOp * gsk_vulkan_op_alloc (GskVulk
|
||||
const GskVulkanOpClass *op_class);
|
||||
void gsk_vulkan_op_finish (GskVulkanOp *op);
|
||||
|
||||
void gsk_vulkan_op_print (GskVulkanOp *op,
|
||||
GString *string,
|
||||
guint indent);
|
||||
|
||||
void gsk_vulkan_op_upload (GskVulkanOp *op,
|
||||
GskVulkanRenderPass *pass,
|
||||
GskVulkanRender *render,
|
||||
|
@ -27,6 +27,21 @@ gsk_vulkan_outset_shadow_op_finish (GskVulkanOp *op)
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
gsk_vulkan_outset_shadow_op_print (GskVulkanOp *op,
|
||||
GString *string,
|
||||
guint indent)
|
||||
{
|
||||
GskVulkanOutsetShadowOp *self = (GskVulkanOutsetShadowOp *) op;
|
||||
|
||||
print_indent (string, indent);
|
||||
print_rounded_rect (string, &self->outline);
|
||||
g_string_append (string, "outset-shadow ");
|
||||
if (self->blur_radius > 0)
|
||||
g_string_append_printf (string, "blur %gpx ", self->blur_radius);
|
||||
print_newline (string);
|
||||
}
|
||||
|
||||
static void
|
||||
gsk_vulkan_outset_shadow_op_upload (GskVulkanOp *op,
|
||||
GskVulkanRenderPass *pass,
|
||||
@ -95,6 +110,7 @@ static const GskVulkanOpClass GSK_VULKAN_OUTSET_SHADOW_OP_CLASS = {
|
||||
"outset-shadow",
|
||||
&gsk_vulkan_outset_shadow_info,
|
||||
gsk_vulkan_outset_shadow_op_finish,
|
||||
gsk_vulkan_outset_shadow_op_print,
|
||||
gsk_vulkan_outset_shadow_op_upload,
|
||||
gsk_vulkan_outset_shadow_op_count_vertex_data,
|
||||
gsk_vulkan_outset_shadow_op_collect_vertex_data,
|
||||
|
@ -2,6 +2,8 @@
|
||||
|
||||
#include "gskdebugprivate.h"
|
||||
|
||||
#include "gskroundedrectprivate.h"
|
||||
|
||||
#include <gdk/gdk.h>
|
||||
#include <graphene.h>
|
||||
|
||||
@ -58,3 +60,78 @@ gsk_vulkan_point_to_float (const graphene_point_t *point,
|
||||
values[1] = point->y;
|
||||
}
|
||||
|
||||
|
||||
static inline void
|
||||
print_indent (GString *string,
|
||||
guint indent)
|
||||
{
|
||||
g_string_append_printf (string, "%*s", 2 * indent, "");
|
||||
}
|
||||
|
||||
static inline void
|
||||
print_rect (GString *string,
|
||||
const graphene_rect_t *rect)
|
||||
{
|
||||
g_string_append_printf (string, "%g %g %g %g ",
|
||||
rect->origin.x, rect->origin.y,
|
||||
rect->size.width, rect->size.height);
|
||||
}
|
||||
|
||||
static inline void
|
||||
print_int_rect (GString *string,
|
||||
const cairo_rectangle_int_t *rect)
|
||||
{
|
||||
g_string_append_printf (string, "%d %d %d %d ",
|
||||
rect->x, rect->y,
|
||||
rect->width, rect->height);
|
||||
}
|
||||
|
||||
static inline void
|
||||
print_rounded_rect (GString *string,
|
||||
const GskRoundedRect *rect)
|
||||
{
|
||||
print_rect (string, &rect->bounds);
|
||||
|
||||
if (gsk_rounded_rect_is_rectilinear (rect))
|
||||
return;
|
||||
|
||||
g_string_append (string, "/ ");
|
||||
|
||||
if (rect->corner[0].width != rect->corner[0].height ||
|
||||
rect->corner[1].width != rect->corner[1].height ||
|
||||
rect->corner[2].width != rect->corner[2].height ||
|
||||
rect->corner[3].width != rect->corner[3].height)
|
||||
{
|
||||
g_string_append (string, "variable ");
|
||||
}
|
||||
else if (rect->corner[0].width != rect->corner[1].width ||
|
||||
rect->corner[0].width != rect->corner[2].width ||
|
||||
rect->corner[0].width != rect->corner[3].width)
|
||||
{
|
||||
g_string_append_printf (string, "%g %g %g %g ",
|
||||
rect->corner[0].width, rect->corner[1].width,
|
||||
rect->corner[2].width, rect->corner[3].width);
|
||||
}
|
||||
else
|
||||
{
|
||||
g_string_append_printf (string, "%g ", rect->corner[0].width);
|
||||
}
|
||||
}
|
||||
static inline void
|
||||
print_rgba (GString *string,
|
||||
const GdkRGBA *rgba)
|
||||
{
|
||||
char *s = gdk_rgba_to_string (rgba);
|
||||
g_string_append (string, s);
|
||||
g_string_append_c (string, ' ');
|
||||
g_free (s);
|
||||
}
|
||||
|
||||
static inline void
|
||||
print_newline (GString *string)
|
||||
{
|
||||
if (string->len && string->str[string->len - 1] == ' ')
|
||||
string->str[string->len - 1] = '\n';
|
||||
else
|
||||
g_string_append_c (string, '\n');
|
||||
}
|
||||
|
@ -3,6 +3,7 @@
|
||||
#include "gskvulkanpushconstantsopprivate.h"
|
||||
|
||||
#include "gskroundedrectprivate.h"
|
||||
#include "gskvulkanprivate.h"
|
||||
|
||||
typedef struct _GskVulkanPushConstantsOp GskVulkanPushConstantsOp;
|
||||
typedef struct _GskVulkanPushConstantsInstance GskVulkanPushConstantsInstance;
|
||||
@ -46,6 +47,16 @@ gsk_vulkan_push_constants_op_finish (GskVulkanOp *op)
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
gsk_vulkan_push_constants_op_print (GskVulkanOp *op,
|
||||
GString *string,
|
||||
guint indent)
|
||||
{
|
||||
print_indent (string, indent);
|
||||
g_string_append_printf (string, "push-constants ");
|
||||
print_newline (string);
|
||||
}
|
||||
|
||||
static void
|
||||
gsk_vulkan_push_constants_op_upload (GskVulkanOp *op,
|
||||
GskVulkanRenderPass *pass,
|
||||
@ -96,6 +107,7 @@ static const GskVulkanOpClass GSK_VULKAN_PUSH_CONSTANTS_OP_CLASS = {
|
||||
NULL,
|
||||
NULL,
|
||||
gsk_vulkan_push_constants_op_finish,
|
||||
gsk_vulkan_push_constants_op_print,
|
||||
gsk_vulkan_push_constants_op_upload,
|
||||
gsk_vulkan_push_constants_op_count_vertex_data,
|
||||
gsk_vulkan_push_constants_op_collect_vertex_data,
|
||||
|
@ -101,6 +101,22 @@ pipeline_cache_key_equal (gconstpointer a,
|
||||
keya->format == keyb->format;
|
||||
}
|
||||
|
||||
static void
|
||||
gsk_vulkan_render_verbose_print (GskVulkanRender *self,
|
||||
const char *heading)
|
||||
{
|
||||
#ifdef G_ENABLE_DEBUG
|
||||
if (GSK_RENDERER_DEBUG_CHECK (self->renderer, VERBOSE))
|
||||
{
|
||||
GString *string = g_string_new (heading);
|
||||
g_string_append (string, ":\n");
|
||||
gsk_vulkan_render_pass_print (g_list_last (self->render_passes)->data, string, 1);
|
||||
g_print ("%s\n", string->str);
|
||||
g_string_free (string, TRUE);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
static void
|
||||
gsk_vulkan_render_setup (GskVulkanRender *self,
|
||||
GskVulkanImage *target,
|
||||
@ -345,6 +361,8 @@ gsk_vulkan_render_add_node (GskVulkanRender *self,
|
||||
gsk_vulkan_render_add_render_pass (self, pass);
|
||||
|
||||
gsk_vulkan_render_pass_add (pass, self, node);
|
||||
|
||||
gsk_vulkan_render_verbose_print (self, "start of frame");
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -204,6 +204,22 @@ gsk_vulkan_render_pass_free (GskVulkanRenderPass *self)
|
||||
g_free (self);
|
||||
}
|
||||
|
||||
void
|
||||
gsk_vulkan_render_pass_print (GskVulkanRenderPass *self,
|
||||
GString *string,
|
||||
guint indent)
|
||||
{
|
||||
GskVulkanOp *op;
|
||||
gsize i;
|
||||
|
||||
for (i = 0; i < gsk_vulkan_render_ops_get_size (&self->render_ops); i += op->op_class->size)
|
||||
{
|
||||
op = (GskVulkanOp *) gsk_vulkan_render_ops_index (&self->render_ops, i);
|
||||
|
||||
gsk_vulkan_op_print (op, string, indent);
|
||||
}
|
||||
}
|
||||
|
||||
static inline gsize
|
||||
round_up (gsize number, gsize divisor)
|
||||
{
|
||||
|
@ -23,6 +23,10 @@ void gsk_vulkan_render_pass_add (GskVulk
|
||||
GskVulkanRender *render,
|
||||
GskRenderNode *node);
|
||||
|
||||
void gsk_vulkan_render_pass_print (GskVulkanRenderPass *self,
|
||||
GString *string,
|
||||
guint indent);
|
||||
|
||||
gpointer gsk_vulkan_render_pass_alloc_op (GskVulkanRenderPass *self,
|
||||
gsize size);
|
||||
|
||||
|
@ -2,6 +2,8 @@
|
||||
|
||||
#include "gskvulkanscissoropprivate.h"
|
||||
|
||||
#include "gskvulkanprivate.h"
|
||||
|
||||
typedef struct _GskVulkanScissorOp GskVulkanScissorOp;
|
||||
|
||||
struct _GskVulkanScissorOp
|
||||
@ -16,6 +18,19 @@ gsk_vulkan_scissor_op_finish (GskVulkanOp *op)
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
gsk_vulkan_scissor_op_print (GskVulkanOp *op,
|
||||
GString *string,
|
||||
guint indent)
|
||||
{
|
||||
GskVulkanScissorOp *self = (GskVulkanScissorOp *) op;
|
||||
|
||||
print_indent (string, indent);
|
||||
print_int_rect (string, &self->rect);
|
||||
g_string_append_printf (string, "scissor ");
|
||||
print_newline (string);
|
||||
}
|
||||
|
||||
static void
|
||||
gsk_vulkan_scissor_op_upload (GskVulkanOp *op,
|
||||
GskVulkanRenderPass *pass,
|
||||
@ -67,6 +82,7 @@ static const GskVulkanOpClass GSK_VULKAN_SCISSOR_OP_CLASS = {
|
||||
NULL,
|
||||
NULL,
|
||||
gsk_vulkan_scissor_op_finish,
|
||||
gsk_vulkan_scissor_op_print,
|
||||
gsk_vulkan_scissor_op_upload,
|
||||
gsk_vulkan_scissor_op_count_vertex_data,
|
||||
gsk_vulkan_scissor_op_collect_vertex_data,
|
||||
|
@ -29,6 +29,20 @@ gsk_vulkan_texture_op_finish (GskVulkanOp *op)
|
||||
g_object_unref (self->image);
|
||||
}
|
||||
|
||||
static void
|
||||
gsk_vulkan_texture_op_print (GskVulkanOp *op,
|
||||
GString *string,
|
||||
guint indent)
|
||||
{
|
||||
GskVulkanTextureOp *self = (GskVulkanTextureOp *) op;
|
||||
|
||||
print_indent (string, indent);
|
||||
print_rect (string, &self->rect);
|
||||
g_string_append (string, "texture ");
|
||||
print_image (string, self->image);
|
||||
print_newline (string);
|
||||
}
|
||||
|
||||
static void
|
||||
gsk_vulkan_texture_op_upload (GskVulkanOp *op,
|
||||
GskVulkanRenderPass *pass,
|
||||
@ -104,6 +118,7 @@ static const GskVulkanOpClass GSK_VULKAN_TEXTURE_OP_CLASS = {
|
||||
"texture",
|
||||
&gsk_vulkan_texture_info,
|
||||
gsk_vulkan_texture_op_finish,
|
||||
gsk_vulkan_texture_op_print,
|
||||
gsk_vulkan_texture_op_upload,
|
||||
gsk_vulkan_texture_op_count_vertex_data,
|
||||
gsk_vulkan_texture_op_collect_vertex_data,
|
||||
|
@ -2,6 +2,8 @@
|
||||
|
||||
#include "gskvulkanuploadcairoopprivate.h"
|
||||
|
||||
#include "gskvulkanprivate.h"
|
||||
|
||||
typedef struct _GskVulkanUploadCairoOp GskVulkanUploadCairoOp;
|
||||
|
||||
struct _GskVulkanUploadCairoOp
|
||||
@ -22,6 +24,19 @@ gsk_vulkan_upload_cairo_op_finish (GskVulkanOp *op)
|
||||
gsk_render_node_unref (self->node);
|
||||
}
|
||||
|
||||
static void
|
||||
gsk_vulkan_upload_cairo_op_print (GskVulkanOp *op,
|
||||
GString *string,
|
||||
guint indent)
|
||||
{
|
||||
GskVulkanUploadCairoOp *self = (GskVulkanUploadCairoOp *) op;
|
||||
|
||||
print_indent (string, indent);
|
||||
g_string_append (string, "upload-cairo ");
|
||||
print_image (string, self->image);
|
||||
print_newline (string);
|
||||
}
|
||||
|
||||
static void
|
||||
gsk_vulkan_upload_cairo_op_upload (GskVulkanOp *op,
|
||||
GskVulkanRenderPass *pass,
|
||||
@ -92,6 +107,7 @@ static const GskVulkanOpClass GSK_VULKAN_UPLOAD_CAIRO_OP_CLASS = {
|
||||
NULL,
|
||||
NULL,
|
||||
gsk_vulkan_upload_cairo_op_finish,
|
||||
gsk_vulkan_upload_cairo_op_print,
|
||||
gsk_vulkan_upload_cairo_op_upload,
|
||||
gsk_vulkan_upload_cairo_op_count_vertex_data,
|
||||
gsk_vulkan_upload_cairo_op_collect_vertex_data,
|
||||
|
@ -2,6 +2,8 @@
|
||||
|
||||
#include "gskvulkanuploadopprivate.h"
|
||||
|
||||
#include "gskvulkanprivate.h"
|
||||
|
||||
typedef struct _GskVulkanUploadOp GskVulkanUploadOp;
|
||||
|
||||
struct _GskVulkanUploadOp
|
||||
@ -21,6 +23,19 @@ gsk_vulkan_upload_op_finish (GskVulkanOp *op)
|
||||
g_object_unref (self->texture);
|
||||
}
|
||||
|
||||
static void
|
||||
gsk_vulkan_upload_op_print (GskVulkanOp *op,
|
||||
GString *string,
|
||||
guint indent)
|
||||
{
|
||||
GskVulkanUploadOp *self = (GskVulkanUploadOp *) op;
|
||||
|
||||
print_indent (string, indent);
|
||||
g_string_append (string, "upload ");
|
||||
print_image (string, self->image);
|
||||
print_newline (string);
|
||||
}
|
||||
|
||||
static void
|
||||
gsk_vulkan_upload_op_upload (GskVulkanOp *op,
|
||||
GskVulkanRenderPass *pass,
|
||||
@ -73,6 +88,7 @@ static const GskVulkanOpClass GSK_VULKAN_UPLOAD_OP_CLASS = {
|
||||
NULL,
|
||||
NULL,
|
||||
gsk_vulkan_upload_op_finish,
|
||||
gsk_vulkan_upload_op_print,
|
||||
gsk_vulkan_upload_op_upload,
|
||||
gsk_vulkan_upload_op_count_vertex_data,
|
||||
gsk_vulkan_upload_op_collect_vertex_data,
|
||||
|
Loading…
Reference in New Issue
Block a user