Skip to content

v0.0.5r5

Latest

Choose a tag to compare

@leegao leegao released this 22 Aug 11:16
c8baafb

See https://github.com/leegao/bionic-vulkan-wrapper/releases/tag/v0.0.4 for instructions on how to use it

Missing Feature/Extension emulation for Winlator Bionic on:

  1. Adreno 6XX stuck on 512.502 (BCn)
  2. Some Mali devices (e.g. Pixel 8)
  3. Some Xclipse devices

For Mali devices, be sure to:

  1. Try using dxvk 1.5.5 if 1.10.3 doesn't work

Note: in Winlator CMOD, the terminal moved. You can either start the container and then find the terminal on the left-hand side menu, or you can copy libvulkan_wrapper.so to Z:\usr\lib within the windows explorer.

See https://github.com/user-attachments/assets/2c78d8a7-da65-48c5-a295-69fcf45f1b07 for a video tutorial (courtesy of kylinzang)


New Features in v0.0.5r4 and 0.0.5r5

  • Depth Format Reduction: reduce the depth buffer format, may improve performance/memory usage for some games
  • Geometry Shader Faking: for PowerVR devices
  • Mali SPIRV/Shader Fixes:
    • Adds a pass for spec composite constants that causes dxvk 1.7.3 to black screen
    • Adds optimization barriers to prevent aggressive driver optimizations leading to buggy compiled shaders
  • Striped Texture Detection: Fixes striped textures in Dead Space due to dynamic BC1/3 packing in their game engine (enable with CHECK_FOR_STRIPING)
  • Driver-Specific Workarounds:
    • Automatically disable VK_EXT_extended_dynamic_state on Mali for DXVK < 2.
    • Only disable VK_KHR_shader_float_controls on Qualcomm
  • VK_POLYGON_MODE_LINE faking - on Mali devices that do not support it to fall back to VK_POLYGON_MODE_FILL
  • Advanced Artifact Dumping: dump BCn textures and decoding artifacts new environment variables (DUMP_BCN, DUMP_SRC_BCN)
  • BCn Validation System: VALIDATE_BCN added to compare the output of the GPU-based BCn decoder against a reference CPU decoder
  • BC4-5 Fixes for USE_CPU_BCN: Fixed a stride problem that causes banding on BC4 and BC5 textures when decoded by USE_CPU_BCN

Current staging build:

[v0.0.5r5] - Fix shader BCn decoding glitch in Factorio due to using the wrong bounds checking - #142
[v0.0.5r4] - Added BCn texture/decoding artifact dumping, depth-buffer reduction mode, geometry shader faking, rewrite passes for FixMaliSpecCompositeConstants and MaliAddOptimizationBarriers, option to detect and fix texture striping in Dead Space, auto disable VK_EXT_extended_dynamic_state on Mali, fix for BC4-5 causing texture banding
[v0.0.5r3] - Fixes a WSI validation error on Mali (and other) devices due to blitting
[v0.0.5r2] - Fix USE_VVL for newer Android devices, add DUMP_BCN_ARTIFACTS for debugging purposes that dumps all processed BCn objects
[v0.0.5r1] - Add vulkan validation layer integration (and ability to add new layers between the wrapper and libvulkan.so)
[v0.0.5r0] - Initial ClipDistance emulation, more complete cpu/gpu side decompression format support, more debugging tools
[v0.0.4r9] - Fixes a compute shader bug for some Mali drivers (can use bcn decoding without USE_CPU_BCN), thanks to Ahmed for helping debug #99
[v0.0.4r8] - Fixes USE_CPU_BCN problem in 4r7
[v0.0.4r7] - Adds GPU fault reporting dumps
[v0.0.4r6] - Reverts a buggy implementation of the inter-buffer GC, and various other improvements / refactorings
[v0.0.4r5] - Fixes a race condition, exposes more error logs from vulkan trace failures
[v0.0.4r4] - Reworked temporary object tracking to be tracked by a secondary command buffer, should reduce memory usage. Added watermarker and mask coloring for debugging. Added more feature faking for G57 r32p1.
[v0.0.4r3] - Reworked temporary object tracking to be tracked by the image, should reduce memory usage slightly, will change this to a thread soon. Also added debug color for buffer overflows in the shader (bright pixel), and fixed GPU faults for BC6 as well
[v0.0.4r2] - Make untracked buffers a non-fatal error, we may be leaking internal/staging vkBuffers out (e.g. WSI did have issues with incomplete buffer tracking too in the past) See #45
[v0.0.4r1] - Fix for GPU faults on BC7 due to register pressure, and add dualSrcBlend as a faked feature for Mali G715 on r38p1. See #43

