1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
gpu / ipc / common / vulkan_types_mojom_traits.h [blame]
// Copyright 2019 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// This file is auto-generated from
// gpu/ipc/common/generate_vulkan_types.py
// It's formatted by clang-format using chromium coding style:
// clang-format -i -style=chromium filename
// DO NOT EDIT!
#ifndef GPU_IPC_COMMON_VULKAN_TYPES_MOJOM_TRAITS_H_
#define GPU_IPC_COMMON_VULKAN_TYPES_MOJOM_TRAITS_H_
#include <string_view>
#include "base/containers/span.h"
#include "gpu/ipc/common/vulkan_types.h"
#include "gpu/ipc/common/vulkan_types.mojom-shared.h"
namespace mojo {
template <>
struct StructTraits<gpu::mojom::VkExtensionPropertiesDataView,
VkExtensionProperties> {
static std::string_view extensionName(const VkExtensionProperties& input) {
return input.extensionName;
}
static uint32_t specVersion(const VkExtensionProperties& input) {
return input.specVersion;
}
static bool Read(gpu::mojom::VkExtensionPropertiesDataView data,
VkExtensionProperties* out);
};
template <>
struct StructTraits<gpu::mojom::VkLayerPropertiesDataView, VkLayerProperties> {
static std::string_view layerName(const VkLayerProperties& input) {
return input.layerName;
}
static uint32_t specVersion(const VkLayerProperties& input) {
return input.specVersion;
}
static uint32_t implementationVersion(const VkLayerProperties& input) {
return input.implementationVersion;
}
static std::string_view description(const VkLayerProperties& input) {
return input.description;
}
static bool Read(gpu::mojom::VkLayerPropertiesDataView data,
VkLayerProperties* out);
};
template <>
struct StructTraits<gpu::mojom::VkPhysicalDevicePropertiesDataView,
VkPhysicalDeviceProperties> {
static uint32_t apiVersion(const VkPhysicalDeviceProperties& input) {
return input.apiVersion;
}
static uint32_t driverVersion(const VkPhysicalDeviceProperties& input) {
return input.driverVersion;
}
static uint32_t vendorID(const VkPhysicalDeviceProperties& input) {
return input.vendorID;
}
static uint32_t deviceID(const VkPhysicalDeviceProperties& input) {
return input.deviceID;
}
static VkPhysicalDeviceType deviceType(
const VkPhysicalDeviceProperties& input) {
return input.deviceType;
}
static std::string_view deviceName(const VkPhysicalDeviceProperties& input) {
return input.deviceName;
}
static base::span<const uint8_t> pipelineCacheUUID(
const VkPhysicalDeviceProperties& input) {
return input.pipelineCacheUUID;
}
static const VkPhysicalDeviceLimits& limits(
const VkPhysicalDeviceProperties& input) {
return input.limits;
}
static const VkPhysicalDeviceSparseProperties& sparseProperties(
const VkPhysicalDeviceProperties& input) {
return input.sparseProperties;
}
static bool Read(gpu::mojom::VkPhysicalDevicePropertiesDataView data,
VkPhysicalDeviceProperties* out);
};
template <>
struct EnumTraits<gpu::mojom::VkPhysicalDeviceType, VkPhysicalDeviceType> {
static gpu::mojom::VkPhysicalDeviceType ToMojom(VkPhysicalDeviceType input) {
switch (input) {
case VkPhysicalDeviceType::VK_PHYSICAL_DEVICE_TYPE_OTHER:
return gpu::mojom::VkPhysicalDeviceType::OTHER;
case VkPhysicalDeviceType::VK_PHYSICAL_DEVICE_TYPE_INTEGRATED_GPU:
return gpu::mojom::VkPhysicalDeviceType::INTEGRATED_GPU;
case VkPhysicalDeviceType::VK_PHYSICAL_DEVICE_TYPE_DISCRETE_GPU:
return gpu::mojom::VkPhysicalDeviceType::DISCRETE_GPU;
case VkPhysicalDeviceType::VK_PHYSICAL_DEVICE_TYPE_VIRTUAL_GPU:
return gpu::mojom::VkPhysicalDeviceType::VIRTUAL_GPU;
case VkPhysicalDeviceType::VK_PHYSICAL_DEVICE_TYPE_CPU:
return gpu::mojom::VkPhysicalDeviceType::CPU;
default:
NOTREACHED();
}
}
static bool FromMojom(gpu::mojom::VkPhysicalDeviceType input,
VkPhysicalDeviceType* out) {
switch (input) {
case gpu::mojom::VkPhysicalDeviceType::OTHER:
*out = VkPhysicalDeviceType::VK_PHYSICAL_DEVICE_TYPE_OTHER;
return true;
case gpu::mojom::VkPhysicalDeviceType::INTEGRATED_GPU:
*out = VkPhysicalDeviceType::VK_PHYSICAL_DEVICE_TYPE_INTEGRATED_GPU;
return true;
case gpu::mojom::VkPhysicalDeviceType::DISCRETE_GPU:
*out = VkPhysicalDeviceType::VK_PHYSICAL_DEVICE_TYPE_DISCRETE_GPU;
return true;
case gpu::mojom::VkPhysicalDeviceType::VIRTUAL_GPU:
*out = VkPhysicalDeviceType::VK_PHYSICAL_DEVICE_TYPE_VIRTUAL_GPU;
return true;
case gpu::mojom::VkPhysicalDeviceType::CPU:
*out = VkPhysicalDeviceType::VK_PHYSICAL_DEVICE_TYPE_CPU;
return true;
case gpu::mojom::VkPhysicalDeviceType::INVALID_VALUE:
NOTREACHED();
}
NOTREACHED();
}
};
template <>
struct StructTraits<gpu::mojom::VkPhysicalDeviceLimitsDataView,
VkPhysicalDeviceLimits> {
static uint32_t maxImageDimension1D(const VkPhysicalDeviceLimits& input) {
return input.maxImageDimension1D;
}
static uint32_t maxImageDimension2D(const VkPhysicalDeviceLimits& input) {
return input.maxImageDimension2D;
}
static uint32_t maxImageDimension3D(const VkPhysicalDeviceLimits& input) {
return input.maxImageDimension3D;
}
static uint32_t maxImageDimensionCube(const VkPhysicalDeviceLimits& input) {
return input.maxImageDimensionCube;
}
static uint32_t maxImageArrayLayers(const VkPhysicalDeviceLimits& input) {
return input.maxImageArrayLayers;
}
static uint32_t maxTexelBufferElements(const VkPhysicalDeviceLimits& input) {
return input.maxTexelBufferElements;
}
static uint32_t maxUniformBufferRange(const VkPhysicalDeviceLimits& input) {
return input.maxUniformBufferRange;
}
static uint32_t maxStorageBufferRange(const VkPhysicalDeviceLimits& input) {
return input.maxStorageBufferRange;
}
static uint32_t maxPushConstantsSize(const VkPhysicalDeviceLimits& input) {
return input.maxPushConstantsSize;
}
static uint32_t maxMemoryAllocationCount(
const VkPhysicalDeviceLimits& input) {
return input.maxMemoryAllocationCount;
}
static uint32_t maxSamplerAllocationCount(
const VkPhysicalDeviceLimits& input) {
return input.maxSamplerAllocationCount;
}
static bool bufferImageGranularity(const VkPhysicalDeviceLimits& input) {
return input.bufferImageGranularity;
}
static bool sparseAddressSpaceSize(const VkPhysicalDeviceLimits& input) {
return input.sparseAddressSpaceSize;
}
static uint32_t maxBoundDescriptorSets(const VkPhysicalDeviceLimits& input) {
return input.maxBoundDescriptorSets;
}
static uint32_t maxPerStageDescriptorSamplers(
const VkPhysicalDeviceLimits& input) {
return input.maxPerStageDescriptorSamplers;
}
static uint32_t maxPerStageDescriptorUniformBuffers(
const VkPhysicalDeviceLimits& input) {
return input.maxPerStageDescriptorUniformBuffers;
}
static uint32_t maxPerStageDescriptorStorageBuffers(
const VkPhysicalDeviceLimits& input) {
return input.maxPerStageDescriptorStorageBuffers;
}
static uint32_t maxPerStageDescriptorSampledImages(
const VkPhysicalDeviceLimits& input) {
return input.maxPerStageDescriptorSampledImages;
}
static uint32_t maxPerStageDescriptorStorageImages(
const VkPhysicalDeviceLimits& input) {
return input.maxPerStageDescriptorStorageImages;
}
static uint32_t maxPerStageDescriptorInputAttachments(
const VkPhysicalDeviceLimits& input) {
return input.maxPerStageDescriptorInputAttachments;
}
static uint32_t maxPerStageResources(const VkPhysicalDeviceLimits& input) {
return input.maxPerStageResources;
}
static uint32_t maxDescriptorSetSamplers(
const VkPhysicalDeviceLimits& input) {
return input.maxDescriptorSetSamplers;
}
static uint32_t maxDescriptorSetUniformBuffers(
const VkPhysicalDeviceLimits& input) {
return input.maxDescriptorSetUniformBuffers;
}
static uint32_t maxDescriptorSetUniformBuffersDynamic(
const VkPhysicalDeviceLimits& input) {
return input.maxDescriptorSetUniformBuffersDynamic;
}
static uint32_t maxDescriptorSetStorageBuffers(
const VkPhysicalDeviceLimits& input) {
return input.maxDescriptorSetStorageBuffers;
}
static uint32_t maxDescriptorSetStorageBuffersDynamic(
const VkPhysicalDeviceLimits& input) {
return input.maxDescriptorSetStorageBuffersDynamic;
}
static uint32_t maxDescriptorSetSampledImages(
const VkPhysicalDeviceLimits& input) {
return input.maxDescriptorSetSampledImages;
}
static uint32_t maxDescriptorSetStorageImages(
const VkPhysicalDeviceLimits& input) {
return input.maxDescriptorSetStorageImages;
}
static uint32_t maxDescriptorSetInputAttachments(
const VkPhysicalDeviceLimits& input) {
return input.maxDescriptorSetInputAttachments;
}
static uint32_t maxVertexInputAttributes(
const VkPhysicalDeviceLimits& input) {
return input.maxVertexInputAttributes;
}
static uint32_t maxVertexInputBindings(const VkPhysicalDeviceLimits& input) {
return input.maxVertexInputBindings;
}
static uint32_t maxVertexInputAttributeOffset(
const VkPhysicalDeviceLimits& input) {
return input.maxVertexInputAttributeOffset;
}
static uint32_t maxVertexInputBindingStride(
const VkPhysicalDeviceLimits& input) {
return input.maxVertexInputBindingStride;
}
static uint32_t maxVertexOutputComponents(
const VkPhysicalDeviceLimits& input) {
return input.maxVertexOutputComponents;
}
static uint32_t maxTessellationGenerationLevel(
const VkPhysicalDeviceLimits& input) {
return input.maxTessellationGenerationLevel;
}
static uint32_t maxTessellationPatchSize(
const VkPhysicalDeviceLimits& input) {
return input.maxTessellationPatchSize;
}
static uint32_t maxTessellationControlPerVertexInputComponents(
const VkPhysicalDeviceLimits& input) {
return input.maxTessellationControlPerVertexInputComponents;
}
static uint32_t maxTessellationControlPerVertexOutputComponents(
const VkPhysicalDeviceLimits& input) {
return input.maxTessellationControlPerVertexOutputComponents;
}
static uint32_t maxTessellationControlPerPatchOutputComponents(
const VkPhysicalDeviceLimits& input) {
return input.maxTessellationControlPerPatchOutputComponents;
}
static uint32_t maxTessellationControlTotalOutputComponents(
const VkPhysicalDeviceLimits& input) {
return input.maxTessellationControlTotalOutputComponents;
}
static uint32_t maxTessellationEvaluationInputComponents(
const VkPhysicalDeviceLimits& input) {
return input.maxTessellationEvaluationInputComponents;
}
static uint32_t maxTessellationEvaluationOutputComponents(
const VkPhysicalDeviceLimits& input) {
return input.maxTessellationEvaluationOutputComponents;
}
static uint32_t maxGeometryShaderInvocations(
const VkPhysicalDeviceLimits& input) {
return input.maxGeometryShaderInvocations;
}
static uint32_t maxGeometryInputComponents(
const VkPhysicalDeviceLimits& input) {
return input.maxGeometryInputComponents;
}
static uint32_t maxGeometryOutputComponents(
const VkPhysicalDeviceLimits& input) {
return input.maxGeometryOutputComponents;
}
static uint32_t maxGeometryOutputVertices(
const VkPhysicalDeviceLimits& input) {
return input.maxGeometryOutputVertices;
}
static uint32_t maxGeometryTotalOutputComponents(
const VkPhysicalDeviceLimits& input) {
return input.maxGeometryTotalOutputComponents;
}
static uint32_t maxFragmentInputComponents(
const VkPhysicalDeviceLimits& input) {
return input.maxFragmentInputComponents;
}
static uint32_t maxFragmentOutputAttachments(
const VkPhysicalDeviceLimits& input) {
return input.maxFragmentOutputAttachments;
}
static uint32_t maxFragmentDualSrcAttachments(
const VkPhysicalDeviceLimits& input) {
return input.maxFragmentDualSrcAttachments;
}
static uint32_t maxFragmentCombinedOutputResources(
const VkPhysicalDeviceLimits& input) {
return input.maxFragmentCombinedOutputResources;
}
static uint32_t maxComputeSharedMemorySize(
const VkPhysicalDeviceLimits& input) {
return input.maxComputeSharedMemorySize;
}
static base::span<const uint32_t> maxComputeWorkGroupCount(
const VkPhysicalDeviceLimits& input) {
return input.maxComputeWorkGroupCount;
}
static uint32_t maxComputeWorkGroupInvocations(
const VkPhysicalDeviceLimits& input) {
return input.maxComputeWorkGroupInvocations;
}
static base::span<const uint32_t> maxComputeWorkGroupSize(
const VkPhysicalDeviceLimits& input) {
return input.maxComputeWorkGroupSize;
}
static uint32_t subPixelPrecisionBits(const VkPhysicalDeviceLimits& input) {
return input.subPixelPrecisionBits;
}
static uint32_t subTexelPrecisionBits(const VkPhysicalDeviceLimits& input) {
return input.subTexelPrecisionBits;
}
static uint32_t mipmapPrecisionBits(const VkPhysicalDeviceLimits& input) {
return input.mipmapPrecisionBits;
}
static uint32_t maxDrawIndexedIndexValue(
const VkPhysicalDeviceLimits& input) {
return input.maxDrawIndexedIndexValue;
}
static uint32_t maxDrawIndirectCount(const VkPhysicalDeviceLimits& input) {
return input.maxDrawIndirectCount;
}
static float maxSamplerLodBias(const VkPhysicalDeviceLimits& input) {
return input.maxSamplerLodBias;
}
static float maxSamplerAnisotropy(const VkPhysicalDeviceLimits& input) {
return input.maxSamplerAnisotropy;
}
static uint32_t maxViewports(const VkPhysicalDeviceLimits& input) {
return input.maxViewports;
}
static base::span<const uint32_t> maxViewportDimensions(
const VkPhysicalDeviceLimits& input) {
return input.maxViewportDimensions;
}
static base::span<const float> viewportBoundsRange(
const VkPhysicalDeviceLimits& input) {
return input.viewportBoundsRange;
}
static uint32_t viewportSubPixelBits(const VkPhysicalDeviceLimits& input) {
return input.viewportSubPixelBits;
}
static size_t minMemoryMapAlignment(const VkPhysicalDeviceLimits& input) {
return input.minMemoryMapAlignment;
}
static bool minTexelBufferOffsetAlignment(
const VkPhysicalDeviceLimits& input) {
return input.minTexelBufferOffsetAlignment;
}
static bool minUniformBufferOffsetAlignment(
const VkPhysicalDeviceLimits& input) {
return input.minUniformBufferOffsetAlignment;
}
static bool minStorageBufferOffsetAlignment(
const VkPhysicalDeviceLimits& input) {
return input.minStorageBufferOffsetAlignment;
}
static int32_t minTexelOffset(const VkPhysicalDeviceLimits& input) {
return input.minTexelOffset;
}
static uint32_t maxTexelOffset(const VkPhysicalDeviceLimits& input) {
return input.maxTexelOffset;
}
static int32_t minTexelGatherOffset(const VkPhysicalDeviceLimits& input) {
return input.minTexelGatherOffset;
}
static uint32_t maxTexelGatherOffset(const VkPhysicalDeviceLimits& input) {
return input.maxTexelGatherOffset;
}
static float minInterpolationOffset(const VkPhysicalDeviceLimits& input) {
return input.minInterpolationOffset;
}
static float maxInterpolationOffset(const VkPhysicalDeviceLimits& input) {
return input.maxInterpolationOffset;
}
static uint32_t subPixelInterpolationOffsetBits(
const VkPhysicalDeviceLimits& input) {
return input.subPixelInterpolationOffsetBits;
}
static uint32_t maxFramebufferWidth(const VkPhysicalDeviceLimits& input) {
return input.maxFramebufferWidth;
}
static uint32_t maxFramebufferHeight(const VkPhysicalDeviceLimits& input) {
return input.maxFramebufferHeight;
}
static uint32_t maxFramebufferLayers(const VkPhysicalDeviceLimits& input) {
return input.maxFramebufferLayers;
}
static VkSampleCountFlags framebufferColorSampleCounts(
const VkPhysicalDeviceLimits& input) {
return input.framebufferColorSampleCounts;
}
static VkSampleCountFlags framebufferDepthSampleCounts(
const VkPhysicalDeviceLimits& input) {
return input.framebufferDepthSampleCounts;
}
static VkSampleCountFlags framebufferStencilSampleCounts(
const VkPhysicalDeviceLimits& input) {
return input.framebufferStencilSampleCounts;
}
static VkSampleCountFlags framebufferNoAttachmentsSampleCounts(
const VkPhysicalDeviceLimits& input) {
return input.framebufferNoAttachmentsSampleCounts;
}
static uint32_t maxColorAttachments(const VkPhysicalDeviceLimits& input) {
return input.maxColorAttachments;
}
static VkSampleCountFlags sampledImageColorSampleCounts(
const VkPhysicalDeviceLimits& input) {
return input.sampledImageColorSampleCounts;
}
static VkSampleCountFlags sampledImageIntegerSampleCounts(
const VkPhysicalDeviceLimits& input) {
return input.sampledImageIntegerSampleCounts;
}
static VkSampleCountFlags sampledImageDepthSampleCounts(
const VkPhysicalDeviceLimits& input) {
return input.sampledImageDepthSampleCounts;
}
static VkSampleCountFlags sampledImageStencilSampleCounts(
const VkPhysicalDeviceLimits& input) {
return input.sampledImageStencilSampleCounts;
}
static VkSampleCountFlags storageImageSampleCounts(
const VkPhysicalDeviceLimits& input) {
return input.storageImageSampleCounts;
}
static uint32_t maxSampleMaskWords(const VkPhysicalDeviceLimits& input) {
return input.maxSampleMaskWords;
}
static bool timestampComputeAndGraphics(const VkPhysicalDeviceLimits& input) {
return input.timestampComputeAndGraphics;
}
static float timestampPeriod(const VkPhysicalDeviceLimits& input) {
return input.timestampPeriod;
}
static uint32_t maxClipDistances(const VkPhysicalDeviceLimits& input) {
return input.maxClipDistances;
}
static uint32_t maxCullDistances(const VkPhysicalDeviceLimits& input) {
return input.maxCullDistances;
}
static uint32_t maxCombinedClipAndCullDistances(
const VkPhysicalDeviceLimits& input) {
return input.maxCombinedClipAndCullDistances;
}
static uint32_t discreteQueuePriorities(const VkPhysicalDeviceLimits& input) {
return input.discreteQueuePriorities;
}
static base::span<const float> pointSizeRange(
const VkPhysicalDeviceLimits& input) {
return input.pointSizeRange;
}
static base::span<const float> lineWidthRange(
const VkPhysicalDeviceLimits& input) {
return input.lineWidthRange;
}
static float pointSizeGranularity(const VkPhysicalDeviceLimits& input) {
return input.pointSizeGranularity;
}
static float lineWidthGranularity(const VkPhysicalDeviceLimits& input) {
return input.lineWidthGranularity;
}
static bool strictLines(const VkPhysicalDeviceLimits& input) {
return input.strictLines;
}
static bool standardSampleLocations(const VkPhysicalDeviceLimits& input) {
return input.standardSampleLocations;
}
static bool optimalBufferCopyOffsetAlignment(
const VkPhysicalDeviceLimits& input) {
return input.optimalBufferCopyOffsetAlignment;
}
static bool optimalBufferCopyRowPitchAlignment(
const VkPhysicalDeviceLimits& input) {
return input.optimalBufferCopyRowPitchAlignment;
}
static bool nonCoherentAtomSize(const VkPhysicalDeviceLimits& input) {
return input.nonCoherentAtomSize;
}
static bool Read(gpu::mojom::VkPhysicalDeviceLimitsDataView data,
VkPhysicalDeviceLimits* out);
};
template <>
struct StructTraits<gpu::mojom::VkPhysicalDeviceSparsePropertiesDataView,
VkPhysicalDeviceSparseProperties> {
static bool residencyStandard2DBlockShape(
const VkPhysicalDeviceSparseProperties& input) {
return input.residencyStandard2DBlockShape;
}
static bool residencyStandard2DMultisampleBlockShape(
const VkPhysicalDeviceSparseProperties& input) {
return input.residencyStandard2DMultisampleBlockShape;
}
static bool residencyStandard3DBlockShape(
const VkPhysicalDeviceSparseProperties& input) {
return input.residencyStandard3DBlockShape;
}
static bool residencyAlignedMipSize(
const VkPhysicalDeviceSparseProperties& input) {
return input.residencyAlignedMipSize;
}
static bool residencyNonResidentStrict(
const VkPhysicalDeviceSparseProperties& input) {
return input.residencyNonResidentStrict;
}
static bool Read(gpu::mojom::VkPhysicalDeviceSparsePropertiesDataView data,
VkPhysicalDeviceSparseProperties* out);
};
template <>
struct StructTraits<gpu::mojom::VkPhysicalDeviceFeaturesDataView,
VkPhysicalDeviceFeatures> {
static bool robustBufferAccess(const VkPhysicalDeviceFeatures& input) {
return input.robustBufferAccess;
}
static bool fullDrawIndexUint32(const VkPhysicalDeviceFeatures& input) {
return input.fullDrawIndexUint32;
}
static bool imageCubeArray(const VkPhysicalDeviceFeatures& input) {
return input.imageCubeArray;
}
static bool independentBlend(const VkPhysicalDeviceFeatures& input) {
return input.independentBlend;
}
static bool geometryShader(const VkPhysicalDeviceFeatures& input) {
return input.geometryShader;
}
static bool tessellationShader(const VkPhysicalDeviceFeatures& input) {
return input.tessellationShader;
}
static bool sampleRateShading(const VkPhysicalDeviceFeatures& input) {
return input.sampleRateShading;
}
static bool dualSrcBlend(const VkPhysicalDeviceFeatures& input) {
return input.dualSrcBlend;
}
static bool logicOp(const VkPhysicalDeviceFeatures& input) {
return input.logicOp;
}
static bool multiDrawIndirect(const VkPhysicalDeviceFeatures& input) {
return input.multiDrawIndirect;
}
static bool drawIndirectFirstInstance(const VkPhysicalDeviceFeatures& input) {
return input.drawIndirectFirstInstance;
}
static bool depthClamp(const VkPhysicalDeviceFeatures& input) {
return input.depthClamp;
}
static bool depthBiasClamp(const VkPhysicalDeviceFeatures& input) {
return input.depthBiasClamp;
}
static bool fillModeNonSolid(const VkPhysicalDeviceFeatures& input) {
return input.fillModeNonSolid;
}
static bool depthBounds(const VkPhysicalDeviceFeatures& input) {
return input.depthBounds;
}
static bool wideLines(const VkPhysicalDeviceFeatures& input) {
return input.wideLines;
}
static bool largePoints(const VkPhysicalDeviceFeatures& input) {
return input.largePoints;
}
static bool alphaToOne(const VkPhysicalDeviceFeatures& input) {
return input.alphaToOne;
}
static bool multiViewport(const VkPhysicalDeviceFeatures& input) {
return input.multiViewport;
}
static bool samplerAnisotropy(const VkPhysicalDeviceFeatures& input) {
return input.samplerAnisotropy;
}
static bool textureCompressionETC2(const VkPhysicalDeviceFeatures& input) {
return input.textureCompressionETC2;
}
static bool textureCompressionASTC_LDR(
const VkPhysicalDeviceFeatures& input) {
return input.textureCompressionASTC_LDR;
}
static bool textureCompressionBC(const VkPhysicalDeviceFeatures& input) {
return input.textureCompressionBC;
}
static bool occlusionQueryPrecise(const VkPhysicalDeviceFeatures& input) {
return input.occlusionQueryPrecise;
}
static bool pipelineStatisticsQuery(const VkPhysicalDeviceFeatures& input) {
return input.pipelineStatisticsQuery;
}
static bool vertexPipelineStoresAndAtomics(
const VkPhysicalDeviceFeatures& input) {
return input.vertexPipelineStoresAndAtomics;
}
static bool fragmentStoresAndAtomics(const VkPhysicalDeviceFeatures& input) {
return input.fragmentStoresAndAtomics;
}
static bool shaderTessellationAndGeometryPointSize(
const VkPhysicalDeviceFeatures& input) {
return input.shaderTessellationAndGeometryPointSize;
}
static bool shaderImageGatherExtended(const VkPhysicalDeviceFeatures& input) {
return input.shaderImageGatherExtended;
}
static bool shaderStorageImageExtendedFormats(
const VkPhysicalDeviceFeatures& input) {
return input.shaderStorageImageExtendedFormats;
}
static bool shaderStorageImageMultisample(
const VkPhysicalDeviceFeatures& input) {
return input.shaderStorageImageMultisample;
}
static bool shaderStorageImageReadWithoutFormat(
const VkPhysicalDeviceFeatures& input) {
return input.shaderStorageImageReadWithoutFormat;
}
static bool shaderStorageImageWriteWithoutFormat(
const VkPhysicalDeviceFeatures& input) {
return input.shaderStorageImageWriteWithoutFormat;
}
static bool shaderUniformBufferArrayDynamicIndexing(
const VkPhysicalDeviceFeatures& input) {
return input.shaderUniformBufferArrayDynamicIndexing;
}
static bool shaderSampledImageArrayDynamicIndexing(
const VkPhysicalDeviceFeatures& input) {
return input.shaderSampledImageArrayDynamicIndexing;
}
static bool shaderStorageBufferArrayDynamicIndexing(
const VkPhysicalDeviceFeatures& input) {
return input.shaderStorageBufferArrayDynamicIndexing;
}
static bool shaderStorageImageArrayDynamicIndexing(
const VkPhysicalDeviceFeatures& input) {
return input.shaderStorageImageArrayDynamicIndexing;
}
static bool shaderClipDistance(const VkPhysicalDeviceFeatures& input) {
return input.shaderClipDistance;
}
static bool shaderCullDistance(const VkPhysicalDeviceFeatures& input) {
return input.shaderCullDistance;
}
static bool shaderFloat64(const VkPhysicalDeviceFeatures& input) {
return input.shaderFloat64;
}
static bool shaderInt64(const VkPhysicalDeviceFeatures& input) {
return input.shaderInt64;
}
static bool shaderInt16(const VkPhysicalDeviceFeatures& input) {
return input.shaderInt16;
}
static bool shaderResourceResidency(const VkPhysicalDeviceFeatures& input) {
return input.shaderResourceResidency;
}
static bool shaderResourceMinLod(const VkPhysicalDeviceFeatures& input) {
return input.shaderResourceMinLod;
}
static bool sparseBinding(const VkPhysicalDeviceFeatures& input) {
return input.sparseBinding;
}
static bool sparseResidencyBuffer(const VkPhysicalDeviceFeatures& input) {
return input.sparseResidencyBuffer;
}
static bool sparseResidencyImage2D(const VkPhysicalDeviceFeatures& input) {
return input.sparseResidencyImage2D;
}
static bool sparseResidencyImage3D(const VkPhysicalDeviceFeatures& input) {
return input.sparseResidencyImage3D;
}
static bool sparseResidency2Samples(const VkPhysicalDeviceFeatures& input) {
return input.sparseResidency2Samples;
}
static bool sparseResidency4Samples(const VkPhysicalDeviceFeatures& input) {
return input.sparseResidency4Samples;
}
static bool sparseResidency8Samples(const VkPhysicalDeviceFeatures& input) {
return input.sparseResidency8Samples;
}
static bool sparseResidency16Samples(const VkPhysicalDeviceFeatures& input) {
return input.sparseResidency16Samples;
}
static bool sparseResidencyAliased(const VkPhysicalDeviceFeatures& input) {
return input.sparseResidencyAliased;
}
static bool variableMultisampleRate(const VkPhysicalDeviceFeatures& input) {
return input.variableMultisampleRate;
}
static bool inheritedQueries(const VkPhysicalDeviceFeatures& input) {
return input.inheritedQueries;
}
static bool Read(gpu::mojom::VkPhysicalDeviceFeaturesDataView data,
VkPhysicalDeviceFeatures* out);
};
template <>
struct StructTraits<gpu::mojom::VkQueueFamilyPropertiesDataView,
VkQueueFamilyProperties> {
static VkQueueFlags queueFlags(const VkQueueFamilyProperties& input) {
return input.queueFlags;
}
static uint32_t queueCount(const VkQueueFamilyProperties& input) {
return input.queueCount;
}
static uint32_t timestampValidBits(const VkQueueFamilyProperties& input) {
return input.timestampValidBits;
}
static const VkExtent3D& minImageTransferGranularity(
const VkQueueFamilyProperties& input) {
return input.minImageTransferGranularity;
}
static bool Read(gpu::mojom::VkQueueFamilyPropertiesDataView data,
VkQueueFamilyProperties* out);
};
template <>
struct StructTraits<gpu::mojom::VkExtent3DDataView, VkExtent3D> {
static uint32_t width(const VkExtent3D& input) { return input.width; }
static uint32_t height(const VkExtent3D& input) { return input.height; }
static uint32_t depth(const VkExtent3D& input) { return input.depth; }
static bool Read(gpu::mojom::VkExtent3DDataView data, VkExtent3D* out);
};
} // namespace mojo
#endif // GPU_IPC_COMMON_VULKAN_TYPES_MOJOM_TRAITS_H_