diff options
author | Jaebaek Seo <jaebaek@google.com> | 2021-08-18 15:30:48 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-08-18 15:30:48 +0300 |
commit | 57e1d8ebe3190c4ba23c1bee5147fe00c83ce358 (patch) | |
tree | ca546f7b5a5bbb8407e59eb4119c4a97861b42bb /BUILD.gn | |
parent | b2e36b67eca055e4338d260cf5bc23c12420494d (diff) |
Add spirv-opt convert-to-sampled-image pass (#4340)
convert-to-sampled-image pass converts images and/or samplers with
given pairs of descriptor set and binding to sampled image.
If a pair of an image and a sampler have the same pair of descriptor
set and binding that is one of the given pairs, they will be
converted to a sampled image. In addition, if only an image has the
descriptor set and binding that is one of the given pairs, it will
be converted to a sampled image as well.
For example, when we have
%a = OpLoad %type_2d_image %texture
%b = OpLoad %type_sampler %sampler
%combined = OpSampledImage %type_sampled_image %a %b
%value = OpImageSampleExplicitLod %v4float %combined ...
1. If %texture and %sampler have the same descriptor set and binding
%combine_texture_and_sampler = OpVaraible %ptr_type_sampled_image_Uniform
...
%combined = OpLoad %type_sampled_image %combine_texture_and_sampler
%value = OpImageSampleExplicitLod %v4float %combined ...
2. If %texture and %sampler have different pairs of descriptor set and binding
%a = OpLoad %type_sampled_image %texture
%extracted_image = OpImage %type_2d_image %a
%b = OpLoad %type_sampler %sampler
%combined = OpSampledImage %type_sampled_image %extracted_image %b
%value = OpImageSampleExplicitLod %v4float %combined ...
Diffstat (limited to 'BUILD.gn')
-rw-r--r-- | BUILD.gn | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -608,6 +608,8 @@ static_library("spvtools_opt") { "source/opt/constants.h", "source/opt/control_dependence.cpp", "source/opt/control_dependence.h", + "source/opt/convert_to_sampled_image_pass.cpp", + "source/opt/convert_to_sampled_image_pass.h", "source/opt/convert_to_half_pass.cpp", "source/opt/convert_to_half_pass.h", "source/opt/copy_prop_arrays.cpp", |