New Environment Variables:

  • MASK_BCN - can be a list of all, bc1, ..., bc7, 131, ..., 146 - skip BCn compute for select BC texture types (to debug GPU faults/hangs)
  • WATERMARK_BCN - can be a list of all, bc1, ..., bc7, 131, ..., 146 - mark the bottom 32x32 block of pixels for every texture of this type with a solid color (to debug texture faults)
  • USE_CPU_BCN - can be a list of all, bc1, ..., bc7, 131, ..., 146 - use CPU decoding for the selected formats instead of compute (if your game is hanging, try this)
  • DISABLE_BCN - disable BCn emulation for specific texture formats (all, bc1 ... bc7, ...)
  • WATERMARK_SIZE - how big the WATERMARK_BCN mark should be, from XXS ... S, M, L, ... XXL
  • NO_BCN_EMULATION - Disable the BCn emulation path completely
  • NO_BC123_EMULATION - Disable the BC1-BC3 emulation path completely
  • LOG_DISASSEMBLY - Enables logging of transformed spirv code
  • DISABLE_EXTERNAL_FD - For some games that tries to import external fd, it may fail on Proton for certain underlying drivers. This flag will disable this path in dxvk.
  • FORCE_CLIP_DISTANCE - enable ClipDistance emulation even when the underlying driver supports it
  • DISABLE_CLIP_DISTANCE - disable ClipDistance emulation even when the underlying driver does not support it
  • WRAPPER_ONE_BY_ONE - submits bcn tasks to the GPU one by one instead of inlined into the application's command buffer. Helps isolate which specific shader causes problems
  • USE_VVL - make sure you also download and copy libVkLayer_khronos_validation.so into usr/lib as well, this will toggle on the Vulkan Validation layer
  • DUMP_BCN_ARTIFACTS - dumps every decoded texture to a /sdcard/Documents/Wrapper/artifacts_... directory. This is extremely slow and creates lots of really large files. Use only when asked to.

(new)

  • DUMP_BCN - Dump artifacts for successfully decoded BCn textures to /sdcard/Documents/Wrapper/artifacts.... This can be a list of all, bc1, ..., bc7. This is very slow and generates large files.
  • VALIDATE_BCN - Enables validation of GPU vs. CPU BCn decoding. Dumps artifacts only on a mismatch. Accepts the same format list as DUMP_BCN.
  • DUMP_SRC_BCN - Dumps the original, compressed source buffer and region info before any decoding is attempted. Useful for debugging corrupted source textures.
  • WRAPPER_REDUCE_DEPTH_FORMAT - Reduces the precision of depth/stencil formats to improve compatibility.
    • safe: Reduces D24/D32 formats to D16 variants while preserving the stencil buffer if possible.
    • aggressive: Reduces all D24/D32/D16S8 formats to D16, discarding the stencil buffer.
    • disabled: Blocks the creation of depth/stencil images entirely for debugging purposes.
  • DISABLE_SPEC_COMPOSITE_CONSTANTS / FORCE_SPEC_COMPOSITE_CONSTANTS - Disables/forces the SPIR-V pass that fixes specialization composite constant issues on Mali GPUs that causes 1.7.3 to black screen.
  • DISABLE_OPTIMIZATION_BARRIERS / FORCE_OPTIMIZATION_BARRIERS - Disables/forces the SPIR-V pass that adds optimization barriers for Mali/Adreno drivers.
  • CHECK_FOR_STRIPING - Set to 1 to enable the detection of striped BCn textures (for Dead Space for e.g.), note that this forces a CPU decoding path.

Logging Instructions:

Validation Logs:

  1. Create a directory (if it doesn't already exist) at /sdcard/Documents/Wrapper
  2. Download libVkLayer_khronos_validation.so.zip
  3. Extract the library, and in Winlator, copy it to the same directory that libvulkan_wrapper.so is in
  4. Go to the Environment Variables view in your container settings
  5. Add an entry for USE_VVL (upper case) to 1
  6. Rerun the game
  7. Grab the logs at /sdcard/Documents/Wrapper/vvl_*.txt and upload them here

Wrapper Logs:

  1. Create a directory (if it doesn't already exist) at /sdcard/Documents/Wrapper
  2. Go to the Environment Variables view in your container settings
  3. Add an entry for WRAPPER_LOG_LEVEL (upper case) to debug (small case - NOTE: do not set to all as this can generate several gbs of logs)
  4. Rerun the game
  5. Grab the logs at /sdcard/Documents/Wrapper/wrapper_*.txt and upload them here

See https://photos.app.goo.gl/6Ah6EkkjQpR2Rsih8

DXVK Logs:

  1. Go to the Environment Variables view in your container settings (same as before)
  2. Add an entry for DXVK_LOG_LEVEL (upper case) to debug (small case)
  3. Add another entry for DXVK_LOG_PATH (upper case) set to /sdcard/Download

Run the game, then go to your Files app, go into Internal storage > Download, and look for $GAME_d3d11.log and upload it as well

Wine Logs:

  1. Go to Winlator's settings
  2. Scroll down to the Logs section and enable Wine debug and Box64 logs
  3. Click on the little + button and also select vulkan and all of the d3d... entries too
  4. Rerun the game
  5. Grab the logs at /sdcard/Download/Winlator/logs

See https://photos.app.goo.gl/HQunEv1is28vRT9v6

BCn Artifacts:

  1. Create a directory (if it doesn't already exist) at /sdcard/Documents/Wrapper
  2. Go to the Environment Variables view in your container settings
  3. Add an entry for DUMP_BCN_ARTIFACTS (upper case) to 1
  4. Rerun the game
  5. Zip the newest artifacts at the /sdcard/Documents/Wrapper/artifacts_... directory and upload it

Don't forget to set your video memory to the maximum: https://photos.app.goo.gl/53rAyWAZBEq75UxB8

What's Changed

Full Changelog: v0.0.5r4...v0.0.5r5