/* This file is auto-generated; any change will not be preserved */
#pragma once

typedef struct _GskGpuRoundedcolorInstance GskGpuRoundedcolorInstance;

struct _GskGpuRoundedcolorInstance {
  float outline[12];
  float color[4];
};

static inline void
gsk_gpu_roundedcolor_setup_vao (gsize offset)
{
  glEnableVertexAttribArray (0);
  glVertexAttribDivisor (0, 1);
  glVertexAttribPointer (0,
                         4,
                         GL_FLOAT,
                         GL_FALSE,
                         sizeof (GskGpuRoundedcolorInstance),
                         GSIZE_TO_POINTER (offset + G_STRUCT_OFFSET(GskGpuRoundedcolorInstance, outline)));
  glEnableVertexAttribArray (1);
  glVertexAttribDivisor (1, 1);
  glVertexAttribPointer (1,
                         4,
                         GL_FLOAT,
                         GL_FALSE,
                         sizeof (GskGpuRoundedcolorInstance),
                         GSIZE_TO_POINTER (offset + G_STRUCT_OFFSET(GskGpuRoundedcolorInstance, outline) + sizeof (float) * 4));
  glEnableVertexAttribArray (2);
  glVertexAttribDivisor (2, 1);
  glVertexAttribPointer (2,
                         4,
                         GL_FLOAT,
                         GL_FALSE,
                         sizeof (GskGpuRoundedcolorInstance),
                         GSIZE_TO_POINTER (offset + G_STRUCT_OFFSET(GskGpuRoundedcolorInstance, outline) + sizeof (float) * 8));
  glEnableVertexAttribArray (3);
  glVertexAttribDivisor (3, 1);
  glVertexAttribPointer (3,
                         4,
                         GL_FLOAT,
                         GL_FALSE,
                         sizeof (GskGpuRoundedcolorInstance),
                         GSIZE_TO_POINTER (offset + G_STRUCT_OFFSET(GskGpuRoundedcolorInstance, color)));
}


static void
gsk_gpu_roundedcolor_setup_attrib_locations (GLuint program)
{
  glBindAttribLocation (program, 0, "in_outline");
  glBindAttribLocation (program, 3, "in_color");
}


#ifdef GDK_RENDERING_VULKAN

static const VkPipelineVertexInputStateCreateInfo gsk_gpu_roundedcolor_info = {
  .sType = VK_STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_STATE_CREATE_INFO,
  .vertexBindingDescriptionCount = 1,
  .pVertexBindingDescriptions = (VkVertexInputBindingDescription[1]) {
      {
        .binding = 0,
        .stride = sizeof (GskGpuRoundedcolorInstance),
        .inputRate = VK_VERTEX_INPUT_RATE_INSTANCE
      }
  },
  .vertexAttributeDescriptionCount = 4,
  .pVertexAttributeDescriptions = (VkVertexInputAttributeDescription[4]) {
      {
        .location = 0,
        .binding = 0,
        .format = VK_FORMAT_R32G32B32A32_SFLOAT,
        .offset = G_STRUCT_OFFSET(GskGpuRoundedcolorInstance, outline),
      },
      {
        .location = 1,
        .binding = 0,
        .format = VK_FORMAT_R32G32B32A32_SFLOAT,
        .offset = G_STRUCT_OFFSET(GskGpuRoundedcolorInstance, outline) + sizeof (float) * 4,
      },
      {
        .location = 2,
        .binding = 0,
        .format = VK_FORMAT_R32G32B32A32_SFLOAT,
        .offset = G_STRUCT_OFFSET(GskGpuRoundedcolorInstance, outline) + sizeof (float) * 8,
      },
      {
        .location = 3,
        .binding = 0,
        .format = VK_FORMAT_R32G32B32A32_SFLOAT,
        .offset = G_STRUCT_OFFSET(GskGpuRoundedcolorInstance, color),
      },
  },
};

#endif

