gtk/gsk/gpu/gskgpushaderopprivate.h
Benjamin Otte 73ac2d0a1c gpu: Add a flip_y argument to shader execution
Because GL flips its shit sometimes (ie when it's the framebuffer),
pass the height of the target as the flip variable, so commands
that need to operate on the pixels can flip the y axis around this value.
2024-01-07 07:22:49 +01:00

70 lines
3.5 KiB
C

#pragma once
#include "gskgpuopprivate.h"
#include "gskgputypesprivate.h"
G_BEGIN_DECLS
struct _GskGpuShaderOp
{
GskGpuOp parent_op;
GskGpuShaderClip clip;
gsize vertex_offset;
struct {
GskGpuImage *image;
GskGpuSampler sampler;
guint32 descriptor;
} images[2];
gsize n_images;
};
struct _GskGpuShaderOpClass
{
GskGpuOpClass parent_class;
const char * shader_name;
gsize vertex_size;
#ifdef GDK_RENDERING_VULKAN
const VkPipelineVertexInputStateCreateInfo *vertex_input_state;
#endif
void (* setup_vao) (gsize offset);
};
GskGpuShaderOp * gsk_gpu_shader_op_alloc (GskGpuFrame *frame,
const GskGpuShaderOpClass *op_class,
GskGpuShaderClip clip,
gpointer out_vertex_data);
void gsk_gpu_shader_op_finish (GskGpuOp *op);
guint32 gsk_gpu_shader_op_use_image (GskGpuShaderOp *self,
GskGpuFrame *frame,
GskGpuImage *image,
GskGpuSampler sampler);
#ifdef GDK_RENDERING_VULKAN
GskGpuOp * gsk_gpu_shader_op_vk_command_n (GskGpuOp *op,
GskGpuFrame *frame,
VkRenderPass render_pass,
VkFormat format,
VkCommandBuffer command_buffer,
gsize instance_scale);
GskGpuOp * gsk_gpu_shader_op_vk_command (GskGpuOp *op,
GskGpuFrame *frame,
VkRenderPass render_pass,
VkFormat format,
VkCommandBuffer command_buffer);
#endif
GskGpuOp * gsk_gpu_shader_op_gl_command_n (GskGpuOp *op,
GskGpuFrame *frame,
gsize flip_y,
gsize instance_scale);
GskGpuOp * gsk_gpu_shader_op_gl_command (GskGpuOp *op,
GskGpuFrame *frame,
gsize flip_y);
G_END_DECLS