Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/KhronosGroup/SPIRV-Cross.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBill Hollings <bill.hollings@brenwill.com>2021-11-08 23:59:45 +0300
committerBill Hollings <bill.hollings@brenwill.com>2021-11-08 23:59:45 +0300
commitfd252b21ff291f5dee8d74f1702d5755af30a776 (patch)
tree6e7448868f1419d7e68494f2f4bdc6d93f034ec0 /spirv_cross.hpp
parent2e0fb3a7784011ebd3c25cd1252beca0819fd1de (diff)
Separate (partially) the tracking of depth images from depth compare ops.
SPIR-V allows an image to be marked as a depth image, but with a non-depth format. Such images should be read or sampled as vectors instead of scalars, except when they are subject to compare operations. Don't mark an OpSampledImage as using a compare operation just because the image contains a depth marker. Instead, require that a compare operation is actually used on that image. Compiler::image_is_comparison() was really testing whether an image is a depth image, since it incorporates the depth marker. Rename that function to is_depth_image(), to clarify what it is really testing. In Compiler::is_depth_image(), do not treat an image as a depth image if it has been explicitly marked with a color format, unless the image is subject to compare operations. In CompilerMSL::to_function_name(), test for compare operations specifically, rather than assuming them from the depth-image marker. CompilerGLSL and CompilerMSL still contain a number of internal tests that use is_depth_image() both for testing for a depth image, and for testing whether compare operations are being used. I've left these as they are for now, but these should be cleaned up at some point. Add unit tests for fetch/sample depth images with color formats and no compare ops.
Diffstat (limited to 'spirv_cross.hpp')
-rw-r--r--spirv_cross.hpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/spirv_cross.hpp b/spirv_cross.hpp
index d8967963..26744376 100644
--- a/spirv_cross.hpp
+++ b/spirv_cross.hpp
@@ -1107,7 +1107,7 @@ protected:
Bitset combined_decoration_for_member(const SPIRType &type, uint32_t index) const;
static bool is_desktop_only_format(spv::ImageFormat format);
- bool image_is_comparison(const SPIRType &type, uint32_t id) const;
+ bool is_depth_image(const SPIRType &type, uint32_t id) const;
void set_extended_decoration(uint32_t id, ExtendedDecorations decoration, uint32_t value = 0);
uint32_t get_extended_decoration(uint32_t id, ExtendedDecorations decoration) const;