From 770fcff4c2e91e763cd1f4b16592e21c67e6445f Mon Sep 17 00:00:00 2001 From: Hajime Hoshi Date: Sat, 27 Jan 2024 17:44:29 +0900 Subject: [PATCH] internal/graphicsdriver/directx: bug fix: Go 1.22 + 32bit Windows + DirectX 12 didn't work well Apparently, a pseudo padding was needed for D3D12_RESOURCE_DESC, but this is still mysterious. This change also add Go 1.22 to the GitHub Actions. Closes #2867 --- .github/workflows/test.yml | 2 +- internal/graphicsdriver/directx/api_32bit_windows.go | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index b031b7911..cc643525d 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -7,7 +7,7 @@ jobs: strategy: matrix: os: [ubuntu-latest, macos-latest, windows-latest] - go: ['1.18.x', '1.19.x', '1.20.x', '1.21.x'] + go: ['1.18.x', '1.19.x', '1.20.x', '1.21.x', '1.22.0-rc.2'] name: Test with Go ${{ matrix.go }} on ${{ matrix.os }} runs-on: ${{ matrix.os }} env: diff --git a/internal/graphicsdriver/directx/api_32bit_windows.go b/internal/graphicsdriver/directx/api_32bit_windows.go index 2dd7538ad..daf50792e 100644 --- a/internal/graphicsdriver/directx/api_32bit_windows.go +++ b/internal/graphicsdriver/directx/api_32bit_windows.go @@ -40,6 +40,10 @@ type _D3D12_RESOURCE_DESC struct { SampleDesc _DXGI_SAMPLE_DESC Layout _D3D12_TEXTURE_LAYOUT Flags _D3D12_RESOURCE_FLAGS + + // This is a pseudo padding which D3D12_RESOURCE_DESC1 would use. + // Mysteriously, some functions don't work correctly without this hack (#2867). + _ [12]byte } type _D3D12_ROOT_PARAMETER struct {