Hash :
7ad48b84
Author :
Date :
2022-05-26T00:23:35
Revert "Add Vulkan backend support for texture labels"
This reverts commit 1afb80587e302e2ce9a901a69fd66e5ef98a73b6.
Reason for revert: Null-dereference crash starting here:
https://ci.chromium.org/ui/p/chromium/builders/ci/mac-swangle-chromium-x64/26323/blamelist
(see angle blamelist)
Crash reason: EXC_BAD_ACCESS / KERN_INVALID_ADDRESS
Crash address: 0x0
Process uptime: 24 seconds
Thread 0 (crashed)
0 0x0
rax = 0x0000011c0113c000 rdx = 0x0000011c09094590
rcx = 0x0000000000000006 rbx = 0x0000011c0e2a0000
rsi = 0x00007ffedfc11500 rdi = 0x0000011c01378010
rbp = 0x00007ffedfc11540 rsp = 0x00007ffedfc114f8
r8 = 0x0000000000000006 r9 = 0x0000000123a6ccc4
r10 = 0x0000011c011018d0 r11 = 0x00007ffdbc1a4834
r12 = 0x0000000000000006 r13 = 0x0000011c090944b0
r14 = 0x0000011c0e34c000 r15 = 0x00007ffedfc11550
rip = 0x0000000000000000
Found by: given as instruction pointer in context
1 libGLESv2.dylib!gl::Context::objectLabel(unsigned int, unsigned int, int, char const*) + 0x156
rbp = 0x00007ffedfc116a0 rsp = 0x00007ffedfc11550
rip = 0x00000001357b38e6
Found by: previous frame's frame pointer
2 libGLESv2.dylib!_GL_ObjectLabelKHR + 0xa5
rbp = 0x00007ffedfc116f0 rsp = 0x00007ffedfc116b0
rip = 0x000000013578e7e5
Found by: previous frame's frame pointer
3 Chromium Framework!gpu::gles2::GLES2DecoderPassthroughImpl::DoBindTexture(unsigned int, unsigned int) + 0x1ea
rbp = 0x00007ffedfc11780 rsp = 0x00007ffedfc11700
rip = 0x000000011e7dcd4a
Found by: previous frame's frame pointer
Original change's description:
> Add Vulkan backend support for texture labels
>
> Add onLableUpdate support for textures in the Vulkan backend.
>
> Bug: b/229105865
> Change-Id: Id9e5b2b81352e97b7843a63f27709739005dc2f3
> Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3645854
> Reviewed-by: Ian Elliott <ianelliott@google.com>
> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
> Reviewed-by: Jamie Madill <jmadill@chromium.org>
> Commit-Queue: Ian Elliott <ianelliott@google.com>
Bug: b/229105865
Change-Id: I5a5e00084e1320a486c43fec9d41b9ae6cb2b1db
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3669657
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Kai Ninomiya <kainino@chromium.org>
ANGLE’s Vulkan back-end implementation lives in this folder.
Vulkan is an explicit graphics API. It has a lot in common with other explicit APIs such as Microsoft’s D3D12 and Apple’s Metal. Compared to APIs like OpenGL or D3D11 explicit APIs can offer a number of significant benefits:
The RendererVk class represents an EGLDisplay. RendererVk owns shared global
resources like the VkDevice, VkQueue, the Vulkan format tables
and internal Vulkan shaders. The ContextVk class implements the back-end
of a front-end OpenGL Context. ContextVk processes state changes and handles action commands like
glDrawArrays and glDrawElements.
The back-end records commands into command buffers via the following ContextVk APIs:
beginNewRenderPass: Writes out (aka flushes) prior pending commands into a primary command
buffer, then starts a new render pass. Returns a secondary command buffer inside a render pass
instance. getOutsideRenderPassCommandBuffer: May flush prior command buffers and close the render pass if
necessary, in addition to issuing the appropriate barriers. Returns a secondary command buffer
outside a render pass instance. getStartedRenderPassCommands: Returns a reference to the currently open render pass’ commands
buffer.
The back-end (mostly) records Image and Buffer barriers through additional CommandBufferAccess
APIs, the result of which is passed to getOutsideRenderPassCommandBuffer. Note that the
barriers are not actually recorded until getOutsideRenderPassCommandBuffer is called:
onBufferTransferRead and onBufferComputeShaderRead accumulate VkBuffer read barriers. onBufferTransferWrite and onBufferComputeShaderWrite accumulate VkBuffer write barriers. onBuffferSelfCopy is a special case for VkBuffer self copies. It behaves the same as write. onImageTransferRead and onImageComputerShadeRead accumulate VkImage read barriers. onImageTransferWrite and onImageComputerShadeWrite accumulate VkImage write barriers. onImageRenderPassRead and onImageRenderPassWrite accumulate VkImage barriers inside a
started RenderPass.
After the back-end records commands to the primary buffer and we flush (e.g. on swap) or when we call
ContextVk::finishToSerial, ANGLE submits the primary command buffer to a VkQueue.
See the code for more details.
In this example we’ll be recording a buffer copy command:
// Ensure that ANGLE sets proper read and write barriers for the Buffers.
vk::CommandBufferAccess access;
access.onBufferTransferWrite(dstBuffer);
access.onBufferTransferRead(srcBuffer);
// Get a pointer to a secondary command buffer for command recording.
vk::OutsideRenderPassCommandBuffer *commandBuffer;
ANGLE_TRY(contextVk->getOutsideRenderPassCommandBuffer(access, &commandBuffer));
// Record the copy command into the secondary buffer. We're done!
commandBuffer->copyBuffer(srcBuffer->getBuffer(), dstBuffer->getBuffer(), copyCount, copies);
More implementation details can be found in the doc directory: