protonscr

[d3d9] Incorrect border color texture address mode behaviour with A8L8 texture

dxvkclosed
doitsujin/dxvk#5388 · opened 2025-12-17 by Cambidd · updated 2025-12-17 · 2 comments · github
CCambidd 2025-12-17 github

Admittedly this is probably a very niche situation, but it's an issue I encountered in another project I work on. When using the D3DTADDRESS_BORDER texture address mode on a sampler with a A8L8 monochrome texture set to it, the color channels don't seem to be mapped correctly. I have to put the alpha value I want on the green channel of the D3DCOLOR value passed to D3DSAMP_BORDERCOLOR when using a monochrome bitmap with DXVK (but this then will break if a A8R8G8B8 texture is used). This does not happen with the windows driver d3d9 iimplementations (tested AMD and Intel) where the channels are mapped correctly regardless of texture format.

This issue comes up with Halo Custom Edition with the lastest chimera master which restores the Xbox motion sensor blending. It works fine with a 32-bit sweeper texture but doesn't blend correctly with DXVK with a A8L8 version due to this issue.
Left is AMD d3d9, right is DXVK. Note the blips disappearing when the sweeper starts.
https://github.com/user-attachments/assets/e5a7d97c-b128-4c8e-8f51-3ad3250c61ae

I've been told it works properly with Nvidia hardware with DXVK to make things more confusing.

Software information

Halo Custom Edition
Latest chimera master https://github.com/SnowyMouse/chimera/actions/runs/20274277404
Restored maps with monochrome sweeper bitmap (extract to /maps directory https://cdn.discordapp.com/attachments/631949444316659742/1450639123684786367/halopc-restored-custom-edition-full-r212.7z?ex=69434476&is=6941f2f6&hm=5f04e22739b2604e857ff5b84904169655638256a7741753148429987823b203&

System information

  • GPU: AMD 5700XT
  • Driver: Mesa 25.1.9
  • Wine version: Staging 10.5
  • DXVK version: v2.7.1-346-g900779d8

Apitrace file(s)

https://drive.google.com/file/d/1UQe0eYBn66VoDDSz_rmkNUgFXAJoBw9E/view?usp=sharing

Log files

haloce_d3d9.log

Ddoitsujin maintainer 2025-12-17 github

This is a quirk with how border colors work in hardware, we implement L8A8 as R8G8 with swizzling, but some GPUs (including AMD) will also swizzle the border color while others don't (e.g. Nvidia); we'll need to implement some sort of fix-up using EXT_border_color_swizzle.

Ddoitsujin maintainer 2025-12-17 github

The trace only seems to render the splash screen.

Edit: Unrelated, probably game bug because one of the vertex buffers just contains garbage. It does render the right thing in the background.

Nothing extracted yet.