Skip to content

Commit ba4bfe7

Browse files
committed
Rename level to lod to match spirv and glsl naming convention.
1 parent ca6a64c commit ba4bfe7

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

crates/spirv-std/src/image.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -163,13 +163,13 @@ impl<
163163
result.truncate_into()
164164
}
165165

166-
/// Fetch a single texel at a mipmap `level` with a sampler set at compile time
166+
/// Fetch a single texel at a mipmap `lod` with a sampler set at compile time
167167
#[crate::macros::gpu_only]
168168
#[doc(alias = "OpImageFetch")]
169-
pub fn fetch_with_level<I>(
169+
pub fn fetch_with_lod<I>(
170170
&self,
171171
coordinate: impl ImageCoordinate<I, DIM, ARRAYED>,
172-
level: u32,
172+
lod: u32,
173173
) -> SampledType::SampleResult
174174
where
175175
I: Integer,
@@ -181,12 +181,12 @@ impl<
181181
"OpDecorate %result NonUniform",
182182
"%image = OpLoad _ {this}",
183183
"%coordinate = OpLoad _ {coordinate}",
184-
"%result = OpImageFetch typeof*{result} %image %coordinate Lod {level}",
184+
"%result = OpImageFetch typeof*{result} %image %coordinate Lod {lod}",
185185
"OpStore {result} %result",
186186
result = in(reg) &mut result,
187187
this = in(reg) self,
188188
coordinate = in(reg) &coordinate,
189-
level = in(reg) level,
189+
lod = in(reg) lod,
190190
}
191191
}
192192
result.truncate_into()

tests/compiletests/ui/image/fetch_with_level.rs renamed to tests/compiletests/ui/image/fetch_with_lod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@ pub fn main(
88
#[spirv(descriptor_set = 0, binding = 0)] image: &Image!(2D, type=f32, sampled),
99
output: &mut glam::Vec4,
1010
) {
11-
let texel = image.fetch_with_level(glam::IVec2::new(0, 1), 0);
11+
let texel = image.fetch_with_lod(glam::IVec2::new(0, 1), 0);
1212
*output = texel;
1313
}

0 commit comments

Comments
 (0)