wgpu 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,609 @@
1
+ # frozen_string_literal: true
2
+
3
+ module WGPU
4
+ module Native
5
+ class ChainedStruct < FFI::Struct
6
+ layout :next, :pointer,
7
+ :s_type, SType
8
+ end
9
+
10
+ class StringView < FFI::Struct
11
+ layout :data, :pointer,
12
+ :length, :size_t
13
+ end
14
+
15
+ class ChainedStructOut < FFI::Struct
16
+ layout :next, :pointer,
17
+ :s_type, SType
18
+ end
19
+
20
+ class InstanceCapabilities < FFI::Struct
21
+ layout :next_in_chain, :pointer,
22
+ :timed_wait_any_enable, :uint32,
23
+ :timed_wait_any_max_count, :size_t
24
+ end
25
+
26
+ class InstanceDescriptor < FFI::Struct
27
+ layout :next_in_chain, :pointer,
28
+ :features, InstanceCapabilities
29
+ end
30
+
31
+ class RequestAdapterOptions < FFI::Struct
32
+ layout :next_in_chain, :pointer,
33
+ :feature_level, FeatureLevel,
34
+ :power_preference, PowerPreference,
35
+ :force_fallback_adapter, :uint32,
36
+ :backend_type, BackendType,
37
+ :compatible_surface, :pointer
38
+ end
39
+
40
+ class AdapterInfo < FFI::Struct
41
+ layout :next_in_chain, :pointer,
42
+ :vendor, StringView,
43
+ :architecture, StringView,
44
+ :device, StringView,
45
+ :description, StringView,
46
+ :backend_type, BackendType,
47
+ :adapter_type, AdapterType,
48
+ :vendor_id, :uint32,
49
+ :device_id, :uint32
50
+ end
51
+
52
+ class QueueDescriptor < FFI::Struct
53
+ layout :next_in_chain, :pointer,
54
+ :label, StringView
55
+ end
56
+
57
+ class DeviceLostCallbackInfo < FFI::Struct
58
+ layout :next_in_chain, :pointer,
59
+ :mode, :uint32,
60
+ :callback, :pointer,
61
+ :userdata, :pointer
62
+ end
63
+
64
+ class UncapturedErrorCallbackInfo < FFI::Struct
65
+ layout :next_in_chain, :pointer,
66
+ :callback, :pointer,
67
+ :userdata, :pointer
68
+ end
69
+
70
+ class PopErrorScopeCallbackInfo < FFI::Struct
71
+ layout :next_in_chain, :pointer,
72
+ :mode, :uint32,
73
+ :callback, :pointer,
74
+ :userdata1, :pointer,
75
+ :userdata2, :pointer
76
+ end
77
+
78
+ class QueueWorkDoneCallbackInfo < FFI::Struct
79
+ layout :next_in_chain, :pointer,
80
+ :mode, :uint32,
81
+ :callback, :pointer,
82
+ :userdata1, :pointer,
83
+ :userdata2, :pointer
84
+ end
85
+
86
+ class InstanceEnumerateAdapterOptions < FFI::Struct
87
+ layout :next_in_chain, :pointer,
88
+ :backends, :uint32
89
+ end
90
+
91
+ class Limits < FFI::Struct
92
+ layout :max_texture_dimension_1d, :uint32,
93
+ :max_texture_dimension_2d, :uint32,
94
+ :max_texture_dimension_3d, :uint32,
95
+ :max_texture_array_layers, :uint32,
96
+ :max_bind_groups, :uint32,
97
+ :max_bind_groups_plus_vertex_buffers, :uint32,
98
+ :max_bindings_per_bind_group, :uint32,
99
+ :max_dynamic_uniform_buffers_per_pipeline_layout, :uint32,
100
+ :max_dynamic_storage_buffers_per_pipeline_layout, :uint32,
101
+ :max_sampled_textures_per_shader_stage, :uint32,
102
+ :max_samplers_per_shader_stage, :uint32,
103
+ :max_storage_buffers_per_shader_stage, :uint32,
104
+ :max_storage_textures_per_shader_stage, :uint32,
105
+ :max_uniform_buffers_per_shader_stage, :uint32,
106
+ :max_uniform_buffer_binding_size, :uint64,
107
+ :max_storage_buffer_binding_size, :uint64,
108
+ :min_uniform_buffer_offset_alignment, :uint32,
109
+ :min_storage_buffer_offset_alignment, :uint32,
110
+ :max_vertex_buffers, :uint32,
111
+ :max_buffer_size, :uint64,
112
+ :max_vertex_attributes, :uint32,
113
+ :max_vertex_buffer_array_stride, :uint32,
114
+ :max_inter_stage_shader_variables, :uint32,
115
+ :max_color_attachments, :uint32,
116
+ :max_color_attachment_bytes_per_sample, :uint32,
117
+ :max_compute_workgroup_storage_size, :uint32,
118
+ :max_compute_invocations_per_workgroup, :uint32,
119
+ :max_compute_workgroup_size_x, :uint32,
120
+ :max_compute_workgroup_size_y, :uint32,
121
+ :max_compute_workgroup_size_z, :uint32,
122
+ :max_compute_workgroups_per_dimension, :uint32,
123
+ :max_subgroup_size, :uint32
124
+ end
125
+
126
+ class RequiredLimits < FFI::Struct
127
+ layout :next_in_chain, :pointer,
128
+ :limits, Limits
129
+ end
130
+
131
+ class DeviceDescriptor < FFI::Struct
132
+ layout :next_in_chain, :pointer,
133
+ :label, StringView,
134
+ :required_feature_count, :size_t,
135
+ :required_features, :pointer,
136
+ :required_limits, :pointer,
137
+ :default_queue, QueueDescriptor,
138
+ :device_lost_callback_info, DeviceLostCallbackInfo,
139
+ :uncaptured_error_callback_info, UncapturedErrorCallbackInfo
140
+ end
141
+
142
+ class BufferDescriptor < FFI::Struct
143
+ layout :next_in_chain, :pointer,
144
+ :label, StringView,
145
+ :usage, :uint64,
146
+ :size, :uint64,
147
+ :mapped_at_creation, :uint32
148
+ end
149
+
150
+ class Extent3D < FFI::Struct
151
+ layout :width, :uint32,
152
+ :height, :uint32,
153
+ :depth_or_array_layers, :uint32
154
+ end
155
+
156
+ class TextureDescriptor < FFI::Struct
157
+ layout :next_in_chain, :pointer,
158
+ :label, StringView,
159
+ :usage, :uint64,
160
+ :dimension, TextureDimension,
161
+ :size, Extent3D,
162
+ :format, TextureFormat,
163
+ :mip_level_count, :uint32,
164
+ :sample_count, :uint32,
165
+ :view_format_count, :size_t,
166
+ :view_formats, :pointer
167
+ end
168
+
169
+ class ShaderSourceWGSL < FFI::Struct
170
+ layout :chain, ChainedStruct,
171
+ :code, StringView
172
+ end
173
+
174
+ class ShaderModuleDescriptor < FFI::Struct
175
+ layout :next_in_chain, :pointer,
176
+ :label, StringView
177
+ end
178
+
179
+ class CommandEncoderDescriptor < FFI::Struct
180
+ layout :next_in_chain, :pointer,
181
+ :label, StringView
182
+ end
183
+
184
+ class CommandBufferDescriptor < FFI::Struct
185
+ layout :next_in_chain, :pointer,
186
+ :label, StringView
187
+ end
188
+
189
+ class Color < FFI::Struct
190
+ layout :r, :double,
191
+ :g, :double,
192
+ :b, :double,
193
+ :a, :double
194
+ end
195
+
196
+ class RenderPassColorAttachment < FFI::Struct
197
+ layout :next_in_chain, :pointer,
198
+ :view, :pointer,
199
+ :depth_slice, :uint32,
200
+ :resolve_target, :pointer,
201
+ :load_op, LoadOp,
202
+ :store_op, StoreOp,
203
+ :clear_value, Color
204
+ end
205
+
206
+ class RenderPassDepthStencilAttachment < FFI::Struct
207
+ layout :view, :pointer,
208
+ :depth_load_op, LoadOp,
209
+ :depth_store_op, StoreOp,
210
+ :depth_clear_value, :float,
211
+ :depth_read_only, :uint32,
212
+ :stencil_load_op, LoadOp,
213
+ :stencil_store_op, StoreOp,
214
+ :stencil_clear_value, :uint32,
215
+ :stencil_read_only, :uint32
216
+ end
217
+
218
+ class RenderPassDescriptor < FFI::Struct
219
+ layout :next_in_chain, :pointer,
220
+ :label, StringView,
221
+ :color_attachment_count, :size_t,
222
+ :color_attachments, :pointer,
223
+ :depth_stencil_attachment, :pointer,
224
+ :occlusion_query_set, :pointer,
225
+ :timestamp_writes, :pointer
226
+ end
227
+
228
+ class ComputePassDescriptor < FFI::Struct
229
+ layout :next_in_chain, :pointer,
230
+ :label, StringView,
231
+ :timestamp_writes, :pointer
232
+ end
233
+
234
+ class ProgrammableStageDescriptor < FFI::Struct
235
+ layout :next_in_chain, :pointer,
236
+ :module, :pointer,
237
+ :entry_point, StringView,
238
+ :constant_count, :size_t,
239
+ :constants, :pointer
240
+ end
241
+
242
+ class ComputePipelineDescriptor < FFI::Struct
243
+ layout :next_in_chain, :pointer,
244
+ :label, StringView,
245
+ :layout, :pointer,
246
+ :compute, ProgrammableStageDescriptor
247
+ end
248
+
249
+ class BufferBindingLayout < FFI::Struct
250
+ layout :next_in_chain, :pointer,
251
+ :type, BufferBindingType,
252
+ :has_dynamic_offset, :uint32,
253
+ :min_binding_size, :uint64
254
+ end
255
+
256
+ class SamplerBindingLayout < FFI::Struct
257
+ layout :next_in_chain, :pointer,
258
+ :type, SamplerBindingType
259
+ end
260
+
261
+ class TextureBindingLayout < FFI::Struct
262
+ layout :next_in_chain, :pointer,
263
+ :sample_type, TextureSampleType,
264
+ :view_dimension, TextureViewDimension,
265
+ :multisampled, :uint32
266
+ end
267
+
268
+ class StorageTextureBindingLayout < FFI::Struct
269
+ layout :next_in_chain, :pointer,
270
+ :access, StorageTextureAccess,
271
+ :format, TextureFormat,
272
+ :view_dimension, TextureViewDimension
273
+ end
274
+
275
+ class BindGroupLayoutEntry < FFI::Struct
276
+ layout :next_in_chain, :pointer,
277
+ :binding, :uint32,
278
+ :visibility, :uint64,
279
+ :buffer, BufferBindingLayout,
280
+ :sampler, SamplerBindingLayout,
281
+ :texture, TextureBindingLayout,
282
+ :storage_texture, StorageTextureBindingLayout
283
+ end
284
+
285
+ class BindGroupLayoutDescriptor < FFI::Struct
286
+ layout :next_in_chain, :pointer,
287
+ :label, StringView,
288
+ :entry_count, :size_t,
289
+ :entries, :pointer
290
+ end
291
+
292
+ class BindGroupEntry < FFI::Struct
293
+ layout :next_in_chain, :pointer,
294
+ :binding, :uint32,
295
+ :buffer, :pointer,
296
+ :offset, :uint64,
297
+ :size, :uint64,
298
+ :sampler, :pointer,
299
+ :texture_view, :pointer
300
+ end
301
+
302
+ class BindGroupDescriptor < FFI::Struct
303
+ layout :next_in_chain, :pointer,
304
+ :label, StringView,
305
+ :layout, :pointer,
306
+ :entry_count, :size_t,
307
+ :entries, :pointer
308
+ end
309
+
310
+ class PipelineLayoutDescriptor < FFI::Struct
311
+ layout :next_in_chain, :pointer,
312
+ :label, StringView,
313
+ :bind_group_layout_count, :size_t,
314
+ :bind_group_layouts, :pointer
315
+ end
316
+
317
+ class RequestAdapterCallbackInfo < FFI::Struct
318
+ layout :next_in_chain, :pointer,
319
+ :mode, :uint32,
320
+ :callback, :pointer,
321
+ :userdata, :pointer
322
+ end
323
+
324
+ class RequestDeviceCallbackInfo < FFI::Struct
325
+ layout :next_in_chain, :pointer,
326
+ :mode, :uint32,
327
+ :callback, :pointer,
328
+ :userdata, :pointer
329
+ end
330
+
331
+ class BufferMapCallbackInfo < FFI::Struct
332
+ layout :next_in_chain, :pointer,
333
+ :mode, :uint32,
334
+ :callback, :pointer,
335
+ :userdata, :pointer
336
+ end
337
+
338
+ class TextureViewDescriptor < FFI::Struct
339
+ layout :next_in_chain, :pointer,
340
+ :label, StringView,
341
+ :format, TextureFormat,
342
+ :dimension, TextureViewDimension,
343
+ :base_mip_level, :uint32,
344
+ :mip_level_count, :uint32,
345
+ :base_array_layer, :uint32,
346
+ :array_layer_count, :uint32,
347
+ :aspect, TextureAspect
348
+ end
349
+
350
+ class SamplerDescriptor < FFI::Struct
351
+ layout :next_in_chain, :pointer,
352
+ :label, StringView,
353
+ :address_mode_u, AddressMode,
354
+ :address_mode_v, AddressMode,
355
+ :address_mode_w, AddressMode,
356
+ :mag_filter, FilterMode,
357
+ :min_filter, FilterMode,
358
+ :mipmap_filter, MipmapFilterMode,
359
+ :lod_min_clamp, :float,
360
+ :lod_max_clamp, :float,
361
+ :compare, CompareFunction,
362
+ :max_anisotropy, :uint16
363
+ end
364
+
365
+ class BlendComponent < FFI::Struct
366
+ layout :operation, BlendOperation,
367
+ :src_factor, BlendFactor,
368
+ :dst_factor, BlendFactor
369
+ end
370
+
371
+ class BlendState < FFI::Struct
372
+ layout :color, BlendComponent,
373
+ :alpha, BlendComponent
374
+ end
375
+
376
+ class ColorTargetState < FFI::Struct
377
+ layout :next_in_chain, :pointer,
378
+ :format, TextureFormat,
379
+ :blend, :pointer,
380
+ :write_mask, :uint64
381
+ end
382
+
383
+ class FragmentState < FFI::Struct
384
+ layout :next_in_chain, :pointer,
385
+ :module, :pointer,
386
+ :entry_point, StringView,
387
+ :constant_count, :size_t,
388
+ :constants, :pointer,
389
+ :target_count, :size_t,
390
+ :targets, :pointer
391
+ end
392
+
393
+ class VertexAttribute < FFI::Struct
394
+ layout :format, VertexFormat,
395
+ :offset, :uint64,
396
+ :shader_location, :uint32
397
+ end
398
+
399
+ class VertexBufferLayout < FFI::Struct
400
+ layout :array_stride, :uint64,
401
+ :step_mode, VertexStepMode,
402
+ :attribute_count, :size_t,
403
+ :attributes, :pointer
404
+ end
405
+
406
+ class VertexState < FFI::Struct
407
+ layout :next_in_chain, :pointer,
408
+ :module, :pointer,
409
+ :entry_point, StringView,
410
+ :constant_count, :size_t,
411
+ :constants, :pointer,
412
+ :buffer_count, :size_t,
413
+ :buffers, :pointer
414
+ end
415
+
416
+ class PrimitiveState < FFI::Struct
417
+ layout :next_in_chain, :pointer,
418
+ :topology, PrimitiveTopology,
419
+ :strip_index_format, IndexFormat,
420
+ :front_face, FrontFace,
421
+ :cull_mode, CullMode,
422
+ :unclipped_depth, :uint32
423
+ end
424
+
425
+ class StencilFaceState < FFI::Struct
426
+ layout :compare, CompareFunction,
427
+ :fail_op, StencilOperation,
428
+ :depth_fail_op, StencilOperation,
429
+ :pass_op, StencilOperation
430
+ end
431
+
432
+ class DepthStencilState < FFI::Struct
433
+ layout :next_in_chain, :pointer,
434
+ :format, TextureFormat,
435
+ :depth_write_enabled, :uint32,
436
+ :depth_compare, CompareFunction,
437
+ :stencil_front, StencilFaceState,
438
+ :stencil_back, StencilFaceState,
439
+ :stencil_read_mask, :uint32,
440
+ :stencil_write_mask, :uint32,
441
+ :depth_bias, :int32,
442
+ :depth_bias_slope_scale, :float,
443
+ :depth_bias_clamp, :float
444
+ end
445
+
446
+ class MultisampleState < FFI::Struct
447
+ layout :next_in_chain, :pointer,
448
+ :count, :uint32,
449
+ :mask, :uint32,
450
+ :alpha_to_coverage_enabled, :uint32
451
+ end
452
+
453
+ class RenderPipelineDescriptor < FFI::Struct
454
+ layout :next_in_chain, :pointer,
455
+ :label, StringView,
456
+ :layout, :pointer,
457
+ :vertex, VertexState,
458
+ :primitive, PrimitiveState,
459
+ :depth_stencil, :pointer,
460
+ :multisample, MultisampleState,
461
+ :fragment, :pointer
462
+ end
463
+
464
+ class Origin3D < FFI::Struct
465
+ layout :x, :uint32,
466
+ :y, :uint32,
467
+ :z, :uint32
468
+ end
469
+
470
+ class ImageCopyTexture < FFI::Struct
471
+ layout :texture, :pointer,
472
+ :mip_level, :uint32,
473
+ :origin, Origin3D,
474
+ :aspect, TextureAspect
475
+ end
476
+
477
+ class TextureDataLayout < FFI::Struct
478
+ layout :offset, :uint64,
479
+ :bytes_per_row, :uint32,
480
+ :rows_per_image, :uint32
481
+ end
482
+
483
+ class SurfaceDescriptor < FFI::Struct
484
+ layout :next_in_chain, :pointer,
485
+ :label, StringView
486
+ end
487
+
488
+ class SurfaceCapabilities < FFI::Struct
489
+ layout :next_in_chain, :pointer,
490
+ :usages, :uint64,
491
+ :format_count, :size_t,
492
+ :formats, :pointer,
493
+ :present_mode_count, :size_t,
494
+ :present_modes, :pointer,
495
+ :alpha_mode_count, :size_t,
496
+ :alpha_modes, :pointer
497
+ end
498
+
499
+ class SurfaceConfiguration < FFI::Struct
500
+ layout :next_in_chain, :pointer,
501
+ :device, :pointer,
502
+ :format, TextureFormat,
503
+ :usage, :uint64,
504
+ :width, :uint32,
505
+ :height, :uint32,
506
+ :view_format_count, :size_t,
507
+ :view_formats, :pointer,
508
+ :alpha_mode, :uint32,
509
+ :present_mode, :uint32
510
+ end
511
+
512
+ class SurfaceTexture < FFI::Struct
513
+ layout :texture, :pointer,
514
+ :suboptimal, :uint32,
515
+ :status, :uint32
516
+ end
517
+
518
+ class SurfaceSourceMetalLayer < FFI::Struct
519
+ layout :chain, ChainedStruct,
520
+ :layer, :pointer
521
+ end
522
+
523
+ class SurfaceSourceWindowsHWND < FFI::Struct
524
+ layout :chain, ChainedStruct,
525
+ :hinstance, :pointer,
526
+ :hwnd, :pointer
527
+ end
528
+
529
+ class SurfaceSourceXlibWindow < FFI::Struct
530
+ layout :chain, ChainedStruct,
531
+ :display, :pointer,
532
+ :window, :uint64
533
+ end
534
+
535
+ class SurfaceSourceWaylandSurface < FFI::Struct
536
+ layout :chain, ChainedStruct,
537
+ :display, :pointer,
538
+ :surface, :pointer
539
+ end
540
+
541
+ class SurfaceSourceXCBWindow < FFI::Struct
542
+ layout :chain, ChainedStruct,
543
+ :connection, :pointer,
544
+ :window, :uint32
545
+ end
546
+
547
+ class QuerySetDescriptor < FFI::Struct
548
+ layout :next_in_chain, :pointer,
549
+ :label, StringView,
550
+ :type, QueryType,
551
+ :count, :uint32
552
+ end
553
+
554
+ class ImageCopyBuffer < FFI::Struct
555
+ layout :layout, TextureDataLayout,
556
+ :buffer, :pointer
557
+ end
558
+
559
+ class SupportedFeatures < FFI::Struct
560
+ layout :feature_count, :size_t,
561
+ :features, :pointer
562
+ end
563
+
564
+ class SupportedLimits < FFI::Struct
565
+ layout :next_in_chain, :pointer,
566
+ :limits, Limits
567
+ end
568
+
569
+ class CompilationMessage < FFI::Struct
570
+ layout :next_in_chain, :pointer,
571
+ :message, StringView,
572
+ :type, CompilationMessageType,
573
+ :line_num, :uint64,
574
+ :line_pos, :uint64,
575
+ :offset, :uint64,
576
+ :length, :uint64
577
+ end
578
+
579
+ class CompilationInfo < FFI::Struct
580
+ layout :next_in_chain, :pointer,
581
+ :message_count, :size_t,
582
+ :messages, :pointer
583
+ end
584
+
585
+ class CompilationInfoCallbackInfo < FFI::Struct
586
+ layout :next_in_chain, :pointer,
587
+ :mode, :uint32,
588
+ :callback, :pointer,
589
+ :userdata1, :pointer,
590
+ :userdata2, :pointer
591
+ end
592
+
593
+ class RenderBundleDescriptor < FFI::Struct
594
+ layout :next_in_chain, :pointer,
595
+ :label, StringView
596
+ end
597
+
598
+ class RenderBundleEncoderDescriptor < FFI::Struct
599
+ layout :next_in_chain, :pointer,
600
+ :label, StringView,
601
+ :color_format_count, :size_t,
602
+ :color_formats, :pointer,
603
+ :depth_stencil_format, TextureFormat,
604
+ :sample_count, :uint32,
605
+ :depth_read_only, :uint32,
606
+ :stencil_read_only, :uint32
607
+ end
608
+ end
609
+ end
@@ -0,0 +1,80 @@
1
+ # frozen_string_literal: true
2
+
3
+ module WGPU
4
+ class BindGroup
5
+ attr_reader :handle
6
+
7
+ def initialize(device, label: nil, layout:, entries:)
8
+ @device = device
9
+
10
+ entries_array = entries.map { |e| create_entry(e) }
11
+ entries_ptr = FFI::MemoryPointer.new(Native::BindGroupEntry, entries_array.size)
12
+ entries_array.each_with_index do |entry, i|
13
+ offset = i * Native::BindGroupEntry.size
14
+ (entries_ptr + offset).put_bytes(0, entry.pointer.read_bytes(Native::BindGroupEntry.size))
15
+ end
16
+
17
+ desc = Native::BindGroupDescriptor.new
18
+ desc[:next_in_chain] = nil
19
+ if label
20
+ label_ptr = FFI::MemoryPointer.from_string(label)
21
+ desc[:label][:data] = label_ptr
22
+ desc[:label][:length] = label.bytesize
23
+ else
24
+ desc[:label][:data] = nil
25
+ desc[:label][:length] = 0
26
+ end
27
+ desc[:layout] = layout.handle
28
+ desc[:entry_count] = entries_array.size
29
+ desc[:entries] = entries_ptr
30
+
31
+ device.push_error_scope(:validation)
32
+ @handle = Native.wgpuDeviceCreateBindGroup(device.handle, desc)
33
+ error = device.pop_error_scope
34
+
35
+ if @handle.null? || (error[:type] && error[:type] != :no_error)
36
+ msg = error[:message] || "Failed to create bind group"
37
+ raise PipelineError, msg
38
+ end
39
+ end
40
+
41
+ def release
42
+ return if @handle.null?
43
+ Native.wgpuBindGroupRelease(@handle)
44
+ @handle = FFI::Pointer::NULL
45
+ end
46
+
47
+ private
48
+
49
+ def create_entry(entry_hash)
50
+ entry = Native::BindGroupEntry.new
51
+ entry[:next_in_chain] = nil
52
+ entry[:binding] = entry_hash[:binding]
53
+
54
+ if entry_hash[:buffer]
55
+ buffer = entry_hash[:buffer]
56
+ entry[:buffer] = buffer.handle
57
+ entry[:offset] = entry_hash[:offset] || 0
58
+ entry[:size] = entry_hash[:size] || buffer.size
59
+ else
60
+ entry[:buffer] = nil
61
+ entry[:offset] = 0
62
+ entry[:size] = 0
63
+ end
64
+
65
+ if entry_hash[:sampler]
66
+ entry[:sampler] = entry_hash[:sampler].handle
67
+ else
68
+ entry[:sampler] = nil
69
+ end
70
+
71
+ if entry_hash[:texture_view]
72
+ entry[:texture_view] = entry_hash[:texture_view].handle
73
+ else
74
+ entry[:texture_view] = nil
75
+ end
76
+
77
+ entry
78
+ end
79
+ end
80
+ end