vk/0.210.0: Change field names in vertex input structs
authorJason Ekstrand <jason.ekstrand@intel.com>
Tue, 1 Dec 2015 01:00:30 +0000 (17:00 -0800)
committerJason Ekstrand <jason.ekstrand@intel.com>
Thu, 3 Dec 2015 21:43:51 +0000 (13:43 -0800)
include/vulkan/vulkan.h
src/vulkan/anv_meta.c
src/vulkan/anv_meta_clear.c
src/vulkan/anv_pipeline.c
src/vulkan/gen7_pipeline.c
src/vulkan/gen8_pipeline.c

index 3a428ca54e60c0bd7286e00d92912c59ab5877f6..93c4047da9ee947691f7c91e47ff8844985c3efa 100644 (file)
@@ -1598,7 +1598,7 @@ typedef struct VkPipelineShaderStageCreateInfo {
 
 typedef struct VkVertexInputBindingDescription {
     uint32_t                                    binding;
-    uint32_t                                    strideInBytes;
+    uint32_t                                    stride;
     VkVertexInputRate                           inputRate;
 } VkVertexInputBindingDescription;
 
@@ -1606,15 +1606,15 @@ typedef struct VkVertexInputAttributeDescription {
     uint32_t                                    location;
     uint32_t                                    binding;
     VkFormat                                    format;
-    uint32_t                                    offsetInBytes;
+    uint32_t                                    offset;
 } VkVertexInputAttributeDescription;
 
 typedef struct VkPipelineVertexInputStateCreateInfo {
     VkStructureType                             sType;
     const void*                                 pNext;
-    uint32_t                                    bindingCount;
+    uint32_t                                    vertexBindingDescriptionCount;
     const VkVertexInputBindingDescription*      pVertexBindingDescriptions;
-    uint32_t                                    attributeCount;
+    uint32_t                                    vertexAttributeDescriptionCount;
     const VkVertexInputAttributeDescription*    pVertexAttributeDescriptions;
 } VkPipelineVertexInputStateCreateInfo;
 
index 3f93e1d0b447e32a9f6ac8149cba44411afc00b6..f28775e0f7ae7bf9bc1382d231e4c17a357c98b8 100644 (file)
@@ -264,41 +264,41 @@ anv_device_init_meta_blit_state(struct anv_device *device)
 
    VkPipelineVertexInputStateCreateInfo vi_create_info = {
       .sType = VK_STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_STATE_CREATE_INFO,
-      .bindingCount = 2,
+      .vertexBindingDescriptionCount = 2,
       .pVertexBindingDescriptions = (VkVertexInputBindingDescription[]) {
          {
             .binding = 0,
-            .strideInBytes = 0,
+            .stride = 0,
             .inputRate = VK_VERTEX_INPUT_RATE_VERTEX
          },
          {
             .binding = 1,
-            .strideInBytes = 5 * sizeof(float),
+            .stride = 5 * sizeof(float),
             .inputRate = VK_VERTEX_INPUT_RATE_VERTEX
          },
       },
-      .attributeCount = 3,
+      .vertexAttributeDescriptionCount = 3,
       .pVertexAttributeDescriptions = (VkVertexInputAttributeDescription[]) {
          {
             /* VUE Header */
             .location = 0,
             .binding = 0,
             .format = VK_FORMAT_R32G32B32A32_UINT,
-            .offsetInBytes = 0
+            .offset = 0
          },
          {
             /* Position */
             .location = 1,
             .binding = 1,
             .format = VK_FORMAT_R32G32_SFLOAT,
-            .offsetInBytes = 0
+            .offset = 0
          },
          {
             /* Texture Coordinate */
             .location = 2,
             .binding = 1,
             .format = VK_FORMAT_R32G32B32_SFLOAT,
-            .offsetInBytes = 8
+            .offset = 8
          }
       }
    };
index d1f1d95a3aa7db242ea538f6494474f9cdccf75f..9f3085005f4e31518ec25c243648aecd212d8a16 100644 (file)
@@ -241,36 +241,36 @@ init_color_pipeline(struct anv_device *device)
 
    const VkPipelineVertexInputStateCreateInfo vi_state = {
       .sType = VK_STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_STATE_CREATE_INFO,
-      .bindingCount = 1,
+      .vertexBindingDescriptionCount = 1,
       .pVertexBindingDescriptions = (VkVertexInputBindingDescription[]) {
          {
             .binding = 0,
-            .strideInBytes = sizeof(struct color_clear_vattrs),
+            .stride = sizeof(struct color_clear_vattrs),
             .inputRate = VK_VERTEX_INPUT_RATE_VERTEX
          },
       },
-      .attributeCount = 3,
+      .vertexAttributeDescriptionCount = 3,
       .pVertexAttributeDescriptions = (VkVertexInputAttributeDescription[]) {
          {
             /* VUE Header */
             .location = 0,
             .binding = 0,
             .format = VK_FORMAT_R32G32B32A32_UINT,
-            .offsetInBytes = offsetof(struct color_clear_vattrs, vue_header),
+            .offset = offsetof(struct color_clear_vattrs, vue_header),
          },
          {
             /* Position */
             .location = 1,
             .binding = 0,
             .format = VK_FORMAT_R32G32_SFLOAT,
-            .offsetInBytes = offsetof(struct color_clear_vattrs, position),
+            .offset = offsetof(struct color_clear_vattrs, position),
          },
          {
             /* Color */
             .location = 2,
             .binding = 0,
             .format = VK_FORMAT_R32G32B32A32_SFLOAT,
-            .offsetInBytes = offsetof(struct color_clear_vattrs, color),
+            .offset = offsetof(struct color_clear_vattrs, color),
          },
       },
    };
@@ -424,29 +424,29 @@ create_depthstencil_pipeline(struct anv_device *device,
 
    const VkPipelineVertexInputStateCreateInfo vi_state = {
       .sType = VK_STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_STATE_CREATE_INFO,
-      .bindingCount = 1,
+      .vertexBindingDescriptionCount = 1,
       .pVertexBindingDescriptions = (VkVertexInputBindingDescription[]) {
          {
             .binding = 0,
-            .strideInBytes = sizeof(struct depthstencil_clear_vattrs),
+            .stride = sizeof(struct depthstencil_clear_vattrs),
             .inputRate = VK_VERTEX_INPUT_RATE_VERTEX
          },
       },
-      .attributeCount = 2,
+      .vertexAttributeDescriptionCount = 2,
       .pVertexAttributeDescriptions = (VkVertexInputAttributeDescription[]) {
          {
             /* VUE Header */
             .location = 0,
             .binding = 0,
             .format = VK_FORMAT_R32G32B32A32_UINT,
-            .offsetInBytes = offsetof(struct depthstencil_clear_vattrs, vue_header),
+            .offset = offsetof(struct depthstencil_clear_vattrs, vue_header),
          },
          {
             /* Position */
             .location = 1,
             .binding = 0,
             .format = VK_FORMAT_R32G32_SFLOAT,
-            .offsetInBytes = offsetof(struct depthstencil_clear_vattrs, position),
+            .offset = offsetof(struct depthstencil_clear_vattrs, position),
          },
       },
    };
index e4209bd13c9e528e40e3b512d9b702d6f14d915f..41a26c70d8587cfc6f8ea8aa9f24b4f3bcdc1e1e 100644 (file)
@@ -1034,12 +1034,12 @@ anv_pipeline_init(struct anv_pipeline *pipeline, struct anv_device *device,
    const VkPipelineVertexInputStateCreateInfo *vi_info =
       pCreateInfo->pVertexInputState;
    pipeline->vb_used = 0;
-   for (uint32_t i = 0; i < vi_info->bindingCount; i++) {
+   for (uint32_t i = 0; i < vi_info->vertexBindingDescriptionCount; i++) {
       const VkVertexInputBindingDescription *desc =
          &vi_info->pVertexBindingDescriptions[i];
 
       pipeline->vb_used |= 1 << desc->binding;
-      pipeline->binding_stride[desc->binding] = desc->strideInBytes;
+      pipeline->binding_stride[desc->binding] = desc->stride;
 
       /* Step rate is programmed per vertex element (attribute), not
        * binding. Set up a map of which bindings step per instance, for
index 2f51b4bfc733ece8a327af825682e9c2afe97e78..f63ca4dcb4f40577647f6b2d8d5cea0f110d21d6 100644 (file)
@@ -38,17 +38,18 @@ gen7_emit_vertex_input(struct anv_pipeline *pipeline,
 {
    const bool sgvs = pipeline->vs_prog_data.uses_vertexid ||
       pipeline->vs_prog_data.uses_instanceid;
-   const uint32_t element_count = info->attributeCount + (sgvs ? 1 : 0);
+   const uint32_t element_count =
+      info->vertexAttributeDescriptionCount + (sgvs ? 1 : 0);
    const uint32_t num_dwords = 1 + element_count * 2;
    uint32_t *p;
 
-   if (info->attributeCount == 0 && !sgvs)
+   if (info->vertexAttributeDescriptionCount == 0 && !sgvs)
       return;
 
    p = anv_batch_emitn(&pipeline->batch, num_dwords,
                        GEN7_3DSTATE_VERTEX_ELEMENTS);
 
-   for (uint32_t i = 0; i < info->attributeCount; i++) {
+   for (uint32_t i = 0; i < info->vertexAttributeDescriptionCount; i++) {
       const VkVertexInputAttributeDescription *desc =
          &info->pVertexAttributeDescriptions[i];
       const struct anv_format *format = anv_format_for_vk_format(desc->format);
@@ -58,7 +59,7 @@ gen7_emit_vertex_input(struct anv_pipeline *pipeline,
          .Valid = true,
          .SourceElementFormat = format->surface_format,
          .EdgeFlagEnable = false,
-         .SourceElementOffset = desc->offsetInBytes,
+         .SourceElementOffset = desc->offset,
          .Component0Control = VFCOMP_STORE_SRC,
          .Component1Control = format->num_channels >= 2 ? VFCOMP_STORE_SRC : VFCOMP_STORE_0,
          .Component2Control = format->num_channels >= 3 ? VFCOMP_STORE_SRC : VFCOMP_STORE_0,
@@ -77,7 +78,7 @@ gen7_emit_vertex_input(struct anv_pipeline *pipeline,
          .Component2Control = VFCOMP_STORE_VID,
          .Component3Control = VFCOMP_STORE_IID
       };
-      GEN7_VERTEX_ELEMENT_STATE_pack(NULL, &p[1 + info->attributeCount * 2], &element);
+      GEN7_VERTEX_ELEMENT_STATE_pack(NULL, &p[1 + info->vertexAttributeDescriptionCount * 2], &element);
    }
 }
 
index 16143300cf1fccd35a00d83f7199424a753aa5fb..9bf7d2d555e5f75b09d4e8bfeb334cc867b52c65 100644 (file)
@@ -36,17 +36,17 @@ static void
 emit_vertex_input(struct anv_pipeline *pipeline,
                   const VkPipelineVertexInputStateCreateInfo *info)
 {
-   const uint32_t num_dwords = 1 + info->attributeCount * 2;
+   const uint32_t num_dwords = 1 + info->vertexAttributeDescriptionCount * 2;
    uint32_t *p;
 
    static_assert(ANV_GEN >= 8, "should be compiling this for gen < 8");
 
-   if (info->attributeCount > 0) {
+   if (info->vertexAttributeDescriptionCount > 0) {
       p = anv_batch_emitn(&pipeline->batch, num_dwords,
                           GENX(3DSTATE_VERTEX_ELEMENTS));
    }
 
-   for (uint32_t i = 0; i < info->attributeCount; i++) {
+   for (uint32_t i = 0; i < info->vertexAttributeDescriptionCount; i++) {
       const VkVertexInputAttributeDescription *desc =
          &info->pVertexAttributeDescriptions[i];
       const struct anv_format *format = anv_format_for_vk_format(desc->format);
@@ -56,7 +56,7 @@ emit_vertex_input(struct anv_pipeline *pipeline,
          .Valid = true,
          .SourceElementFormat = format->surface_format,
          .EdgeFlagEnable = false,
-         .SourceElementOffset = desc->offsetInBytes,
+         .SourceElementOffset = desc->offset,
          .Component0Control = VFCOMP_STORE_SRC,
          .Component1Control = format->num_channels >= 2 ? VFCOMP_STORE_SRC : VFCOMP_STORE_0,
          .Component2Control = format->num_channels >= 3 ? VFCOMP_STORE_SRC : VFCOMP_STORE_0,
@@ -75,10 +75,10 @@ emit_vertex_input(struct anv_pipeline *pipeline,
    anv_batch_emit(&pipeline->batch, GENX(3DSTATE_VF_SGVS),
                   .VertexIDEnable = pipeline->vs_prog_data.uses_vertexid,
                   .VertexIDComponentNumber = 2,
-                  .VertexIDElementOffset = info->bindingCount,
+                  .VertexIDElementOffset = info->vertexBindingDescriptionCount,
                   .InstanceIDEnable = pipeline->vs_prog_data.uses_instanceid,
                   .InstanceIDComponentNumber = 3,
-                  .InstanceIDElementOffset = info->bindingCount);
+                  .InstanceIDElementOffset = info->vertexBindingDescriptionCount);
 }
 
 static void
@@ -355,7 +355,7 @@ genX(graphics_pipeline_create)(
     * inputs. */
    if (pipeline->vs_simd8 == NO_KERNEL) {
       pipeline->wm_prog_data.num_varying_inputs =
-         pCreateInfo->pVertexInputState->attributeCount - 2;
+         pCreateInfo->pVertexInputState->vertexAttributeDescriptionCount - 2;
    }
 
    assert(pCreateInfo->pVertexInputState);