diff --git a/src/back/hlsl/writer.rs b/src/back/hlsl/writer.rs index ec452ebe44..8f7abc2a5a 100644 --- a/src/back/hlsl/writer.rs +++ b/src/back/hlsl/writer.rs @@ -2394,7 +2394,7 @@ impl<'a, W: fmt::Write> super::Writer<'a, W> { }; let level_str = match level { Sl::Zero if gather.is_none() => "LevelZero", - Sl::Base => "LevelZero", + Sl::Base => "Level", Sl::Auto | Sl::Zero => "", Sl::Exact(_) => "Level", Sl::Bias(_) => "Bias", @@ -2432,7 +2432,7 @@ impl<'a, W: fmt::Write> super::Writer<'a, W> { } match level { - Sl::Auto | Sl::Zero | Sl::Base => {} + Sl::Auto | Sl::Zero => {} Sl::Exact(expr) => { write!(self.out, ", ")?; self.write_expr(module, expr, func_ctx)?; @@ -2447,6 +2447,9 @@ impl<'a, W: fmt::Write> super::Writer<'a, W> { write!(self.out, ", ")?; self.write_expr(module, y, func_ctx)?; } + Sl::Base => { + write!(self.out, ", 0.0")?; + } } if let Some(offset) = offset { diff --git a/tests/out/hlsl/image.hlsl b/tests/out/hlsl/image.hlsl index 40831b5da1..63f1bd3153 100644 --- a/tests/out/hlsl/image.hlsl +++ b/tests/out/hlsl/image.hlsl @@ -314,9 +314,9 @@ float4 texture_sample() : SV_Target0 a = (_expr136 + _expr135); float2 _expr140_dim; float _expr140_num; - image_2d.GetDimensions(0u, _expr140_dim.x, _expr140_dim.y, num); + image_2d.GetDimensions(0u, _expr140_dim.x, _expr140_dim.y, _expr140_num); float2 _expr140_half_texel = (0.5).xx / _expr140_dim; - float4 _expr140 = image_2d.SampleLevelZero(sampler_reg, clamp(tc, _expr140_half_texel, (1.0).xx - _expr140_half_texel)); + float4 _expr140 = image_2d.SampleLevel(sampler_reg, clamp(tc, _expr140_half_texel, (1.0).xx - _expr140_half_texel), 0.0); float4 _expr141 = a; a = (_expr141 + _expr140); float4 _expr143 = a;