aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCody Northrop <cody@lunarg.com>2015-08-04 10:47:08 -0600
committerCody Northrop <cody@lunarg.com>2015-08-04 17:37:03 -0600
commit2e11cade51d0a0f08aa4f55d9fb96a33b40726fb (patch)
treef0108d17d0611045986fcb6875f72a7e6463974e
parent4d3c11d455499e57557264e41048a922172516d7 (diff)
downloadusermoji-2e11cade51d0a0f08aa4f55d9fb96a33b40726fb.tar.xz
v142: Bug 14275 - Remove image layouts in VkFramebufferCreateInfo
-rw-r--r--demos/cube.c15
-rw-r--r--demos/tri.c15
-rw-r--r--include/vulkan.h11
-rw-r--r--layers/draw_state.cpp4
-rw-r--r--layers/param_checker.cpp7
5 files changed, 13 insertions, 39 deletions
diff --git a/demos/cube.c b/demos/cube.c
index a848bcc5..2c1acd3a 100644
--- a/demos/cube.c
+++ b/demos/cube.c
@@ -1772,16 +1772,9 @@ static void demo_prepare_descriptor_set(struct demo *demo)
static void demo_prepare_framebuffers(struct demo *demo)
{
- VkAttachmentBindInfo attachments[2] = {
- [0] = {
- .view.handle = VK_NULL_HANDLE,
- .layout = VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL,
- },
- [1] = {
- .view = demo->depth.view,
- .layout = VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL,
- },
- };
+ VkAttachmentView attachments[2];
+ attachments[1] = demo->depth.view;
+
const VkFramebufferCreateInfo fb_info = {
.sType = VK_STRUCTURE_TYPE_FRAMEBUFFER_CREATE_INFO,
.pNext = NULL,
@@ -1796,7 +1789,7 @@ static void demo_prepare_framebuffers(struct demo *demo)
uint32_t i;
for (i = 0; i < DEMO_BUFFER_COUNT; i++) {
- attachments[0].view = demo->buffers[i].view;
+ attachments[0] = demo->buffers[i].view;
err = vkCreateFramebuffer(demo->device, &fb_info, &demo->framebuffers[i]);
assert(!err);
}
diff --git a/demos/tri.c b/demos/tri.c
index 6c094ffd..134e261b 100644
--- a/demos/tri.c
+++ b/demos/tri.c
@@ -1394,16 +1394,9 @@ static void demo_prepare_descriptor_set(struct demo *demo)
static void demo_prepare_framebuffers(struct demo *demo)
{
- VkAttachmentBindInfo attachments[2] = {
- [0] = {
- .view.handle = VK_NULL_HANDLE,
- .layout = VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL,
- },
- [1] = {
- .view = demo->depth.view,
- .layout = VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL,
- },
- };
+ VkAttachmentView attachments[2];
+ attachments[1] = demo->depth.view;
+
const VkFramebufferCreateInfo fb_info = {
.sType = VK_STRUCTURE_TYPE_FRAMEBUFFER_CREATE_INFO,
.pNext = NULL,
@@ -1418,7 +1411,7 @@ static void demo_prepare_framebuffers(struct demo *demo)
uint32_t i;
for (i = 0; i < DEMO_BUFFER_COUNT; i++) {
- attachments[0].view = demo->buffers[i].view;
+ attachments[0]= demo->buffers[i].view;
err = vkCreateFramebuffer(demo->device, &fb_info, &demo->framebuffers[i]);
assert(!err);
}
diff --git a/include/vulkan.h b/include/vulkan.h
index 36d8b2cc..33ccde74 100644
--- a/include/vulkan.h
+++ b/include/vulkan.h
@@ -41,14 +41,14 @@ extern "C" {
((major << 22) | (minor << 12) | patch)
// Vulkan API version supported by this file
-#define VK_API_VERSION VK_MAKE_VERSION(0, 140, 0)
+#define VK_API_VERSION VK_MAKE_VERSION(0, 142, 0)
#define VK_DEFINE_HANDLE(obj) typedef struct obj##_T* obj;
#if defined(__cplusplus)
- #if (_MSC_VER >= 1800 || __cplusplus >= 201103L)
+ #if ((defined(_MSC_VER) && _MSC_VER >= 1800) || __cplusplus >= 201103L)
// The bool operator only works if there are no implicit conversions from an obj to
// a bool-compatible type, which can then be used to unintentionally violate type safety.
// C++11 and above supports the "explicit" keyword on conversion operators to stop this
@@ -1860,16 +1860,11 @@ typedef struct {
} VkDynamicDepthStencilStateCreateInfo;
typedef struct {
- VkAttachmentView view;
- VkImageLayout layout;
-} VkAttachmentBindInfo;
-
-typedef struct {
VkStructureType sType;
const void* pNext;
VkRenderPass renderPass;
uint32_t attachmentCount;
- const VkAttachmentBindInfo* pAttachments;
+ const VkAttachmentView* pAttachments;
uint32_t width;
uint32_t height;
uint32_t layers;
diff --git a/layers/draw_state.cpp b/layers/draw_state.cpp
index e17a36e4..b8b9df1b 100644
--- a/layers/draw_state.cpp
+++ b/layers/draw_state.cpp
@@ -2783,8 +2783,8 @@ VK_LAYER_EXPORT VkResult VKAPI vkCreateFramebuffer(VkDevice device, const VkFram
// Shadow create info and store in map
VkFramebufferCreateInfo* localFBCI = new VkFramebufferCreateInfo(*pCreateInfo);
if (pCreateInfo->pAttachments) {
- localFBCI->pAttachments = new VkAttachmentBindInfo[localFBCI->attachmentCount];
- memcpy((void*)localFBCI->pAttachments, pCreateInfo->pAttachments, localFBCI->attachmentCount*sizeof(VkAttachmentBindInfo));
+ localFBCI->pAttachments = new VkAttachmentView[localFBCI->attachmentCount];
+ memcpy((void*)localFBCI->pAttachments, pCreateInfo->pAttachments, localFBCI->attachmentCount*sizeof(VkAttachmentView));
}
frameBufferMap[pFramebuffer->handle] = localFBCI;
}
diff --git a/layers/param_checker.cpp b/layers/param_checker.cpp
index 0c7b4d48..1547fbbe 100644
--- a/layers/param_checker.cpp
+++ b/layers/param_checker.cpp
@@ -6134,13 +6134,6 @@ bool PreCreateFramebuffer(
}
if(pCreateInfo->pAttachments != nullptr)
{
- if(pCreateInfo->pAttachments->layout < VK_IMAGE_LAYOUT_BEGIN_RANGE ||
- pCreateInfo->pAttachments->layout > VK_IMAGE_LAYOUT_END_RANGE)
- {
- log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK",
- "vkCreateFramebuffer parameter, VkImageLayout pCreateInfo->pAttachments->layout, is an unrecognized enumerator");
- return false;
- }
}
}