Skip to content

Commit 3cac8a2

Browse files
committed
HLSL: Allow Gather on integer textures in SM < 6.7
Texture2D<uint>.GatherRed() and similar Gather operations on integer textures are valid in HLSL SM 5.0, but the non-float texture sampling check rejected all non-float texture operations unconditionally. Narrow the check to exclude Gather operations.
1 parent a2e10fc commit 3cac8a2

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

spirv_hlsl.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3952,7 +3952,7 @@ void CompilerHLSL::emit_texture_op(const Instruction &i, bool sparse)
39523952
else
39533953
{
39543954
auto &imgformat = get<SPIRType>(imgtype.image.type);
3955-
if (hlsl_options.shader_model < 67 && imgformat.basetype != SPIRType::Float)
3955+
if (hlsl_options.shader_model < 67 && imgformat.basetype != SPIRType::Float && !gather)
39563956
{
39573957
SPIRV_CROSS_THROW("Sampling non-float textures is not supported in HLSL SM < 6.7.");
39583958
}

0 commit comments

Comments
 (0)