-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdevice.js
251 lines (246 loc) · 15.4 KB
/
device.js
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
'use strict'
const mongoose = require('mongoose')
require('../customTypes/uint12.js')(mongoose)
require('../customTypes/uint10.js')(mongoose)
require('../customTypes/formats.js')(mongoose)
const DeviceSchema = new mongoose.Schema({
'name': { type: String, required: true },
'os': { type: String, required: true, enum: ['Windows', 'Linux', 'Android'] },
'deviceId': { type: Number, required: true },
'vendorId': { type: Number, required: true },
'driverVersion': { type: Number, required: true },
'vulkanInfo': {
'properties': {
'apiVersion': {
'major': { type: mongoose.Schema.Types.Uint10, required: true },
'minor': { type: mongoose.Schema.Types.Uint10, required: true },
'patch': { type: mongoose.Schema.Types.Uint12, required: true },
},
'driverVersion': { type: Number, required: true },
'vendorID': { type: Number, required: true },
'deviceID': { type: Number, required: true },
'deviceName': { type: String, required: true },
'deviceType': { type: String, required: true },
'pipelineCacheUUID': { type: [Number], required: true },
'limits': {
'maxImageDimension1D': { type: Number, required: true },
'maxImageDimension2D': { type: Number, required: true },
'maxImageDimension3D': { type: Number, required: true },
'maxImageDimensionCube': { type: Number, required: true },
'maxImageArrayLayers': { type: Number, required: true },
'maxTexelBufferElements': { type: Number, required: true },
'maxUniformBufferRange': { type: Number, required: true },
'maxStorageBufferRange': { type: Number, required: true },
'maxPushConstantsSize': { type: Number, required: true },
'maxMemoryAllocationCount': { type: Number, required: true },
'maxSamplerAllocationCount': { type: Number, required: true },
'bufferImageGranularity': { type: Number, required: true },
'sparseAddressSpaceSize': { type: Number, required: true },
'maxBoundDescriptorSets': { type: Number, required: true },
'maxPerStageDescriptorSamplers': { type: Number, required: true },
'maxPerStageDescriptorUniformBuffers': { type: Number, required: true },
'maxPerStageDescriptorStorageBuffers': { type: Number, required: true },
'maxPerStageDescriptorSampledImages': { type: Number, required: true },
'maxPerStageDescriptorStorageImages': { type: Number, required: true },
'maxPerStageDescriptorInputAttachments': { type: Number, required: true },
'maxPerStageResources': { type: Number, required: true },
'maxDescriptorSetSamplers': { type: Number, required: true },
'maxDescriptorSetUniformBuffers': { type: Number, required: true },
'maxDescriptorSetUniformBuffersDynamic': { type: Number, required: true },
'maxDescriptorSetStorageBuffers': { type: Number, required: true },
'maxDescriptorSetStorageBuffersDynamic': { type: Number, required: true },
'maxDescriptorSetSampledImages': { type: Number, required: true },
'maxDescriptorSetStorageImages': { type: Number, required: true },
'maxDescriptorSetInputAttachments': { type: Number, required: true },
'maxVertexInputAttributes': { type: Number, required: true },
'maxVertexInputBindings': { type: Number, required: true },
'maxVertexInputAttributeOffset': { type: Number, required: true },
'maxVertexInputBindingStride': { type: Number, required: true },
'maxVertexOutputComponents': { type: Number, required: true },
'maxTessellationGenerationLevel': { type: Number, required: true },
'maxTessellationPatchSize': { type: Number, required: true },
'maxTessellationControlPerVertexInputComponents': { type: Number, required: true },
'maxTessellationControlPerVertexOutputComponents': { type: Number, required: true },
'maxTessellationControlPerPatchOutputComponents': { type: Number, required: true },
'maxTessellationControlTotalOutputComponents': { type: Number, required: true },
'maxTessellationEvaluationInputComponents': { type: Number, required: true },
'maxTessellationEvaluationOutputComponents': { type: Number, required: true },
'maxGeometryShaderInvocations': { type: Number, required: true },
'maxGeometryInputComponents': { type: Number, required: true },
'maxGeometryOutputComponents': { type: Number, required: true },
'maxGeometryOutputVertices': { type: Number, required: true },
'maxGeometryTotalOutputComponents': { type: Number, required: true },
'maxFragmentInputComponents': { type: Number, required: true },
'maxFragmentOutputAttachments': { type: Number, required: true },
'maxFragmentDualSrcAttachments': { type: Number, required: true },
'maxFragmentCombinedOutputResources': { type: Number, required: true },
'maxComputeSharedMemorySize': { type: Number, required: true },
'maxComputeWorkGroupCount': { type: [Number], required: true },
'maxComputeWorkGroupInvocations': { type: Number, required: true },
'maxComputeWorkGroupSize': { type: [Number], required: true },
'subPixelPrecisionBits': { type: Number, required: true },
'subTexelPrecisionBits': { type: Number, required: true },
'mipmapPrecisionBits': { type: Number, required: true },
'maxDrawIndexedIndexValue': { type: Number, required: true },
'maxDrawIndirectCount': { type: Number, required: true },
'maxSamplerLodBias': { type: Number, required: true },
'maxSamplerAnisotropy': { type: Number, required: true },
'maxViewports': { type: Number, required: true },
'maxViewportDimensions': { type: [Number], required: true },
'viewportBoundsRange': { type: [Number], required: true },
'viewportSubPixelBits': { type: Number, required: true },
'minMemoryMapAlignment': { type: Number, required: true },
'minTexelBufferOffsetAlignment': { type: Number, required: true },
'minUniformBufferOffsetAlignment': { type: Number, required: true },
'minStorageBufferOffsetAlignment': { type: Number, required: true },
'minTexelOffset': { type: Number, required: true },
'maxTexelOffset': { type: Number, required: true },
'minTexelGatherOffset': { type: Number, required: true },
'maxTexelGatherOffset': { type: Number, required: true },
'minInterpolationOffset': { type: Number, required: true },
'maxInterpolationOffset': { type: Number, required: true },
'subPixelInterpolationOffsetBits': { type: Number, required: true },
'maxFramebufferWidth': { type: Number, required: true },
'maxFramebufferHeight': { type: Number, required: true },
'maxFramebufferLayers': { type: Number, required: true },
'framebufferColorSampleCounts': { type: [String], required: true },
'framebufferDepthSampleCounts': { type: [String], required: true },
'framebufferStencilSampleCounts': { type: [String], required: true },
'framebufferNoAttachmentsSampleCounts': { type: [String], required: true },
'maxColorAttachments': { type: Number, required: true },
'sampledImageColorSampleCounts': { type: [String], required: true },
'sampledImageIntegerSampleCounts': { type: [String], required: true },
'sampledImageDepthSampleCounts': { type: [String], required: true },
'sampledImageStencilSampleCounts': { type: [String], required: true },
'storageImageSampleCounts': { type: [String], required: true },
'maxSampleMaskWords': { type: Number, required: true },
'timestampComputeAndGraphics': { type: Boolean, required: true },
'timestampPeriod': { type: Number, required: true },
'maxClipDistances': { type: Number, required: true },
'maxCullDistances': { type: Number, required: true },
'maxCombinedClipAndCullDistances': { type: Number, required: true },
'discreteQueuePriorities': { type: Number, required: true },
'pointSizeRange': { type: [Number], required: true },
'lineWidthRange': { type: [Number], required: true },
'pointSizeGranularity': { type: Number, required: true },
'lineWidthGranularity': { type: Number, required: true },
'strictLines': { type: Boolean, required: true },
'standardSampleLocations': { type: Boolean, required: true },
'optimalBufferCopyOffsetAlignment': { type: Number, required: true },
'optimalBufferCopyRowPitchAlignment': { type: Number, required: true },
'nonCoherentAtomSize': { type: Number, required: true },
},
'sparseProperties': {
'residencyStandard2DBlockShape': { type: Boolean, required: true },
'residencyStandard2DMultisampleBlockShape': { type: Boolean, required: true },
'residencyStandard3DBlockShape': { type: Boolean, required: true },
'residencyAlignedMipSize': { type: Boolean, required: true },
'residencyNonResidentStrict': { type: Boolean, required: true },
},
},
'features': {
'robustBufferAccess': { type: Boolean, required: true },
'fullDrawIndexUint32': { type: Boolean, required: true },
'imageCubeArray': { type: Boolean, required: true },
'independentBlend': { type: Boolean, required: true },
'geometryShader': { type: Boolean, required: true },
'tessellationShader': { type: Boolean, required: true },
'sampleRateShading': { type: Boolean, required: true },
'dualSrcBlend': { type: Boolean, required: true },
'logicOp': { type: Boolean, required: true },
'multiDrawIndirect': { type: Boolean, required: true },
'drawIndirectFirstInstance': { type: Boolean, required: true },
'depthClamp': { type: Boolean, required: true },
'depthBiasClamp': { type: Boolean, required: true },
'fillModeNonSolid': { type: Boolean, required: true },
'depthBounds': { type: Boolean, required: true },
'wideLines': { type: Boolean, required: true },
'largePoints': { type: Boolean, required: true },
'alphaToOne': { type: Boolean, required: true },
'multiViewport': { type: Boolean, required: true },
'samplerAnisotropy': { type: Boolean, required: true },
'textureCompressionETC2': { type: Boolean, required: true },
'textureCompressionASTC_LDR': { type: Boolean, required: true },
'textureCompressionBC': { type: Boolean, required: true },
'occlusionQueryPrecise': { type: Boolean, required: true },
'pipelineStatisticsQuery': { type: Boolean, required: true },
'vertexPipelineStoresAndAtomics': { type: Boolean, required: true },
'fragmentStoresAndAtomics': { type: Boolean, required: true },
'shaderTessellationAndGeometryPointSize': { type: Boolean, required: true },
'shaderImageGatherExtended': { type: Boolean, required: true },
'shaderStorageImageExtendedFormats': { type: Boolean, required: true },
'shaderStorageImageMultisample': { type: Boolean, required: true },
'shaderStorageImageReadWithoutFormat': { type: Boolean, required: true },
'shaderStorageImageWriteWithoutFormat': { type: Boolean, required: true },
'shaderUniformBufferArrayDynamicIndexing': { type: Boolean, required: true },
'shaderSampledImageArrayDynamicIndexing': { type: Boolean, required: true },
'shaderStorageBufferArrayDynamicIndexing': { type: Boolean, required: true },
'shaderStorageImageArrayDynamicIndexing': { type: Boolean, required: true },
'shaderClipDistance': { type: Boolean, required: true },
'shaderCullDistance': { type: Boolean, required: true },
'shaderFloat64': { type: Boolean, required: true },
'shaderInt64': { type: Boolean, required: true },
'shaderInt16': { type: Boolean, required: true },
'shaderResourceResidency': { type: Boolean, required: true },
'shaderResourceMinLod': { type: Boolean, required: true },
'sparseBinding': { type: Boolean, required: true },
'sparseResidencyBuffer': { type: Boolean, required: true },
'sparseResidencyImage2D': { type: Boolean, required: true },
'sparseResidencyImage3D': { type: Boolean, required: true },
'sparseResidency2Samples': { type: Boolean, required: true },
'sparseResidency4Samples': { type: Boolean, required: true },
'sparseResidency8Samples': { type: Boolean, required: true },
'sparseResidency16Samples': { type: Boolean, required: true },
'sparseResidencyAliased': { type: Boolean, required: true },
'variableMultisampleRate': { type: Boolean, required: true },
'inheritedQueries': { type: Boolean, required: true },
},
'memory': {
'memoryTypes': [{
'heapIndex': Number,
'propertyFlags': [String],
}],
'memoryHeaps': [{
'size': Number,
'flags': [String],
}],
},
'queues': [{
'minImageTransferGranularity': {
'depth': { type: Number, required: true },
'height': { type: Number, required: true },
'width': { type: Number, required: true },
},
'queueCount': { type: Number, required: true },
'queueFlags': { type: [String], required: true },
'timestampValidBits': { type: Number, required: true },
}],
'swapchain': {
'maxImageArrayLayers': Number,
'minImageCount': Number,
'maxImageCount': Number,
'formats': [String],
'presentModes': [String],
'supportedTransforms': [String],
'supportedCompositeAlpha': [String],
'supportedUsageFlags': [String],
'surfaceExtension': String,
},
'extensions': [{
'extensionName': { type: String, required: true },
'specVersion': { type: Number, required: true },
}],
'formats': { type: [mongoose.Schema.Types.Formats], required: true },
},
}, {
versionKey: false,
})
DeviceSchema.index({
'name': 1,
'os': 1,
'deviceId': 1,
'vendorId': 1,
'driverVersion': 1,
}, { unique: true })
const Device = mongoose.model('Device', DeviceSchema)
module.exports = Device