@@ -194,7 +194,7 @@ pub fn main() -> Result<(), Box<dyn std::error::Error>> {
194
194
. map_err ( |e| e. to_string ( ) ) ?;
195
195
196
196
let gpu = sdl3:: gpu:: Device :: new (
197
- ShaderFormat :: SpirV | ShaderFormat :: Dxil | ShaderFormat :: Dxbc | ShaderFormat :: MetalLib ,
197
+ ShaderFormat :: SPIRV | ShaderFormat :: DXIL | ShaderFormat :: DXBC | ShaderFormat :: METALLIB ,
198
198
true ,
199
199
) ?
200
200
. with_window ( & window) ?;
@@ -203,7 +203,7 @@ pub fn main() -> Result<(), Box<dyn std::error::Error>> {
203
203
let vert_shader = gpu
204
204
. create_shader ( )
205
205
. with_code (
206
- ShaderFormat :: SpirV ,
206
+ ShaderFormat :: SPIRV ,
207
207
include_bytes ! ( "shaders/cube-texture.vert.spv" ) ,
208
208
ShaderStage :: Vertex ,
209
209
)
@@ -213,7 +213,7 @@ pub fn main() -> Result<(), Box<dyn std::error::Error>> {
213
213
let frag_shader = gpu
214
214
. create_shader ( )
215
215
. with_code (
216
- ShaderFormat :: SpirV ,
216
+ ShaderFormat :: SPIRV ,
217
217
include_bytes ! ( "shaders/cube-texture.frag.spv" ) ,
218
218
ShaderStage :: Fragment ,
219
219
)
@@ -284,7 +284,7 @@ pub fn main() -> Result<(), Box<dyn std::error::Error>> {
284
284
let transfer_buffer = gpu
285
285
. create_transfer_buffer ( )
286
286
. with_size ( vertices_len_bytes. max ( indices_len_bytes) as u32 )
287
- . with_usage ( TransferBufferUsage :: Upload )
287
+ . with_usage ( TransferBufferUsage :: UPLOAD )
288
288
. build ( ) ?;
289
289
290
290
// We need to start a copy pass in order to transfer data to the GPU
@@ -296,14 +296,14 @@ pub fn main() -> Result<(), Box<dyn std::error::Error>> {
296
296
& gpu,
297
297
& transfer_buffer,
298
298
& copy_pass,
299
- BufferUsageFlags :: Vertex ,
299
+ BufferUsageFlags :: VERTEX ,
300
300
& CUBE_VERTICES ,
301
301
) ?;
302
302
let index_buffer = create_buffer_with_data (
303
303
& gpu,
304
304
& transfer_buffer,
305
305
& copy_pass,
306
- BufferUsageFlags :: Index ,
306
+ BufferUsageFlags :: INDEX ,
307
307
& CUBE_INDICES ,
308
308
) ?;
309
309
@@ -338,7 +338,7 @@ pub fn main() -> Result<(), Box<dyn std::error::Error>> {
338
338
. with_num_levels ( 1 )
339
339
. with_sample_count ( SampleCount :: NoMultiSampling )
340
340
. with_format ( TextureFormat :: D16Unorm )
341
- . with_usage ( TextureUsage :: Sampler | TextureUsage :: DepthStencilTarget ) ,
341
+ . with_usage ( TextureUsage :: SAMPLER | TextureUsage :: DEPTH_STENCIL_TARGET ) ,
342
342
) ?;
343
343
344
344
let mut rotation = 45.0f32 ;
@@ -365,19 +365,19 @@ pub fn main() -> Result<(), Box<dyn std::error::Error>> {
365
365
// Again, like in gpu-clear.rs, we'd want to define basic operations for our cube
366
366
let color_targets = [ ColorTargetInfo :: default ( )
367
367
. with_texture ( & swapchain)
368
- . with_load_op ( LoadOp :: Clear )
369
- . with_store_op ( StoreOp :: Store )
368
+ . with_load_op ( LoadOp :: CLEAR )
369
+ . with_store_op ( StoreOp :: STORE )
370
370
. with_clear_color ( Color :: RGB ( 128 , 128 , 128 ) ) ] ;
371
371
// This time, however, we want depth testing, so we need to also target a depth texture buffer
372
372
let depth_target = DepthStencilTargetInfo :: new ( )
373
373
. with_texture ( & mut depth_texture)
374
374
. with_cycle ( true )
375
375
. with_clear_depth ( 1.0 )
376
376
. with_clear_stencil ( 0 )
377
- . with_load_op ( LoadOp :: Clear )
378
- . with_store_op ( StoreOp :: Store )
379
- . with_stencil_load_op ( LoadOp :: Clear )
380
- . with_stencil_store_op ( StoreOp :: Store ) ;
377
+ . with_load_op ( LoadOp :: CLEAR )
378
+ . with_store_op ( StoreOp :: STORE )
379
+ . with_stencil_load_op ( LoadOp :: CLEAR )
380
+ . with_stencil_store_op ( StoreOp :: STORE ) ;
381
381
let render_pass =
382
382
gpu. begin_render_pass ( & command_buffer, & color_targets, Some ( & depth_target) ) ?;
383
383
@@ -395,7 +395,7 @@ pub fn main() -> Result<(), Box<dyn std::error::Error>> {
395
395
& BufferBinding :: new ( )
396
396
. with_buffer ( & index_buffer)
397
397
. with_offset ( 0 ) ,
398
- IndexElementSize :: _16Bit ,
398
+ IndexElementSize :: _16BIT ,
399
399
) ;
400
400
render_pass. bind_fragment_samplers (
401
401
0 ,
@@ -440,13 +440,13 @@ fn create_texture_from_image(
440
440
. with_height ( image_size. 1 )
441
441
. with_layer_count_or_depth ( 1 )
442
442
. with_num_levels ( 1 )
443
- . with_usage ( TextureUsage :: Sampler ) ,
443
+ . with_usage ( TextureUsage :: SAMPLER ) ,
444
444
) ?;
445
445
446
446
let transfer_buffer = gpu
447
447
. create_transfer_buffer ( )
448
448
. with_size ( size_bytes)
449
- . with_usage ( TransferBufferUsage :: Upload )
449
+ . with_usage ( TransferBufferUsage :: UPLOAD )
450
450
. build ( ) ?;
451
451
452
452
let mut buffer_mem = transfer_buffer. map :: < u8 > ( gpu, false ) ;
0 commit comments