File tree Expand file tree Collapse file tree 4 files changed +15
-15
lines changed Expand file tree Collapse file tree 4 files changed +15
-15
lines changed Original file line number Diff line number Diff line change @@ -110,7 +110,7 @@ func InitState(window *glfw.Window) (s *State, err error) {
110
110
111
111
computeShader , err := s .device .CreateShaderModule (& wgpu.ShaderModuleDescriptor {
112
112
Label : "compute.wgsl" ,
113
- WGSLDescriptor : & wgpu.ShaderModuleWGSLDescriptor {
113
+ WGSLSource : & wgpu.ShaderSourceWGSL {
114
114
Code : compute ,
115
115
},
116
116
})
@@ -121,7 +121,7 @@ func InitState(window *glfw.Window) (s *State, err error) {
121
121
122
122
drawShader , err := s .device .CreateShaderModule (& wgpu.ShaderModuleDescriptor {
123
123
Label : "draw.wgsl" ,
124
- WGSLDescriptor : & wgpu.ShaderModuleWGSLDescriptor {
124
+ WGSLSource : & wgpu.ShaderSourceWGSL {
125
125
Code : draw ,
126
126
},
127
127
})
Original file line number Diff line number Diff line change @@ -132,9 +132,9 @@ func main() {
132
132
// Copy the data from the texture to the buffer
133
133
encoder .CopyTextureToBuffer (
134
134
texture .AsImageCopy (),
135
- & wgpu.ImageCopyBuffer {
135
+ & wgpu.TexelCopyBufferInfo {
136
136
Buffer : outputBuffer ,
137
- Layout : wgpu.TextureDataLayout {
137
+ Layout : wgpu.TexelCopyBufferLayout {
138
138
Offset : 0 ,
139
139
BytesPerRow : uint32 (bufferDimensions .paddedBytesPerRow ),
140
140
RowsPerImage : wgpu .CopyStrideUndefined ,
@@ -151,14 +151,14 @@ func main() {
151
151
152
152
queue .Submit (cmdBuffer )
153
153
154
- outputBuffer .MapAsync (wgpu .MapModeRead , 0 , bufferSize , func (status wgpu.BufferMapAsyncStatus ) {
155
- if status != wgpu .BufferMapAsyncStatusSuccess {
154
+ outputBuffer .MapAsync (wgpu .MapModeRead , 0 , bufferSize , func (status wgpu.MapAsyncStatus ) {
155
+ if status != wgpu .MapAsyncStatusSuccess {
156
156
panic ("failed to map buffer" )
157
157
}
158
158
})
159
159
defer outputBuffer .Unmap ()
160
160
161
- device .Poll (true , nil )
161
+ device .Poll (true , 0 )
162
162
163
163
data := outputBuffer .GetMappedRange (0 , uint (bufferSize ))
164
164
Original file line number Diff line number Diff line change @@ -60,7 +60,7 @@ func main() {
60
60
61
61
shaderModule , err := device .CreateShaderModule (& wgpu.ShaderModuleDescriptor {
62
62
Label : "shader.wgsl" ,
63
- WGSLDescriptor : & wgpu.ShaderModuleWGSLDescriptor {
63
+ WGSLSource : & wgpu.ShaderSourceWGSL {
64
64
Code : shader ,
65
65
},
66
66
})
@@ -141,18 +141,18 @@ func main() {
141
141
}
142
142
queue .Submit (cmdBuffer )
143
143
144
- var status wgpu.BufferMapAsyncStatus
145
- err = stagingBuffer .MapAsync (wgpu .MapModeRead , 0 , size , func (s wgpu.BufferMapAsyncStatus ) {
144
+ var status wgpu.MapAsyncStatus
145
+ err = stagingBuffer .MapAsync (wgpu .MapModeRead , 0 , size , func (s wgpu.MapAsyncStatus ) {
146
146
status = s
147
147
})
148
148
if err != nil {
149
149
panic (err )
150
150
}
151
151
defer stagingBuffer .Unmap ()
152
152
153
- device .Poll (true , nil )
153
+ device .Poll (true , 0 )
154
154
155
- if status != wgpu .BufferMapAsyncStatusSuccess {
155
+ if status != wgpu .MapAsyncStatusSuccess {
156
156
panic (status )
157
157
}
158
158
Original file line number Diff line number Diff line change @@ -243,7 +243,7 @@ func InitState(window *glfw.Window) (s *State, err error) {
243
243
s .queue .WriteTexture (
244
244
texture .AsImageCopy (),
245
245
wgpu .ToBytes (texels [:]),
246
- & wgpu.TextureDataLayout {
246
+ & wgpu.TexelCopyBufferLayout {
247
247
Offset : 0 ,
248
248
BytesPerRow : texelsSize ,
249
249
RowsPerImage : wgpu .CopyStrideUndefined ,
@@ -262,8 +262,8 @@ func InitState(window *glfw.Window) (s *State, err error) {
262
262
}
263
263
264
264
shader , err := s .device .CreateShaderModule (& wgpu.ShaderModuleDescriptor {
265
- Label : "shader.wgsl" ,
266
- WGSLDescriptor : & wgpu.ShaderModuleWGSLDescriptor {Code : shader },
265
+ Label : "shader.wgsl" ,
266
+ WGSLSource : & wgpu.ShaderSourceWGSL {Code : shader },
267
267
})
268
268
if err != nil {
269
269
return s , err
You can’t perform that action at this time.
0 commit comments