SPIRV-Tools/include/spirv-tools
Jaebaek Seo 57e1d8ebe3
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 ...
2021-08-18 08:30:48 -04:00
..
instrument.hpp Add kInstErrorMax to instrument.hpp (#4315) 2021-06-07 08:06:10 -04:00
libspirv.h Add non-semantic vulkan extended instruction set (#4362) 2021-07-12 05:51:08 -04:00
libspirv.hpp Add interpolate legalization pass (#4220) 2021-03-31 14:26:36 -04:00
linker.hpp Rewrite include guards (#1793) 2018-08-03 08:05:33 -04:00
linter.hpp Add new target for spirv-lint (#4446) 2021-08-06 14:03:59 -04:00
optimizer.hpp Add spirv-opt convert-to-sampled-image pass (#4340) 2021-08-18 08:30:48 -04:00