From 6d29a412f24aeb945f537c0b47a0dd7cf3a24a07 Mon Sep 17 00:00:00 2001 From: Chia-I Wu Date: Mon, 25 May 2015 16:22:52 +0800 Subject: v98: rename count to arraySize in VkDescriptorSetLayoutBinding Conflicts: include/vulkan.h --- demos/cube.c | 4 ++-- demos/tri.c | 2 +- include/vulkan.h | 4 ++-- layers/draw_state.cpp | 12 ++++++------ 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/demos/cube.c b/demos/cube.c index 91281d59..992251d8 100644 --- a/demos/cube.c +++ b/demos/cube.c @@ -1159,13 +1159,13 @@ static void demo_prepare_descriptor_layout(struct demo *demo) const VkDescriptorSetLayoutBinding layout_bindings[2] = { [0] = { .descriptorType = VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER, - .count = 1, + .arraySize = 1, .stageFlags = VK_SHADER_STAGE_VERTEX_BIT, .pImmutableSamplers = NULL, }, [1] = { .descriptorType = VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, - .count = DEMO_TEXTURE_COUNT, + .arraySize = DEMO_TEXTURE_COUNT, .stageFlags = VK_SHADER_STAGE_FRAGMENT_BIT, .pImmutableSamplers = NULL, }, diff --git a/demos/tri.c b/demos/tri.c index df4c63b2..d8264a1f 100644 --- a/demos/tri.c +++ b/demos/tri.c @@ -795,7 +795,7 @@ static void demo_prepare_descriptor_layout(struct demo *demo) { const VkDescriptorSetLayoutBinding layout_binding = { .descriptorType = VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, - .count = DEMO_TEXTURE_COUNT, + .arraySize = DEMO_TEXTURE_COUNT, .stageFlags = VK_SHADER_STAGE_FRAGMENT_BIT, .pImmutableSamplers = NULL, }; diff --git a/include/vulkan.h b/include/vulkan.h index 36cca755..0a39d18b 100644 --- a/include/vulkan.h +++ b/include/vulkan.h @@ -33,7 +33,7 @@ #include "vk_platform.h" // Vulkan API version supported by this file -#define VK_API_VERSION VK_MAKE_VERSION(0, 97, 0) +#define VK_API_VERSION VK_MAKE_VERSION(0, 97, 1) #ifdef __cplusplus extern "C" @@ -1709,7 +1709,7 @@ typedef struct VkShaderCreateInfo_ typedef struct VkDescriptorSetLayoutBinding_ { VkDescriptorType descriptorType; // Type of the descriptors in this binding - uint32_t count; // Number of descriptors in this binding + uint32_t arraySize; // Number of descriptors in this binding VkShaderStageFlags stageFlags; // Shader stages this binding is visible to const VkSampler* pImmutableSamplers; // Immutable samplers (used if descriptor type is SAMPLER or COMBINED_IMAGE_SAMPLER, is either NULL or contains number of elements) } VkDescriptorSetLayoutBinding; diff --git a/layers/draw_state.cpp b/layers/draw_state.cpp index 20ccd701..28951327 100755 --- a/layers/draw_state.cpp +++ b/layers/draw_state.cpp @@ -676,7 +676,7 @@ static uint32_t getBindingStartIndex(const LAYOUT_NODE* pLayout, const uint32_t { uint32_t offsetIndex = 0; for (uint32_t i = 0; icreateInfo.pBinding[i].count; + offsetIndex += pLayout->createInfo.pBinding[i].arraySize; } return offsetIndex; } @@ -685,7 +685,7 @@ static uint32_t getBindingEndIndex(const LAYOUT_NODE* pLayout, const uint32_t bi { uint32_t offsetIndex = 0; for (uint32_t i = 0; i<=binding; i++) { - offsetIndex += pLayout->createInfo.pBinding[i].count; + offsetIndex += pLayout->createInfo.pBinding[i].arraySize; } return offsetIndex-1; } @@ -1737,11 +1737,11 @@ VK_LAYER_EXPORT VkResult VKAPI vkCreateDescriptorSetLayout(VkDevice device, cons memcpy((void*)pNewNode->createInfo.pBinding, pCreateInfo->pBinding, sizeof(VkDescriptorSetLayoutBinding)*pCreateInfo->count); uint32_t totalCount = 0; for (uint32_t i=0; icount; i++) { - totalCount += pCreateInfo->pBinding[i].count; + totalCount += pCreateInfo->pBinding[i].arraySize; if (pCreateInfo->pBinding[i].pImmutableSamplers) { VkSampler** ppIS = (VkSampler**)&pNewNode->createInfo.pBinding[i].pImmutableSamplers; - *ppIS = new VkSampler[pCreateInfo->pBinding[i].count]; - memcpy(*ppIS, pCreateInfo->pBinding[i].pImmutableSamplers, pCreateInfo->pBinding[i].count*sizeof(VkSampler)); + *ppIS = new VkSampler[pCreateInfo->pBinding[i].arraySize]; + memcpy(*ppIS, pCreateInfo->pBinding[i].pImmutableSamplers, pCreateInfo->pBinding[i].arraySize*sizeof(VkSampler)); } } if (totalCount > 0) { @@ -1749,7 +1749,7 @@ VK_LAYER_EXPORT VkResult VKAPI vkCreateDescriptorSetLayout(VkDevice device, cons uint32_t offset = 0; uint32_t j = 0; for (uint32_t i=0; icount; i++) { - for (j = 0; j < pCreateInfo->pBinding[i].count; j++) { + for (j = 0; j < pCreateInfo->pBinding[i].arraySize; j++) { pNewNode->pTypes[offset + j] = pCreateInfo->pBinding[i].descriptorType; } offset += j; -- cgit v1.2.3