Disable Compression Buffers (Not use Arm Frame Buffer Compression (AFBC) ) in ANGLE

117 views
Skip to first unread message

Kha Trần

unread,
Jun 10, 2025, 9:21:10 AMJun 10
to angleproject
Hi ANGLE developers,

I'm trying to use ANGLE for my device with Arm GPU (Mali Vulkan is used as Backend).
My GPU hardware does not support Arm Frame Buffer Compression (AFBC).

On native Mali GPU library, I have to disable Arm Frame Buffer Compression (AFBC)
to avoid below issue:

error detected from slot 0, job status 0x00000058 (DATA_INVALID_FAULT)
t6xx: GPU fault 0x58 from job slot 0

As my investigation, AFBC is only used when image compression is required.

So if you know how to disable using AFBC in ANGLE.
Please let me know. Thank you so much!

Best Regards,
Kha Tran

Shahbaz Youssefi

unread,
Jun 10, 2025, 10:08:06 AMJun 10
to angleproject
Hello,

It looks like you have source access to the driver? In that case, you should be able to disable AFBC in the ARM Vulkan driver.

However, if you have to tweak ANGLE to achieve this, then you can indirectly affect the Vulkan driver's decision. As far as I know, using VK_IMAGE_USAGE_STORAGE_BIT disables AFBC for example, you can add that to any image that can take it!

Kha Trần

unread,
Jun 14, 2025, 9:52:54 AMJun 14
to angleproject
Hello,

Thanks for your answer.
I have Arm Mali Source. But I'd love to disable it in ANGLE. I've tried to use  VK_IMAGE_USAGE_STORAGE_BIT and some other flags in  Enabling AFBC in your Vulkan Application :: Vulkan Documentation Project to disable AFBC. However, it does not work as expected.

Do you know any file or function which directly affects Vulkan Display Render on ANGLE?
Thanks in advance!

Vào lúc 21:08:06 UTC+7 ngày Thứ Ba, 10 tháng 6, 2025, syou...@chromium.org đã viết:

Shahbaz Youssefi

unread,
Jun 16, 2025, 11:52:43 AMJun 16
to angleproject
Hard to tell without seeing code why it didn't work for you. If you search for VK_IMAGE_USAGE_ in ANGLE, you can see where we select usage flags and add the STORAGE bit to it. One example is TextureVk::initImageUsageFlags, another is RenderbufferVk::setStorageImpl. Here's another example of where we used to set this flag on the swapchain: https://chromium-review.googlesource.com/c/angle/angle/+/2225810/3/src/libANGLE/renderer/vulkan/SurfaceVk.cpp#873.

That said, if your hardware doesn't support AFBC, it's very clearly the responsibility of the driver to avoid using AFBC.

Kha Trần

unread,
Jun 24, 2025, 7:16:27 AMJun 24
to angleproject
Thank you for your response!

I shared the diff. Would you please give your suggestion?
> One example is TextureVk::initImageUsageFlags, another is RenderbufferVk::setStorageImpl. Here's another example of where we used to set this flag on the swapchain: https://chromium-review.googlesource.com/c/angle/angle/+/2225810/3/src/libANGLE/renderer/vulkan/SurfaceVk.cpp#873.
That's great! Let me learn from it. Thank you


Vào lúc 22:52:43 UTC+7 ngày Thứ Hai, 16 tháng 6, 2025, syou...@chromium.org đã viết:
Disable_AFBC_not_work.diff
try_disable_afbc_but_failed.diff

Kha Trần

unread,
Jun 24, 2025, 8:56:20 AMJun 24
to angleproject
Hi Shahbaz Youssefi,

Let me also share log. Please help me give your suggestion if possible

