aboutsummaryrefslogtreecommitdiffstats
path: root/src/intel/vulkan
diff options
context:
space:
mode:
authorJason Ekstrand <[email protected]>2016-05-31 16:27:19 -0700
committerJason Ekstrand <[email protected]>2016-06-03 19:29:28 -0700
commita19ae36ce52e72e2b93251ba0a43d683bd5e58cc (patch)
tree97e8555f3170fcd7a04ae9f864bbcc43cfc38c90 /src/intel/vulkan
parent45542f554ca01b00b3d4674cf90575dff7904736 (diff)
anv/pipeline: Refactor specialization constant handling a bit
Signed-off-by: Jason Ekstrand <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Cc: "12.0" <[email protected]>
Diffstat (limited to 'src/intel/vulkan')
-rw-r--r--src/intel/vulkan/anv_pipeline.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/intel/vulkan/anv_pipeline.c b/src/intel/vulkan/anv_pipeline.c
index 504f0be289f..cdbf60bc218 100644
--- a/src/intel/vulkan/anv_pipeline.c
+++ b/src/intel/vulkan/anv_pipeline.c
@@ -123,13 +123,12 @@ anv_shader_compile_to_nir(struct anv_device *device,
num_spec_entries = spec_info->mapEntryCount;
spec_entries = malloc(num_spec_entries * sizeof(*spec_entries));
for (uint32_t i = 0; i < num_spec_entries; i++) {
- const uint32_t *data =
- spec_info->pData + spec_info->pMapEntries[i].offset;
- assert((const void *)(data + 1) <=
- spec_info->pData + spec_info->dataSize);
+ VkSpecializationMapEntry entry = spec_info->pMapEntries[i];
+ const void *data = spec_info->pData + entry.offset;
+ assert(data + entry.size <= spec_info->pData + spec_info->dataSize);
spec_entries[i].id = spec_info->pMapEntries[i].constantID;
- spec_entries[i].data = *data;
+ spec_entries[i].data = *(const uint32_t *)data;
}
}