@@ -24,20 +24,20 @@ pub struct Image2d {
24
24
25
25
impl Image2d {
26
26
#[ spirv_std_macros:: gpu_only]
27
- pub fn sample ( & self , sampler : Sampler , coord : Vec2 ) -> Vec4 {
27
+ pub fn sample ( & self , sampler : Sampler , coordinate : Vec2 ) -> Vec4 {
28
28
unsafe {
29
29
let mut result = Default :: default ( ) ;
30
30
asm ! (
31
- "%image = OpLoad _ {1 }" ,
32
- "%sampler = OpLoad _ {2 }" ,
33
- "%coord = OpLoad _ {3 }" ,
31
+ "%image = OpLoad _ {this }" ,
32
+ "%sampler = OpLoad _ {sampler }" ,
33
+ "%coordinate = OpLoad _ {coordinate }" ,
34
34
"%sampledImage = OpSampledImage _ %image %sampler" ,
35
- "%result = OpImageSampleImplicitLod _ %sampledImage %coord " ,
36
- "OpStore {0 } %result" ,
37
- in( reg) & mut result,
38
- in( reg) self ,
39
- in( reg) & sampler,
40
- in( reg) & coord
35
+ "%result = OpImageSampleImplicitLod _ %sampledImage %coordinate " ,
36
+ "OpStore {result } %result" ,
37
+ result = in( reg) & mut result,
38
+ this = in( reg) self ,
39
+ sampler = in( reg) & sampler,
40
+ coordinate = in( reg) & coordinate ,
41
41
) ;
42
42
result
43
43
}
@@ -55,9 +55,9 @@ impl Image2d {
55
55
"%coordinate = OpLoad _ {coordinate}" ,
56
56
"%result = OpImageFetch typeof*{result} %image %coordinate" ,
57
57
"OpStore {result} %result" ,
58
+ result = in( reg) & mut result,
58
59
this = in( reg) self ,
59
60
coordinate = in( reg) & coordinate,
60
- result = in( reg) & mut result,
61
61
}
62
62
}
63
63
@@ -141,20 +141,20 @@ pub struct Image2dArray {
141
141
142
142
impl Image2dArray {
143
143
#[ spirv_std_macros:: gpu_only]
144
- pub fn sample ( & self , sampler : Sampler , coord : Vec3A ) -> Vec4 {
144
+ pub fn sample ( & self , sampler : Sampler , coordinate : Vec3A ) -> Vec4 {
145
145
unsafe {
146
146
let mut result = Default :: default ( ) ;
147
147
asm ! (
148
- "%image = OpLoad _ {1 }" ,
149
- "%sampler = OpLoad _ {2 }" ,
150
- "%coord = OpLoad _ {3 }" ,
148
+ "%image = OpLoad _ {this }" ,
149
+ "%sampler = OpLoad _ {sampler }" ,
150
+ "%coordinate = OpLoad _ {coordinate }" ,
151
151
"%sampledImage = OpSampledImage _ %image %sampler" ,
152
- "%result = OpImageSampleImplicitLod _ %sampledImage %coord " ,
153
- "OpStore {0 } %result" ,
154
- in( reg) & mut result,
155
- in( reg) self ,
156
- in( reg) & sampler,
157
- in( reg) & coord
152
+ "%result = OpImageSampleImplicitLod _ %sampledImage %coordinate " ,
153
+ "OpStore {result } %result" ,
154
+ result = in( reg) & mut result,
155
+ this = in( reg) self ,
156
+ sampler = in( reg) & sampler,
157
+ coordinate = in( reg) & coordinate ,
158
158
) ;
159
159
result
160
160
}
@@ -169,17 +169,17 @@ pub struct SampledImage<I> {
169
169
170
170
impl SampledImage < Image2d > {
171
171
#[ spirv_std_macros:: gpu_only]
172
- pub fn sample ( & self , coord : Vec2 ) -> Vec4 {
172
+ pub fn sample ( & self , coordinate : Vec2 ) -> Vec4 {
173
173
unsafe {
174
174
let mut result = Default :: default ( ) ;
175
175
asm ! (
176
- "%sampledImage = OpLoad _ {1 }" ,
177
- "%coord = OpLoad _ {2 }" ,
178
- "%result = OpImageSampleImplicitLod _ %sampledImage %coord " ,
179
- "OpStore {0 } %result" ,
180
- in( reg) & mut result,
181
- in( reg) self ,
182
- in( reg) & coord
176
+ "%sampledImage = OpLoad _ {this }" ,
177
+ "%coordinate = OpLoad _ {coordinate }" ,
178
+ "%result = OpImageSampleImplicitLod _ %sampledImage %coordinate " ,
179
+ "OpStore {result } %result" ,
180
+ result = in( reg) & mut result,
181
+ this = in( reg) self ,
182
+ coordinate = in( reg) & coordinate
183
183
) ;
184
184
result
185
185
}
0 commit comments