summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNanley Chery <[email protected]>2017-01-31 11:25:31 -0800
committerNanley Chery <[email protected]>2017-03-02 13:17:55 -0800
commitea744912b3fb2fe4a4d74dcb4f7bc8a07a8c6cf5 (patch)
tree025423fa61f03bd07719baeb675f11ee16a919b6
parent5408d3fd055501fe518b5d31159fd830a27b8947 (diff)
anv/cmd_buffer: Conditionally choose the sampled image surface state
Signed-off-by: Nanley Chery <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
-rw-r--r--src/intel/vulkan/genX_cmd_buffer.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/intel/vulkan/genX_cmd_buffer.c b/src/intel/vulkan/genX_cmd_buffer.c
index fdfea3fd564..73876fc7b40 100644
--- a/src/intel/vulkan/genX_cmd_buffer.c
+++ b/src/intel/vulkan/genX_cmd_buffer.c
@@ -1178,24 +1178,25 @@ emit_binding_table(struct anv_cmd_buffer *cmd_buffer,
case VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER:
case VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE:
- surface_state = desc->image_view->sampler_surface_state;
+ surface_state = desc->aux_usage == ISL_AUX_USAGE_NONE ?
+ desc->image_view->no_aux_sampler_surface_state :
+ desc->image_view->sampler_surface_state;
assert(surface_state.alloc_size);
add_image_view_relocs(cmd_buffer, desc->image_view,
- desc->image_view->image->aux_usage,
- surface_state);
+ desc->aux_usage, surface_state);
break;
-
case VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT:
assert(stage == MESA_SHADER_FRAGMENT);
if (desc->image_view->aspect_mask != VK_IMAGE_ASPECT_COLOR_BIT) {
/* For depth and stencil input attachments, we treat it like any
* old texture that a user may have bound.
*/
- surface_state = desc->image_view->sampler_surface_state;
+ surface_state = desc->aux_usage == ISL_AUX_USAGE_NONE ?
+ desc->image_view->no_aux_sampler_surface_state :
+ desc->image_view->sampler_surface_state;
assert(surface_state.alloc_size);
add_image_view_relocs(cmd_buffer, desc->image_view,
- desc->image_view->image->aux_usage,
- surface_state);
+ desc->aux_usage, surface_state);
} else {
/* For color input attachments, we create the surface state at
* vkBeginRenderPass time so that we can include aux and clear