Skip to content

Commit ffb16a2

Browse files
Merge pull request #2608 from xen2/hlsl_minor_fixes
fixes for integer gather and a failing assert
2 parents 7bfcf72 + 3cac8a2 commit ffb16a2

2 files changed

Lines changed: 2 additions & 1 deletion

File tree

spirv_glsl.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -382,6 +382,7 @@ void CompilerGLSL::reset(uint32_t iteration_count)
382382
});
383383

384384
ir.for_each_typed_id<SPIRVariable>([&](uint32_t, SPIRVariable &var) { var.dependees.clear(); });
385+
ir.for_each_typed_id<SPIRBlock>([&](uint32_t, SPIRBlock &block) { block.rearm_dominated_variables.clear(); });
385386

386387
ir.reset_all_of_type<SPIRExpression>();
387388
ir.reset_all_of_type<SPIRAccessChain>();

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)