diff options
| author | Tony Barbour <tony@LunarG.com> | 2016-04-28 15:05:09 -0600 |
|---|---|---|
| committer | Tony Barbour <tony@LunarG.com> | 2016-04-28 15:05:09 -0600 |
| commit | 5342ef5e9026fc97e3dc1b6ceaeed0eb7f2e1d85 (patch) | |
| tree | 0c78a7d9576c012a9d313aeb73beffcb6f4a10d7 | |
| parent | 89eb8df12be1aa3bce2ae021b578da7a6d3d0981 (diff) | |
| download | usermoji-5342ef5e9026fc97e3dc1b6ceaeed0eb7f2e1d85.tar.xz | |
demos+tests: Add HOST_COHERENT to HOST_VISIBLE memory requests
Where the memory is going to be mapped
Change-Id: I66c4f5950fa77fe8b785b12233adbc4e9db797ce
| -rw-r--r-- | demos/cube.c | 21 | ||||
| -rw-r--r-- | demos/tri.c | 21 |
2 files changed, 24 insertions, 18 deletions
diff --git a/demos/cube.c b/demos/cube.c index c4dd33ca..bc391414 100644 --- a/demos/cube.c +++ b/demos/cube.c @@ -1210,20 +1210,22 @@ static void demo_prepare_textures(struct demo *demo) { VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT) && !demo->use_staging_buffer) { /* Device can texture using linear textures */ - demo_prepare_texture_image(demo, tex_files[i], &demo->textures[i], - VK_IMAGE_TILING_LINEAR, - VK_IMAGE_USAGE_SAMPLED_BIT, - VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT); + demo_prepare_texture_image( + demo, tex_files[i], &demo->textures[i], VK_IMAGE_TILING_LINEAR, + VK_IMAGE_USAGE_SAMPLED_BIT, + VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT | + VK_MEMORY_PROPERTY_HOST_COHERENT_BIT); } else if (props.optimalTilingFeatures & VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT) { /* Must use staging buffer to copy linear texture to optimized */ struct texture_object staging_texture; memset(&staging_texture, 0, sizeof(staging_texture)); - demo_prepare_texture_image(demo, tex_files[i], &staging_texture, - VK_IMAGE_TILING_LINEAR, - VK_IMAGE_USAGE_TRANSFER_SRC_BIT, - VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT); + demo_prepare_texture_image( + demo, tex_files[i], &staging_texture, VK_IMAGE_TILING_LINEAR, + VK_IMAGE_USAGE_TRANSFER_SRC_BIT, + VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT | + VK_MEMORY_PROPERTY_HOST_COHERENT_BIT); demo_prepare_texture_image( demo, tex_files[i], &demo->textures[i], VK_IMAGE_TILING_OPTIMAL, @@ -1359,7 +1361,8 @@ void demo_prepare_cube_data_buffer(struct demo *demo) { demo->uniform_data.mem_alloc.memoryTypeIndex = 0; pass = memory_type_from_properties( - demo, mem_reqs.memoryTypeBits, VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT, + demo, mem_reqs.memoryTypeBits, VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT | + VK_MEMORY_PROPERTY_HOST_COHERENT_BIT, &demo->uniform_data.mem_alloc.memoryTypeIndex); assert(pass); diff --git a/demos/tri.c b/demos/tri.c index ed8dfdaf..847655fa 100644 --- a/demos/tri.c +++ b/demos/tri.c @@ -939,20 +939,22 @@ static void demo_prepare_textures(struct demo *demo) { VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT) && !demo->use_staging_buffer) { /* Device can texture using linear textures */ - demo_prepare_texture_image(demo, tex_colors[i], &demo->textures[i], - VK_IMAGE_TILING_LINEAR, - VK_IMAGE_USAGE_SAMPLED_BIT, - VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT); + demo_prepare_texture_image( + demo, tex_colors[i], &demo->textures[i], VK_IMAGE_TILING_LINEAR, + VK_IMAGE_USAGE_SAMPLED_BIT, + VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT | + VK_MEMORY_PROPERTY_HOST_COHERENT_BIT); } else if (props.optimalTilingFeatures & VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT) { /* Must use staging buffer to copy linear texture to optimized */ struct texture_object staging_texture; memset(&staging_texture, 0, sizeof(staging_texture)); - demo_prepare_texture_image(demo, tex_colors[i], &staging_texture, - VK_IMAGE_TILING_LINEAR, - VK_IMAGE_USAGE_TRANSFER_SRC_BIT, - VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT); + demo_prepare_texture_image( + demo, tex_colors[i], &staging_texture, VK_IMAGE_TILING_LINEAR, + VK_IMAGE_USAGE_TRANSFER_SRC_BIT, + VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT | + VK_MEMORY_PROPERTY_HOST_COHERENT_BIT); demo_prepare_texture_image( demo, tex_colors[i], &demo->textures[i], @@ -1082,7 +1084,8 @@ static void demo_prepare_vertices(struct demo *demo) { mem_alloc.allocationSize = mem_reqs.size; pass = memory_type_from_properties(demo, mem_reqs.memoryTypeBits, - VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT, + VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT | + VK_MEMORY_PROPERTY_HOST_COHERENT_BIT, &mem_alloc.memoryTypeIndex); assert(pass); |
