Code cleanup, removed unnecessary VERTEX_BUFFER_BIND_ID

This commit is contained in:
Sascha Willems 2024-01-08 20:26:41 +01:00
parent fc3e535074
commit 6893a04a43
12 changed files with 38 additions and 56 deletions

View file

@ -10,8 +10,6 @@
#include "vulkanexamplebase.h"
#define VERTEX_BUFFER_BIND_ID 0
// Vertex layout for this example
struct Vertex {
float pos[3];
@ -222,7 +220,7 @@ public:
// Signed distance field font
vkCmdBindDescriptorSets(drawCmdBuffers[i], VK_PIPELINE_BIND_POINT_GRAPHICS, pipelineLayout, 0, 1, &descriptorSets.sdf, 0, NULL);
vkCmdBindPipeline(drawCmdBuffers[i], VK_PIPELINE_BIND_POINT_GRAPHICS, pipelines.sdf);
vkCmdBindVertexBuffers(drawCmdBuffers[i], VERTEX_BUFFER_BIND_ID, 1, &vertexBuffer.buffer, offsets);
vkCmdBindVertexBuffers(drawCmdBuffers[i], 0, 1, &vertexBuffer.buffer, offsets);
vkCmdBindIndexBuffer(drawCmdBuffers[i], indexBuffer.buffer, 0, VK_INDEX_TYPE_UINT32);
vkCmdDrawIndexed(drawCmdBuffers[i], indexCount, 1, 0, 0, 0);
@ -325,7 +323,7 @@ public:
vertices.bindingDescriptions.resize(1);
vertices.bindingDescriptions[0] =
vks::initializers::vertexInputBindingDescription(
VERTEX_BUFFER_BIND_ID,
0,
sizeof(Vertex),
VK_VERTEX_INPUT_RATE_VERTEX);
@ -335,14 +333,14 @@ public:
// Location 0 : Position
vertices.attributeDescriptions[0] =
vks::initializers::vertexInputAttributeDescription(
VERTEX_BUFFER_BIND_ID,
0,
0,
VK_FORMAT_R32G32B32_SFLOAT,
0);
// Location 1 : Texture coordinates
vertices.attributeDescriptions[1] =
vks::initializers::vertexInputAttributeDescription(
VERTEX_BUFFER_BIND_ID,
0,
1,
VK_FORMAT_R32G32_SFLOAT,
sizeof(float) * 3);