W mali 14850000.gpu: error detected from slot 1, job status 0x00000058 (DATA_INVALID_FAULT)
E mali 14850000.gpu: t6xx: GPU fault 0x58 from job slot 1
D StatsLog: LAUNCHER_ALLAPPS_OPEN_UPW libEGL  : ANGLE Warn:MemoryTracking.cpp:50 (OutputMemoryLogStream): Currently allocated size for memory allocation type (ImageExternal): 24576 | Count: 1
W libEGL  : --> Heap index 0: 24576 | Count: 1
W libEGL  : ANGLE Warn:MemoryTracking.cpp:50 (OutputMemoryLogStream): Currently allocated size for memory allocation type (SwapchainDepthStencilImage): 2396160 | Count: 2
W libEGL  : --> Heap index 0: 2396160 | Count: 2
W libEGL  : ANGLE Warn:MemoryTracking.cpp:50 (OutputMemoryLogStream): Currently allocated size for memory allocation type (TextureImage): 16983680 | Count: 38
W libEGL  : --> Heap index 0: 16983680 | Count: 38
W libEGL  : ANGLE Warn:MemoryTracking.cpp:50 (OutputMemoryLogStream): Currently allocated size for memory allocation type (Buffer): 12648480 | Count: 6
W libEGL  : --> Heap index 0: 12648480 | Count: 6
W libEGL  : ANGLE Warn:MemoryTracking.cpp:50 (OutputMemoryLogStream): Memory heap info
W libEGL  :
W libEGL  : * Available memory heaps:
W libEGL  : 0 | Heap size: 8589934592 | Flags: 0x1
W libEGL  :
W libEGL  : * Available memory types:
W libEGL  : 0 | Heap index: 0 | Property flags: 0x7
W libEGL  : 1 | Heap index: 0 | Property flags: 0xb
W libEGL  : 2 | Heap index: 0 | Property flags: 0x11
W libEGL  : ANGLE Warn:vk_renderer.cpp:1793 (RetrieveDeviceLostInfoFromDevice): Fault description: <Exception type 0x58: DATA_INVALID_FAULT. VA: 0x1af4cb000.>
W libEGL  : --> Address fault reported at 0x1af4cb000 | Precision range: 0x1000 (12 bits) | Operation: None
W libEGL  : --> Vendor-specific fault reported (Code 88): <Exception type 0x58: DATA_INVALID_FAULT. VA: 0x1af4cb000.> | Fault Data: 0x40258
W libEGL  : --> Vendor-specific binary crash dump not available.
W libEGL  : ANGLE Warn:ContextVk.cpp:7274 (handleError): Internal Vulkan error (-4): The logical or physical device has been lost.
W libEGL  : ANGLE Warn:Debug.cpp:180 (insertMessage): GL error: HIGH: Error: 0x00000507, in ../../src/libANGLE/renderer/vulkan/SurfaceVk.cpp, cl
eanUpPresentHistory:2745. Internal Vulkan error (-4): The logical or physical device has been lost.
W HWUI    : swapBuffers encountered EGL error 12301 on 0xb400ed493828fca0, halting rendering...
E libEGL  : eglMakeCurrentImpl:1088 error 300e (EGL_CONTEXT_LOST)
F HWUI    : Failed to make current on surface 0x0, error=EGL_CONTEXT_LOST
Vào lúc 18:16:27 UTC+7 ngày Thứ Ba, 24 tháng 6, 2025, Kha Trần đã viết:

Shahbaz Youssefi

unread,
Jun 26, 2025, 9:48:07 PMJun 26
to angleproject
Why add VK_IMAGE_USAGE_TRANSIENT_ATTACHMENT_BIT to swapchain images? That can't be good. VK_IMAGE_CREATE_ALIAS_BIT is also suspicious. All you really need is VK_IMAGE_USAGE_STORAGE_BIT. 

Kha Trần

unread,
Jul 13, 2025, 11:53:31 PMJul 13
to angleproject
Hello  Shahbaz Youssefi,

Thanks for your great support. I figured out that the issue was not AFBC issue.
Issue was caused if supportsExtendedDynamicState2 was disabled by this commit 37d2277bd - platform/external/angle - Git at Google.

As described there were some issues on latest Vulkan Drivers. But no mention which version is the latest at the time, PIC submitted this commit.

I'm currently using r50p0 and having render issue when jumping to Main UI if this commit was applied.
I'm checking more about this and if I can have clear information. I may submit the fix back to ANGLE repo.

By the way, supportsExtendedDynamicState2 was supported by your commit and it was related to VK_EXT_extended_dynamic_state2. It's good if you can share how it works. So that I can have more investigation in Mali DDK to provide completed solution.

Thanks

Regards,
Kha

Vào lúc 08:48:07 UTC+7 ngày Thứ Sáu, 27 tháng 6, 2025, syou...@chromium.org đã viết:

Shahbaz Youssefi

unread,
Jul 14, 2025, 1:51:56 AMJul 14
to angleproject
Mali gpus with a job manager (JM in that commit) are an older architecture, I'm not sure how well they are supported by ARM. Disabling use of that extension should not cause rendering issues though, that should be a bug somewhere.

supportsExtendedDynamicState2 is an ANGLE feature, it's a flag basically that Renderer::initFeatures sets once (based on Vulkan driver features, driver bug workarounds etc) and the rest of the code uses to tweak its behavior. It can easily be overriden via EGL attributes (the `EGL_ANGLE_feature_control` extension found in extensions/EGL_ANGLE_feature_control,txt) or the command line / Android attribute: `export ANGLE_FEATURE_OVERRIDES_ENABLED=feature1:feature2` on Linux and `adb shell setprop debug.angle.feature_overrides_enabled feature1:feature2` on Android to force enable features (or use DISABLED/disabled to force disable them).

Kha Trần

unread,
Jul 15, 2025, 8:58:43 AMJul 15
to angleproject
Hello  Shahbaz Youssefi,


> This extension adds some more dynamic state to support applications that need to reduce the number of  pipeline state objects they compile and bind.
There are some chances we have performance degradation issue when supportsExtendedDynamicState2 is disabled. So it caused invalid access in Mali GPU?
I'm using Bifrost GPU (G-31). It's an old architecture.

> error detected from slot 1, job status 0x00000058 (DATA_INVALID_FAULT)

> t6xx: GPU fault 0x58 from job slot 1


It is reasonable? 

Vào lúc 12:51:56 UTC+7 ngày Thứ Hai, 14 tháng 7, 2025, syou...@chromium.org đã viết:

Shahbaz Youssefi

unread,
Jul 15, 2025, 7:38:38 PMJul 15
to angleproject
I'm afraid you'd need to do some more debugging in your system, I can't really tell. Disabling use of some dynamic state should not lead to a fault, that sounds like a driver bug.
Reply all
Reply to author
Forward
0 new messages