1 // Copyright (C) 2018 The Android Open Source Project
2 // Copyright (C) 2018 Google Inc.
3 //
4 // Licensed under the Apache License, Version 2.0 (the "License");
5 // you may not use this file except in compliance with the License.
6 // You may obtain a copy of the License at
7 //
8 // http://www.apache.org/licenses/LICENSE-2.0
9 //
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
15
16 // Autogenerated module VkSubDecoder
17 //
18 // (impl) generated by codegen/vulkan/vulkan-docs-next/scripts/genvk.py -registry
19 // codegen/vulkan/vulkan-docs-next/xml/vk.xml -registryGfxstream
20 // codegen/vulkan/vulkan-docs-next/xml/vk_gfxstream.xml cereal -o host/vulkan/cereal
21 //
22 // Please do not modify directly;
23 // re-run gfxstream-protocols/scripts/generate-vulkan-sources.sh,
24 // or directly from Python by defining:
25 // VULKAN_REGISTRY_XML_DIR : Directory containing vk.xml
26 // VULKAN_REGISTRY_SCRIPTS_DIR : Directory containing genvk.py
27 // CEREAL_OUTPUT_DIR: Where to put the generated sources.
28 //
29 // python3 $VULKAN_REGISTRY_SCRIPTS_DIR/genvk.py -registry $VULKAN_REGISTRY_XML_DIR/vk.xml cereal -o
30 // $CEREAL_OUTPUT_DIR
31 //
32 #define MAX_STACK_ITEMS 16
33 #define MAX_PACKET_LENGTH (400 * 1024 * 1024) // 400MB
subDecode(VulkanMemReadingStream * readStream,VulkanDispatch * vk,void * boxed_dispatchHandle,void * dispatchHandle,VkDeviceSize dataSize,const void * pData,const VkDecoderContext & context)34 size_t subDecode(VulkanMemReadingStream* readStream, VulkanDispatch* vk, void* boxed_dispatchHandle,
35 void* dispatchHandle, VkDeviceSize dataSize, const void* pData,
36 const VkDecoderContext& context) {
37 auto& metricsLogger = *context.metricsLogger;
38 uint32_t count = 0;
39 unsigned char* buf = (unsigned char*)pData;
40 android::base::BumpPool* pool = readStream->pool();
41 unsigned char* ptr = (unsigned char*)pData;
42 const unsigned char* const end = (const unsigned char*)buf + dataSize;
43 VkDecoderGlobalState* globalstate = VkDecoderGlobalState::get();
44 while (end - ptr >= 8) {
45 uint32_t opcode = *(uint32_t*)ptr;
46 uint32_t packetLen = *(uint32_t*)(ptr + 4);
47
48 // packetLen should be at least 8 (op code and packet length) and should not be excessively
49 // large
50 if (packetLen < 8 || packetLen > MAX_PACKET_LENGTH) {
51 WARN("Bad packet length %d detected, subdecode may fail", packetLen);
52 metricsLogger.logMetricEvent(MetricEventBadPacketLength{.len = packetLen});
53 }
54
55 if (end - ptr < packetLen) return ptr - (unsigned char*)buf;
56 readStream->setBuf((uint8_t*)(ptr + 8));
57 uint8_t* readStreamPtr = readStream->getBuf();
58 uint8_t** readStreamPtrPtr = &readStreamPtr;
59 switch (opcode) {
60 #ifdef VK_VERSION_1_0
61 case OP_vkBeginCommandBuffer: {
62 android::base::beginTrace("vkBeginCommandBuffer subdecode");
63 const VkCommandBufferBeginInfo* pBeginInfo;
64 VkCommandBufferBeginInfo stack_pBeginInfo[1];
65 pBeginInfo = (VkCommandBufferBeginInfo*)stack_pBeginInfo;
66 reservedunmarshal_VkCommandBufferBeginInfo(readStream, VK_STRUCTURE_TYPE_MAX_ENUM,
67 (VkCommandBufferBeginInfo*)(pBeginInfo),
68 readStreamPtrPtr);
69 if (pBeginInfo) {
70 transform_tohost_VkCommandBufferBeginInfo(
71 globalstate, (VkCommandBufferBeginInfo*)(pBeginInfo));
72 }
73 VkResult vkBeginCommandBuffer_VkResult_return = (VkResult)0;
74 vkBeginCommandBuffer_VkResult_return = this->on_vkBeginCommandBuffer(
75 pool, (VkCommandBuffer)(boxed_dispatchHandle), pBeginInfo, context);
76 if ((vkBeginCommandBuffer_VkResult_return) == VK_ERROR_DEVICE_LOST)
77 this->on_DeviceLost();
78 this->on_CheckOutOfMemory(vkBeginCommandBuffer_VkResult_return, opcode, context);
79 android::base::endTrace();
80 break;
81 }
82 case OP_vkEndCommandBuffer: {
83 android::base::beginTrace("vkEndCommandBuffer subdecode");
84 VkResult vkEndCommandBuffer_VkResult_return = (VkResult)0;
85 vkEndCommandBuffer_VkResult_return = this->on_vkEndCommandBuffer(
86 pool, (VkCommandBuffer)(boxed_dispatchHandle), context);
87 if ((vkEndCommandBuffer_VkResult_return) == VK_ERROR_DEVICE_LOST)
88 this->on_DeviceLost();
89 this->on_CheckOutOfMemory(vkEndCommandBuffer_VkResult_return, opcode, context);
90 android::base::endTrace();
91 break;
92 }
93 case OP_vkResetCommandBuffer: {
94 android::base::beginTrace("vkResetCommandBuffer subdecode");
95 VkCommandBufferResetFlags flags;
96 memcpy((VkCommandBufferResetFlags*)&flags, *readStreamPtrPtr,
97 sizeof(VkCommandBufferResetFlags));
98 *readStreamPtrPtr += sizeof(VkCommandBufferResetFlags);
99 VkResult vkResetCommandBuffer_VkResult_return = (VkResult)0;
100 vkResetCommandBuffer_VkResult_return = this->on_vkResetCommandBuffer(
101 pool, (VkCommandBuffer)(boxed_dispatchHandle), flags);
102 if ((vkResetCommandBuffer_VkResult_return) == VK_ERROR_DEVICE_LOST)
103 this->on_DeviceLost();
104 this->on_CheckOutOfMemory(vkResetCommandBuffer_VkResult_return, opcode, context);
105 android::base::endTrace();
106 break;
107 }
108 case OP_vkCmdBindPipeline: {
109 android::base::beginTrace("vkCmdBindPipeline subdecode");
110 VkPipelineBindPoint pipelineBindPoint;
111 VkPipeline pipeline;
112 memcpy((VkPipelineBindPoint*)&pipelineBindPoint, *readStreamPtrPtr,
113 sizeof(VkPipelineBindPoint));
114 *readStreamPtrPtr += sizeof(VkPipelineBindPoint);
115 uint64_t cgen_var_0;
116 memcpy((uint64_t*)&cgen_var_0, *readStreamPtrPtr, 1 * 8);
117 *readStreamPtrPtr += 1 * 8;
118 *(VkPipeline*)&pipeline = (VkPipeline)unbox_VkPipeline((VkPipeline)(*&cgen_var_0));
119 this->on_vkCmdBindPipeline(pool, (VkCommandBuffer)(boxed_dispatchHandle),
120 pipelineBindPoint, pipeline);
121 android::base::endTrace();
122 break;
123 }
124 case OP_vkCmdSetViewport: {
125 android::base::beginTrace("vkCmdSetViewport subdecode");
126 uint32_t firstViewport;
127 uint32_t viewportCount;
128 const VkViewport* pViewports;
129 VkViewport stack_pViewports[MAX_STACK_ITEMS];
130 memcpy((uint32_t*)&firstViewport, *readStreamPtrPtr, sizeof(uint32_t));
131 *readStreamPtrPtr += sizeof(uint32_t);
132 memcpy((uint32_t*)&viewportCount, *readStreamPtrPtr, sizeof(uint32_t));
133 *readStreamPtrPtr += sizeof(uint32_t);
134 if (((viewportCount)) <= MAX_STACK_ITEMS) {
135 pViewports = (VkViewport*)stack_pViewports;
136 } else {
137 readStream->alloc((void**)&pViewports,
138 ((viewportCount)) * sizeof(const VkViewport));
139 }
140 for (uint32_t i = 0; i < (uint32_t)((viewportCount)); ++i) {
141 reservedunmarshal_VkViewport(readStream, VK_STRUCTURE_TYPE_MAX_ENUM,
142 (VkViewport*)(pViewports + i), readStreamPtrPtr);
143 }
144 if (pViewports) {
145 for (uint32_t i = 0; i < (uint32_t)((viewportCount)); ++i) {
146 transform_tohost_VkViewport(globalstate, (VkViewport*)(pViewports + i));
147 }
148 }
149 vk->vkCmdSetViewport((VkCommandBuffer)dispatchHandle, firstViewport, viewportCount,
150 pViewports);
151 android::base::endTrace();
152 break;
153 }
154 case OP_vkCmdSetScissor: {
155 android::base::beginTrace("vkCmdSetScissor subdecode");
156 uint32_t firstScissor;
157 uint32_t scissorCount;
158 const VkRect2D* pScissors;
159 VkRect2D stack_pScissors[MAX_STACK_ITEMS];
160 memcpy((uint32_t*)&firstScissor, *readStreamPtrPtr, sizeof(uint32_t));
161 *readStreamPtrPtr += sizeof(uint32_t);
162 memcpy((uint32_t*)&scissorCount, *readStreamPtrPtr, sizeof(uint32_t));
163 *readStreamPtrPtr += sizeof(uint32_t);
164 if (((scissorCount)) <= MAX_STACK_ITEMS) {
165 pScissors = (VkRect2D*)stack_pScissors;
166 } else {
167 readStream->alloc((void**)&pScissors,
168 ((scissorCount)) * sizeof(const VkRect2D));
169 }
170 for (uint32_t i = 0; i < (uint32_t)((scissorCount)); ++i) {
171 reservedunmarshal_VkRect2D(readStream, VK_STRUCTURE_TYPE_MAX_ENUM,
172 (VkRect2D*)(pScissors + i), readStreamPtrPtr);
173 }
174 if (pScissors) {
175 for (uint32_t i = 0; i < (uint32_t)((scissorCount)); ++i) {
176 transform_tohost_VkRect2D(globalstate, (VkRect2D*)(pScissors + i));
177 }
178 }
179 vk->vkCmdSetScissor((VkCommandBuffer)dispatchHandle, firstScissor, scissorCount,
180 pScissors);
181 android::base::endTrace();
182 break;
183 }
184 case OP_vkCmdSetLineWidth: {
185 android::base::beginTrace("vkCmdSetLineWidth subdecode");
186 float lineWidth;
187 memcpy((float*)&lineWidth, *readStreamPtrPtr, sizeof(float));
188 *readStreamPtrPtr += sizeof(float);
189 vk->vkCmdSetLineWidth((VkCommandBuffer)dispatchHandle, lineWidth);
190 android::base::endTrace();
191 break;
192 }
193 case OP_vkCmdSetDepthBias: {
194 android::base::beginTrace("vkCmdSetDepthBias subdecode");
195 float depthBiasConstantFactor;
196 float depthBiasClamp;
197 float depthBiasSlopeFactor;
198 memcpy((float*)&depthBiasConstantFactor, *readStreamPtrPtr, sizeof(float));
199 *readStreamPtrPtr += sizeof(float);
200 memcpy((float*)&depthBiasClamp, *readStreamPtrPtr, sizeof(float));
201 *readStreamPtrPtr += sizeof(float);
202 memcpy((float*)&depthBiasSlopeFactor, *readStreamPtrPtr, sizeof(float));
203 *readStreamPtrPtr += sizeof(float);
204 vk->vkCmdSetDepthBias((VkCommandBuffer)dispatchHandle, depthBiasConstantFactor,
205 depthBiasClamp, depthBiasSlopeFactor);
206 android::base::endTrace();
207 break;
208 }
209 case OP_vkCmdSetBlendConstants: {
210 android::base::beginTrace("vkCmdSetBlendConstants subdecode");
211 float blendConstants[4];
212 memcpy((float*)blendConstants, *readStreamPtrPtr, 4 * sizeof(const float));
213 *readStreamPtrPtr += 4 * sizeof(const float);
214 vk->vkCmdSetBlendConstants((VkCommandBuffer)dispatchHandle, blendConstants);
215 android::base::endTrace();
216 break;
217 }
218 case OP_vkCmdSetDepthBounds: {
219 android::base::beginTrace("vkCmdSetDepthBounds subdecode");
220 float minDepthBounds;
221 float maxDepthBounds;
222 memcpy((float*)&minDepthBounds, *readStreamPtrPtr, sizeof(float));
223 *readStreamPtrPtr += sizeof(float);
224 memcpy((float*)&maxDepthBounds, *readStreamPtrPtr, sizeof(float));
225 *readStreamPtrPtr += sizeof(float);
226 vk->vkCmdSetDepthBounds((VkCommandBuffer)dispatchHandle, minDepthBounds,
227 maxDepthBounds);
228 android::base::endTrace();
229 break;
230 }
231 case OP_vkCmdSetStencilCompareMask: {
232 android::base::beginTrace("vkCmdSetStencilCompareMask subdecode");
233 VkStencilFaceFlags faceMask;
234 uint32_t compareMask;
235 memcpy((VkStencilFaceFlags*)&faceMask, *readStreamPtrPtr,
236 sizeof(VkStencilFaceFlags));
237 *readStreamPtrPtr += sizeof(VkStencilFaceFlags);
238 memcpy((uint32_t*)&compareMask, *readStreamPtrPtr, sizeof(uint32_t));
239 *readStreamPtrPtr += sizeof(uint32_t);
240 vk->vkCmdSetStencilCompareMask((VkCommandBuffer)dispatchHandle, faceMask,
241 compareMask);
242 android::base::endTrace();
243 break;
244 }
245 case OP_vkCmdSetStencilWriteMask: {
246 android::base::beginTrace("vkCmdSetStencilWriteMask subdecode");
247 VkStencilFaceFlags faceMask;
248 uint32_t writeMask;
249 memcpy((VkStencilFaceFlags*)&faceMask, *readStreamPtrPtr,
250 sizeof(VkStencilFaceFlags));
251 *readStreamPtrPtr += sizeof(VkStencilFaceFlags);
252 memcpy((uint32_t*)&writeMask, *readStreamPtrPtr, sizeof(uint32_t));
253 *readStreamPtrPtr += sizeof(uint32_t);
254 vk->vkCmdSetStencilWriteMask((VkCommandBuffer)dispatchHandle, faceMask, writeMask);
255 android::base::endTrace();
256 break;
257 }
258 case OP_vkCmdSetStencilReference: {
259 android::base::beginTrace("vkCmdSetStencilReference subdecode");
260 VkStencilFaceFlags faceMask;
261 uint32_t reference;
262 memcpy((VkStencilFaceFlags*)&faceMask, *readStreamPtrPtr,
263 sizeof(VkStencilFaceFlags));
264 *readStreamPtrPtr += sizeof(VkStencilFaceFlags);
265 memcpy((uint32_t*)&reference, *readStreamPtrPtr, sizeof(uint32_t));
266 *readStreamPtrPtr += sizeof(uint32_t);
267 vk->vkCmdSetStencilReference((VkCommandBuffer)dispatchHandle, faceMask, reference);
268 android::base::endTrace();
269 break;
270 }
271 case OP_vkCmdBindDescriptorSets: {
272 android::base::beginTrace("vkCmdBindDescriptorSets subdecode");
273 VkPipelineBindPoint pipelineBindPoint;
274 VkPipelineLayout layout;
275 uint32_t firstSet;
276 uint32_t descriptorSetCount;
277 const VkDescriptorSet* pDescriptorSets;
278 VkDescriptorSet stack_pDescriptorSets[MAX_STACK_ITEMS];
279 uint32_t dynamicOffsetCount;
280 const uint32_t* pDynamicOffsets;
281 uint32_t stack_pDynamicOffsets[MAX_STACK_ITEMS];
282 memcpy((VkPipelineBindPoint*)&pipelineBindPoint, *readStreamPtrPtr,
283 sizeof(VkPipelineBindPoint));
284 *readStreamPtrPtr += sizeof(VkPipelineBindPoint);
285 uint64_t cgen_var_0;
286 memcpy((uint64_t*)&cgen_var_0, *readStreamPtrPtr, 1 * 8);
287 *readStreamPtrPtr += 1 * 8;
288 *(VkPipelineLayout*)&layout =
289 (VkPipelineLayout)unbox_VkPipelineLayout((VkPipelineLayout)(*&cgen_var_0));
290 memcpy((uint32_t*)&firstSet, *readStreamPtrPtr, sizeof(uint32_t));
291 *readStreamPtrPtr += sizeof(uint32_t);
292 memcpy((uint32_t*)&descriptorSetCount, *readStreamPtrPtr, sizeof(uint32_t));
293 *readStreamPtrPtr += sizeof(uint32_t);
294 if (((descriptorSetCount)) <= MAX_STACK_ITEMS) {
295 pDescriptorSets = (VkDescriptorSet*)stack_pDescriptorSets;
296 } else {
297 readStream->alloc((void**)&pDescriptorSets,
298 ((descriptorSetCount)) * sizeof(const VkDescriptorSet));
299 }
300 if (((descriptorSetCount))) {
301 uint8_t* cgen_var_1_ptr = (uint8_t*)(*readStreamPtrPtr);
302 *readStreamPtrPtr += 8 * ((descriptorSetCount));
303 for (uint32_t k = 0; k < ((descriptorSetCount)); ++k) {
304 uint64_t tmpval;
305 memcpy(&tmpval, cgen_var_1_ptr + k * 8, sizeof(uint64_t));
306 *(((VkDescriptorSet*)pDescriptorSets) + k) =
307 (VkDescriptorSet)unbox_VkDescriptorSet((VkDescriptorSet)tmpval);
308 }
309 }
310 memcpy((uint32_t*)&dynamicOffsetCount, *readStreamPtrPtr, sizeof(uint32_t));
311 *readStreamPtrPtr += sizeof(uint32_t);
312 if (((dynamicOffsetCount)) <= MAX_STACK_ITEMS) {
313 pDynamicOffsets = (uint32_t*)stack_pDynamicOffsets;
314 } else {
315 readStream->alloc((void**)&pDynamicOffsets,
316 ((dynamicOffsetCount)) * sizeof(const uint32_t));
317 }
318 memcpy((uint32_t*)pDynamicOffsets, *readStreamPtrPtr,
319 ((dynamicOffsetCount)) * sizeof(const uint32_t));
320 *readStreamPtrPtr += ((dynamicOffsetCount)) * sizeof(const uint32_t);
321 this->on_vkCmdBindDescriptorSets(pool, (VkCommandBuffer)(boxed_dispatchHandle),
322 pipelineBindPoint, layout, firstSet,
323 descriptorSetCount, pDescriptorSets,
324 dynamicOffsetCount, pDynamicOffsets);
325 android::base::endTrace();
326 break;
327 }
328 case OP_vkCmdBindIndexBuffer: {
329 android::base::beginTrace("vkCmdBindIndexBuffer subdecode");
330 VkBuffer buffer;
331 VkDeviceSize offset;
332 VkIndexType indexType;
333 uint64_t cgen_var_0;
334 memcpy((uint64_t*)&cgen_var_0, *readStreamPtrPtr, 1 * 8);
335 *readStreamPtrPtr += 1 * 8;
336 *(VkBuffer*)&buffer = (VkBuffer)unbox_VkBuffer((VkBuffer)(*&cgen_var_0));
337 memcpy((VkDeviceSize*)&offset, *readStreamPtrPtr, sizeof(VkDeviceSize));
338 *readStreamPtrPtr += sizeof(VkDeviceSize);
339 memcpy((VkIndexType*)&indexType, *readStreamPtrPtr, sizeof(VkIndexType));
340 *readStreamPtrPtr += sizeof(VkIndexType);
341 vk->vkCmdBindIndexBuffer((VkCommandBuffer)dispatchHandle, buffer, offset,
342 indexType);
343 android::base::endTrace();
344 break;
345 }
346 case OP_vkCmdBindVertexBuffers: {
347 android::base::beginTrace("vkCmdBindVertexBuffers subdecode");
348 uint32_t firstBinding;
349 uint32_t bindingCount;
350 const VkBuffer* pBuffers;
351 VkBuffer stack_pBuffers[MAX_STACK_ITEMS];
352 const VkDeviceSize* pOffsets;
353 VkDeviceSize stack_pOffsets[MAX_STACK_ITEMS];
354 memcpy((uint32_t*)&firstBinding, *readStreamPtrPtr, sizeof(uint32_t));
355 *readStreamPtrPtr += sizeof(uint32_t);
356 memcpy((uint32_t*)&bindingCount, *readStreamPtrPtr, sizeof(uint32_t));
357 *readStreamPtrPtr += sizeof(uint32_t);
358 if (((bindingCount)) <= MAX_STACK_ITEMS) {
359 pBuffers = (VkBuffer*)stack_pBuffers;
360 } else {
361 readStream->alloc((void**)&pBuffers, ((bindingCount)) * sizeof(const VkBuffer));
362 }
363 if (((bindingCount))) {
364 uint8_t* cgen_var_0_ptr = (uint8_t*)(*readStreamPtrPtr);
365 *readStreamPtrPtr += 8 * ((bindingCount));
366 for (uint32_t k = 0; k < ((bindingCount)); ++k) {
367 uint64_t tmpval;
368 memcpy(&tmpval, cgen_var_0_ptr + k * 8, sizeof(uint64_t));
369 *(((VkBuffer*)pBuffers) + k) = (VkBuffer)unbox_VkBuffer((VkBuffer)tmpval);
370 }
371 }
372 if (((bindingCount)) <= MAX_STACK_ITEMS) {
373 pOffsets = (VkDeviceSize*)stack_pOffsets;
374 } else {
375 readStream->alloc((void**)&pOffsets,
376 ((bindingCount)) * sizeof(const VkDeviceSize));
377 }
378 memcpy((VkDeviceSize*)pOffsets, *readStreamPtrPtr,
379 ((bindingCount)) * sizeof(const VkDeviceSize));
380 *readStreamPtrPtr += ((bindingCount)) * sizeof(const VkDeviceSize);
381 vk->vkCmdBindVertexBuffers((VkCommandBuffer)dispatchHandle, firstBinding,
382 bindingCount, pBuffers, pOffsets);
383 android::base::endTrace();
384 break;
385 }
386 case OP_vkCmdDraw: {
387 android::base::beginTrace("vkCmdDraw subdecode");
388 uint32_t vertexCount;
389 uint32_t instanceCount;
390 uint32_t firstVertex;
391 uint32_t firstInstance;
392 memcpy((uint32_t*)&vertexCount, *readStreamPtrPtr, sizeof(uint32_t));
393 *readStreamPtrPtr += sizeof(uint32_t);
394 memcpy((uint32_t*)&instanceCount, *readStreamPtrPtr, sizeof(uint32_t));
395 *readStreamPtrPtr += sizeof(uint32_t);
396 memcpy((uint32_t*)&firstVertex, *readStreamPtrPtr, sizeof(uint32_t));
397 *readStreamPtrPtr += sizeof(uint32_t);
398 memcpy((uint32_t*)&firstInstance, *readStreamPtrPtr, sizeof(uint32_t));
399 *readStreamPtrPtr += sizeof(uint32_t);
400 vk->vkCmdDraw((VkCommandBuffer)dispatchHandle, vertexCount, instanceCount,
401 firstVertex, firstInstance);
402 android::base::endTrace();
403 break;
404 }
405 case OP_vkCmdDrawIndexed: {
406 android::base::beginTrace("vkCmdDrawIndexed subdecode");
407 uint32_t indexCount;
408 uint32_t instanceCount;
409 uint32_t firstIndex;
410 int32_t vertexOffset;
411 uint32_t firstInstance;
412 memcpy((uint32_t*)&indexCount, *readStreamPtrPtr, sizeof(uint32_t));
413 *readStreamPtrPtr += sizeof(uint32_t);
414 memcpy((uint32_t*)&instanceCount, *readStreamPtrPtr, sizeof(uint32_t));
415 *readStreamPtrPtr += sizeof(uint32_t);
416 memcpy((uint32_t*)&firstIndex, *readStreamPtrPtr, sizeof(uint32_t));
417 *readStreamPtrPtr += sizeof(uint32_t);
418 memcpy((int32_t*)&vertexOffset, *readStreamPtrPtr, sizeof(int32_t));
419 *readStreamPtrPtr += sizeof(int32_t);
420 memcpy((uint32_t*)&firstInstance, *readStreamPtrPtr, sizeof(uint32_t));
421 *readStreamPtrPtr += sizeof(uint32_t);
422 vk->vkCmdDrawIndexed((VkCommandBuffer)dispatchHandle, indexCount, instanceCount,
423 firstIndex, vertexOffset, firstInstance);
424 android::base::endTrace();
425 break;
426 }
427 case OP_vkCmdDrawIndirect: {
428 android::base::beginTrace("vkCmdDrawIndirect subdecode");
429 VkBuffer buffer;
430 VkDeviceSize offset;
431 uint32_t drawCount;
432 uint32_t stride;
433 uint64_t cgen_var_0;
434 memcpy((uint64_t*)&cgen_var_0, *readStreamPtrPtr, 1 * 8);
435 *readStreamPtrPtr += 1 * 8;
436 *(VkBuffer*)&buffer = (VkBuffer)unbox_VkBuffer((VkBuffer)(*&cgen_var_0));
437 memcpy((VkDeviceSize*)&offset, *readStreamPtrPtr, sizeof(VkDeviceSize));
438 *readStreamPtrPtr += sizeof(VkDeviceSize);
439 memcpy((uint32_t*)&drawCount, *readStreamPtrPtr, sizeof(uint32_t));
440 *readStreamPtrPtr += sizeof(uint32_t);
441 memcpy((uint32_t*)&stride, *readStreamPtrPtr, sizeof(uint32_t));
442 *readStreamPtrPtr += sizeof(uint32_t);
443 vk->vkCmdDrawIndirect((VkCommandBuffer)dispatchHandle, buffer, offset, drawCount,
444 stride);
445 android::base::endTrace();
446 break;
447 }
448 case OP_vkCmdDrawIndexedIndirect: {
449 android::base::beginTrace("vkCmdDrawIndexedIndirect subdecode");
450 VkBuffer buffer;
451 VkDeviceSize offset;
452 uint32_t drawCount;
453 uint32_t stride;
454 uint64_t cgen_var_0;
455 memcpy((uint64_t*)&cgen_var_0, *readStreamPtrPtr, 1 * 8);
456 *readStreamPtrPtr += 1 * 8;
457 *(VkBuffer*)&buffer = (VkBuffer)unbox_VkBuffer((VkBuffer)(*&cgen_var_0));
458 memcpy((VkDeviceSize*)&offset, *readStreamPtrPtr, sizeof(VkDeviceSize));
459 *readStreamPtrPtr += sizeof(VkDeviceSize);
460 memcpy((uint32_t*)&drawCount, *readStreamPtrPtr, sizeof(uint32_t));
461 *readStreamPtrPtr += sizeof(uint32_t);
462 memcpy((uint32_t*)&stride, *readStreamPtrPtr, sizeof(uint32_t));
463 *readStreamPtrPtr += sizeof(uint32_t);
464 vk->vkCmdDrawIndexedIndirect((VkCommandBuffer)dispatchHandle, buffer, offset,
465 drawCount, stride);
466 android::base::endTrace();
467 break;
468 }
469 case OP_vkCmdDispatch: {
470 android::base::beginTrace("vkCmdDispatch subdecode");
471 uint32_t groupCountX;
472 uint32_t groupCountY;
473 uint32_t groupCountZ;
474 memcpy((uint32_t*)&groupCountX, *readStreamPtrPtr, sizeof(uint32_t));
475 *readStreamPtrPtr += sizeof(uint32_t);
476 memcpy((uint32_t*)&groupCountY, *readStreamPtrPtr, sizeof(uint32_t));
477 *readStreamPtrPtr += sizeof(uint32_t);
478 memcpy((uint32_t*)&groupCountZ, *readStreamPtrPtr, sizeof(uint32_t));
479 *readStreamPtrPtr += sizeof(uint32_t);
480 vk->vkCmdDispatch((VkCommandBuffer)dispatchHandle, groupCountX, groupCountY,
481 groupCountZ);
482 android::base::endTrace();
483 break;
484 }
485 case OP_vkCmdDispatchIndirect: {
486 android::base::beginTrace("vkCmdDispatchIndirect subdecode");
487 VkBuffer buffer;
488 VkDeviceSize offset;
489 uint64_t cgen_var_0;
490 memcpy((uint64_t*)&cgen_var_0, *readStreamPtrPtr, 1 * 8);
491 *readStreamPtrPtr += 1 * 8;
492 *(VkBuffer*)&buffer = (VkBuffer)unbox_VkBuffer((VkBuffer)(*&cgen_var_0));
493 memcpy((VkDeviceSize*)&offset, *readStreamPtrPtr, sizeof(VkDeviceSize));
494 *readStreamPtrPtr += sizeof(VkDeviceSize);
495 vk->vkCmdDispatchIndirect((VkCommandBuffer)dispatchHandle, buffer, offset);
496 android::base::endTrace();
497 break;
498 }
499 case OP_vkCmdCopyBuffer: {
500 android::base::beginTrace("vkCmdCopyBuffer subdecode");
501 VkBuffer srcBuffer;
502 VkBuffer dstBuffer;
503 uint32_t regionCount;
504 const VkBufferCopy* pRegions;
505 VkBufferCopy stack_pRegions[MAX_STACK_ITEMS];
506 uint64_t cgen_var_0;
507 memcpy((uint64_t*)&cgen_var_0, *readStreamPtrPtr, 1 * 8);
508 *readStreamPtrPtr += 1 * 8;
509 *(VkBuffer*)&srcBuffer = (VkBuffer)unbox_VkBuffer((VkBuffer)(*&cgen_var_0));
510 uint64_t cgen_var_1;
511 memcpy((uint64_t*)&cgen_var_1, *readStreamPtrPtr, 1 * 8);
512 *readStreamPtrPtr += 1 * 8;
513 *(VkBuffer*)&dstBuffer = (VkBuffer)unbox_VkBuffer((VkBuffer)(*&cgen_var_1));
514 memcpy((uint32_t*)®ionCount, *readStreamPtrPtr, sizeof(uint32_t));
515 *readStreamPtrPtr += sizeof(uint32_t);
516 if (((regionCount)) <= MAX_STACK_ITEMS) {
517 pRegions = (VkBufferCopy*)stack_pRegions;
518 } else {
519 readStream->alloc((void**)&pRegions,
520 ((regionCount)) * sizeof(const VkBufferCopy));
521 }
522 for (uint32_t i = 0; i < (uint32_t)((regionCount)); ++i) {
523 reservedunmarshal_VkBufferCopy(readStream, VK_STRUCTURE_TYPE_MAX_ENUM,
524 (VkBufferCopy*)(pRegions + i), readStreamPtrPtr);
525 }
526 if (pRegions) {
527 for (uint32_t i = 0; i < (uint32_t)((regionCount)); ++i) {
528 transform_tohost_VkBufferCopy(globalstate, (VkBufferCopy*)(pRegions + i));
529 }
530 }
531 vk->vkCmdCopyBuffer((VkCommandBuffer)dispatchHandle, srcBuffer, dstBuffer,
532 regionCount, pRegions);
533 android::base::endTrace();
534 break;
535 }
536 case OP_vkCmdCopyImage: {
537 android::base::beginTrace("vkCmdCopyImage subdecode");
538 VkImage srcImage;
539 VkImageLayout srcImageLayout;
540 VkImage dstImage;
541 VkImageLayout dstImageLayout;
542 uint32_t regionCount;
543 const VkImageCopy* pRegions;
544 VkImageCopy stack_pRegions[MAX_STACK_ITEMS];
545 uint64_t cgen_var_0;
546 memcpy((uint64_t*)&cgen_var_0, *readStreamPtrPtr, 1 * 8);
547 *readStreamPtrPtr += 1 * 8;
548 *(VkImage*)&srcImage = (VkImage)unbox_VkImage((VkImage)(*&cgen_var_0));
549 memcpy((VkImageLayout*)&srcImageLayout, *readStreamPtrPtr, sizeof(VkImageLayout));
550 *readStreamPtrPtr += sizeof(VkImageLayout);
551 uint64_t cgen_var_1;
552 memcpy((uint64_t*)&cgen_var_1, *readStreamPtrPtr, 1 * 8);
553 *readStreamPtrPtr += 1 * 8;
554 *(VkImage*)&dstImage = (VkImage)unbox_VkImage((VkImage)(*&cgen_var_1));
555 memcpy((VkImageLayout*)&dstImageLayout, *readStreamPtrPtr, sizeof(VkImageLayout));
556 *readStreamPtrPtr += sizeof(VkImageLayout);
557 memcpy((uint32_t*)®ionCount, *readStreamPtrPtr, sizeof(uint32_t));
558 *readStreamPtrPtr += sizeof(uint32_t);
559 if (((regionCount)) <= MAX_STACK_ITEMS) {
560 pRegions = (VkImageCopy*)stack_pRegions;
561 } else {
562 readStream->alloc((void**)&pRegions,
563 ((regionCount)) * sizeof(const VkImageCopy));
564 }
565 for (uint32_t i = 0; i < (uint32_t)((regionCount)); ++i) {
566 reservedunmarshal_VkImageCopy(readStream, VK_STRUCTURE_TYPE_MAX_ENUM,
567 (VkImageCopy*)(pRegions + i), readStreamPtrPtr);
568 }
569 if (pRegions) {
570 for (uint32_t i = 0; i < (uint32_t)((regionCount)); ++i) {
571 transform_tohost_VkImageCopy(globalstate, (VkImageCopy*)(pRegions + i));
572 }
573 }
574 this->on_vkCmdCopyImage(pool, (VkCommandBuffer)(boxed_dispatchHandle), srcImage,
575 srcImageLayout, dstImage, dstImageLayout, regionCount,
576 pRegions);
577 android::base::endTrace();
578 break;
579 }
580 case OP_vkCmdBlitImage: {
581 android::base::beginTrace("vkCmdBlitImage subdecode");
582 VkImage srcImage;
583 VkImageLayout srcImageLayout;
584 VkImage dstImage;
585 VkImageLayout dstImageLayout;
586 uint32_t regionCount;
587 const VkImageBlit* pRegions;
588 VkImageBlit stack_pRegions[MAX_STACK_ITEMS];
589 VkFilter filter;
590 uint64_t cgen_var_0;
591 memcpy((uint64_t*)&cgen_var_0, *readStreamPtrPtr, 1 * 8);
592 *readStreamPtrPtr += 1 * 8;
593 *(VkImage*)&srcImage = (VkImage)unbox_VkImage((VkImage)(*&cgen_var_0));
594 memcpy((VkImageLayout*)&srcImageLayout, *readStreamPtrPtr, sizeof(VkImageLayout));
595 *readStreamPtrPtr += sizeof(VkImageLayout);
596 uint64_t cgen_var_1;
597 memcpy((uint64_t*)&cgen_var_1, *readStreamPtrPtr, 1 * 8);
598 *readStreamPtrPtr += 1 * 8;
599 *(VkImage*)&dstImage = (VkImage)unbox_VkImage((VkImage)(*&cgen_var_1));
600 memcpy((VkImageLayout*)&dstImageLayout, *readStreamPtrPtr, sizeof(VkImageLayout));
601 *readStreamPtrPtr += sizeof(VkImageLayout);
602 memcpy((uint32_t*)®ionCount, *readStreamPtrPtr, sizeof(uint32_t));
603 *readStreamPtrPtr += sizeof(uint32_t);
604 if (((regionCount)) <= MAX_STACK_ITEMS) {
605 pRegions = (VkImageBlit*)stack_pRegions;
606 } else {
607 readStream->alloc((void**)&pRegions,
608 ((regionCount)) * sizeof(const VkImageBlit));
609 }
610 for (uint32_t i = 0; i < (uint32_t)((regionCount)); ++i) {
611 reservedunmarshal_VkImageBlit(readStream, VK_STRUCTURE_TYPE_MAX_ENUM,
612 (VkImageBlit*)(pRegions + i), readStreamPtrPtr);
613 }
614 memcpy((VkFilter*)&filter, *readStreamPtrPtr, sizeof(VkFilter));
615 *readStreamPtrPtr += sizeof(VkFilter);
616 if (pRegions) {
617 for (uint32_t i = 0; i < (uint32_t)((regionCount)); ++i) {
618 transform_tohost_VkImageBlit(globalstate, (VkImageBlit*)(pRegions + i));
619 }
620 }
621 vk->vkCmdBlitImage((VkCommandBuffer)dispatchHandle, srcImage, srcImageLayout,
622 dstImage, dstImageLayout, regionCount, pRegions, filter);
623 android::base::endTrace();
624 break;
625 }
626 case OP_vkCmdCopyBufferToImage: {
627 android::base::beginTrace("vkCmdCopyBufferToImage subdecode");
628 VkBuffer srcBuffer;
629 VkImage dstImage;
630 VkImageLayout dstImageLayout;
631 uint32_t regionCount;
632 const VkBufferImageCopy* pRegions;
633 VkBufferImageCopy stack_pRegions[MAX_STACK_ITEMS];
634 uint64_t cgen_var_0;
635 memcpy((uint64_t*)&cgen_var_0, *readStreamPtrPtr, 1 * 8);
636 *readStreamPtrPtr += 1 * 8;
637 *(VkBuffer*)&srcBuffer = (VkBuffer)unbox_VkBuffer((VkBuffer)(*&cgen_var_0));
638 uint64_t cgen_var_1;
639 memcpy((uint64_t*)&cgen_var_1, *readStreamPtrPtr, 1 * 8);
640 *readStreamPtrPtr += 1 * 8;
641 *(VkImage*)&dstImage = (VkImage)unbox_VkImage((VkImage)(*&cgen_var_1));
642 memcpy((VkImageLayout*)&dstImageLayout, *readStreamPtrPtr, sizeof(VkImageLayout));
643 *readStreamPtrPtr += sizeof(VkImageLayout);
644 memcpy((uint32_t*)®ionCount, *readStreamPtrPtr, sizeof(uint32_t));
645 *readStreamPtrPtr += sizeof(uint32_t);
646 if (((regionCount)) <= MAX_STACK_ITEMS) {
647 pRegions = (VkBufferImageCopy*)stack_pRegions;
648 } else {
649 readStream->alloc((void**)&pRegions,
650 ((regionCount)) * sizeof(const VkBufferImageCopy));
651 }
652 for (uint32_t i = 0; i < (uint32_t)((regionCount)); ++i) {
653 reservedunmarshal_VkBufferImageCopy(readStream, VK_STRUCTURE_TYPE_MAX_ENUM,
654 (VkBufferImageCopy*)(pRegions + i),
655 readStreamPtrPtr);
656 }
657 if (pRegions) {
658 for (uint32_t i = 0; i < (uint32_t)((regionCount)); ++i) {
659 transform_tohost_VkBufferImageCopy(globalstate,
660 (VkBufferImageCopy*)(pRegions + i));
661 }
662 }
663 this->on_vkCmdCopyBufferToImage(pool, (VkCommandBuffer)(boxed_dispatchHandle),
664 srcBuffer, dstImage, dstImageLayout, regionCount,
665 pRegions, context);
666 android::base::endTrace();
667 break;
668 }
669 case OP_vkCmdCopyImageToBuffer: {
670 android::base::beginTrace("vkCmdCopyImageToBuffer subdecode");
671 VkImage srcImage;
672 VkImageLayout srcImageLayout;
673 VkBuffer dstBuffer;
674 uint32_t regionCount;
675 const VkBufferImageCopy* pRegions;
676 VkBufferImageCopy stack_pRegions[MAX_STACK_ITEMS];
677 uint64_t cgen_var_0;
678 memcpy((uint64_t*)&cgen_var_0, *readStreamPtrPtr, 1 * 8);
679 *readStreamPtrPtr += 1 * 8;
680 *(VkImage*)&srcImage = (VkImage)unbox_VkImage((VkImage)(*&cgen_var_0));
681 memcpy((VkImageLayout*)&srcImageLayout, *readStreamPtrPtr, sizeof(VkImageLayout));
682 *readStreamPtrPtr += sizeof(VkImageLayout);
683 uint64_t cgen_var_1;
684 memcpy((uint64_t*)&cgen_var_1, *readStreamPtrPtr, 1 * 8);
685 *readStreamPtrPtr += 1 * 8;
686 *(VkBuffer*)&dstBuffer = (VkBuffer)unbox_VkBuffer((VkBuffer)(*&cgen_var_1));
687 memcpy((uint32_t*)®ionCount, *readStreamPtrPtr, sizeof(uint32_t));
688 *readStreamPtrPtr += sizeof(uint32_t);
689 if (((regionCount)) <= MAX_STACK_ITEMS) {
690 pRegions = (VkBufferImageCopy*)stack_pRegions;
691 } else {
692 readStream->alloc((void**)&pRegions,
693 ((regionCount)) * sizeof(const VkBufferImageCopy));
694 }
695 for (uint32_t i = 0; i < (uint32_t)((regionCount)); ++i) {
696 reservedunmarshal_VkBufferImageCopy(readStream, VK_STRUCTURE_TYPE_MAX_ENUM,
697 (VkBufferImageCopy*)(pRegions + i),
698 readStreamPtrPtr);
699 }
700 if (pRegions) {
701 for (uint32_t i = 0; i < (uint32_t)((regionCount)); ++i) {
702 transform_tohost_VkBufferImageCopy(globalstate,
703 (VkBufferImageCopy*)(pRegions + i));
704 }
705 }
706 this->on_vkCmdCopyImageToBuffer(pool, (VkCommandBuffer)(boxed_dispatchHandle),
707 srcImage, srcImageLayout, dstBuffer, regionCount,
708 pRegions);
709 android::base::endTrace();
710 break;
711 }
712 case OP_vkCmdUpdateBuffer: {
713 android::base::beginTrace("vkCmdUpdateBuffer subdecode");
714 VkBuffer dstBuffer;
715 VkDeviceSize dstOffset;
716 VkDeviceSize dataSize;
717 const void* pData;
718 uint8_t* stack_pData[MAX_STACK_ITEMS];
719 uint64_t cgen_var_0;
720 memcpy((uint64_t*)&cgen_var_0, *readStreamPtrPtr, 1 * 8);
721 *readStreamPtrPtr += 1 * 8;
722 *(VkBuffer*)&dstBuffer = (VkBuffer)unbox_VkBuffer((VkBuffer)(*&cgen_var_0));
723 memcpy((VkDeviceSize*)&dstOffset, *readStreamPtrPtr, sizeof(VkDeviceSize));
724 *readStreamPtrPtr += sizeof(VkDeviceSize);
725 memcpy((VkDeviceSize*)&dataSize, *readStreamPtrPtr, sizeof(VkDeviceSize));
726 *readStreamPtrPtr += sizeof(VkDeviceSize);
727 if (((dataSize)) <= MAX_STACK_ITEMS) {
728 pData = (void*)stack_pData;
729 } else {
730 readStream->alloc((void**)&pData, ((dataSize)) * sizeof(const uint8_t));
731 }
732 memcpy((void*)pData, *readStreamPtrPtr, ((dataSize)) * sizeof(const uint8_t));
733 *readStreamPtrPtr += ((dataSize)) * sizeof(const uint8_t);
734 vk->vkCmdUpdateBuffer((VkCommandBuffer)dispatchHandle, dstBuffer, dstOffset,
735 dataSize, pData);
736 android::base::endTrace();
737 break;
738 }
739 case OP_vkCmdFillBuffer: {
740 android::base::beginTrace("vkCmdFillBuffer subdecode");
741 VkBuffer dstBuffer;
742 VkDeviceSize dstOffset;
743 VkDeviceSize size;
744 uint32_t data;
745 uint64_t cgen_var_0;
746 memcpy((uint64_t*)&cgen_var_0, *readStreamPtrPtr, 1 * 8);
747 *readStreamPtrPtr += 1 * 8;
748 *(VkBuffer*)&dstBuffer = (VkBuffer)unbox_VkBuffer((VkBuffer)(*&cgen_var_0));
749 memcpy((VkDeviceSize*)&dstOffset, *readStreamPtrPtr, sizeof(VkDeviceSize));
750 *readStreamPtrPtr += sizeof(VkDeviceSize);
751 memcpy((VkDeviceSize*)&size, *readStreamPtrPtr, sizeof(VkDeviceSize));
752 *readStreamPtrPtr += sizeof(VkDeviceSize);
753 memcpy((uint32_t*)&data, *readStreamPtrPtr, sizeof(uint32_t));
754 *readStreamPtrPtr += sizeof(uint32_t);
755 vk->vkCmdFillBuffer((VkCommandBuffer)dispatchHandle, dstBuffer, dstOffset, size,
756 data);
757 android::base::endTrace();
758 break;
759 }
760 case OP_vkCmdClearColorImage: {
761 android::base::beginTrace("vkCmdClearColorImage subdecode");
762 VkImage image;
763 VkImageLayout imageLayout;
764 const VkClearColorValue* pColor;
765 VkClearColorValue stack_pColor[1];
766 uint32_t rangeCount;
767 const VkImageSubresourceRange* pRanges;
768 VkImageSubresourceRange stack_pRanges[MAX_STACK_ITEMS];
769 uint64_t cgen_var_0;
770 memcpy((uint64_t*)&cgen_var_0, *readStreamPtrPtr, 1 * 8);
771 *readStreamPtrPtr += 1 * 8;
772 *(VkImage*)&image = (VkImage)unbox_VkImage((VkImage)(*&cgen_var_0));
773 memcpy((VkImageLayout*)&imageLayout, *readStreamPtrPtr, sizeof(VkImageLayout));
774 *readStreamPtrPtr += sizeof(VkImageLayout);
775 pColor = (VkClearColorValue*)stack_pColor;
776 reservedunmarshal_VkClearColorValue(readStream, VK_STRUCTURE_TYPE_MAX_ENUM,
777 (VkClearColorValue*)(pColor), readStreamPtrPtr);
778 memcpy((uint32_t*)&rangeCount, *readStreamPtrPtr, sizeof(uint32_t));
779 *readStreamPtrPtr += sizeof(uint32_t);
780 if (((rangeCount)) <= MAX_STACK_ITEMS) {
781 pRanges = (VkImageSubresourceRange*)stack_pRanges;
782 } else {
783 readStream->alloc((void**)&pRanges,
784 ((rangeCount)) * sizeof(const VkImageSubresourceRange));
785 }
786 for (uint32_t i = 0; i < (uint32_t)((rangeCount)); ++i) {
787 reservedunmarshal_VkImageSubresourceRange(
788 readStream, VK_STRUCTURE_TYPE_MAX_ENUM,
789 (VkImageSubresourceRange*)(pRanges + i), readStreamPtrPtr);
790 }
791 if (pColor) {
792 transform_tohost_VkClearColorValue(globalstate, (VkClearColorValue*)(pColor));
793 }
794 if (pRanges) {
795 for (uint32_t i = 0; i < (uint32_t)((rangeCount)); ++i) {
796 transform_tohost_VkImageSubresourceRange(
797 globalstate, (VkImageSubresourceRange*)(pRanges + i));
798 }
799 }
800 vk->vkCmdClearColorImage((VkCommandBuffer)dispatchHandle, image, imageLayout,
801 pColor, rangeCount, pRanges);
802 android::base::endTrace();
803 break;
804 }
805 case OP_vkCmdClearDepthStencilImage: {
806 android::base::beginTrace("vkCmdClearDepthStencilImage subdecode");
807 VkImage image;
808 VkImageLayout imageLayout;
809 const VkClearDepthStencilValue* pDepthStencil;
810 VkClearDepthStencilValue stack_pDepthStencil[1];
811 uint32_t rangeCount;
812 const VkImageSubresourceRange* pRanges;
813 VkImageSubresourceRange stack_pRanges[MAX_STACK_ITEMS];
814 uint64_t cgen_var_0;
815 memcpy((uint64_t*)&cgen_var_0, *readStreamPtrPtr, 1 * 8);
816 *readStreamPtrPtr += 1 * 8;
817 *(VkImage*)&image = (VkImage)unbox_VkImage((VkImage)(*&cgen_var_0));
818 memcpy((VkImageLayout*)&imageLayout, *readStreamPtrPtr, sizeof(VkImageLayout));
819 *readStreamPtrPtr += sizeof(VkImageLayout);
820 pDepthStencil = (VkClearDepthStencilValue*)stack_pDepthStencil;
821 reservedunmarshal_VkClearDepthStencilValue(
822 readStream, VK_STRUCTURE_TYPE_MAX_ENUM,
823 (VkClearDepthStencilValue*)(pDepthStencil), readStreamPtrPtr);
824 memcpy((uint32_t*)&rangeCount, *readStreamPtrPtr, sizeof(uint32_t));
825 *readStreamPtrPtr += sizeof(uint32_t);
826 if (((rangeCount)) <= MAX_STACK_ITEMS) {
827 pRanges = (VkImageSubresourceRange*)stack_pRanges;
828 } else {
829 readStream->alloc((void**)&pRanges,
830 ((rangeCount)) * sizeof(const VkImageSubresourceRange));
831 }
832 for (uint32_t i = 0; i < (uint32_t)((rangeCount)); ++i) {
833 reservedunmarshal_VkImageSubresourceRange(
834 readStream, VK_STRUCTURE_TYPE_MAX_ENUM,
835 (VkImageSubresourceRange*)(pRanges + i), readStreamPtrPtr);
836 }
837 if (pDepthStencil) {
838 transform_tohost_VkClearDepthStencilValue(
839 globalstate, (VkClearDepthStencilValue*)(pDepthStencil));
840 }
841 if (pRanges) {
842 for (uint32_t i = 0; i < (uint32_t)((rangeCount)); ++i) {
843 transform_tohost_VkImageSubresourceRange(
844 globalstate, (VkImageSubresourceRange*)(pRanges + i));
845 }
846 }
847 vk->vkCmdClearDepthStencilImage((VkCommandBuffer)dispatchHandle, image, imageLayout,
848 pDepthStencil, rangeCount, pRanges);
849 android::base::endTrace();
850 break;
851 }
852 case OP_vkCmdClearAttachments: {
853 android::base::beginTrace("vkCmdClearAttachments subdecode");
854 uint32_t attachmentCount;
855 const VkClearAttachment* pAttachments;
856 VkClearAttachment stack_pAttachments[MAX_STACK_ITEMS];
857 uint32_t rectCount;
858 const VkClearRect* pRects;
859 VkClearRect stack_pRects[MAX_STACK_ITEMS];
860 memcpy((uint32_t*)&attachmentCount, *readStreamPtrPtr, sizeof(uint32_t));
861 *readStreamPtrPtr += sizeof(uint32_t);
862 if (((attachmentCount)) <= MAX_STACK_ITEMS) {
863 pAttachments = (VkClearAttachment*)stack_pAttachments;
864 } else {
865 readStream->alloc((void**)&pAttachments,
866 ((attachmentCount)) * sizeof(const VkClearAttachment));
867 }
868 for (uint32_t i = 0; i < (uint32_t)((attachmentCount)); ++i) {
869 reservedunmarshal_VkClearAttachment(readStream, VK_STRUCTURE_TYPE_MAX_ENUM,
870 (VkClearAttachment*)(pAttachments + i),
871 readStreamPtrPtr);
872 }
873 memcpy((uint32_t*)&rectCount, *readStreamPtrPtr, sizeof(uint32_t));
874 *readStreamPtrPtr += sizeof(uint32_t);
875 if (((rectCount)) <= MAX_STACK_ITEMS) {
876 pRects = (VkClearRect*)stack_pRects;
877 } else {
878 readStream->alloc((void**)&pRects, ((rectCount)) * sizeof(const VkClearRect));
879 }
880 for (uint32_t i = 0; i < (uint32_t)((rectCount)); ++i) {
881 reservedunmarshal_VkClearRect(readStream, VK_STRUCTURE_TYPE_MAX_ENUM,
882 (VkClearRect*)(pRects + i), readStreamPtrPtr);
883 }
884 if (pAttachments) {
885 for (uint32_t i = 0; i < (uint32_t)((attachmentCount)); ++i) {
886 transform_tohost_VkClearAttachment(globalstate,
887 (VkClearAttachment*)(pAttachments + i));
888 }
889 }
890 if (pRects) {
891 for (uint32_t i = 0; i < (uint32_t)((rectCount)); ++i) {
892 transform_tohost_VkClearRect(globalstate, (VkClearRect*)(pRects + i));
893 }
894 }
895 vk->vkCmdClearAttachments((VkCommandBuffer)dispatchHandle, attachmentCount,
896 pAttachments, rectCount, pRects);
897 android::base::endTrace();
898 break;
899 }
900 case OP_vkCmdResolveImage: {
901 android::base::beginTrace("vkCmdResolveImage subdecode");
902 VkImage srcImage;
903 VkImageLayout srcImageLayout;
904 VkImage dstImage;
905 VkImageLayout dstImageLayout;
906 uint32_t regionCount;
907 const VkImageResolve* pRegions;
908 VkImageResolve stack_pRegions[MAX_STACK_ITEMS];
909 uint64_t cgen_var_0;
910 memcpy((uint64_t*)&cgen_var_0, *readStreamPtrPtr, 1 * 8);
911 *readStreamPtrPtr += 1 * 8;
912 *(VkImage*)&srcImage = (VkImage)unbox_VkImage((VkImage)(*&cgen_var_0));
913 memcpy((VkImageLayout*)&srcImageLayout, *readStreamPtrPtr, sizeof(VkImageLayout));
914 *readStreamPtrPtr += sizeof(VkImageLayout);
915 uint64_t cgen_var_1;
916 memcpy((uint64_t*)&cgen_var_1, *readStreamPtrPtr, 1 * 8);
917 *readStreamPtrPtr += 1 * 8;
918 *(VkImage*)&dstImage = (VkImage)unbox_VkImage((VkImage)(*&cgen_var_1));
919 memcpy((VkImageLayout*)&dstImageLayout, *readStreamPtrPtr, sizeof(VkImageLayout));
920 *readStreamPtrPtr += sizeof(VkImageLayout);
921 memcpy((uint32_t*)®ionCount, *readStreamPtrPtr, sizeof(uint32_t));
922 *readStreamPtrPtr += sizeof(uint32_t);
923 if (((regionCount)) <= MAX_STACK_ITEMS) {
924 pRegions = (VkImageResolve*)stack_pRegions;
925 } else {
926 readStream->alloc((void**)&pRegions,
927 ((regionCount)) * sizeof(const VkImageResolve));
928 }
929 for (uint32_t i = 0; i < (uint32_t)((regionCount)); ++i) {
930 reservedunmarshal_VkImageResolve(readStream, VK_STRUCTURE_TYPE_MAX_ENUM,
931 (VkImageResolve*)(pRegions + i),
932 readStreamPtrPtr);
933 }
934 if (pRegions) {
935 for (uint32_t i = 0; i < (uint32_t)((regionCount)); ++i) {
936 transform_tohost_VkImageResolve(globalstate,
937 (VkImageResolve*)(pRegions + i));
938 }
939 }
940 vk->vkCmdResolveImage((VkCommandBuffer)dispatchHandle, srcImage, srcImageLayout,
941 dstImage, dstImageLayout, regionCount, pRegions);
942 android::base::endTrace();
943 break;
944 }
945 case OP_vkCmdSetEvent: {
946 android::base::beginTrace("vkCmdSetEvent subdecode");
947 VkEvent event;
948 VkPipelineStageFlags stageMask;
949 uint64_t cgen_var_0;
950 memcpy((uint64_t*)&cgen_var_0, *readStreamPtrPtr, 1 * 8);
951 *readStreamPtrPtr += 1 * 8;
952 *(VkEvent*)&event = (VkEvent)unbox_VkEvent((VkEvent)(*&cgen_var_0));
953 memcpy((VkPipelineStageFlags*)&stageMask, *readStreamPtrPtr,
954 sizeof(VkPipelineStageFlags));
955 *readStreamPtrPtr += sizeof(VkPipelineStageFlags);
956 vk->vkCmdSetEvent((VkCommandBuffer)dispatchHandle, event, stageMask);
957 android::base::endTrace();
958 break;
959 }
960 case OP_vkCmdResetEvent: {
961 android::base::beginTrace("vkCmdResetEvent subdecode");
962 VkEvent event;
963 VkPipelineStageFlags stageMask;
964 uint64_t cgen_var_0;
965 memcpy((uint64_t*)&cgen_var_0, *readStreamPtrPtr, 1 * 8);
966 *readStreamPtrPtr += 1 * 8;
967 *(VkEvent*)&event = (VkEvent)unbox_VkEvent((VkEvent)(*&cgen_var_0));
968 memcpy((VkPipelineStageFlags*)&stageMask, *readStreamPtrPtr,
969 sizeof(VkPipelineStageFlags));
970 *readStreamPtrPtr += sizeof(VkPipelineStageFlags);
971 vk->vkCmdResetEvent((VkCommandBuffer)dispatchHandle, event, stageMask);
972 android::base::endTrace();
973 break;
974 }
975 case OP_vkCmdWaitEvents: {
976 android::base::beginTrace("vkCmdWaitEvents subdecode");
977 uint32_t eventCount;
978 const VkEvent* pEvents;
979 VkEvent stack_pEvents[MAX_STACK_ITEMS];
980 VkPipelineStageFlags srcStageMask;
981 VkPipelineStageFlags dstStageMask;
982 uint32_t memoryBarrierCount;
983 const VkMemoryBarrier* pMemoryBarriers;
984 VkMemoryBarrier stack_pMemoryBarriers[MAX_STACK_ITEMS];
985 uint32_t bufferMemoryBarrierCount;
986 const VkBufferMemoryBarrier* pBufferMemoryBarriers;
987 VkBufferMemoryBarrier stack_pBufferMemoryBarriers[MAX_STACK_ITEMS];
988 uint32_t imageMemoryBarrierCount;
989 const VkImageMemoryBarrier* pImageMemoryBarriers;
990 VkImageMemoryBarrier stack_pImageMemoryBarriers[MAX_STACK_ITEMS];
991 memcpy((uint32_t*)&eventCount, *readStreamPtrPtr, sizeof(uint32_t));
992 *readStreamPtrPtr += sizeof(uint32_t);
993 if (((eventCount)) <= MAX_STACK_ITEMS) {
994 pEvents = (VkEvent*)stack_pEvents;
995 } else {
996 readStream->alloc((void**)&pEvents, ((eventCount)) * sizeof(const VkEvent));
997 }
998 if (((eventCount))) {
999 uint8_t* cgen_var_0_ptr = (uint8_t*)(*readStreamPtrPtr);
1000 *readStreamPtrPtr += 8 * ((eventCount));
1001 for (uint32_t k = 0; k < ((eventCount)); ++k) {
1002 uint64_t tmpval;
1003 memcpy(&tmpval, cgen_var_0_ptr + k * 8, sizeof(uint64_t));
1004 *(((VkEvent*)pEvents) + k) = (VkEvent)unbox_VkEvent((VkEvent)tmpval);
1005 }
1006 }
1007 memcpy((VkPipelineStageFlags*)&srcStageMask, *readStreamPtrPtr,
1008 sizeof(VkPipelineStageFlags));
1009 *readStreamPtrPtr += sizeof(VkPipelineStageFlags);
1010 memcpy((VkPipelineStageFlags*)&dstStageMask, *readStreamPtrPtr,
1011 sizeof(VkPipelineStageFlags));
1012 *readStreamPtrPtr += sizeof(VkPipelineStageFlags);
1013 memcpy((uint32_t*)&memoryBarrierCount, *readStreamPtrPtr, sizeof(uint32_t));
1014 *readStreamPtrPtr += sizeof(uint32_t);
1015 if (((memoryBarrierCount)) <= MAX_STACK_ITEMS) {
1016 pMemoryBarriers = (VkMemoryBarrier*)stack_pMemoryBarriers;
1017 } else {
1018 readStream->alloc((void**)&pMemoryBarriers,
1019 ((memoryBarrierCount)) * sizeof(const VkMemoryBarrier));
1020 }
1021 for (uint32_t i = 0; i < (uint32_t)((memoryBarrierCount)); ++i) {
1022 reservedunmarshal_VkMemoryBarrier(readStream, VK_STRUCTURE_TYPE_MAX_ENUM,
1023 (VkMemoryBarrier*)(pMemoryBarriers + i),
1024 readStreamPtrPtr);
1025 }
1026 memcpy((uint32_t*)&bufferMemoryBarrierCount, *readStreamPtrPtr, sizeof(uint32_t));
1027 *readStreamPtrPtr += sizeof(uint32_t);
1028 if (((bufferMemoryBarrierCount)) <= MAX_STACK_ITEMS) {
1029 pBufferMemoryBarriers = (VkBufferMemoryBarrier*)stack_pBufferMemoryBarriers;
1030 } else {
1031 readStream->alloc(
1032 (void**)&pBufferMemoryBarriers,
1033 ((bufferMemoryBarrierCount)) * sizeof(const VkBufferMemoryBarrier));
1034 }
1035 for (uint32_t i = 0; i < (uint32_t)((bufferMemoryBarrierCount)); ++i) {
1036 reservedunmarshal_VkBufferMemoryBarrier(
1037 readStream, VK_STRUCTURE_TYPE_MAX_ENUM,
1038 (VkBufferMemoryBarrier*)(pBufferMemoryBarriers + i), readStreamPtrPtr);
1039 }
1040 memcpy((uint32_t*)&imageMemoryBarrierCount, *readStreamPtrPtr, sizeof(uint32_t));
1041 *readStreamPtrPtr += sizeof(uint32_t);
1042 if (((imageMemoryBarrierCount)) <= MAX_STACK_ITEMS) {
1043 pImageMemoryBarriers = (VkImageMemoryBarrier*)stack_pImageMemoryBarriers;
1044 } else {
1045 readStream->alloc(
1046 (void**)&pImageMemoryBarriers,
1047 ((imageMemoryBarrierCount)) * sizeof(const VkImageMemoryBarrier));
1048 }
1049 for (uint32_t i = 0; i < (uint32_t)((imageMemoryBarrierCount)); ++i) {
1050 reservedunmarshal_VkImageMemoryBarrier(
1051 readStream, VK_STRUCTURE_TYPE_MAX_ENUM,
1052 (VkImageMemoryBarrier*)(pImageMemoryBarriers + i), readStreamPtrPtr);
1053 }
1054 if (pMemoryBarriers) {
1055 for (uint32_t i = 0; i < (uint32_t)((memoryBarrierCount)); ++i) {
1056 transform_tohost_VkMemoryBarrier(globalstate,
1057 (VkMemoryBarrier*)(pMemoryBarriers + i));
1058 }
1059 }
1060 if (pBufferMemoryBarriers) {
1061 for (uint32_t i = 0; i < (uint32_t)((bufferMemoryBarrierCount)); ++i) {
1062 transform_tohost_VkBufferMemoryBarrier(
1063 globalstate, (VkBufferMemoryBarrier*)(pBufferMemoryBarriers + i));
1064 }
1065 }
1066 if (pImageMemoryBarriers) {
1067 for (uint32_t i = 0; i < (uint32_t)((imageMemoryBarrierCount)); ++i) {
1068 transform_tohost_VkImageMemoryBarrier(
1069 globalstate, (VkImageMemoryBarrier*)(pImageMemoryBarriers + i));
1070 }
1071 }
1072 vk->vkCmdWaitEvents((VkCommandBuffer)dispatchHandle, eventCount, pEvents,
1073 srcStageMask, dstStageMask, memoryBarrierCount, pMemoryBarriers,
1074 bufferMemoryBarrierCount, pBufferMemoryBarriers,
1075 imageMemoryBarrierCount, pImageMemoryBarriers);
1076 android::base::endTrace();
1077 break;
1078 }
1079 case OP_vkCmdPipelineBarrier: {
1080 android::base::beginTrace("vkCmdPipelineBarrier subdecode");
1081 VkPipelineStageFlags srcStageMask;
1082 VkPipelineStageFlags dstStageMask;
1083 VkDependencyFlags dependencyFlags;
1084 uint32_t memoryBarrierCount;
1085 const VkMemoryBarrier* pMemoryBarriers;
1086 VkMemoryBarrier stack_pMemoryBarriers[MAX_STACK_ITEMS];
1087 uint32_t bufferMemoryBarrierCount;
1088 const VkBufferMemoryBarrier* pBufferMemoryBarriers;
1089 VkBufferMemoryBarrier stack_pBufferMemoryBarriers[MAX_STACK_ITEMS];
1090 uint32_t imageMemoryBarrierCount;
1091 const VkImageMemoryBarrier* pImageMemoryBarriers;
1092 VkImageMemoryBarrier stack_pImageMemoryBarriers[MAX_STACK_ITEMS];
1093 memcpy((VkPipelineStageFlags*)&srcStageMask, *readStreamPtrPtr,
1094 sizeof(VkPipelineStageFlags));
1095 *readStreamPtrPtr += sizeof(VkPipelineStageFlags);
1096 memcpy((VkPipelineStageFlags*)&dstStageMask, *readStreamPtrPtr,
1097 sizeof(VkPipelineStageFlags));
1098 *readStreamPtrPtr += sizeof(VkPipelineStageFlags);
1099 memcpy((VkDependencyFlags*)&dependencyFlags, *readStreamPtrPtr,
1100 sizeof(VkDependencyFlags));
1101 *readStreamPtrPtr += sizeof(VkDependencyFlags);
1102 memcpy((uint32_t*)&memoryBarrierCount, *readStreamPtrPtr, sizeof(uint32_t));
1103 *readStreamPtrPtr += sizeof(uint32_t);
1104 if (((memoryBarrierCount)) <= MAX_STACK_ITEMS) {
1105 pMemoryBarriers = (VkMemoryBarrier*)stack_pMemoryBarriers;
1106 } else {
1107 readStream->alloc((void**)&pMemoryBarriers,
1108 ((memoryBarrierCount)) * sizeof(const VkMemoryBarrier));
1109 }
1110 for (uint32_t i = 0; i < (uint32_t)((memoryBarrierCount)); ++i) {
1111 reservedunmarshal_VkMemoryBarrier(readStream, VK_STRUCTURE_TYPE_MAX_ENUM,
1112 (VkMemoryBarrier*)(pMemoryBarriers + i),
1113 readStreamPtrPtr);
1114 }
1115 memcpy((uint32_t*)&bufferMemoryBarrierCount, *readStreamPtrPtr, sizeof(uint32_t));
1116 *readStreamPtrPtr += sizeof(uint32_t);
1117 if (((bufferMemoryBarrierCount)) <= MAX_STACK_ITEMS) {
1118 pBufferMemoryBarriers = (VkBufferMemoryBarrier*)stack_pBufferMemoryBarriers;
1119 } else {
1120 readStream->alloc(
1121 (void**)&pBufferMemoryBarriers,
1122 ((bufferMemoryBarrierCount)) * sizeof(const VkBufferMemoryBarrier));
1123 }
1124 for (uint32_t i = 0; i < (uint32_t)((bufferMemoryBarrierCount)); ++i) {
1125 reservedunmarshal_VkBufferMemoryBarrier(
1126 readStream, VK_STRUCTURE_TYPE_MAX_ENUM,
1127 (VkBufferMemoryBarrier*)(pBufferMemoryBarriers + i), readStreamPtrPtr);
1128 }
1129 memcpy((uint32_t*)&imageMemoryBarrierCount, *readStreamPtrPtr, sizeof(uint32_t));
1130 *readStreamPtrPtr += sizeof(uint32_t);
1131 if (((imageMemoryBarrierCount)) <= MAX_STACK_ITEMS) {
1132 pImageMemoryBarriers = (VkImageMemoryBarrier*)stack_pImageMemoryBarriers;
1133 } else {
1134 readStream->alloc(
1135 (void**)&pImageMemoryBarriers,
1136 ((imageMemoryBarrierCount)) * sizeof(const VkImageMemoryBarrier));
1137 }
1138 for (uint32_t i = 0; i < (uint32_t)((imageMemoryBarrierCount)); ++i) {
1139 reservedunmarshal_VkImageMemoryBarrier(
1140 readStream, VK_STRUCTURE_TYPE_MAX_ENUM,
1141 (VkImageMemoryBarrier*)(pImageMemoryBarriers + i), readStreamPtrPtr);
1142 }
1143 if (pMemoryBarriers) {
1144 for (uint32_t i = 0; i < (uint32_t)((memoryBarrierCount)); ++i) {
1145 transform_tohost_VkMemoryBarrier(globalstate,
1146 (VkMemoryBarrier*)(pMemoryBarriers + i));
1147 }
1148 }
1149 if (pBufferMemoryBarriers) {
1150 for (uint32_t i = 0; i < (uint32_t)((bufferMemoryBarrierCount)); ++i) {
1151 transform_tohost_VkBufferMemoryBarrier(
1152 globalstate, (VkBufferMemoryBarrier*)(pBufferMemoryBarriers + i));
1153 }
1154 }
1155 if (pImageMemoryBarriers) {
1156 for (uint32_t i = 0; i < (uint32_t)((imageMemoryBarrierCount)); ++i) {
1157 transform_tohost_VkImageMemoryBarrier(
1158 globalstate, (VkImageMemoryBarrier*)(pImageMemoryBarriers + i));
1159 }
1160 }
1161 this->on_vkCmdPipelineBarrier(
1162 pool, (VkCommandBuffer)(boxed_dispatchHandle), srcStageMask, dstStageMask,
1163 dependencyFlags, memoryBarrierCount, pMemoryBarriers, bufferMemoryBarrierCount,
1164 pBufferMemoryBarriers, imageMemoryBarrierCount, pImageMemoryBarriers);
1165 android::base::endTrace();
1166 break;
1167 }
1168 case OP_vkCmdBeginQuery: {
1169 android::base::beginTrace("vkCmdBeginQuery subdecode");
1170 VkQueryPool queryPool;
1171 uint32_t query;
1172 VkQueryControlFlags flags;
1173 uint64_t cgen_var_0;
1174 memcpy((uint64_t*)&cgen_var_0, *readStreamPtrPtr, 1 * 8);
1175 *readStreamPtrPtr += 1 * 8;
1176 *(VkQueryPool*)&queryPool =
1177 (VkQueryPool)unbox_VkQueryPool((VkQueryPool)(*&cgen_var_0));
1178 memcpy((uint32_t*)&query, *readStreamPtrPtr, sizeof(uint32_t));
1179 *readStreamPtrPtr += sizeof(uint32_t);
1180 memcpy((VkQueryControlFlags*)&flags, *readStreamPtrPtr,
1181 sizeof(VkQueryControlFlags));
1182 *readStreamPtrPtr += sizeof(VkQueryControlFlags);
1183 vk->vkCmdBeginQuery((VkCommandBuffer)dispatchHandle, queryPool, query, flags);
1184 android::base::endTrace();
1185 break;
1186 }
1187 case OP_vkCmdEndQuery: {
1188 android::base::beginTrace("vkCmdEndQuery subdecode");
1189 VkQueryPool queryPool;
1190 uint32_t query;
1191 uint64_t cgen_var_0;
1192 memcpy((uint64_t*)&cgen_var_0, *readStreamPtrPtr, 1 * 8);
1193 *readStreamPtrPtr += 1 * 8;
1194 *(VkQueryPool*)&queryPool =
1195 (VkQueryPool)unbox_VkQueryPool((VkQueryPool)(*&cgen_var_0));
1196 memcpy((uint32_t*)&query, *readStreamPtrPtr, sizeof(uint32_t));
1197 *readStreamPtrPtr += sizeof(uint32_t);
1198 vk->vkCmdEndQuery((VkCommandBuffer)dispatchHandle, queryPool, query);
1199 android::base::endTrace();
1200 break;
1201 }
1202 case OP_vkCmdResetQueryPool: {
1203 android::base::beginTrace("vkCmdResetQueryPool subdecode");
1204 VkQueryPool queryPool;
1205 uint32_t firstQuery;
1206 uint32_t queryCount;
1207 uint64_t cgen_var_0;
1208 memcpy((uint64_t*)&cgen_var_0, *readStreamPtrPtr, 1 * 8);
1209 *readStreamPtrPtr += 1 * 8;
1210 *(VkQueryPool*)&queryPool =
1211 (VkQueryPool)unbox_VkQueryPool((VkQueryPool)(*&cgen_var_0));
1212 memcpy((uint32_t*)&firstQuery, *readStreamPtrPtr, sizeof(uint32_t));
1213 *readStreamPtrPtr += sizeof(uint32_t);
1214 memcpy((uint32_t*)&queryCount, *readStreamPtrPtr, sizeof(uint32_t));
1215 *readStreamPtrPtr += sizeof(uint32_t);
1216 vk->vkCmdResetQueryPool((VkCommandBuffer)dispatchHandle, queryPool, firstQuery,
1217 queryCount);
1218 android::base::endTrace();
1219 break;
1220 }
1221 case OP_vkCmdWriteTimestamp: {
1222 android::base::beginTrace("vkCmdWriteTimestamp subdecode");
1223 VkPipelineStageFlagBits pipelineStage;
1224 VkQueryPool queryPool;
1225 uint32_t query;
1226 memcpy((VkPipelineStageFlagBits*)&pipelineStage, *readStreamPtrPtr,
1227 sizeof(VkPipelineStageFlagBits));
1228 *readStreamPtrPtr += sizeof(VkPipelineStageFlagBits);
1229 uint64_t cgen_var_0;
1230 memcpy((uint64_t*)&cgen_var_0, *readStreamPtrPtr, 1 * 8);
1231 *readStreamPtrPtr += 1 * 8;
1232 *(VkQueryPool*)&queryPool =
1233 (VkQueryPool)unbox_VkQueryPool((VkQueryPool)(*&cgen_var_0));
1234 memcpy((uint32_t*)&query, *readStreamPtrPtr, sizeof(uint32_t));
1235 *readStreamPtrPtr += sizeof(uint32_t);
1236 vk->vkCmdWriteTimestamp((VkCommandBuffer)dispatchHandle, pipelineStage, queryPool,
1237 query);
1238 android::base::endTrace();
1239 break;
1240 }
1241 case OP_vkCmdCopyQueryPoolResults: {
1242 android::base::beginTrace("vkCmdCopyQueryPoolResults subdecode");
1243 VkQueryPool queryPool;
1244 uint32_t firstQuery;
1245 uint32_t queryCount;
1246 VkBuffer dstBuffer;
1247 VkDeviceSize dstOffset;
1248 VkDeviceSize stride;
1249 VkQueryResultFlags flags;
1250 uint64_t cgen_var_0;
1251 memcpy((uint64_t*)&cgen_var_0, *readStreamPtrPtr, 1 * 8);
1252 *readStreamPtrPtr += 1 * 8;
1253 *(VkQueryPool*)&queryPool =
1254 (VkQueryPool)unbox_VkQueryPool((VkQueryPool)(*&cgen_var_0));
1255 memcpy((uint32_t*)&firstQuery, *readStreamPtrPtr, sizeof(uint32_t));
1256 *readStreamPtrPtr += sizeof(uint32_t);
1257 memcpy((uint32_t*)&queryCount, *readStreamPtrPtr, sizeof(uint32_t));
1258 *readStreamPtrPtr += sizeof(uint32_t);
1259 uint64_t cgen_var_1;
1260 memcpy((uint64_t*)&cgen_var_1, *readStreamPtrPtr, 1 * 8);
1261 *readStreamPtrPtr += 1 * 8;
1262 *(VkBuffer*)&dstBuffer = (VkBuffer)unbox_VkBuffer((VkBuffer)(*&cgen_var_1));
1263 memcpy((VkDeviceSize*)&dstOffset, *readStreamPtrPtr, sizeof(VkDeviceSize));
1264 *readStreamPtrPtr += sizeof(VkDeviceSize);
1265 memcpy((VkDeviceSize*)&stride, *readStreamPtrPtr, sizeof(VkDeviceSize));
1266 *readStreamPtrPtr += sizeof(VkDeviceSize);
1267 memcpy((VkQueryResultFlags*)&flags, *readStreamPtrPtr, sizeof(VkQueryResultFlags));
1268 *readStreamPtrPtr += sizeof(VkQueryResultFlags);
1269 this->on_vkCmdCopyQueryPoolResults(pool, (VkCommandBuffer)(boxed_dispatchHandle),
1270 queryPool, firstQuery, queryCount, dstBuffer,
1271 dstOffset, stride, flags);
1272 android::base::endTrace();
1273 break;
1274 }
1275 case OP_vkCmdPushConstants: {
1276 android::base::beginTrace("vkCmdPushConstants subdecode");
1277 VkPipelineLayout layout;
1278 VkShaderStageFlags stageFlags;
1279 uint32_t offset;
1280 uint32_t size;
1281 const void* pValues;
1282 uint8_t* stack_pValues[MAX_STACK_ITEMS];
1283 uint64_t cgen_var_0;
1284 memcpy((uint64_t*)&cgen_var_0, *readStreamPtrPtr, 1 * 8);
1285 *readStreamPtrPtr += 1 * 8;
1286 *(VkPipelineLayout*)&layout =
1287 (VkPipelineLayout)unbox_VkPipelineLayout((VkPipelineLayout)(*&cgen_var_0));
1288 memcpy((VkShaderStageFlags*)&stageFlags, *readStreamPtrPtr,
1289 sizeof(VkShaderStageFlags));
1290 *readStreamPtrPtr += sizeof(VkShaderStageFlags);
1291 memcpy((uint32_t*)&offset, *readStreamPtrPtr, sizeof(uint32_t));
1292 *readStreamPtrPtr += sizeof(uint32_t);
1293 memcpy((uint32_t*)&size, *readStreamPtrPtr, sizeof(uint32_t));
1294 *readStreamPtrPtr += sizeof(uint32_t);
1295 if (((size)) <= MAX_STACK_ITEMS) {
1296 pValues = (void*)stack_pValues;
1297 } else {
1298 readStream->alloc((void**)&pValues, ((size)) * sizeof(const uint8_t));
1299 }
1300 memcpy((void*)pValues, *readStreamPtrPtr, ((size)) * sizeof(const uint8_t));
1301 *readStreamPtrPtr += ((size)) * sizeof(const uint8_t);
1302 vk->vkCmdPushConstants((VkCommandBuffer)dispatchHandle, layout, stageFlags, offset,
1303 size, pValues);
1304 android::base::endTrace();
1305 break;
1306 }
1307 case OP_vkCmdBeginRenderPass: {
1308 android::base::beginTrace("vkCmdBeginRenderPass subdecode");
1309 const VkRenderPassBeginInfo* pRenderPassBegin;
1310 VkRenderPassBeginInfo stack_pRenderPassBegin[1];
1311 VkSubpassContents contents;
1312 pRenderPassBegin = (VkRenderPassBeginInfo*)stack_pRenderPassBegin;
1313 reservedunmarshal_VkRenderPassBeginInfo(readStream, VK_STRUCTURE_TYPE_MAX_ENUM,
1314 (VkRenderPassBeginInfo*)(pRenderPassBegin),
1315 readStreamPtrPtr);
1316 memcpy((VkSubpassContents*)&contents, *readStreamPtrPtr, sizeof(VkSubpassContents));
1317 *readStreamPtrPtr += sizeof(VkSubpassContents);
1318 if (pRenderPassBegin) {
1319 transform_tohost_VkRenderPassBeginInfo(
1320 globalstate, (VkRenderPassBeginInfo*)(pRenderPassBegin));
1321 }
1322 this->on_vkCmdBeginRenderPass(pool, (VkCommandBuffer)(boxed_dispatchHandle),
1323 pRenderPassBegin, contents);
1324 android::base::endTrace();
1325 break;
1326 }
1327 case OP_vkCmdNextSubpass: {
1328 android::base::beginTrace("vkCmdNextSubpass subdecode");
1329 VkSubpassContents contents;
1330 memcpy((VkSubpassContents*)&contents, *readStreamPtrPtr, sizeof(VkSubpassContents));
1331 *readStreamPtrPtr += sizeof(VkSubpassContents);
1332 vk->vkCmdNextSubpass((VkCommandBuffer)dispatchHandle, contents);
1333 android::base::endTrace();
1334 break;
1335 }
1336 case OP_vkCmdEndRenderPass: {
1337 android::base::beginTrace("vkCmdEndRenderPass subdecode");
1338 vk->vkCmdEndRenderPass((VkCommandBuffer)dispatchHandle);
1339 android::base::endTrace();
1340 break;
1341 }
1342 case OP_vkCmdExecuteCommands: {
1343 android::base::beginTrace("vkCmdExecuteCommands subdecode");
1344 uint32_t commandBufferCount;
1345 const VkCommandBuffer* pCommandBuffers;
1346 VkCommandBuffer stack_pCommandBuffers[MAX_STACK_ITEMS];
1347 memcpy((uint32_t*)&commandBufferCount, *readStreamPtrPtr, sizeof(uint32_t));
1348 *readStreamPtrPtr += sizeof(uint32_t);
1349 if (((commandBufferCount)) <= MAX_STACK_ITEMS) {
1350 pCommandBuffers = (VkCommandBuffer*)stack_pCommandBuffers;
1351 } else {
1352 readStream->alloc((void**)&pCommandBuffers,
1353 ((commandBufferCount)) * sizeof(const VkCommandBuffer));
1354 }
1355 if (((commandBufferCount))) {
1356 uint8_t* cgen_var_0_ptr = (uint8_t*)(*readStreamPtrPtr);
1357 *readStreamPtrPtr += 8 * ((commandBufferCount));
1358 for (uint32_t k = 0; k < ((commandBufferCount)); ++k) {
1359 uint64_t tmpval;
1360 memcpy(&tmpval, cgen_var_0_ptr + k * 8, sizeof(uint64_t));
1361 *(((VkCommandBuffer*)pCommandBuffers) + k) =
1362 (VkCommandBuffer)unbox_VkCommandBuffer((VkCommandBuffer)tmpval);
1363 }
1364 }
1365 this->on_vkCmdExecuteCommands(pool, (VkCommandBuffer)(boxed_dispatchHandle),
1366 commandBufferCount, pCommandBuffers);
1367 android::base::endTrace();
1368 break;
1369 }
1370 #endif
1371 #ifdef VK_VERSION_1_1
1372 case OP_vkCmdSetDeviceMask: {
1373 android::base::beginTrace("vkCmdSetDeviceMask subdecode");
1374 uint32_t deviceMask;
1375 memcpy((uint32_t*)&deviceMask, *readStreamPtrPtr, sizeof(uint32_t));
1376 *readStreamPtrPtr += sizeof(uint32_t);
1377 vk->vkCmdSetDeviceMask((VkCommandBuffer)dispatchHandle, deviceMask);
1378 android::base::endTrace();
1379 break;
1380 }
1381 case OP_vkCmdDispatchBase: {
1382 android::base::beginTrace("vkCmdDispatchBase subdecode");
1383 uint32_t baseGroupX;
1384 uint32_t baseGroupY;
1385 uint32_t baseGroupZ;
1386 uint32_t groupCountX;
1387 uint32_t groupCountY;
1388 uint32_t groupCountZ;
1389 memcpy((uint32_t*)&baseGroupX, *readStreamPtrPtr, sizeof(uint32_t));
1390 *readStreamPtrPtr += sizeof(uint32_t);
1391 memcpy((uint32_t*)&baseGroupY, *readStreamPtrPtr, sizeof(uint32_t));
1392 *readStreamPtrPtr += sizeof(uint32_t);
1393 memcpy((uint32_t*)&baseGroupZ, *readStreamPtrPtr, sizeof(uint32_t));
1394 *readStreamPtrPtr += sizeof(uint32_t);
1395 memcpy((uint32_t*)&groupCountX, *readStreamPtrPtr, sizeof(uint32_t));
1396 *readStreamPtrPtr += sizeof(uint32_t);
1397 memcpy((uint32_t*)&groupCountY, *readStreamPtrPtr, sizeof(uint32_t));
1398 *readStreamPtrPtr += sizeof(uint32_t);
1399 memcpy((uint32_t*)&groupCountZ, *readStreamPtrPtr, sizeof(uint32_t));
1400 *readStreamPtrPtr += sizeof(uint32_t);
1401 vk->vkCmdDispatchBase((VkCommandBuffer)dispatchHandle, baseGroupX, baseGroupY,
1402 baseGroupZ, groupCountX, groupCountY, groupCountZ);
1403 android::base::endTrace();
1404 break;
1405 }
1406 #endif
1407 #ifdef VK_VERSION_1_2
1408 case OP_vkCmdDrawIndirectCount: {
1409 android::base::beginTrace("vkCmdDrawIndirectCount subdecode");
1410 VkBuffer buffer;
1411 VkDeviceSize offset;
1412 VkBuffer countBuffer;
1413 VkDeviceSize countBufferOffset;
1414 uint32_t maxDrawCount;
1415 uint32_t stride;
1416 uint64_t cgen_var_0;
1417 memcpy((uint64_t*)&cgen_var_0, *readStreamPtrPtr, 1 * 8);
1418 *readStreamPtrPtr += 1 * 8;
1419 *(VkBuffer*)&buffer = (VkBuffer)unbox_VkBuffer((VkBuffer)(*&cgen_var_0));
1420 memcpy((VkDeviceSize*)&offset, *readStreamPtrPtr, sizeof(VkDeviceSize));
1421 *readStreamPtrPtr += sizeof(VkDeviceSize);
1422 uint64_t cgen_var_1;
1423 memcpy((uint64_t*)&cgen_var_1, *readStreamPtrPtr, 1 * 8);
1424 *readStreamPtrPtr += 1 * 8;
1425 *(VkBuffer*)&countBuffer = (VkBuffer)unbox_VkBuffer((VkBuffer)(*&cgen_var_1));
1426 memcpy((VkDeviceSize*)&countBufferOffset, *readStreamPtrPtr, sizeof(VkDeviceSize));
1427 *readStreamPtrPtr += sizeof(VkDeviceSize);
1428 memcpy((uint32_t*)&maxDrawCount, *readStreamPtrPtr, sizeof(uint32_t));
1429 *readStreamPtrPtr += sizeof(uint32_t);
1430 memcpy((uint32_t*)&stride, *readStreamPtrPtr, sizeof(uint32_t));
1431 *readStreamPtrPtr += sizeof(uint32_t);
1432 vk->vkCmdDrawIndirectCount((VkCommandBuffer)dispatchHandle, buffer, offset,
1433 countBuffer, countBufferOffset, maxDrawCount, stride);
1434 android::base::endTrace();
1435 break;
1436 }
1437 case OP_vkCmdDrawIndexedIndirectCount: {
1438 android::base::beginTrace("vkCmdDrawIndexedIndirectCount subdecode");
1439 VkBuffer buffer;
1440 VkDeviceSize offset;
1441 VkBuffer countBuffer;
1442 VkDeviceSize countBufferOffset;
1443 uint32_t maxDrawCount;
1444 uint32_t stride;
1445 uint64_t cgen_var_0;
1446 memcpy((uint64_t*)&cgen_var_0, *readStreamPtrPtr, 1 * 8);
1447 *readStreamPtrPtr += 1 * 8;
1448 *(VkBuffer*)&buffer = (VkBuffer)unbox_VkBuffer((VkBuffer)(*&cgen_var_0));
1449 memcpy((VkDeviceSize*)&offset, *readStreamPtrPtr, sizeof(VkDeviceSize));
1450 *readStreamPtrPtr += sizeof(VkDeviceSize);
1451 uint64_t cgen_var_1;
1452 memcpy((uint64_t*)&cgen_var_1, *readStreamPtrPtr, 1 * 8);
1453 *readStreamPtrPtr += 1 * 8;
1454 *(VkBuffer*)&countBuffer = (VkBuffer)unbox_VkBuffer((VkBuffer)(*&cgen_var_1));
1455 memcpy((VkDeviceSize*)&countBufferOffset, *readStreamPtrPtr, sizeof(VkDeviceSize));
1456 *readStreamPtrPtr += sizeof(VkDeviceSize);
1457 memcpy((uint32_t*)&maxDrawCount, *readStreamPtrPtr, sizeof(uint32_t));
1458 *readStreamPtrPtr += sizeof(uint32_t);
1459 memcpy((uint32_t*)&stride, *readStreamPtrPtr, sizeof(uint32_t));
1460 *readStreamPtrPtr += sizeof(uint32_t);
1461 vk->vkCmdDrawIndexedIndirectCount((VkCommandBuffer)dispatchHandle, buffer, offset,
1462 countBuffer, countBufferOffset, maxDrawCount,
1463 stride);
1464 android::base::endTrace();
1465 break;
1466 }
1467 case OP_vkCmdBeginRenderPass2: {
1468 android::base::beginTrace("vkCmdBeginRenderPass2 subdecode");
1469 const VkRenderPassBeginInfo* pRenderPassBegin;
1470 VkRenderPassBeginInfo stack_pRenderPassBegin[1];
1471 const VkSubpassBeginInfo* pSubpassBeginInfo;
1472 VkSubpassBeginInfo stack_pSubpassBeginInfo[1];
1473 pRenderPassBegin = (VkRenderPassBeginInfo*)stack_pRenderPassBegin;
1474 reservedunmarshal_VkRenderPassBeginInfo(readStream, VK_STRUCTURE_TYPE_MAX_ENUM,
1475 (VkRenderPassBeginInfo*)(pRenderPassBegin),
1476 readStreamPtrPtr);
1477 pSubpassBeginInfo = (VkSubpassBeginInfo*)stack_pSubpassBeginInfo;
1478 reservedunmarshal_VkSubpassBeginInfo(readStream, VK_STRUCTURE_TYPE_MAX_ENUM,
1479 (VkSubpassBeginInfo*)(pSubpassBeginInfo),
1480 readStreamPtrPtr);
1481 if (pRenderPassBegin) {
1482 transform_tohost_VkRenderPassBeginInfo(
1483 globalstate, (VkRenderPassBeginInfo*)(pRenderPassBegin));
1484 }
1485 if (pSubpassBeginInfo) {
1486 transform_tohost_VkSubpassBeginInfo(globalstate,
1487 (VkSubpassBeginInfo*)(pSubpassBeginInfo));
1488 }
1489 this->on_vkCmdBeginRenderPass2(pool, (VkCommandBuffer)(boxed_dispatchHandle),
1490 pRenderPassBegin, pSubpassBeginInfo);
1491 android::base::endTrace();
1492 break;
1493 }
1494 case OP_vkCmdNextSubpass2: {
1495 android::base::beginTrace("vkCmdNextSubpass2 subdecode");
1496 const VkSubpassBeginInfo* pSubpassBeginInfo;
1497 VkSubpassBeginInfo stack_pSubpassBeginInfo[1];
1498 const VkSubpassEndInfo* pSubpassEndInfo;
1499 VkSubpassEndInfo stack_pSubpassEndInfo[1];
1500 pSubpassBeginInfo = (VkSubpassBeginInfo*)stack_pSubpassBeginInfo;
1501 reservedunmarshal_VkSubpassBeginInfo(readStream, VK_STRUCTURE_TYPE_MAX_ENUM,
1502 (VkSubpassBeginInfo*)(pSubpassBeginInfo),
1503 readStreamPtrPtr);
1504 pSubpassEndInfo = (VkSubpassEndInfo*)stack_pSubpassEndInfo;
1505 reservedunmarshal_VkSubpassEndInfo(readStream, VK_STRUCTURE_TYPE_MAX_ENUM,
1506 (VkSubpassEndInfo*)(pSubpassEndInfo),
1507 readStreamPtrPtr);
1508 if (pSubpassBeginInfo) {
1509 transform_tohost_VkSubpassBeginInfo(globalstate,
1510 (VkSubpassBeginInfo*)(pSubpassBeginInfo));
1511 }
1512 if (pSubpassEndInfo) {
1513 transform_tohost_VkSubpassEndInfo(globalstate,
1514 (VkSubpassEndInfo*)(pSubpassEndInfo));
1515 }
1516 vk->vkCmdNextSubpass2((VkCommandBuffer)dispatchHandle, pSubpassBeginInfo,
1517 pSubpassEndInfo);
1518 android::base::endTrace();
1519 break;
1520 }
1521 case OP_vkCmdEndRenderPass2: {
1522 android::base::beginTrace("vkCmdEndRenderPass2 subdecode");
1523 const VkSubpassEndInfo* pSubpassEndInfo;
1524 VkSubpassEndInfo stack_pSubpassEndInfo[1];
1525 pSubpassEndInfo = (VkSubpassEndInfo*)stack_pSubpassEndInfo;
1526 reservedunmarshal_VkSubpassEndInfo(readStream, VK_STRUCTURE_TYPE_MAX_ENUM,
1527 (VkSubpassEndInfo*)(pSubpassEndInfo),
1528 readStreamPtrPtr);
1529 if (pSubpassEndInfo) {
1530 transform_tohost_VkSubpassEndInfo(globalstate,
1531 (VkSubpassEndInfo*)(pSubpassEndInfo));
1532 }
1533 vk->vkCmdEndRenderPass2((VkCommandBuffer)dispatchHandle, pSubpassEndInfo);
1534 android::base::endTrace();
1535 break;
1536 }
1537 #endif
1538 #ifdef VK_VERSION_1_3
1539 case OP_vkCmdSetEvent2: {
1540 android::base::beginTrace("vkCmdSetEvent2 subdecode");
1541 VkEvent event;
1542 const VkDependencyInfo* pDependencyInfo;
1543 VkDependencyInfo stack_pDependencyInfo[1];
1544 uint64_t cgen_var_0;
1545 memcpy((uint64_t*)&cgen_var_0, *readStreamPtrPtr, 1 * 8);
1546 *readStreamPtrPtr += 1 * 8;
1547 *(VkEvent*)&event = (VkEvent)unbox_VkEvent((VkEvent)(*&cgen_var_0));
1548 pDependencyInfo = (VkDependencyInfo*)stack_pDependencyInfo;
1549 reservedunmarshal_VkDependencyInfo(readStream, VK_STRUCTURE_TYPE_MAX_ENUM,
1550 (VkDependencyInfo*)(pDependencyInfo),
1551 readStreamPtrPtr);
1552 if (pDependencyInfo) {
1553 transform_tohost_VkDependencyInfo(globalstate,
1554 (VkDependencyInfo*)(pDependencyInfo));
1555 }
1556 vk->vkCmdSetEvent2((VkCommandBuffer)dispatchHandle, event, pDependencyInfo);
1557 android::base::endTrace();
1558 break;
1559 }
1560 case OP_vkCmdResetEvent2: {
1561 android::base::beginTrace("vkCmdResetEvent2 subdecode");
1562 VkEvent event;
1563 VkPipelineStageFlags2 stageMask;
1564 uint64_t cgen_var_0;
1565 memcpy((uint64_t*)&cgen_var_0, *readStreamPtrPtr, 1 * 8);
1566 *readStreamPtrPtr += 1 * 8;
1567 *(VkEvent*)&event = (VkEvent)unbox_VkEvent((VkEvent)(*&cgen_var_0));
1568 memcpy((VkPipelineStageFlags2*)&stageMask, *readStreamPtrPtr,
1569 sizeof(VkPipelineStageFlags2));
1570 *readStreamPtrPtr += sizeof(VkPipelineStageFlags2);
1571 vk->vkCmdResetEvent2((VkCommandBuffer)dispatchHandle, event, stageMask);
1572 android::base::endTrace();
1573 break;
1574 }
1575 case OP_vkCmdWaitEvents2: {
1576 android::base::beginTrace("vkCmdWaitEvents2 subdecode");
1577 uint32_t eventCount;
1578 const VkEvent* pEvents;
1579 VkEvent stack_pEvents[MAX_STACK_ITEMS];
1580 const VkDependencyInfo* pDependencyInfos;
1581 VkDependencyInfo stack_pDependencyInfos[MAX_STACK_ITEMS];
1582 memcpy((uint32_t*)&eventCount, *readStreamPtrPtr, sizeof(uint32_t));
1583 *readStreamPtrPtr += sizeof(uint32_t);
1584 if (((eventCount)) <= MAX_STACK_ITEMS) {
1585 pEvents = (VkEvent*)stack_pEvents;
1586 } else {
1587 readStream->alloc((void**)&pEvents, ((eventCount)) * sizeof(const VkEvent));
1588 }
1589 if (((eventCount))) {
1590 uint8_t* cgen_var_0_ptr = (uint8_t*)(*readStreamPtrPtr);
1591 *readStreamPtrPtr += 8 * ((eventCount));
1592 for (uint32_t k = 0; k < ((eventCount)); ++k) {
1593 uint64_t tmpval;
1594 memcpy(&tmpval, cgen_var_0_ptr + k * 8, sizeof(uint64_t));
1595 *(((VkEvent*)pEvents) + k) = (VkEvent)unbox_VkEvent((VkEvent)tmpval);
1596 }
1597 }
1598 if (((eventCount)) <= MAX_STACK_ITEMS) {
1599 pDependencyInfos = (VkDependencyInfo*)stack_pDependencyInfos;
1600 } else {
1601 readStream->alloc((void**)&pDependencyInfos,
1602 ((eventCount)) * sizeof(const VkDependencyInfo));
1603 }
1604 for (uint32_t i = 0; i < (uint32_t)((eventCount)); ++i) {
1605 reservedunmarshal_VkDependencyInfo(readStream, VK_STRUCTURE_TYPE_MAX_ENUM,
1606 (VkDependencyInfo*)(pDependencyInfos + i),
1607 readStreamPtrPtr);
1608 }
1609 if (pDependencyInfos) {
1610 for (uint32_t i = 0; i < (uint32_t)((eventCount)); ++i) {
1611 transform_tohost_VkDependencyInfo(
1612 globalstate, (VkDependencyInfo*)(pDependencyInfos + i));
1613 }
1614 }
1615 vk->vkCmdWaitEvents2((VkCommandBuffer)dispatchHandle, eventCount, pEvents,
1616 pDependencyInfos);
1617 android::base::endTrace();
1618 break;
1619 }
1620 case OP_vkCmdPipelineBarrier2: {
1621 android::base::beginTrace("vkCmdPipelineBarrier2 subdecode");
1622 const VkDependencyInfo* pDependencyInfo;
1623 VkDependencyInfo stack_pDependencyInfo[1];
1624 pDependencyInfo = (VkDependencyInfo*)stack_pDependencyInfo;
1625 reservedunmarshal_VkDependencyInfo(readStream, VK_STRUCTURE_TYPE_MAX_ENUM,
1626 (VkDependencyInfo*)(pDependencyInfo),
1627 readStreamPtrPtr);
1628 if (pDependencyInfo) {
1629 transform_tohost_VkDependencyInfo(globalstate,
1630 (VkDependencyInfo*)(pDependencyInfo));
1631 }
1632 vk->vkCmdPipelineBarrier2((VkCommandBuffer)dispatchHandle, pDependencyInfo);
1633 android::base::endTrace();
1634 break;
1635 }
1636 case OP_vkCmdWriteTimestamp2: {
1637 android::base::beginTrace("vkCmdWriteTimestamp2 subdecode");
1638 VkPipelineStageFlags2 stage;
1639 VkQueryPool queryPool;
1640 uint32_t query;
1641 memcpy((VkPipelineStageFlags2*)&stage, *readStreamPtrPtr,
1642 sizeof(VkPipelineStageFlags2));
1643 *readStreamPtrPtr += sizeof(VkPipelineStageFlags2);
1644 uint64_t cgen_var_0;
1645 memcpy((uint64_t*)&cgen_var_0, *readStreamPtrPtr, 1 * 8);
1646 *readStreamPtrPtr += 1 * 8;
1647 *(VkQueryPool*)&queryPool =
1648 (VkQueryPool)unbox_VkQueryPool((VkQueryPool)(*&cgen_var_0));
1649 memcpy((uint32_t*)&query, *readStreamPtrPtr, sizeof(uint32_t));
1650 *readStreamPtrPtr += sizeof(uint32_t);
1651 vk->vkCmdWriteTimestamp2((VkCommandBuffer)dispatchHandle, stage, queryPool, query);
1652 android::base::endTrace();
1653 break;
1654 }
1655 case OP_vkCmdCopyBuffer2: {
1656 android::base::beginTrace("vkCmdCopyBuffer2 subdecode");
1657 const VkCopyBufferInfo2* pCopyBufferInfo;
1658 VkCopyBufferInfo2 stack_pCopyBufferInfo[1];
1659 pCopyBufferInfo = (VkCopyBufferInfo2*)stack_pCopyBufferInfo;
1660 reservedunmarshal_VkCopyBufferInfo2(readStream, VK_STRUCTURE_TYPE_MAX_ENUM,
1661 (VkCopyBufferInfo2*)(pCopyBufferInfo),
1662 readStreamPtrPtr);
1663 if (pCopyBufferInfo) {
1664 transform_tohost_VkCopyBufferInfo2(globalstate,
1665 (VkCopyBufferInfo2*)(pCopyBufferInfo));
1666 }
1667 vk->vkCmdCopyBuffer2((VkCommandBuffer)dispatchHandle, pCopyBufferInfo);
1668 android::base::endTrace();
1669 break;
1670 }
1671 case OP_vkCmdCopyImage2: {
1672 android::base::beginTrace("vkCmdCopyImage2 subdecode");
1673 const VkCopyImageInfo2* pCopyImageInfo;
1674 VkCopyImageInfo2 stack_pCopyImageInfo[1];
1675 pCopyImageInfo = (VkCopyImageInfo2*)stack_pCopyImageInfo;
1676 reservedunmarshal_VkCopyImageInfo2(readStream, VK_STRUCTURE_TYPE_MAX_ENUM,
1677 (VkCopyImageInfo2*)(pCopyImageInfo),
1678 readStreamPtrPtr);
1679 if (pCopyImageInfo) {
1680 transform_tohost_VkCopyImageInfo2(globalstate,
1681 (VkCopyImageInfo2*)(pCopyImageInfo));
1682 }
1683 this->on_vkCmdCopyImage2(pool, (VkCommandBuffer)(boxed_dispatchHandle),
1684 pCopyImageInfo);
1685 android::base::endTrace();
1686 break;
1687 }
1688 case OP_vkCmdCopyBufferToImage2: {
1689 android::base::beginTrace("vkCmdCopyBufferToImage2 subdecode");
1690 const VkCopyBufferToImageInfo2* pCopyBufferToImageInfo;
1691 VkCopyBufferToImageInfo2 stack_pCopyBufferToImageInfo[1];
1692 pCopyBufferToImageInfo = (VkCopyBufferToImageInfo2*)stack_pCopyBufferToImageInfo;
1693 reservedunmarshal_VkCopyBufferToImageInfo2(
1694 readStream, VK_STRUCTURE_TYPE_MAX_ENUM,
1695 (VkCopyBufferToImageInfo2*)(pCopyBufferToImageInfo), readStreamPtrPtr);
1696 if (pCopyBufferToImageInfo) {
1697 transform_tohost_VkCopyBufferToImageInfo2(
1698 globalstate, (VkCopyBufferToImageInfo2*)(pCopyBufferToImageInfo));
1699 }
1700 this->on_vkCmdCopyBufferToImage2(pool, (VkCommandBuffer)(boxed_dispatchHandle),
1701 pCopyBufferToImageInfo, context);
1702 android::base::endTrace();
1703 break;
1704 }
1705 case OP_vkCmdCopyImageToBuffer2: {
1706 android::base::beginTrace("vkCmdCopyImageToBuffer2 subdecode");
1707 const VkCopyImageToBufferInfo2* pCopyImageToBufferInfo;
1708 VkCopyImageToBufferInfo2 stack_pCopyImageToBufferInfo[1];
1709 pCopyImageToBufferInfo = (VkCopyImageToBufferInfo2*)stack_pCopyImageToBufferInfo;
1710 reservedunmarshal_VkCopyImageToBufferInfo2(
1711 readStream, VK_STRUCTURE_TYPE_MAX_ENUM,
1712 (VkCopyImageToBufferInfo2*)(pCopyImageToBufferInfo), readStreamPtrPtr);
1713 if (pCopyImageToBufferInfo) {
1714 transform_tohost_VkCopyImageToBufferInfo2(
1715 globalstate, (VkCopyImageToBufferInfo2*)(pCopyImageToBufferInfo));
1716 }
1717 this->on_vkCmdCopyImageToBuffer2(pool, (VkCommandBuffer)(boxed_dispatchHandle),
1718 pCopyImageToBufferInfo);
1719 android::base::endTrace();
1720 break;
1721 }
1722 case OP_vkCmdBlitImage2: {
1723 android::base::beginTrace("vkCmdBlitImage2 subdecode");
1724 const VkBlitImageInfo2* pBlitImageInfo;
1725 VkBlitImageInfo2 stack_pBlitImageInfo[1];
1726 pBlitImageInfo = (VkBlitImageInfo2*)stack_pBlitImageInfo;
1727 reservedunmarshal_VkBlitImageInfo2(readStream, VK_STRUCTURE_TYPE_MAX_ENUM,
1728 (VkBlitImageInfo2*)(pBlitImageInfo),
1729 readStreamPtrPtr);
1730 if (pBlitImageInfo) {
1731 transform_tohost_VkBlitImageInfo2(globalstate,
1732 (VkBlitImageInfo2*)(pBlitImageInfo));
1733 }
1734 vk->vkCmdBlitImage2((VkCommandBuffer)dispatchHandle, pBlitImageInfo);
1735 android::base::endTrace();
1736 break;
1737 }
1738 case OP_vkCmdResolveImage2: {
1739 android::base::beginTrace("vkCmdResolveImage2 subdecode");
1740 const VkResolveImageInfo2* pResolveImageInfo;
1741 VkResolveImageInfo2 stack_pResolveImageInfo[1];
1742 pResolveImageInfo = (VkResolveImageInfo2*)stack_pResolveImageInfo;
1743 reservedunmarshal_VkResolveImageInfo2(readStream, VK_STRUCTURE_TYPE_MAX_ENUM,
1744 (VkResolveImageInfo2*)(pResolveImageInfo),
1745 readStreamPtrPtr);
1746 if (pResolveImageInfo) {
1747 transform_tohost_VkResolveImageInfo2(globalstate,
1748 (VkResolveImageInfo2*)(pResolveImageInfo));
1749 }
1750 vk->vkCmdResolveImage2((VkCommandBuffer)dispatchHandle, pResolveImageInfo);
1751 android::base::endTrace();
1752 break;
1753 }
1754 case OP_vkCmdBeginRendering: {
1755 android::base::beginTrace("vkCmdBeginRendering subdecode");
1756 const VkRenderingInfo* pRenderingInfo;
1757 VkRenderingInfo stack_pRenderingInfo[1];
1758 pRenderingInfo = (VkRenderingInfo*)stack_pRenderingInfo;
1759 reservedunmarshal_VkRenderingInfo(readStream, VK_STRUCTURE_TYPE_MAX_ENUM,
1760 (VkRenderingInfo*)(pRenderingInfo),
1761 readStreamPtrPtr);
1762 if (pRenderingInfo) {
1763 transform_tohost_VkRenderingInfo(globalstate,
1764 (VkRenderingInfo*)(pRenderingInfo));
1765 }
1766 vk->vkCmdBeginRendering((VkCommandBuffer)dispatchHandle, pRenderingInfo);
1767 android::base::endTrace();
1768 break;
1769 }
1770 case OP_vkCmdEndRendering: {
1771 android::base::beginTrace("vkCmdEndRendering subdecode");
1772 vk->vkCmdEndRendering((VkCommandBuffer)dispatchHandle);
1773 android::base::endTrace();
1774 break;
1775 }
1776 case OP_vkCmdSetCullMode: {
1777 android::base::beginTrace("vkCmdSetCullMode subdecode");
1778 VkCullModeFlags cullMode;
1779 memcpy((VkCullModeFlags*)&cullMode, *readStreamPtrPtr, sizeof(VkCullModeFlags));
1780 *readStreamPtrPtr += sizeof(VkCullModeFlags);
1781 vk->vkCmdSetCullMode((VkCommandBuffer)dispatchHandle, cullMode);
1782 android::base::endTrace();
1783 break;
1784 }
1785 case OP_vkCmdSetFrontFace: {
1786 android::base::beginTrace("vkCmdSetFrontFace subdecode");
1787 VkFrontFace frontFace;
1788 memcpy((VkFrontFace*)&frontFace, *readStreamPtrPtr, sizeof(VkFrontFace));
1789 *readStreamPtrPtr += sizeof(VkFrontFace);
1790 vk->vkCmdSetFrontFace((VkCommandBuffer)dispatchHandle, frontFace);
1791 android::base::endTrace();
1792 break;
1793 }
1794 case OP_vkCmdSetPrimitiveTopology: {
1795 android::base::beginTrace("vkCmdSetPrimitiveTopology subdecode");
1796 VkPrimitiveTopology primitiveTopology;
1797 memcpy((VkPrimitiveTopology*)&primitiveTopology, *readStreamPtrPtr,
1798 sizeof(VkPrimitiveTopology));
1799 *readStreamPtrPtr += sizeof(VkPrimitiveTopology);
1800 vk->vkCmdSetPrimitiveTopology((VkCommandBuffer)dispatchHandle, primitiveTopology);
1801 android::base::endTrace();
1802 break;
1803 }
1804 case OP_vkCmdSetViewportWithCount: {
1805 android::base::beginTrace("vkCmdSetViewportWithCount subdecode");
1806 uint32_t viewportCount;
1807 const VkViewport* pViewports;
1808 VkViewport stack_pViewports[MAX_STACK_ITEMS];
1809 memcpy((uint32_t*)&viewportCount, *readStreamPtrPtr, sizeof(uint32_t));
1810 *readStreamPtrPtr += sizeof(uint32_t);
1811 if (((viewportCount)) <= MAX_STACK_ITEMS) {
1812 pViewports = (VkViewport*)stack_pViewports;
1813 } else {
1814 readStream->alloc((void**)&pViewports,
1815 ((viewportCount)) * sizeof(const VkViewport));
1816 }
1817 for (uint32_t i = 0; i < (uint32_t)((viewportCount)); ++i) {
1818 reservedunmarshal_VkViewport(readStream, VK_STRUCTURE_TYPE_MAX_ENUM,
1819 (VkViewport*)(pViewports + i), readStreamPtrPtr);
1820 }
1821 if (pViewports) {
1822 for (uint32_t i = 0; i < (uint32_t)((viewportCount)); ++i) {
1823 transform_tohost_VkViewport(globalstate, (VkViewport*)(pViewports + i));
1824 }
1825 }
1826 vk->vkCmdSetViewportWithCount((VkCommandBuffer)dispatchHandle, viewportCount,
1827 pViewports);
1828 android::base::endTrace();
1829 break;
1830 }
1831 case OP_vkCmdSetScissorWithCount: {
1832 android::base::beginTrace("vkCmdSetScissorWithCount subdecode");
1833 uint32_t scissorCount;
1834 const VkRect2D* pScissors;
1835 VkRect2D stack_pScissors[MAX_STACK_ITEMS];
1836 memcpy((uint32_t*)&scissorCount, *readStreamPtrPtr, sizeof(uint32_t));
1837 *readStreamPtrPtr += sizeof(uint32_t);
1838 if (((scissorCount)) <= MAX_STACK_ITEMS) {
1839 pScissors = (VkRect2D*)stack_pScissors;
1840 } else {
1841 readStream->alloc((void**)&pScissors,
1842 ((scissorCount)) * sizeof(const VkRect2D));
1843 }
1844 for (uint32_t i = 0; i < (uint32_t)((scissorCount)); ++i) {
1845 reservedunmarshal_VkRect2D(readStream, VK_STRUCTURE_TYPE_MAX_ENUM,
1846 (VkRect2D*)(pScissors + i), readStreamPtrPtr);
1847 }
1848 if (pScissors) {
1849 for (uint32_t i = 0; i < (uint32_t)((scissorCount)); ++i) {
1850 transform_tohost_VkRect2D(globalstate, (VkRect2D*)(pScissors + i));
1851 }
1852 }
1853 vk->vkCmdSetScissorWithCount((VkCommandBuffer)dispatchHandle, scissorCount,
1854 pScissors);
1855 android::base::endTrace();
1856 break;
1857 }
1858 case OP_vkCmdBindVertexBuffers2: {
1859 android::base::beginTrace("vkCmdBindVertexBuffers2 subdecode");
1860 uint32_t firstBinding;
1861 uint32_t bindingCount;
1862 const VkBuffer* pBuffers;
1863 VkBuffer stack_pBuffers[MAX_STACK_ITEMS];
1864 const VkDeviceSize* pOffsets;
1865 VkDeviceSize stack_pOffsets[MAX_STACK_ITEMS];
1866 const VkDeviceSize* pSizes;
1867 VkDeviceSize stack_pSizes[MAX_STACK_ITEMS];
1868 const VkDeviceSize* pStrides;
1869 VkDeviceSize stack_pStrides[MAX_STACK_ITEMS];
1870 memcpy((uint32_t*)&firstBinding, *readStreamPtrPtr, sizeof(uint32_t));
1871 *readStreamPtrPtr += sizeof(uint32_t);
1872 memcpy((uint32_t*)&bindingCount, *readStreamPtrPtr, sizeof(uint32_t));
1873 *readStreamPtrPtr += sizeof(uint32_t);
1874 // WARNING PTR CHECK
1875 memcpy((VkBuffer**)&pBuffers, (*readStreamPtrPtr), 8);
1876 android::base::Stream::fromBe64((uint8_t*)&pBuffers);
1877 *readStreamPtrPtr += 8;
1878 if (pBuffers) {
1879 if (((bindingCount)) <= MAX_STACK_ITEMS) {
1880 pBuffers = (VkBuffer*)stack_pBuffers;
1881 } else {
1882 readStream->alloc((void**)&pBuffers,
1883 ((bindingCount)) * sizeof(const VkBuffer));
1884 }
1885 if (((bindingCount))) {
1886 uint8_t* cgen_var_0_0_ptr = (uint8_t*)(*readStreamPtrPtr);
1887 *readStreamPtrPtr += 8 * ((bindingCount));
1888 for (uint32_t k = 0; k < ((bindingCount)); ++k) {
1889 uint64_t tmpval;
1890 memcpy(&tmpval, cgen_var_0_0_ptr + k * 8, sizeof(uint64_t));
1891 *(((VkBuffer*)pBuffers) + k) =
1892 (VkBuffer)unbox_VkBuffer((VkBuffer)tmpval);
1893 }
1894 }
1895 }
1896 if (((bindingCount)) <= MAX_STACK_ITEMS) {
1897 pOffsets = (VkDeviceSize*)stack_pOffsets;
1898 } else {
1899 readStream->alloc((void**)&pOffsets,
1900 ((bindingCount)) * sizeof(const VkDeviceSize));
1901 }
1902 memcpy((VkDeviceSize*)pOffsets, *readStreamPtrPtr,
1903 ((bindingCount)) * sizeof(const VkDeviceSize));
1904 *readStreamPtrPtr += ((bindingCount)) * sizeof(const VkDeviceSize);
1905 // WARNING PTR CHECK
1906 memcpy((VkDeviceSize**)&pSizes, (*readStreamPtrPtr), 8);
1907 android::base::Stream::fromBe64((uint8_t*)&pSizes);
1908 *readStreamPtrPtr += 8;
1909 if (pSizes) {
1910 if (((bindingCount)) <= MAX_STACK_ITEMS) {
1911 pSizes = (VkDeviceSize*)stack_pSizes;
1912 } else {
1913 readStream->alloc((void**)&pSizes,
1914 ((bindingCount)) * sizeof(const VkDeviceSize));
1915 }
1916 memcpy((VkDeviceSize*)pSizes, *readStreamPtrPtr,
1917 ((bindingCount)) * sizeof(const VkDeviceSize));
1918 *readStreamPtrPtr += ((bindingCount)) * sizeof(const VkDeviceSize);
1919 }
1920 // WARNING PTR CHECK
1921 memcpy((VkDeviceSize**)&pStrides, (*readStreamPtrPtr), 8);
1922 android::base::Stream::fromBe64((uint8_t*)&pStrides);
1923 *readStreamPtrPtr += 8;
1924 if (pStrides) {
1925 if (((bindingCount)) <= MAX_STACK_ITEMS) {
1926 pStrides = (VkDeviceSize*)stack_pStrides;
1927 } else {
1928 readStream->alloc((void**)&pStrides,
1929 ((bindingCount)) * sizeof(const VkDeviceSize));
1930 }
1931 memcpy((VkDeviceSize*)pStrides, *readStreamPtrPtr,
1932 ((bindingCount)) * sizeof(const VkDeviceSize));
1933 *readStreamPtrPtr += ((bindingCount)) * sizeof(const VkDeviceSize);
1934 }
1935 vk->vkCmdBindVertexBuffers2((VkCommandBuffer)dispatchHandle, firstBinding,
1936 bindingCount, pBuffers, pOffsets, pSizes, pStrides);
1937 android::base::endTrace();
1938 break;
1939 }
1940 case OP_vkCmdSetDepthTestEnable: {
1941 android::base::beginTrace("vkCmdSetDepthTestEnable subdecode");
1942 VkBool32 depthTestEnable;
1943 memcpy((VkBool32*)&depthTestEnable, *readStreamPtrPtr, sizeof(VkBool32));
1944 *readStreamPtrPtr += sizeof(VkBool32);
1945 vk->vkCmdSetDepthTestEnable((VkCommandBuffer)dispatchHandle, depthTestEnable);
1946 android::base::endTrace();
1947 break;
1948 }
1949 case OP_vkCmdSetDepthWriteEnable: {
1950 android::base::beginTrace("vkCmdSetDepthWriteEnable subdecode");
1951 VkBool32 depthWriteEnable;
1952 memcpy((VkBool32*)&depthWriteEnable, *readStreamPtrPtr, sizeof(VkBool32));
1953 *readStreamPtrPtr += sizeof(VkBool32);
1954 vk->vkCmdSetDepthWriteEnable((VkCommandBuffer)dispatchHandle, depthWriteEnable);
1955 android::base::endTrace();
1956 break;
1957 }
1958 case OP_vkCmdSetDepthCompareOp: {
1959 android::base::beginTrace("vkCmdSetDepthCompareOp subdecode");
1960 VkCompareOp depthCompareOp;
1961 memcpy((VkCompareOp*)&depthCompareOp, *readStreamPtrPtr, sizeof(VkCompareOp));
1962 *readStreamPtrPtr += sizeof(VkCompareOp);
1963 vk->vkCmdSetDepthCompareOp((VkCommandBuffer)dispatchHandle, depthCompareOp);
1964 android::base::endTrace();
1965 break;
1966 }
1967 case OP_vkCmdSetDepthBoundsTestEnable: {
1968 android::base::beginTrace("vkCmdSetDepthBoundsTestEnable subdecode");
1969 VkBool32 depthBoundsTestEnable;
1970 memcpy((VkBool32*)&depthBoundsTestEnable, *readStreamPtrPtr, sizeof(VkBool32));
1971 *readStreamPtrPtr += sizeof(VkBool32);
1972 vk->vkCmdSetDepthBoundsTestEnable((VkCommandBuffer)dispatchHandle,
1973 depthBoundsTestEnable);
1974 android::base::endTrace();
1975 break;
1976 }
1977 case OP_vkCmdSetStencilTestEnable: {
1978 android::base::beginTrace("vkCmdSetStencilTestEnable subdecode");
1979 VkBool32 stencilTestEnable;
1980 memcpy((VkBool32*)&stencilTestEnable, *readStreamPtrPtr, sizeof(VkBool32));
1981 *readStreamPtrPtr += sizeof(VkBool32);
1982 vk->vkCmdSetStencilTestEnable((VkCommandBuffer)dispatchHandle, stencilTestEnable);
1983 android::base::endTrace();
1984 break;
1985 }
1986 case OP_vkCmdSetStencilOp: {
1987 android::base::beginTrace("vkCmdSetStencilOp subdecode");
1988 VkStencilFaceFlags faceMask;
1989 VkStencilOp failOp;
1990 VkStencilOp passOp;
1991 VkStencilOp depthFailOp;
1992 VkCompareOp compareOp;
1993 memcpy((VkStencilFaceFlags*)&faceMask, *readStreamPtrPtr,
1994 sizeof(VkStencilFaceFlags));
1995 *readStreamPtrPtr += sizeof(VkStencilFaceFlags);
1996 memcpy((VkStencilOp*)&failOp, *readStreamPtrPtr, sizeof(VkStencilOp));
1997 *readStreamPtrPtr += sizeof(VkStencilOp);
1998 memcpy((VkStencilOp*)&passOp, *readStreamPtrPtr, sizeof(VkStencilOp));
1999 *readStreamPtrPtr += sizeof(VkStencilOp);
2000 memcpy((VkStencilOp*)&depthFailOp, *readStreamPtrPtr, sizeof(VkStencilOp));
2001 *readStreamPtrPtr += sizeof(VkStencilOp);
2002 memcpy((VkCompareOp*)&compareOp, *readStreamPtrPtr, sizeof(VkCompareOp));
2003 *readStreamPtrPtr += sizeof(VkCompareOp);
2004 vk->vkCmdSetStencilOp((VkCommandBuffer)dispatchHandle, faceMask, failOp, passOp,
2005 depthFailOp, compareOp);
2006 android::base::endTrace();
2007 break;
2008 }
2009 case OP_vkCmdSetRasterizerDiscardEnable: {
2010 android::base::beginTrace("vkCmdSetRasterizerDiscardEnable subdecode");
2011 VkBool32 rasterizerDiscardEnable;
2012 memcpy((VkBool32*)&rasterizerDiscardEnable, *readStreamPtrPtr, sizeof(VkBool32));
2013 *readStreamPtrPtr += sizeof(VkBool32);
2014 vk->vkCmdSetRasterizerDiscardEnable((VkCommandBuffer)dispatchHandle,
2015 rasterizerDiscardEnable);
2016 android::base::endTrace();
2017 break;
2018 }
2019 case OP_vkCmdSetDepthBiasEnable: {
2020 android::base::beginTrace("vkCmdSetDepthBiasEnable subdecode");
2021 VkBool32 depthBiasEnable;
2022 memcpy((VkBool32*)&depthBiasEnable, *readStreamPtrPtr, sizeof(VkBool32));
2023 *readStreamPtrPtr += sizeof(VkBool32);
2024 vk->vkCmdSetDepthBiasEnable((VkCommandBuffer)dispatchHandle, depthBiasEnable);
2025 android::base::endTrace();
2026 break;
2027 }
2028 case OP_vkCmdSetPrimitiveRestartEnable: {
2029 android::base::beginTrace("vkCmdSetPrimitiveRestartEnable subdecode");
2030 VkBool32 primitiveRestartEnable;
2031 memcpy((VkBool32*)&primitiveRestartEnable, *readStreamPtrPtr, sizeof(VkBool32));
2032 *readStreamPtrPtr += sizeof(VkBool32);
2033 vk->vkCmdSetPrimitiveRestartEnable((VkCommandBuffer)dispatchHandle,
2034 primitiveRestartEnable);
2035 android::base::endTrace();
2036 break;
2037 }
2038 #endif
2039 #ifdef VK_KHR_surface
2040 #endif
2041 #ifdef VK_KHR_swapchain
2042 #endif
2043 #ifdef VK_KHR_xcb_surface
2044 #endif
2045 #ifdef VK_KHR_android_surface
2046 #endif
2047 #ifdef VK_KHR_win32_surface
2048 #endif
2049 #ifdef VK_KHR_dynamic_rendering
2050 case OP_vkCmdBeginRenderingKHR: {
2051 android::base::beginTrace("vkCmdBeginRenderingKHR subdecode");
2052 const VkRenderingInfo* pRenderingInfo;
2053 VkRenderingInfo stack_pRenderingInfo[1];
2054 pRenderingInfo = (VkRenderingInfo*)stack_pRenderingInfo;
2055 reservedunmarshal_VkRenderingInfo(readStream, VK_STRUCTURE_TYPE_MAX_ENUM,
2056 (VkRenderingInfo*)(pRenderingInfo),
2057 readStreamPtrPtr);
2058 if (pRenderingInfo) {
2059 transform_tohost_VkRenderingInfo(globalstate,
2060 (VkRenderingInfo*)(pRenderingInfo));
2061 }
2062 vk->vkCmdBeginRenderingKHR((VkCommandBuffer)dispatchHandle, pRenderingInfo);
2063 android::base::endTrace();
2064 break;
2065 }
2066 case OP_vkCmdEndRenderingKHR: {
2067 android::base::beginTrace("vkCmdEndRenderingKHR subdecode");
2068 vk->vkCmdEndRenderingKHR((VkCommandBuffer)dispatchHandle);
2069 android::base::endTrace();
2070 break;
2071 }
2072 #endif
2073 #ifdef VK_KHR_get_physical_device_properties2
2074 #endif
2075 #ifdef VK_KHR_maintenance1
2076 #endif
2077 #ifdef VK_KHR_external_memory_capabilities
2078 #endif
2079 #ifdef VK_KHR_external_memory
2080 #endif
2081 #ifdef VK_KHR_external_memory_win32
2082 #endif
2083 #ifdef VK_KHR_external_memory_fd
2084 #endif
2085 #ifdef VK_KHR_external_semaphore_capabilities
2086 #endif
2087 #ifdef VK_KHR_external_semaphore
2088 #endif
2089 #ifdef VK_KHR_external_semaphore_win32
2090 #endif
2091 #ifdef VK_KHR_external_semaphore_fd
2092 #endif
2093 #ifdef VK_KHR_shader_float16_int8
2094 #endif
2095 #ifdef VK_KHR_incremental_present
2096 #endif
2097 #ifdef VK_KHR_descriptor_update_template
2098 #endif
2099 #ifdef VK_KHR_imageless_framebuffer
2100 #endif
2101 #ifdef VK_KHR_create_renderpass2
2102 case OP_vkCmdBeginRenderPass2KHR: {
2103 android::base::beginTrace("vkCmdBeginRenderPass2KHR subdecode");
2104 const VkRenderPassBeginInfo* pRenderPassBegin;
2105 VkRenderPassBeginInfo stack_pRenderPassBegin[1];
2106 const VkSubpassBeginInfo* pSubpassBeginInfo;
2107 VkSubpassBeginInfo stack_pSubpassBeginInfo[1];
2108 pRenderPassBegin = (VkRenderPassBeginInfo*)stack_pRenderPassBegin;
2109 reservedunmarshal_VkRenderPassBeginInfo(readStream, VK_STRUCTURE_TYPE_MAX_ENUM,
2110 (VkRenderPassBeginInfo*)(pRenderPassBegin),
2111 readStreamPtrPtr);
2112 pSubpassBeginInfo = (VkSubpassBeginInfo*)stack_pSubpassBeginInfo;
2113 reservedunmarshal_VkSubpassBeginInfo(readStream, VK_STRUCTURE_TYPE_MAX_ENUM,
2114 (VkSubpassBeginInfo*)(pSubpassBeginInfo),
2115 readStreamPtrPtr);
2116 if (pRenderPassBegin) {
2117 transform_tohost_VkRenderPassBeginInfo(
2118 globalstate, (VkRenderPassBeginInfo*)(pRenderPassBegin));
2119 }
2120 if (pSubpassBeginInfo) {
2121 transform_tohost_VkSubpassBeginInfo(globalstate,
2122 (VkSubpassBeginInfo*)(pSubpassBeginInfo));
2123 }
2124 this->on_vkCmdBeginRenderPass2KHR(pool, (VkCommandBuffer)(boxed_dispatchHandle),
2125 pRenderPassBegin, pSubpassBeginInfo);
2126 android::base::endTrace();
2127 break;
2128 }
2129 case OP_vkCmdNextSubpass2KHR: {
2130 android::base::beginTrace("vkCmdNextSubpass2KHR subdecode");
2131 const VkSubpassBeginInfo* pSubpassBeginInfo;
2132 VkSubpassBeginInfo stack_pSubpassBeginInfo[1];
2133 const VkSubpassEndInfo* pSubpassEndInfo;
2134 VkSubpassEndInfo stack_pSubpassEndInfo[1];
2135 pSubpassBeginInfo = (VkSubpassBeginInfo*)stack_pSubpassBeginInfo;
2136 reservedunmarshal_VkSubpassBeginInfo(readStream, VK_STRUCTURE_TYPE_MAX_ENUM,
2137 (VkSubpassBeginInfo*)(pSubpassBeginInfo),
2138 readStreamPtrPtr);
2139 pSubpassEndInfo = (VkSubpassEndInfo*)stack_pSubpassEndInfo;
2140 reservedunmarshal_VkSubpassEndInfo(readStream, VK_STRUCTURE_TYPE_MAX_ENUM,
2141 (VkSubpassEndInfo*)(pSubpassEndInfo),
2142 readStreamPtrPtr);
2143 if (pSubpassBeginInfo) {
2144 transform_tohost_VkSubpassBeginInfo(globalstate,
2145 (VkSubpassBeginInfo*)(pSubpassBeginInfo));
2146 }
2147 if (pSubpassEndInfo) {
2148 transform_tohost_VkSubpassEndInfo(globalstate,
2149 (VkSubpassEndInfo*)(pSubpassEndInfo));
2150 }
2151 vk->vkCmdNextSubpass2KHR((VkCommandBuffer)dispatchHandle, pSubpassBeginInfo,
2152 pSubpassEndInfo);
2153 android::base::endTrace();
2154 break;
2155 }
2156 case OP_vkCmdEndRenderPass2KHR: {
2157 android::base::beginTrace("vkCmdEndRenderPass2KHR subdecode");
2158 const VkSubpassEndInfo* pSubpassEndInfo;
2159 VkSubpassEndInfo stack_pSubpassEndInfo[1];
2160 pSubpassEndInfo = (VkSubpassEndInfo*)stack_pSubpassEndInfo;
2161 reservedunmarshal_VkSubpassEndInfo(readStream, VK_STRUCTURE_TYPE_MAX_ENUM,
2162 (VkSubpassEndInfo*)(pSubpassEndInfo),
2163 readStreamPtrPtr);
2164 if (pSubpassEndInfo) {
2165 transform_tohost_VkSubpassEndInfo(globalstate,
2166 (VkSubpassEndInfo*)(pSubpassEndInfo));
2167 }
2168 vk->vkCmdEndRenderPass2KHR((VkCommandBuffer)dispatchHandle, pSubpassEndInfo);
2169 android::base::endTrace();
2170 break;
2171 }
2172 #endif
2173 #ifdef VK_KHR_external_fence_capabilities
2174 #endif
2175 #ifdef VK_KHR_external_fence
2176 #endif
2177 #ifdef VK_KHR_external_fence_fd
2178 #endif
2179 #ifdef VK_KHR_maintenance2
2180 #endif
2181 #ifdef VK_KHR_dedicated_allocation
2182 #endif
2183 #ifdef VK_KHR_storage_buffer_storage_class
2184 #endif
2185 #ifdef VK_KHR_get_memory_requirements2
2186 #endif
2187 #ifdef VK_KHR_image_format_list
2188 #endif
2189 #ifdef VK_KHR_sampler_ycbcr_conversion
2190 #endif
2191 #ifdef VK_KHR_bind_memory2
2192 #endif
2193 #ifdef VK_KHR_maintenance3
2194 #endif
2195 #ifdef VK_KHR_shader_subgroup_extended_types
2196 #endif
2197 #ifdef VK_KHR_vulkan_memory_model
2198 #endif
2199 #ifdef VK_KHR_shader_terminate_invocation
2200 #endif
2201 #ifdef VK_KHR_buffer_device_address
2202 #endif
2203 #ifdef VK_KHR_pipeline_executable_properties
2204 #endif
2205 #ifdef VK_KHR_shader_integer_dot_product
2206 #endif
2207 #ifdef VK_KHR_shader_non_semantic_info
2208 #endif
2209 #ifdef VK_KHR_synchronization2
2210 case OP_vkCmdSetEvent2KHR: {
2211 android::base::beginTrace("vkCmdSetEvent2KHR subdecode");
2212 VkEvent event;
2213 const VkDependencyInfo* pDependencyInfo;
2214 VkDependencyInfo stack_pDependencyInfo[1];
2215 uint64_t cgen_var_0;
2216 memcpy((uint64_t*)&cgen_var_0, *readStreamPtrPtr, 1 * 8);
2217 *readStreamPtrPtr += 1 * 8;
2218 *(VkEvent*)&event = (VkEvent)unbox_VkEvent((VkEvent)(*&cgen_var_0));
2219 pDependencyInfo = (VkDependencyInfo*)stack_pDependencyInfo;
2220 reservedunmarshal_VkDependencyInfo(readStream, VK_STRUCTURE_TYPE_MAX_ENUM,
2221 (VkDependencyInfo*)(pDependencyInfo),
2222 readStreamPtrPtr);
2223 if (pDependencyInfo) {
2224 transform_tohost_VkDependencyInfo(globalstate,
2225 (VkDependencyInfo*)(pDependencyInfo));
2226 }
2227 vk->vkCmdSetEvent2KHR((VkCommandBuffer)dispatchHandle, event, pDependencyInfo);
2228 android::base::endTrace();
2229 break;
2230 }
2231 case OP_vkCmdResetEvent2KHR: {
2232 android::base::beginTrace("vkCmdResetEvent2KHR subdecode");
2233 VkEvent event;
2234 VkPipelineStageFlags2 stageMask;
2235 uint64_t cgen_var_0;
2236 memcpy((uint64_t*)&cgen_var_0, *readStreamPtrPtr, 1 * 8);
2237 *readStreamPtrPtr += 1 * 8;
2238 *(VkEvent*)&event = (VkEvent)unbox_VkEvent((VkEvent)(*&cgen_var_0));
2239 memcpy((VkPipelineStageFlags2*)&stageMask, *readStreamPtrPtr,
2240 sizeof(VkPipelineStageFlags2));
2241 *readStreamPtrPtr += sizeof(VkPipelineStageFlags2);
2242 vk->vkCmdResetEvent2KHR((VkCommandBuffer)dispatchHandle, event, stageMask);
2243 android::base::endTrace();
2244 break;
2245 }
2246 case OP_vkCmdWaitEvents2KHR: {
2247 android::base::beginTrace("vkCmdWaitEvents2KHR subdecode");
2248 uint32_t eventCount;
2249 const VkEvent* pEvents;
2250 VkEvent stack_pEvents[MAX_STACK_ITEMS];
2251 const VkDependencyInfo* pDependencyInfos;
2252 VkDependencyInfo stack_pDependencyInfos[MAX_STACK_ITEMS];
2253 memcpy((uint32_t*)&eventCount, *readStreamPtrPtr, sizeof(uint32_t));
2254 *readStreamPtrPtr += sizeof(uint32_t);
2255 if (((eventCount)) <= MAX_STACK_ITEMS) {
2256 pEvents = (VkEvent*)stack_pEvents;
2257 } else {
2258 readStream->alloc((void**)&pEvents, ((eventCount)) * sizeof(const VkEvent));
2259 }
2260 if (((eventCount))) {
2261 uint8_t* cgen_var_0_ptr = (uint8_t*)(*readStreamPtrPtr);
2262 *readStreamPtrPtr += 8 * ((eventCount));
2263 for (uint32_t k = 0; k < ((eventCount)); ++k) {
2264 uint64_t tmpval;
2265 memcpy(&tmpval, cgen_var_0_ptr + k * 8, sizeof(uint64_t));
2266 *(((VkEvent*)pEvents) + k) = (VkEvent)unbox_VkEvent((VkEvent)tmpval);
2267 }
2268 }
2269 if (((eventCount)) <= MAX_STACK_ITEMS) {
2270 pDependencyInfos = (VkDependencyInfo*)stack_pDependencyInfos;
2271 } else {
2272 readStream->alloc((void**)&pDependencyInfos,
2273 ((eventCount)) * sizeof(const VkDependencyInfo));
2274 }
2275 for (uint32_t i = 0; i < (uint32_t)((eventCount)); ++i) {
2276 reservedunmarshal_VkDependencyInfo(readStream, VK_STRUCTURE_TYPE_MAX_ENUM,
2277 (VkDependencyInfo*)(pDependencyInfos + i),
2278 readStreamPtrPtr);
2279 }
2280 if (pDependencyInfos) {
2281 for (uint32_t i = 0; i < (uint32_t)((eventCount)); ++i) {
2282 transform_tohost_VkDependencyInfo(
2283 globalstate, (VkDependencyInfo*)(pDependencyInfos + i));
2284 }
2285 }
2286 vk->vkCmdWaitEvents2KHR((VkCommandBuffer)dispatchHandle, eventCount, pEvents,
2287 pDependencyInfos);
2288 android::base::endTrace();
2289 break;
2290 }
2291 case OP_vkCmdPipelineBarrier2KHR: {
2292 android::base::beginTrace("vkCmdPipelineBarrier2KHR subdecode");
2293 const VkDependencyInfo* pDependencyInfo;
2294 VkDependencyInfo stack_pDependencyInfo[1];
2295 pDependencyInfo = (VkDependencyInfo*)stack_pDependencyInfo;
2296 reservedunmarshal_VkDependencyInfo(readStream, VK_STRUCTURE_TYPE_MAX_ENUM,
2297 (VkDependencyInfo*)(pDependencyInfo),
2298 readStreamPtrPtr);
2299 if (pDependencyInfo) {
2300 transform_tohost_VkDependencyInfo(globalstate,
2301 (VkDependencyInfo*)(pDependencyInfo));
2302 }
2303 vk->vkCmdPipelineBarrier2KHR((VkCommandBuffer)dispatchHandle, pDependencyInfo);
2304 android::base::endTrace();
2305 break;
2306 }
2307 case OP_vkCmdWriteTimestamp2KHR: {
2308 android::base::beginTrace("vkCmdWriteTimestamp2KHR subdecode");
2309 VkPipelineStageFlags2 stage;
2310 VkQueryPool queryPool;
2311 uint32_t query;
2312 memcpy((VkPipelineStageFlags2*)&stage, *readStreamPtrPtr,
2313 sizeof(VkPipelineStageFlags2));
2314 *readStreamPtrPtr += sizeof(VkPipelineStageFlags2);
2315 uint64_t cgen_var_0;
2316 memcpy((uint64_t*)&cgen_var_0, *readStreamPtrPtr, 1 * 8);
2317 *readStreamPtrPtr += 1 * 8;
2318 *(VkQueryPool*)&queryPool =
2319 (VkQueryPool)unbox_VkQueryPool((VkQueryPool)(*&cgen_var_0));
2320 memcpy((uint32_t*)&query, *readStreamPtrPtr, sizeof(uint32_t));
2321 *readStreamPtrPtr += sizeof(uint32_t);
2322 vk->vkCmdWriteTimestamp2KHR((VkCommandBuffer)dispatchHandle, stage, queryPool,
2323 query);
2324 android::base::endTrace();
2325 break;
2326 }
2327 case OP_vkCmdWriteBufferMarker2AMD: {
2328 android::base::beginTrace("vkCmdWriteBufferMarker2AMD subdecode");
2329 VkPipelineStageFlags2 stage;
2330 VkBuffer dstBuffer;
2331 VkDeviceSize dstOffset;
2332 uint32_t marker;
2333 memcpy((VkPipelineStageFlags2*)&stage, *readStreamPtrPtr,
2334 sizeof(VkPipelineStageFlags2));
2335 *readStreamPtrPtr += sizeof(VkPipelineStageFlags2);
2336 uint64_t cgen_var_0;
2337 memcpy((uint64_t*)&cgen_var_0, *readStreamPtrPtr, 1 * 8);
2338 *readStreamPtrPtr += 1 * 8;
2339 *(VkBuffer*)&dstBuffer = (VkBuffer)unbox_VkBuffer((VkBuffer)(*&cgen_var_0));
2340 memcpy((VkDeviceSize*)&dstOffset, *readStreamPtrPtr, sizeof(VkDeviceSize));
2341 *readStreamPtrPtr += sizeof(VkDeviceSize);
2342 memcpy((uint32_t*)&marker, *readStreamPtrPtr, sizeof(uint32_t));
2343 *readStreamPtrPtr += sizeof(uint32_t);
2344 vk->vkCmdWriteBufferMarker2AMD((VkCommandBuffer)dispatchHandle, stage, dstBuffer,
2345 dstOffset, marker);
2346 android::base::endTrace();
2347 break;
2348 }
2349 #endif
2350 #ifdef VK_KHR_zero_initialize_workgroup_memory
2351 #endif
2352 #ifdef VK_KHR_copy_commands2
2353 case OP_vkCmdCopyBuffer2KHR: {
2354 android::base::beginTrace("vkCmdCopyBuffer2KHR subdecode");
2355 const VkCopyBufferInfo2* pCopyBufferInfo;
2356 VkCopyBufferInfo2 stack_pCopyBufferInfo[1];
2357 pCopyBufferInfo = (VkCopyBufferInfo2*)stack_pCopyBufferInfo;
2358 reservedunmarshal_VkCopyBufferInfo2(readStream, VK_STRUCTURE_TYPE_MAX_ENUM,
2359 (VkCopyBufferInfo2*)(pCopyBufferInfo),
2360 readStreamPtrPtr);
2361 if (pCopyBufferInfo) {
2362 transform_tohost_VkCopyBufferInfo2(globalstate,
2363 (VkCopyBufferInfo2*)(pCopyBufferInfo));
2364 }
2365 vk->vkCmdCopyBuffer2KHR((VkCommandBuffer)dispatchHandle, pCopyBufferInfo);
2366 android::base::endTrace();
2367 break;
2368 }
2369 case OP_vkCmdCopyImage2KHR: {
2370 android::base::beginTrace("vkCmdCopyImage2KHR subdecode");
2371 const VkCopyImageInfo2* pCopyImageInfo;
2372 VkCopyImageInfo2 stack_pCopyImageInfo[1];
2373 pCopyImageInfo = (VkCopyImageInfo2*)stack_pCopyImageInfo;
2374 reservedunmarshal_VkCopyImageInfo2(readStream, VK_STRUCTURE_TYPE_MAX_ENUM,
2375 (VkCopyImageInfo2*)(pCopyImageInfo),
2376 readStreamPtrPtr);
2377 if (pCopyImageInfo) {
2378 transform_tohost_VkCopyImageInfo2(globalstate,
2379 (VkCopyImageInfo2*)(pCopyImageInfo));
2380 }
2381 this->on_vkCmdCopyImage2KHR(pool, (VkCommandBuffer)(boxed_dispatchHandle),
2382 pCopyImageInfo);
2383 android::base::endTrace();
2384 break;
2385 }
2386 case OP_vkCmdCopyBufferToImage2KHR: {
2387 android::base::beginTrace("vkCmdCopyBufferToImage2KHR subdecode");
2388 const VkCopyBufferToImageInfo2* pCopyBufferToImageInfo;
2389 VkCopyBufferToImageInfo2 stack_pCopyBufferToImageInfo[1];
2390 pCopyBufferToImageInfo = (VkCopyBufferToImageInfo2*)stack_pCopyBufferToImageInfo;
2391 reservedunmarshal_VkCopyBufferToImageInfo2(
2392 readStream, VK_STRUCTURE_TYPE_MAX_ENUM,
2393 (VkCopyBufferToImageInfo2*)(pCopyBufferToImageInfo), readStreamPtrPtr);
2394 if (pCopyBufferToImageInfo) {
2395 transform_tohost_VkCopyBufferToImageInfo2(
2396 globalstate, (VkCopyBufferToImageInfo2*)(pCopyBufferToImageInfo));
2397 }
2398 this->on_vkCmdCopyBufferToImage2KHR(pool, (VkCommandBuffer)(boxed_dispatchHandle),
2399 pCopyBufferToImageInfo, context);
2400 android::base::endTrace();
2401 break;
2402 }
2403 case OP_vkCmdCopyImageToBuffer2KHR: {
2404 android::base::beginTrace("vkCmdCopyImageToBuffer2KHR subdecode");
2405 const VkCopyImageToBufferInfo2* pCopyImageToBufferInfo;
2406 VkCopyImageToBufferInfo2 stack_pCopyImageToBufferInfo[1];
2407 pCopyImageToBufferInfo = (VkCopyImageToBufferInfo2*)stack_pCopyImageToBufferInfo;
2408 reservedunmarshal_VkCopyImageToBufferInfo2(
2409 readStream, VK_STRUCTURE_TYPE_MAX_ENUM,
2410 (VkCopyImageToBufferInfo2*)(pCopyImageToBufferInfo), readStreamPtrPtr);
2411 if (pCopyImageToBufferInfo) {
2412 transform_tohost_VkCopyImageToBufferInfo2(
2413 globalstate, (VkCopyImageToBufferInfo2*)(pCopyImageToBufferInfo));
2414 }
2415 this->on_vkCmdCopyImageToBuffer2KHR(pool, (VkCommandBuffer)(boxed_dispatchHandle),
2416 pCopyImageToBufferInfo);
2417 android::base::endTrace();
2418 break;
2419 }
2420 case OP_vkCmdBlitImage2KHR: {
2421 android::base::beginTrace("vkCmdBlitImage2KHR subdecode");
2422 const VkBlitImageInfo2* pBlitImageInfo;
2423 VkBlitImageInfo2 stack_pBlitImageInfo[1];
2424 pBlitImageInfo = (VkBlitImageInfo2*)stack_pBlitImageInfo;
2425 reservedunmarshal_VkBlitImageInfo2(readStream, VK_STRUCTURE_TYPE_MAX_ENUM,
2426 (VkBlitImageInfo2*)(pBlitImageInfo),
2427 readStreamPtrPtr);
2428 if (pBlitImageInfo) {
2429 transform_tohost_VkBlitImageInfo2(globalstate,
2430 (VkBlitImageInfo2*)(pBlitImageInfo));
2431 }
2432 vk->vkCmdBlitImage2KHR((VkCommandBuffer)dispatchHandle, pBlitImageInfo);
2433 android::base::endTrace();
2434 break;
2435 }
2436 case OP_vkCmdResolveImage2KHR: {
2437 android::base::beginTrace("vkCmdResolveImage2KHR subdecode");
2438 const VkResolveImageInfo2* pResolveImageInfo;
2439 VkResolveImageInfo2 stack_pResolveImageInfo[1];
2440 pResolveImageInfo = (VkResolveImageInfo2*)stack_pResolveImageInfo;
2441 reservedunmarshal_VkResolveImageInfo2(readStream, VK_STRUCTURE_TYPE_MAX_ENUM,
2442 (VkResolveImageInfo2*)(pResolveImageInfo),
2443 readStreamPtrPtr);
2444 if (pResolveImageInfo) {
2445 transform_tohost_VkResolveImageInfo2(globalstate,
2446 (VkResolveImageInfo2*)(pResolveImageInfo));
2447 }
2448 vk->vkCmdResolveImage2KHR((VkCommandBuffer)dispatchHandle, pResolveImageInfo);
2449 android::base::endTrace();
2450 break;
2451 }
2452 #endif
2453 #ifdef VK_KHR_format_feature_flags2
2454 #endif
2455 #ifdef VK_KHR_maintenance4
2456 #endif
2457 #ifdef VK_KHR_maintenance5
2458 case OP_vkCmdBindIndexBuffer2KHR: {
2459 android::base::beginTrace("vkCmdBindIndexBuffer2KHR subdecode");
2460 VkBuffer buffer;
2461 VkDeviceSize offset;
2462 VkDeviceSize size;
2463 VkIndexType indexType;
2464 uint64_t cgen_var_0;
2465 memcpy((uint64_t*)&cgen_var_0, *readStreamPtrPtr, 1 * 8);
2466 *readStreamPtrPtr += 1 * 8;
2467 *(VkBuffer*)&buffer = (VkBuffer)unbox_VkBuffer((VkBuffer)(*&cgen_var_0));
2468 memcpy((VkDeviceSize*)&offset, *readStreamPtrPtr, sizeof(VkDeviceSize));
2469 *readStreamPtrPtr += sizeof(VkDeviceSize);
2470 memcpy((VkDeviceSize*)&size, *readStreamPtrPtr, sizeof(VkDeviceSize));
2471 *readStreamPtrPtr += sizeof(VkDeviceSize);
2472 memcpy((VkIndexType*)&indexType, *readStreamPtrPtr, sizeof(VkIndexType));
2473 *readStreamPtrPtr += sizeof(VkIndexType);
2474 vk->vkCmdBindIndexBuffer2KHR((VkCommandBuffer)dispatchHandle, buffer, offset, size,
2475 indexType);
2476 android::base::endTrace();
2477 break;
2478 }
2479 #endif
2480 #ifdef VK_ANDROID_native_buffer
2481 #endif
2482 #ifdef VK_EXT_transform_feedback
2483 case OP_vkCmdBindTransformFeedbackBuffersEXT: {
2484 android::base::beginTrace("vkCmdBindTransformFeedbackBuffersEXT subdecode");
2485 uint32_t firstBinding;
2486 uint32_t bindingCount;
2487 const VkBuffer* pBuffers;
2488 VkBuffer stack_pBuffers[MAX_STACK_ITEMS];
2489 const VkDeviceSize* pOffsets;
2490 VkDeviceSize stack_pOffsets[MAX_STACK_ITEMS];
2491 const VkDeviceSize* pSizes;
2492 VkDeviceSize stack_pSizes[MAX_STACK_ITEMS];
2493 memcpy((uint32_t*)&firstBinding, *readStreamPtrPtr, sizeof(uint32_t));
2494 *readStreamPtrPtr += sizeof(uint32_t);
2495 memcpy((uint32_t*)&bindingCount, *readStreamPtrPtr, sizeof(uint32_t));
2496 *readStreamPtrPtr += sizeof(uint32_t);
2497 if (((bindingCount)) <= MAX_STACK_ITEMS) {
2498 pBuffers = (VkBuffer*)stack_pBuffers;
2499 } else {
2500 readStream->alloc((void**)&pBuffers, ((bindingCount)) * sizeof(const VkBuffer));
2501 }
2502 if (((bindingCount))) {
2503 uint8_t* cgen_var_0_ptr = (uint8_t*)(*readStreamPtrPtr);
2504 *readStreamPtrPtr += 8 * ((bindingCount));
2505 for (uint32_t k = 0; k < ((bindingCount)); ++k) {
2506 uint64_t tmpval;
2507 memcpy(&tmpval, cgen_var_0_ptr + k * 8, sizeof(uint64_t));
2508 *(((VkBuffer*)pBuffers) + k) = (VkBuffer)unbox_VkBuffer((VkBuffer)tmpval);
2509 }
2510 }
2511 if (((bindingCount)) <= MAX_STACK_ITEMS) {
2512 pOffsets = (VkDeviceSize*)stack_pOffsets;
2513 } else {
2514 readStream->alloc((void**)&pOffsets,
2515 ((bindingCount)) * sizeof(const VkDeviceSize));
2516 }
2517 memcpy((VkDeviceSize*)pOffsets, *readStreamPtrPtr,
2518 ((bindingCount)) * sizeof(const VkDeviceSize));
2519 *readStreamPtrPtr += ((bindingCount)) * sizeof(const VkDeviceSize);
2520 // WARNING PTR CHECK
2521 memcpy((VkDeviceSize**)&pSizes, (*readStreamPtrPtr), 8);
2522 android::base::Stream::fromBe64((uint8_t*)&pSizes);
2523 *readStreamPtrPtr += 8;
2524 if (pSizes) {
2525 if (((bindingCount)) <= MAX_STACK_ITEMS) {
2526 pSizes = (VkDeviceSize*)stack_pSizes;
2527 } else {
2528 readStream->alloc((void**)&pSizes,
2529 ((bindingCount)) * sizeof(const VkDeviceSize));
2530 }
2531 memcpy((VkDeviceSize*)pSizes, *readStreamPtrPtr,
2532 ((bindingCount)) * sizeof(const VkDeviceSize));
2533 *readStreamPtrPtr += ((bindingCount)) * sizeof(const VkDeviceSize);
2534 }
2535 vk->vkCmdBindTransformFeedbackBuffersEXT((VkCommandBuffer)dispatchHandle,
2536 firstBinding, bindingCount, pBuffers,
2537 pOffsets, pSizes);
2538 android::base::endTrace();
2539 break;
2540 }
2541 case OP_vkCmdBeginTransformFeedbackEXT: {
2542 android::base::beginTrace("vkCmdBeginTransformFeedbackEXT subdecode");
2543 uint32_t firstCounterBuffer;
2544 uint32_t counterBufferCount;
2545 const VkBuffer* pCounterBuffers;
2546 VkBuffer stack_pCounterBuffers[MAX_STACK_ITEMS];
2547 const VkDeviceSize* pCounterBufferOffsets;
2548 VkDeviceSize stack_pCounterBufferOffsets[MAX_STACK_ITEMS];
2549 memcpy((uint32_t*)&firstCounterBuffer, *readStreamPtrPtr, sizeof(uint32_t));
2550 *readStreamPtrPtr += sizeof(uint32_t);
2551 memcpy((uint32_t*)&counterBufferCount, *readStreamPtrPtr, sizeof(uint32_t));
2552 *readStreamPtrPtr += sizeof(uint32_t);
2553 // WARNING PTR CHECK
2554 memcpy((VkBuffer**)&pCounterBuffers, (*readStreamPtrPtr), 8);
2555 android::base::Stream::fromBe64((uint8_t*)&pCounterBuffers);
2556 *readStreamPtrPtr += 8;
2557 if (pCounterBuffers) {
2558 if (((counterBufferCount)) <= MAX_STACK_ITEMS) {
2559 pCounterBuffers = (VkBuffer*)stack_pCounterBuffers;
2560 } else {
2561 readStream->alloc((void**)&pCounterBuffers,
2562 ((counterBufferCount)) * sizeof(const VkBuffer));
2563 }
2564 if (((counterBufferCount))) {
2565 uint8_t* cgen_var_0_0_ptr = (uint8_t*)(*readStreamPtrPtr);
2566 *readStreamPtrPtr += 8 * ((counterBufferCount));
2567 for (uint32_t k = 0; k < ((counterBufferCount)); ++k) {
2568 uint64_t tmpval;
2569 memcpy(&tmpval, cgen_var_0_0_ptr + k * 8, sizeof(uint64_t));
2570 *(((VkBuffer*)pCounterBuffers) + k) =
2571 (VkBuffer)unbox_VkBuffer((VkBuffer)tmpval);
2572 }
2573 }
2574 }
2575 // WARNING PTR CHECK
2576 memcpy((VkDeviceSize**)&pCounterBufferOffsets, (*readStreamPtrPtr), 8);
2577 android::base::Stream::fromBe64((uint8_t*)&pCounterBufferOffsets);
2578 *readStreamPtrPtr += 8;
2579 if (pCounterBufferOffsets) {
2580 if (((counterBufferCount)) <= MAX_STACK_ITEMS) {
2581 pCounterBufferOffsets = (VkDeviceSize*)stack_pCounterBufferOffsets;
2582 } else {
2583 readStream->alloc((void**)&pCounterBufferOffsets,
2584 ((counterBufferCount)) * sizeof(const VkDeviceSize));
2585 }
2586 memcpy((VkDeviceSize*)pCounterBufferOffsets, *readStreamPtrPtr,
2587 ((counterBufferCount)) * sizeof(const VkDeviceSize));
2588 *readStreamPtrPtr += ((counterBufferCount)) * sizeof(const VkDeviceSize);
2589 }
2590 vk->vkCmdBeginTransformFeedbackEXT((VkCommandBuffer)dispatchHandle,
2591 firstCounterBuffer, counterBufferCount,
2592 pCounterBuffers, pCounterBufferOffsets);
2593 android::base::endTrace();
2594 break;
2595 }
2596 case OP_vkCmdEndTransformFeedbackEXT: {
2597 android::base::beginTrace("vkCmdEndTransformFeedbackEXT subdecode");
2598 uint32_t firstCounterBuffer;
2599 uint32_t counterBufferCount;
2600 const VkBuffer* pCounterBuffers;
2601 VkBuffer stack_pCounterBuffers[MAX_STACK_ITEMS];
2602 const VkDeviceSize* pCounterBufferOffsets;
2603 VkDeviceSize stack_pCounterBufferOffsets[MAX_STACK_ITEMS];
2604 memcpy((uint32_t*)&firstCounterBuffer, *readStreamPtrPtr, sizeof(uint32_t));
2605 *readStreamPtrPtr += sizeof(uint32_t);
2606 memcpy((uint32_t*)&counterBufferCount, *readStreamPtrPtr, sizeof(uint32_t));
2607 *readStreamPtrPtr += sizeof(uint32_t);
2608 // WARNING PTR CHECK
2609 memcpy((VkBuffer**)&pCounterBuffers, (*readStreamPtrPtr), 8);
2610 android::base::Stream::fromBe64((uint8_t*)&pCounterBuffers);
2611 *readStreamPtrPtr += 8;
2612 if (pCounterBuffers) {
2613 if (((counterBufferCount)) <= MAX_STACK_ITEMS) {
2614 pCounterBuffers = (VkBuffer*)stack_pCounterBuffers;
2615 } else {
2616 readStream->alloc((void**)&pCounterBuffers,
2617 ((counterBufferCount)) * sizeof(const VkBuffer));
2618 }
2619 if (((counterBufferCount))) {
2620 uint8_t* cgen_var_0_0_ptr = (uint8_t*)(*readStreamPtrPtr);
2621 *readStreamPtrPtr += 8 * ((counterBufferCount));
2622 for (uint32_t k = 0; k < ((counterBufferCount)); ++k) {
2623 uint64_t tmpval;
2624 memcpy(&tmpval, cgen_var_0_0_ptr + k * 8, sizeof(uint64_t));
2625 *(((VkBuffer*)pCounterBuffers) + k) =
2626 (VkBuffer)unbox_VkBuffer((VkBuffer)tmpval);
2627 }
2628 }
2629 }
2630 // WARNING PTR CHECK
2631 memcpy((VkDeviceSize**)&pCounterBufferOffsets, (*readStreamPtrPtr), 8);
2632 android::base::Stream::fromBe64((uint8_t*)&pCounterBufferOffsets);
2633 *readStreamPtrPtr += 8;
2634 if (pCounterBufferOffsets) {
2635 if (((counterBufferCount)) <= MAX_STACK_ITEMS) {
2636 pCounterBufferOffsets = (VkDeviceSize*)stack_pCounterBufferOffsets;
2637 } else {
2638 readStream->alloc((void**)&pCounterBufferOffsets,
2639 ((counterBufferCount)) * sizeof(const VkDeviceSize));
2640 }
2641 memcpy((VkDeviceSize*)pCounterBufferOffsets, *readStreamPtrPtr,
2642 ((counterBufferCount)) * sizeof(const VkDeviceSize));
2643 *readStreamPtrPtr += ((counterBufferCount)) * sizeof(const VkDeviceSize);
2644 }
2645 vk->vkCmdEndTransformFeedbackEXT((VkCommandBuffer)dispatchHandle,
2646 firstCounterBuffer, counterBufferCount,
2647 pCounterBuffers, pCounterBufferOffsets);
2648 android::base::endTrace();
2649 break;
2650 }
2651 case OP_vkCmdBeginQueryIndexedEXT: {
2652 android::base::beginTrace("vkCmdBeginQueryIndexedEXT subdecode");
2653 VkQueryPool queryPool;
2654 uint32_t query;
2655 VkQueryControlFlags flags;
2656 uint32_t index;
2657 uint64_t cgen_var_0;
2658 memcpy((uint64_t*)&cgen_var_0, *readStreamPtrPtr, 1 * 8);
2659 *readStreamPtrPtr += 1 * 8;
2660 *(VkQueryPool*)&queryPool =
2661 (VkQueryPool)unbox_VkQueryPool((VkQueryPool)(*&cgen_var_0));
2662 memcpy((uint32_t*)&query, *readStreamPtrPtr, sizeof(uint32_t));
2663 *readStreamPtrPtr += sizeof(uint32_t);
2664 memcpy((VkQueryControlFlags*)&flags, *readStreamPtrPtr,
2665 sizeof(VkQueryControlFlags));
2666 *readStreamPtrPtr += sizeof(VkQueryControlFlags);
2667 memcpy((uint32_t*)&index, *readStreamPtrPtr, sizeof(uint32_t));
2668 *readStreamPtrPtr += sizeof(uint32_t);
2669 vk->vkCmdBeginQueryIndexedEXT((VkCommandBuffer)dispatchHandle, queryPool, query,
2670 flags, index);
2671 android::base::endTrace();
2672 break;
2673 }
2674 case OP_vkCmdEndQueryIndexedEXT: {
2675 android::base::beginTrace("vkCmdEndQueryIndexedEXT subdecode");
2676 VkQueryPool queryPool;
2677 uint32_t query;
2678 uint32_t index;
2679 uint64_t cgen_var_0;
2680 memcpy((uint64_t*)&cgen_var_0, *readStreamPtrPtr, 1 * 8);
2681 *readStreamPtrPtr += 1 * 8;
2682 *(VkQueryPool*)&queryPool =
2683 (VkQueryPool)unbox_VkQueryPool((VkQueryPool)(*&cgen_var_0));
2684 memcpy((uint32_t*)&query, *readStreamPtrPtr, sizeof(uint32_t));
2685 *readStreamPtrPtr += sizeof(uint32_t);
2686 memcpy((uint32_t*)&index, *readStreamPtrPtr, sizeof(uint32_t));
2687 *readStreamPtrPtr += sizeof(uint32_t);
2688 vk->vkCmdEndQueryIndexedEXT((VkCommandBuffer)dispatchHandle, queryPool, query,
2689 index);
2690 android::base::endTrace();
2691 break;
2692 }
2693 case OP_vkCmdDrawIndirectByteCountEXT: {
2694 android::base::beginTrace("vkCmdDrawIndirectByteCountEXT subdecode");
2695 uint32_t instanceCount;
2696 uint32_t firstInstance;
2697 VkBuffer counterBuffer;
2698 VkDeviceSize counterBufferOffset;
2699 uint32_t counterOffset;
2700 uint32_t vertexStride;
2701 memcpy((uint32_t*)&instanceCount, *readStreamPtrPtr, sizeof(uint32_t));
2702 *readStreamPtrPtr += sizeof(uint32_t);
2703 memcpy((uint32_t*)&firstInstance, *readStreamPtrPtr, sizeof(uint32_t));
2704 *readStreamPtrPtr += sizeof(uint32_t);
2705 uint64_t cgen_var_0;
2706 memcpy((uint64_t*)&cgen_var_0, *readStreamPtrPtr, 1 * 8);
2707 *readStreamPtrPtr += 1 * 8;
2708 *(VkBuffer*)&counterBuffer = (VkBuffer)unbox_VkBuffer((VkBuffer)(*&cgen_var_0));
2709 memcpy((VkDeviceSize*)&counterBufferOffset, *readStreamPtrPtr,
2710 sizeof(VkDeviceSize));
2711 *readStreamPtrPtr += sizeof(VkDeviceSize);
2712 memcpy((uint32_t*)&counterOffset, *readStreamPtrPtr, sizeof(uint32_t));
2713 *readStreamPtrPtr += sizeof(uint32_t);
2714 memcpy((uint32_t*)&vertexStride, *readStreamPtrPtr, sizeof(uint32_t));
2715 *readStreamPtrPtr += sizeof(uint32_t);
2716 vk->vkCmdDrawIndirectByteCountEXT((VkCommandBuffer)dispatchHandle, instanceCount,
2717 firstInstance, counterBuffer, counterBufferOffset,
2718 counterOffset, vertexStride);
2719 android::base::endTrace();
2720 break;
2721 }
2722 #endif
2723 #ifdef VK_AMD_gpu_shader_half_float
2724 #endif
2725 #ifdef VK_EXT_texture_compression_astc_hdr
2726 #endif
2727 #ifdef VK_EXT_depth_clip_enable
2728 #endif
2729 #ifdef VK_EXT_swapchain_colorspace
2730 #endif
2731 #ifdef VK_MVK_moltenvk
2732 #endif
2733 #ifdef VK_EXT_queue_family_foreign
2734 #endif
2735 #ifdef VK_EXT_debug_utils
2736 case OP_vkCmdBeginDebugUtilsLabelEXT: {
2737 android::base::beginTrace("vkCmdBeginDebugUtilsLabelEXT subdecode");
2738 const VkDebugUtilsLabelEXT* pLabelInfo;
2739 VkDebugUtilsLabelEXT stack_pLabelInfo[1];
2740 pLabelInfo = (VkDebugUtilsLabelEXT*)stack_pLabelInfo;
2741 reservedunmarshal_VkDebugUtilsLabelEXT(readStream, VK_STRUCTURE_TYPE_MAX_ENUM,
2742 (VkDebugUtilsLabelEXT*)(pLabelInfo),
2743 readStreamPtrPtr);
2744 if (pLabelInfo) {
2745 transform_tohost_VkDebugUtilsLabelEXT(globalstate,
2746 (VkDebugUtilsLabelEXT*)(pLabelInfo));
2747 }
2748 vk->vkCmdBeginDebugUtilsLabelEXT((VkCommandBuffer)dispatchHandle, pLabelInfo);
2749 android::base::endTrace();
2750 break;
2751 }
2752 case OP_vkCmdEndDebugUtilsLabelEXT: {
2753 android::base::beginTrace("vkCmdEndDebugUtilsLabelEXT subdecode");
2754 vk->vkCmdEndDebugUtilsLabelEXT((VkCommandBuffer)dispatchHandle);
2755 android::base::endTrace();
2756 break;
2757 }
2758 case OP_vkCmdInsertDebugUtilsLabelEXT: {
2759 android::base::beginTrace("vkCmdInsertDebugUtilsLabelEXT subdecode");
2760 const VkDebugUtilsLabelEXT* pLabelInfo;
2761 VkDebugUtilsLabelEXT stack_pLabelInfo[1];
2762 pLabelInfo = (VkDebugUtilsLabelEXT*)stack_pLabelInfo;
2763 reservedunmarshal_VkDebugUtilsLabelEXT(readStream, VK_STRUCTURE_TYPE_MAX_ENUM,
2764 (VkDebugUtilsLabelEXT*)(pLabelInfo),
2765 readStreamPtrPtr);
2766 if (pLabelInfo) {
2767 transform_tohost_VkDebugUtilsLabelEXT(globalstate,
2768 (VkDebugUtilsLabelEXT*)(pLabelInfo));
2769 }
2770 vk->vkCmdInsertDebugUtilsLabelEXT((VkCommandBuffer)dispatchHandle, pLabelInfo);
2771 android::base::endTrace();
2772 break;
2773 }
2774 #endif
2775 #ifdef VK_ANDROID_external_memory_android_hardware_buffer
2776 #endif
2777 #ifdef VK_EXT_inline_uniform_block
2778 #endif
2779 #ifdef VK_EXT_shader_stencil_export
2780 #endif
2781 #ifdef VK_EXT_vertex_attribute_divisor
2782 #endif
2783 #ifdef VK_EXT_pipeline_creation_feedback
2784 #endif
2785 #ifdef VK_NV_shader_subgroup_partitioned
2786 #endif
2787 #ifdef VK_EXT_metal_surface
2788 #endif
2789 #ifdef VK_EXT_fragment_density_map
2790 #endif
2791 #ifdef VK_EXT_scalar_block_layout
2792 #endif
2793 #ifdef VK_EXT_subgroup_size_control
2794 #endif
2795 #ifdef VK_EXT_tooling_info
2796 #endif
2797 #ifdef VK_EXT_validation_features
2798 #endif
2799 #ifdef VK_EXT_provoking_vertex
2800 #endif
2801 #ifdef VK_EXT_line_rasterization
2802 case OP_vkCmdSetLineStippleEXT: {
2803 android::base::beginTrace("vkCmdSetLineStippleEXT subdecode");
2804 uint32_t lineStippleFactor;
2805 uint16_t lineStipplePattern;
2806 memcpy((uint32_t*)&lineStippleFactor, *readStreamPtrPtr, sizeof(uint32_t));
2807 *readStreamPtrPtr += sizeof(uint32_t);
2808 memcpy((uint16_t*)&lineStipplePattern, *readStreamPtrPtr, sizeof(uint16_t));
2809 *readStreamPtrPtr += sizeof(uint16_t);
2810 vk->vkCmdSetLineStippleEXT((VkCommandBuffer)dispatchHandle, lineStippleFactor,
2811 lineStipplePattern);
2812 android::base::endTrace();
2813 break;
2814 }
2815 #endif
2816 #ifdef VK_EXT_index_type_uint8
2817 #endif
2818 #ifdef VK_EXT_extended_dynamic_state
2819 case OP_vkCmdSetCullModeEXT: {
2820 android::base::beginTrace("vkCmdSetCullModeEXT subdecode");
2821 VkCullModeFlags cullMode;
2822 memcpy((VkCullModeFlags*)&cullMode, *readStreamPtrPtr, sizeof(VkCullModeFlags));
2823 *readStreamPtrPtr += sizeof(VkCullModeFlags);
2824 vk->vkCmdSetCullModeEXT((VkCommandBuffer)dispatchHandle, cullMode);
2825 android::base::endTrace();
2826 break;
2827 }
2828 case OP_vkCmdSetFrontFaceEXT: {
2829 android::base::beginTrace("vkCmdSetFrontFaceEXT subdecode");
2830 VkFrontFace frontFace;
2831 memcpy((VkFrontFace*)&frontFace, *readStreamPtrPtr, sizeof(VkFrontFace));
2832 *readStreamPtrPtr += sizeof(VkFrontFace);
2833 vk->vkCmdSetFrontFaceEXT((VkCommandBuffer)dispatchHandle, frontFace);
2834 android::base::endTrace();
2835 break;
2836 }
2837 case OP_vkCmdSetPrimitiveTopologyEXT: {
2838 android::base::beginTrace("vkCmdSetPrimitiveTopologyEXT subdecode");
2839 VkPrimitiveTopology primitiveTopology;
2840 memcpy((VkPrimitiveTopology*)&primitiveTopology, *readStreamPtrPtr,
2841 sizeof(VkPrimitiveTopology));
2842 *readStreamPtrPtr += sizeof(VkPrimitiveTopology);
2843 vk->vkCmdSetPrimitiveTopologyEXT((VkCommandBuffer)dispatchHandle,
2844 primitiveTopology);
2845 android::base::endTrace();
2846 break;
2847 }
2848 case OP_vkCmdSetViewportWithCountEXT: {
2849 android::base::beginTrace("vkCmdSetViewportWithCountEXT subdecode");
2850 uint32_t viewportCount;
2851 const VkViewport* pViewports;
2852 VkViewport stack_pViewports[MAX_STACK_ITEMS];
2853 memcpy((uint32_t*)&viewportCount, *readStreamPtrPtr, sizeof(uint32_t));
2854 *readStreamPtrPtr += sizeof(uint32_t);
2855 if (((viewportCount)) <= MAX_STACK_ITEMS) {
2856 pViewports = (VkViewport*)stack_pViewports;
2857 } else {
2858 readStream->alloc((void**)&pViewports,
2859 ((viewportCount)) * sizeof(const VkViewport));
2860 }
2861 for (uint32_t i = 0; i < (uint32_t)((viewportCount)); ++i) {
2862 reservedunmarshal_VkViewport(readStream, VK_STRUCTURE_TYPE_MAX_ENUM,
2863 (VkViewport*)(pViewports + i), readStreamPtrPtr);
2864 }
2865 if (pViewports) {
2866 for (uint32_t i = 0; i < (uint32_t)((viewportCount)); ++i) {
2867 transform_tohost_VkViewport(globalstate, (VkViewport*)(pViewports + i));
2868 }
2869 }
2870 vk->vkCmdSetViewportWithCountEXT((VkCommandBuffer)dispatchHandle, viewportCount,
2871 pViewports);
2872 android::base::endTrace();
2873 break;
2874 }
2875 case OP_vkCmdSetScissorWithCountEXT: {
2876 android::base::beginTrace("vkCmdSetScissorWithCountEXT subdecode");
2877 uint32_t scissorCount;
2878 const VkRect2D* pScissors;
2879 VkRect2D stack_pScissors[MAX_STACK_ITEMS];
2880 memcpy((uint32_t*)&scissorCount, *readStreamPtrPtr, sizeof(uint32_t));
2881 *readStreamPtrPtr += sizeof(uint32_t);
2882 if (((scissorCount)) <= MAX_STACK_ITEMS) {
2883 pScissors = (VkRect2D*)stack_pScissors;
2884 } else {
2885 readStream->alloc((void**)&pScissors,
2886 ((scissorCount)) * sizeof(const VkRect2D));
2887 }
2888 for (uint32_t i = 0; i < (uint32_t)((scissorCount)); ++i) {
2889 reservedunmarshal_VkRect2D(readStream, VK_STRUCTURE_TYPE_MAX_ENUM,
2890 (VkRect2D*)(pScissors + i), readStreamPtrPtr);
2891 }
2892 if (pScissors) {
2893 for (uint32_t i = 0; i < (uint32_t)((scissorCount)); ++i) {
2894 transform_tohost_VkRect2D(globalstate, (VkRect2D*)(pScissors + i));
2895 }
2896 }
2897 vk->vkCmdSetScissorWithCountEXT((VkCommandBuffer)dispatchHandle, scissorCount,
2898 pScissors);
2899 android::base::endTrace();
2900 break;
2901 }
2902 case OP_vkCmdBindVertexBuffers2EXT: {
2903 android::base::beginTrace("vkCmdBindVertexBuffers2EXT subdecode");
2904 uint32_t firstBinding;
2905 uint32_t bindingCount;
2906 const VkBuffer* pBuffers;
2907 VkBuffer stack_pBuffers[MAX_STACK_ITEMS];
2908 const VkDeviceSize* pOffsets;
2909 VkDeviceSize stack_pOffsets[MAX_STACK_ITEMS];
2910 const VkDeviceSize* pSizes;
2911 VkDeviceSize stack_pSizes[MAX_STACK_ITEMS];
2912 const VkDeviceSize* pStrides;
2913 VkDeviceSize stack_pStrides[MAX_STACK_ITEMS];
2914 memcpy((uint32_t*)&firstBinding, *readStreamPtrPtr, sizeof(uint32_t));
2915 *readStreamPtrPtr += sizeof(uint32_t);
2916 memcpy((uint32_t*)&bindingCount, *readStreamPtrPtr, sizeof(uint32_t));
2917 *readStreamPtrPtr += sizeof(uint32_t);
2918 // WARNING PTR CHECK
2919 memcpy((VkBuffer**)&pBuffers, (*readStreamPtrPtr), 8);
2920 android::base::Stream::fromBe64((uint8_t*)&pBuffers);
2921 *readStreamPtrPtr += 8;
2922 if (pBuffers) {
2923 if (((bindingCount)) <= MAX_STACK_ITEMS) {
2924 pBuffers = (VkBuffer*)stack_pBuffers;
2925 } else {
2926 readStream->alloc((void**)&pBuffers,
2927 ((bindingCount)) * sizeof(const VkBuffer));
2928 }
2929 if (((bindingCount))) {
2930 uint8_t* cgen_var_0_0_ptr = (uint8_t*)(*readStreamPtrPtr);
2931 *readStreamPtrPtr += 8 * ((bindingCount));
2932 for (uint32_t k = 0; k < ((bindingCount)); ++k) {
2933 uint64_t tmpval;
2934 memcpy(&tmpval, cgen_var_0_0_ptr + k * 8, sizeof(uint64_t));
2935 *(((VkBuffer*)pBuffers) + k) =
2936 (VkBuffer)unbox_VkBuffer((VkBuffer)tmpval);
2937 }
2938 }
2939 }
2940 if (((bindingCount)) <= MAX_STACK_ITEMS) {
2941 pOffsets = (VkDeviceSize*)stack_pOffsets;
2942 } else {
2943 readStream->alloc((void**)&pOffsets,
2944 ((bindingCount)) * sizeof(const VkDeviceSize));
2945 }
2946 memcpy((VkDeviceSize*)pOffsets, *readStreamPtrPtr,
2947 ((bindingCount)) * sizeof(const VkDeviceSize));
2948 *readStreamPtrPtr += ((bindingCount)) * sizeof(const VkDeviceSize);
2949 // WARNING PTR CHECK
2950 memcpy((VkDeviceSize**)&pSizes, (*readStreamPtrPtr), 8);
2951 android::base::Stream::fromBe64((uint8_t*)&pSizes);
2952 *readStreamPtrPtr += 8;
2953 if (pSizes) {
2954 if (((bindingCount)) <= MAX_STACK_ITEMS) {
2955 pSizes = (VkDeviceSize*)stack_pSizes;
2956 } else {
2957 readStream->alloc((void**)&pSizes,
2958 ((bindingCount)) * sizeof(const VkDeviceSize));
2959 }
2960 memcpy((VkDeviceSize*)pSizes, *readStreamPtrPtr,
2961 ((bindingCount)) * sizeof(const VkDeviceSize));
2962 *readStreamPtrPtr += ((bindingCount)) * sizeof(const VkDeviceSize);
2963 }
2964 // WARNING PTR CHECK
2965 memcpy((VkDeviceSize**)&pStrides, (*readStreamPtrPtr), 8);
2966 android::base::Stream::fromBe64((uint8_t*)&pStrides);
2967 *readStreamPtrPtr += 8;
2968 if (pStrides) {
2969 if (((bindingCount)) <= MAX_STACK_ITEMS) {
2970 pStrides = (VkDeviceSize*)stack_pStrides;
2971 } else {
2972 readStream->alloc((void**)&pStrides,
2973 ((bindingCount)) * sizeof(const VkDeviceSize));
2974 }
2975 memcpy((VkDeviceSize*)pStrides, *readStreamPtrPtr,
2976 ((bindingCount)) * sizeof(const VkDeviceSize));
2977 *readStreamPtrPtr += ((bindingCount)) * sizeof(const VkDeviceSize);
2978 }
2979 vk->vkCmdBindVertexBuffers2EXT((VkCommandBuffer)dispatchHandle, firstBinding,
2980 bindingCount, pBuffers, pOffsets, pSizes, pStrides);
2981 android::base::endTrace();
2982 break;
2983 }
2984 case OP_vkCmdSetDepthTestEnableEXT: {
2985 android::base::beginTrace("vkCmdSetDepthTestEnableEXT subdecode");
2986 VkBool32 depthTestEnable;
2987 memcpy((VkBool32*)&depthTestEnable, *readStreamPtrPtr, sizeof(VkBool32));
2988 *readStreamPtrPtr += sizeof(VkBool32);
2989 vk->vkCmdSetDepthTestEnableEXT((VkCommandBuffer)dispatchHandle, depthTestEnable);
2990 android::base::endTrace();
2991 break;
2992 }
2993 case OP_vkCmdSetDepthWriteEnableEXT: {
2994 android::base::beginTrace("vkCmdSetDepthWriteEnableEXT subdecode");
2995 VkBool32 depthWriteEnable;
2996 memcpy((VkBool32*)&depthWriteEnable, *readStreamPtrPtr, sizeof(VkBool32));
2997 *readStreamPtrPtr += sizeof(VkBool32);
2998 vk->vkCmdSetDepthWriteEnableEXT((VkCommandBuffer)dispatchHandle, depthWriteEnable);
2999 android::base::endTrace();
3000 break;
3001 }
3002 case OP_vkCmdSetDepthCompareOpEXT: {
3003 android::base::beginTrace("vkCmdSetDepthCompareOpEXT subdecode");
3004 VkCompareOp depthCompareOp;
3005 memcpy((VkCompareOp*)&depthCompareOp, *readStreamPtrPtr, sizeof(VkCompareOp));
3006 *readStreamPtrPtr += sizeof(VkCompareOp);
3007 vk->vkCmdSetDepthCompareOpEXT((VkCommandBuffer)dispatchHandle, depthCompareOp);
3008 android::base::endTrace();
3009 break;
3010 }
3011 case OP_vkCmdSetDepthBoundsTestEnableEXT: {
3012 android::base::beginTrace("vkCmdSetDepthBoundsTestEnableEXT subdecode");
3013 VkBool32 depthBoundsTestEnable;
3014 memcpy((VkBool32*)&depthBoundsTestEnable, *readStreamPtrPtr, sizeof(VkBool32));
3015 *readStreamPtrPtr += sizeof(VkBool32);
3016 vk->vkCmdSetDepthBoundsTestEnableEXT((VkCommandBuffer)dispatchHandle,
3017 depthBoundsTestEnable);
3018 android::base::endTrace();
3019 break;
3020 }
3021 case OP_vkCmdSetStencilTestEnableEXT: {
3022 android::base::beginTrace("vkCmdSetStencilTestEnableEXT subdecode");
3023 VkBool32 stencilTestEnable;
3024 memcpy((VkBool32*)&stencilTestEnable, *readStreamPtrPtr, sizeof(VkBool32));
3025 *readStreamPtrPtr += sizeof(VkBool32);
3026 vk->vkCmdSetStencilTestEnableEXT((VkCommandBuffer)dispatchHandle,
3027 stencilTestEnable);
3028 android::base::endTrace();
3029 break;
3030 }
3031 case OP_vkCmdSetStencilOpEXT: {
3032 android::base::beginTrace("vkCmdSetStencilOpEXT subdecode");
3033 VkStencilFaceFlags faceMask;
3034 VkStencilOp failOp;
3035 VkStencilOp passOp;
3036 VkStencilOp depthFailOp;
3037 VkCompareOp compareOp;
3038 memcpy((VkStencilFaceFlags*)&faceMask, *readStreamPtrPtr,
3039 sizeof(VkStencilFaceFlags));
3040 *readStreamPtrPtr += sizeof(VkStencilFaceFlags);
3041 memcpy((VkStencilOp*)&failOp, *readStreamPtrPtr, sizeof(VkStencilOp));
3042 *readStreamPtrPtr += sizeof(VkStencilOp);
3043 memcpy((VkStencilOp*)&passOp, *readStreamPtrPtr, sizeof(VkStencilOp));
3044 *readStreamPtrPtr += sizeof(VkStencilOp);
3045 memcpy((VkStencilOp*)&depthFailOp, *readStreamPtrPtr, sizeof(VkStencilOp));
3046 *readStreamPtrPtr += sizeof(VkStencilOp);
3047 memcpy((VkCompareOp*)&compareOp, *readStreamPtrPtr, sizeof(VkCompareOp));
3048 *readStreamPtrPtr += sizeof(VkCompareOp);
3049 vk->vkCmdSetStencilOpEXT((VkCommandBuffer)dispatchHandle, faceMask, failOp, passOp,
3050 depthFailOp, compareOp);
3051 android::base::endTrace();
3052 break;
3053 }
3054 #endif
3055 #ifdef VK_EXT_host_image_copy
3056 #endif
3057 #ifdef VK_EXT_swapchain_maintenance1
3058 #endif
3059 #ifdef VK_EXT_shader_demote_to_helper_invocation
3060 #endif
3061 #ifdef VK_EXT_texel_buffer_alignment
3062 #endif
3063 #ifdef VK_EXT_device_memory_report
3064 #endif
3065 #ifdef VK_EXT_robustness2
3066 #endif
3067 #ifdef VK_EXT_custom_border_color
3068 #endif
3069 #ifdef VK_EXT_private_data
3070 #endif
3071 #ifdef VK_EXT_pipeline_creation_cache_control
3072 #endif
3073 #ifdef VK_EXT_metal_objects
3074 #endif
3075 #ifdef VK_EXT_graphics_pipeline_library
3076 #endif
3077 #ifdef VK_EXT_ycbcr_2plane_444_formats
3078 #endif
3079 #ifdef VK_EXT_image_robustness
3080 #endif
3081 #ifdef VK_EXT_image_compression_control
3082 #endif
3083 #ifdef VK_EXT_4444_formats
3084 #endif
3085 #ifdef VK_EXT_primitive_topology_list_restart
3086 #endif
3087 #ifdef VK_EXT_extended_dynamic_state2
3088 case OP_vkCmdSetPatchControlPointsEXT: {
3089 android::base::beginTrace("vkCmdSetPatchControlPointsEXT subdecode");
3090 uint32_t patchControlPoints;
3091 memcpy((uint32_t*)&patchControlPoints, *readStreamPtrPtr, sizeof(uint32_t));
3092 *readStreamPtrPtr += sizeof(uint32_t);
3093 vk->vkCmdSetPatchControlPointsEXT((VkCommandBuffer)dispatchHandle,
3094 patchControlPoints);
3095 android::base::endTrace();
3096 break;
3097 }
3098 case OP_vkCmdSetRasterizerDiscardEnableEXT: {
3099 android::base::beginTrace("vkCmdSetRasterizerDiscardEnableEXT subdecode");
3100 VkBool32 rasterizerDiscardEnable;
3101 memcpy((VkBool32*)&rasterizerDiscardEnable, *readStreamPtrPtr, sizeof(VkBool32));
3102 *readStreamPtrPtr += sizeof(VkBool32);
3103 vk->vkCmdSetRasterizerDiscardEnableEXT((VkCommandBuffer)dispatchHandle,
3104 rasterizerDiscardEnable);
3105 android::base::endTrace();
3106 break;
3107 }
3108 case OP_vkCmdSetDepthBiasEnableEXT: {
3109 android::base::beginTrace("vkCmdSetDepthBiasEnableEXT subdecode");
3110 VkBool32 depthBiasEnable;
3111 memcpy((VkBool32*)&depthBiasEnable, *readStreamPtrPtr, sizeof(VkBool32));
3112 *readStreamPtrPtr += sizeof(VkBool32);
3113 vk->vkCmdSetDepthBiasEnableEXT((VkCommandBuffer)dispatchHandle, depthBiasEnable);
3114 android::base::endTrace();
3115 break;
3116 }
3117 case OP_vkCmdSetLogicOpEXT: {
3118 android::base::beginTrace("vkCmdSetLogicOpEXT subdecode");
3119 VkLogicOp logicOp;
3120 memcpy((VkLogicOp*)&logicOp, *readStreamPtrPtr, sizeof(VkLogicOp));
3121 *readStreamPtrPtr += sizeof(VkLogicOp);
3122 vk->vkCmdSetLogicOpEXT((VkCommandBuffer)dispatchHandle, logicOp);
3123 android::base::endTrace();
3124 break;
3125 }
3126 case OP_vkCmdSetPrimitiveRestartEnableEXT: {
3127 android::base::beginTrace("vkCmdSetPrimitiveRestartEnableEXT subdecode");
3128 VkBool32 primitiveRestartEnable;
3129 memcpy((VkBool32*)&primitiveRestartEnable, *readStreamPtrPtr, sizeof(VkBool32));
3130 *readStreamPtrPtr += sizeof(VkBool32);
3131 vk->vkCmdSetPrimitiveRestartEnableEXT((VkCommandBuffer)dispatchHandle,
3132 primitiveRestartEnable);
3133 android::base::endTrace();
3134 break;
3135 }
3136 #endif
3137 #ifdef VK_GOOGLE_gfxstream
3138 case OP_vkBeginCommandBufferAsyncGOOGLE: {
3139 android::base::beginTrace("vkBeginCommandBufferAsyncGOOGLE subdecode");
3140 const VkCommandBufferBeginInfo* pBeginInfo;
3141 VkCommandBufferBeginInfo stack_pBeginInfo[1];
3142 pBeginInfo = (VkCommandBufferBeginInfo*)stack_pBeginInfo;
3143 reservedunmarshal_VkCommandBufferBeginInfo(readStream, VK_STRUCTURE_TYPE_MAX_ENUM,
3144 (VkCommandBufferBeginInfo*)(pBeginInfo),
3145 readStreamPtrPtr);
3146 if (pBeginInfo) {
3147 transform_tohost_VkCommandBufferBeginInfo(
3148 globalstate, (VkCommandBufferBeginInfo*)(pBeginInfo));
3149 }
3150 this->on_vkBeginCommandBufferAsyncGOOGLE(
3151 pool, (VkCommandBuffer)(boxed_dispatchHandle), pBeginInfo, context);
3152 android::base::endTrace();
3153 break;
3154 }
3155 case OP_vkEndCommandBufferAsyncGOOGLE: {
3156 android::base::beginTrace("vkEndCommandBufferAsyncGOOGLE subdecode");
3157 this->on_vkEndCommandBufferAsyncGOOGLE(
3158 pool, (VkCommandBuffer)(boxed_dispatchHandle), context);
3159 android::base::endTrace();
3160 break;
3161 }
3162 case OP_vkResetCommandBufferAsyncGOOGLE: {
3163 android::base::beginTrace("vkResetCommandBufferAsyncGOOGLE subdecode");
3164 VkCommandBufferResetFlags flags;
3165 memcpy((VkCommandBufferResetFlags*)&flags, *readStreamPtrPtr,
3166 sizeof(VkCommandBufferResetFlags));
3167 *readStreamPtrPtr += sizeof(VkCommandBufferResetFlags);
3168 this->on_vkResetCommandBufferAsyncGOOGLE(
3169 pool, (VkCommandBuffer)(boxed_dispatchHandle), flags);
3170 android::base::endTrace();
3171 break;
3172 }
3173 case OP_vkCommandBufferHostSyncGOOGLE: {
3174 android::base::beginTrace("vkCommandBufferHostSyncGOOGLE subdecode");
3175 uint32_t needHostSync;
3176 uint32_t sequenceNumber;
3177 memcpy((uint32_t*)&needHostSync, *readStreamPtrPtr, sizeof(uint32_t));
3178 *readStreamPtrPtr += sizeof(uint32_t);
3179 memcpy((uint32_t*)&sequenceNumber, *readStreamPtrPtr, sizeof(uint32_t));
3180 *readStreamPtrPtr += sizeof(uint32_t);
3181 this->on_vkCommandBufferHostSyncGOOGLE(
3182 pool, (VkCommandBuffer)(boxed_dispatchHandle), needHostSync, sequenceNumber);
3183 android::base::endTrace();
3184 break;
3185 }
3186 #endif
3187 #ifdef VK_EXT_load_store_op_none
3188 #endif
3189 #ifdef VK_EXT_image_compression_control_swapchain
3190 #endif
3191 #ifdef VK_QNX_external_memory_screen_buffer
3192 #endif
3193 default: {
3194 GFXSTREAM_ABORT(::emugl::FatalError(::emugl::ABORT_REASON_OTHER))
3195 << "Unrecognized opcode " << opcode;
3196 }
3197 }
3198 ++count;
3199 if (count % 1000 == 0) {
3200 pool->freeAll();
3201 };
3202 ptr += packetLen;
3203 }
3204 pool->freeAll();
3205 return ptr - (unsigned char*)buf;
3206 ;
3207 }
3208