diff options
author | Jason Ekstrand <[email protected]> | 2017-02-13 08:30:14 -0800 |
---|---|---|
committer | Jason Ekstrand <[email protected]> | 2017-02-14 08:16:45 -0800 |
commit | 2c3091858164a1941e75205a823eb6d83b4468ae (patch) | |
tree | 3bda4fa2b2554a2eef820d00c29f602d39519fdc /src/intel/vulkan | |
parent | f8dfe9b8265d79ac577e193e5ba2215d82fddf52 (diff) |
anv/apply_pipeline_layout: Set image.write_only to false
This makes our driver robust to changes in spirv_to_nir which would set
this flag on the variable. Right now, our driver relies on spirv_to_nir
*not* setting var->data.image.write_only for correctness. Any patch
which implements the shaderStorageImageWriteWithoutFormat will need to
effectively revert this commit.
Reviewed-by: Lionel Landwerlin <[email protected]>
Diffstat (limited to 'src/intel/vulkan')
-rw-r--r-- | src/intel/vulkan/anv_nir_apply_pipeline_layout.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/intel/vulkan/anv_nir_apply_pipeline_layout.c b/src/intel/vulkan/anv_nir_apply_pipeline_layout.c index 8846c2e6c08..d6b85611419 100644 --- a/src/intel/vulkan/anv_nir_apply_pipeline_layout.c +++ b/src/intel/vulkan/anv_nir_apply_pipeline_layout.c @@ -398,6 +398,18 @@ anv_nir_apply_pipeline_layout(struct anv_pipeline *pipeline, unsigned binding = var->data.binding; unsigned image_index = state.set[set].image_offsets[binding]; + /* We have a very tight coupling between back-end compiler and + * state setup which requires us to fill the image surface state + * out differently if and only if the image is declared write-only. + * Right now, our state setup code sets up all images as if they + * are read-write. This means that the compiler needs to see + * read-only as well. + * + * Whenever we implement shaderStorageImageWriteWithoutFormat, we + * need to delete this. + */ + var->data.image.write_only = false; + var->data.driver_location = shader->num_uniforms + image_index * BRW_IMAGE_PARAM_SIZE * 4; } |