summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJason Ekstrand <jason.ekstrand@intel.com>2015-12-01 13:39:28 -0800
committerJason Ekstrand <jason.ekstrand@intel.com>2015-12-03 13:43:53 -0800
commitb1cd025b88e3651fac8dd2f7861516f653422ee4 (patch)
tree909a154b9833b5fd4fe03d1c986dc80ca59cca25
parent43f3e92348939ba6e0c09d219739001f195a69fd (diff)
downloadexternal_mesa3d-b1cd025b88e3651fac8dd2f7861516f653422ee4.zip
external_mesa3d-b1cd025b88e3651fac8dd2f7861516f653422ee4.tar.gz
external_mesa3d-b1cd025b88e3651fac8dd2f7861516f653422ee4.tar.bz2
vk/0.210.0: Replace MemoryInput/OutputFlags with AccessFlags
-rw-r--r--include/vulkan/vulkan.h65
-rw-r--r--src/vulkan/anv_dump.c4
-rw-r--r--src/vulkan/genX_cmd_buffer.c63
3 files changed, 71 insertions, 61 deletions
diff --git a/include/vulkan/vulkan.h b/include/vulkan/vulkan.h
index 484ce8f..5a13260 100644
--- a/include/vulkan/vulkan.h
+++ b/include/vulkan/vulkan.h
@@ -1003,28 +1003,31 @@ typedef enum VkPipelineStageFlagBits {
} VkPipelineStageFlagBits;
typedef VkFlags VkPipelineStageFlags;
-typedef enum {
- VK_MEMORY_OUTPUT_HOST_WRITE_BIT = 0x00000001,
- VK_MEMORY_OUTPUT_SHADER_WRITE_BIT = 0x00000002,
- VK_MEMORY_OUTPUT_COLOR_ATTACHMENT_BIT = 0x00000004,
- VK_MEMORY_OUTPUT_DEPTH_STENCIL_ATTACHMENT_BIT = 0x00000008,
- VK_MEMORY_OUTPUT_TRANSFER_BIT = 0x00000010,
-} VkMemoryOutputFlagBits;
-typedef VkFlags VkMemoryOutputFlags;
-
-typedef enum {
- VK_MEMORY_INPUT_HOST_READ_BIT = 0x00000001,
- VK_MEMORY_INPUT_INDIRECT_COMMAND_BIT = 0x00000002,
- VK_MEMORY_INPUT_INDEX_FETCH_BIT = 0x00000004,
- VK_MEMORY_INPUT_VERTEX_ATTRIBUTE_FETCH_BIT = 0x00000008,
- VK_MEMORY_INPUT_UNIFORM_READ_BIT = 0x00000010,
- VK_MEMORY_INPUT_SHADER_READ_BIT = 0x00000020,
- VK_MEMORY_INPUT_COLOR_ATTACHMENT_BIT = 0x00000040,
- VK_MEMORY_INPUT_DEPTH_STENCIL_ATTACHMENT_BIT = 0x00000080,
- VK_MEMORY_INPUT_INPUT_ATTACHMENT_BIT = 0x00000100,
- VK_MEMORY_INPUT_TRANSFER_BIT = 0x00000200,
-} VkMemoryInputFlagBits;
-typedef VkFlags VkMemoryInputFlags;
+typedef enum VkAccessFlagBits {
+ VK_ACCESS_INDIRECT_COMMAND_READ_BIT = 0x00000001,
+ VK_ACCESS_INDEX_READ_BIT = 0x00000002,
+ VK_ACCESS_VERTEX_ATTRIBUTE_READ_BIT = 0x00000004,
+ VK_ACCESS_UNIFORM_READ_BIT = 0x00000008,
+ VK_ACCESS_INPUT_ATTACHMENT_READ_BIT = 0x00000010,
+ VK_ACCESS_SHADER_READ_BIT = 0x00000020,
+ VK_ACCESS_SHADER_WRITE_BIT = 0x00000040,
+ VK_ACCESS_COLOR_ATTACHMENT_READ_BIT = 0x00000080,
+ VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT = 0x00000100,
+ VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_READ_BIT = 0x00000200,
+ VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT = 0x00000400,
+ VK_ACCESS_TRANSFER_READ_BIT = 0x00000800,
+ VK_ACCESS_TRANSFER_WRITE_BIT = 0x00001000,
+ VK_ACCESS_HOST_READ_BIT = 0x00002000,
+ VK_ACCESS_HOST_WRITE_BIT = 0x00004000,
+ VK_ACCESS_MEMORY_READ_BIT = 0x00008000,
+ VK_ACCESS_MEMORY_WRITE_BIT = 0x00010000,
+} VkAccessFlagBits;
+typedef VkFlags VkAccessFlags;
+
+typedef enum VkDependencyFlagBits {
+ VK_DEPENDENCY_BY_REGION_BIT = 0x00000001,
+} VkDependencyFlagBits;
+typedef VkFlags VkDependencyFlags;
typedef enum VkCommandPoolCreateFlagBits {
VK_COMMAND_POOL_CREATE_TRANSIENT_BIT = 0x00000001,
@@ -1941,9 +1944,9 @@ typedef struct VkSubpassDependency {
uint32_t dstSubpass;
VkPipelineStageFlags srcStageMask;
VkPipelineStageFlags dstStageMask;
- VkMemoryOutputFlags outputMask;
- VkMemoryInputFlags inputMask;
- VkBool32 byRegion;
+ VkAccessFlags srcAccessMask;
+ VkAccessFlags dstAccessMask;
+ VkDependencyFlags dependencyFlags;
} VkSubpassDependency;
typedef struct VkRenderPassCreateInfo {
@@ -2070,8 +2073,8 @@ typedef struct VkRenderPassBeginInfo {
typedef struct VkBufferMemoryBarrier {
VkStructureType sType;
const void* pNext;
- VkMemoryOutputFlags outputMask;
- VkMemoryInputFlags inputMask;
+ VkAccessFlags srcAccessMask;
+ VkAccessFlags dstAccessMask;
uint32_t srcQueueFamilyIndex;
uint32_t destQueueFamilyIndex;
VkBuffer buffer;
@@ -2103,8 +2106,8 @@ typedef struct VkDrawIndirectCommand {
typedef struct VkImageMemoryBarrier {
VkStructureType sType;
const void* pNext;
- VkMemoryOutputFlags outputMask;
- VkMemoryInputFlags inputMask;
+ VkAccessFlags srcAccessMask;
+ VkAccessFlags dstAccessMask;
VkImageLayout oldLayout;
VkImageLayout newLayout;
uint32_t srcQueueFamilyIndex;
@@ -2116,8 +2119,8 @@ typedef struct VkImageMemoryBarrier {
typedef struct VkMemoryBarrier {
VkStructureType sType;
const void* pNext;
- VkMemoryOutputFlags outputMask;
- VkMemoryInputFlags inputMask;
+ VkAccessFlags srcAccessMask;
+ VkAccessFlags dstAccessMask;
} VkMemoryBarrier;
diff --git a/src/vulkan/anv_dump.c b/src/vulkan/anv_dump.c
index 80d9fce..9d323d7 100644
--- a/src/vulkan/anv_dump.c
+++ b/src/vulkan/anv_dump.c
@@ -134,8 +134,8 @@ anv_dump_image_to_ppm(struct anv_device *device,
true, 1,
(const void * []) { &(VkImageMemoryBarrier) {
.sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER,
- .outputMask = VK_MEMORY_OUTPUT_TRANSFER_BIT,
- .inputMask = VK_MEMORY_INPUT_HOST_READ_BIT,
+ .srcAccessMask = VK_ACCESS_HOST_READ_BIT,
+ .dstAccessMask = VK_ACCESS_TRANSFER_WRITE_BIT,
.oldLayout = VK_IMAGE_LAYOUT_GENERAL,
.newLayout = VK_IMAGE_LAYOUT_GENERAL,
.srcQueueFamilyIndex = 0,
diff --git a/src/vulkan/genX_cmd_buffer.c b/src/vulkan/genX_cmd_buffer.c
index 166e335..e404d5e 100644
--- a/src/vulkan/genX_cmd_buffer.c
+++ b/src/vulkan/genX_cmd_buffer.c
@@ -194,28 +194,28 @@ void genX(CmdPipelineBarrier)(
* the app asks for. One of these days we may make this a bit better
* but right now that's all the hardware allows for in most areas.
*/
- VkMemoryOutputFlags out_flags = 0;
- VkMemoryInputFlags in_flags = 0;
+ VkAccessFlags src_flags = 0;
+ VkAccessFlags dst_flags = 0;
for (uint32_t i = 0; i < memBarrierCount; i++) {
const struct anv_common *common = ppMemBarriers[i];
switch (common->sType) {
case VK_STRUCTURE_TYPE_MEMORY_BARRIER: {
ANV_COMMON_TO_STRUCT(VkMemoryBarrier, barrier, common);
- out_flags |= barrier->outputMask;
- in_flags |= barrier->inputMask;
+ src_flags |= barrier->srcAccessMask;
+ dst_flags |= barrier->dstAccessMask;
break;
}
case VK_STRUCTURE_TYPE_BUFFER_MEMORY_BARRIER: {
ANV_COMMON_TO_STRUCT(VkBufferMemoryBarrier, barrier, common);
- out_flags |= barrier->outputMask;
- in_flags |= barrier->inputMask;
+ src_flags |= barrier->srcAccessMask;
+ dst_flags |= barrier->dstAccessMask;
break;
}
case VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER: {
ANV_COMMON_TO_STRUCT(VkImageMemoryBarrier, barrier, common);
- out_flags |= barrier->outputMask;
- in_flags |= barrier->inputMask;
+ src_flags |= barrier->srcAccessMask;
+ dst_flags |= barrier->dstAccessMask;
break;
}
default:
@@ -223,50 +223,57 @@ void genX(CmdPipelineBarrier)(
}
}
- for_each_bit(b, out_flags) {
- switch ((VkMemoryOutputFlags)(1 << b)) {
- case VK_MEMORY_OUTPUT_HOST_WRITE_BIT:
+ for_each_bit(b, dst_flags) {
+ switch ((VkAccessFlagBits)(1 << b)) {
+ case VK_ACCESS_HOST_WRITE_BIT:
break; /* FIXME: Little-core systems */
- case VK_MEMORY_OUTPUT_SHADER_WRITE_BIT:
+ case VK_ACCESS_SHADER_WRITE_BIT:
cmd.DCFlushEnable = true;
break;
- case VK_MEMORY_OUTPUT_COLOR_ATTACHMENT_BIT:
+ case VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT:
cmd.RenderTargetCacheFlushEnable = true;
break;
- case VK_MEMORY_OUTPUT_DEPTH_STENCIL_ATTACHMENT_BIT:
+ case VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT:
cmd.DepthCacheFlushEnable = true;
break;
- case VK_MEMORY_OUTPUT_TRANSFER_BIT:
+ case VK_ACCESS_TRANSFER_WRITE_BIT:
cmd.RenderTargetCacheFlushEnable = true;
cmd.DepthCacheFlushEnable = true;
break;
default:
- unreachable("Invalid memory output flag");
+ assert(!"Not a write bit");
}
}
- for_each_bit(b, out_flags) {
- switch ((VkMemoryInputFlags)(1 << b)) {
- case VK_MEMORY_INPUT_HOST_READ_BIT:
+ for_each_bit(b, src_flags) {
+ switch ((VkAccessFlagBits)(1 << b)) {
+ case VK_ACCESS_HOST_READ_BIT:
break; /* FIXME: Little-core systems */
- case VK_MEMORY_INPUT_INDIRECT_COMMAND_BIT:
- case VK_MEMORY_INPUT_INDEX_FETCH_BIT:
- case VK_MEMORY_INPUT_VERTEX_ATTRIBUTE_FETCH_BIT:
+ case VK_ACCESS_INDIRECT_COMMAND_READ_BIT:
+ case VK_ACCESS_INDEX_READ_BIT:
+ case VK_ACCESS_VERTEX_ATTRIBUTE_READ_BIT:
cmd.VFCacheInvalidationEnable = true;
break;
- case VK_MEMORY_INPUT_UNIFORM_READ_BIT:
+ case VK_ACCESS_UNIFORM_READ_BIT:
cmd.ConstantCacheInvalidationEnable = true;
/* fallthrough */
- case VK_MEMORY_INPUT_SHADER_READ_BIT:
+ case VK_ACCESS_SHADER_READ_BIT:
cmd.DCFlushEnable = true;
cmd.TextureCacheInvalidationEnable = true;
break;
- case VK_MEMORY_INPUT_COLOR_ATTACHMENT_BIT:
- case VK_MEMORY_INPUT_DEPTH_STENCIL_ATTACHMENT_BIT:
- break; /* XXX: Hunh? */
- case VK_MEMORY_INPUT_TRANSFER_BIT:
+ case VK_ACCESS_COLOR_ATTACHMENT_READ_BIT:
cmd.TextureCacheInvalidationEnable = true;
break;
+ case VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_READ_BIT:
+ cmd.DCFlushEnable = true;
+ break;
+ case VK_ACCESS_TRANSFER_READ_BIT:
+ cmd.TextureCacheInvalidationEnable = true;
+ break;
+ case VK_ACCESS_MEMORY_READ_BIT:
+ break; /* XXX: What is this? */
+ default:
+ assert(!"Not a read bit");
}
}