internal/graphicsdriver/directx: bug fix: depth should be passed by math.Float32bits

As depth was always 0, there was not an actual problem.
This commit is contained in:
Hajime Hoshi 2024-01-21 21:38:20 +09:00
parent 7652ccef81
commit e0ccd013ac

View File

@ -16,6 +16,7 @@ package directx
import (
"fmt"
"math"
"runtime"
"syscall"
"unsafe"
@ -963,7 +964,7 @@ func (i *_ID3D11DeviceContext) ClearState() {
func (i *_ID3D11DeviceContext) ClearDepthStencilView(pDepthStencilView *_ID3D11DepthStencilView, clearFlags uint8, depth float32, stencil uint8) {
_, _, _ = syscall.Syscall6(i.vtbl.ClearDepthStencilView, 5, uintptr(unsafe.Pointer(i)),
uintptr(unsafe.Pointer(pDepthStencilView)), uintptr(clearFlags), uintptr(depth),
uintptr(unsafe.Pointer(pDepthStencilView)), uintptr(clearFlags), uintptr(math.Float32bits(depth)),
uintptr(stencil), 0)
runtime.KeepAlive(pDepthStencilView)
}