mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-24 10:48:53 +01:00
internal/graphicsdriver/directx: bug fix: wrong SDK version for Xbox One
This commit is contained in:
parent
50021ef3e4
commit
a6e121613f
@ -62,9 +62,6 @@ const (
|
||||
_D3D12_MIN_DEPTH = 0.0
|
||||
_D3D12_REQ_TEXTURE2D_U_OR_V_DIMENSION = 16384
|
||||
_D3D12_RESOURCE_BARRIER_ALL_SUBRESOURCES = 0xffffffff
|
||||
_D3D12_SDK_VERSION = (_D3D12_SDK_VERSION_MAJOR << 16) | _D3D12_SDK_VERSION_MINOR
|
||||
_D3D12_SDK_VERSION_MAJOR = 2
|
||||
_D3D12_SDK_VERSION_MINOR = 4
|
||||
_D3D12XBOX_DEFAULT_SIZE_BYTES = 0xffffffff
|
||||
)
|
||||
|
||||
|
@ -303,7 +303,7 @@ func (g *Graphics) initializeXbox(useWARP bool, useDebugLayer bool) (ferr error)
|
||||
}
|
||||
|
||||
params := &_D3D12XBOX_CREATE_DEVICE_PARAMETERS{
|
||||
Version: _D3D12_SDK_VERSION, // TODO: Can we always use the same value?
|
||||
Version: microsoftgdk.D3D12SDKVersion(),
|
||||
GraphicsCommandQueueRingSizeBytes: _D3D12XBOX_DEFAULT_SIZE_BYTES,
|
||||
GraphicsScratchMemorySizeBytes: _D3D12XBOX_DEFAULT_SIZE_BYTES,
|
||||
ComputeScratchMemorySizeBytes: _D3D12XBOX_DEFAULT_SIZE_BYTES,
|
||||
|
@ -87,6 +87,17 @@ func D3D12DLLName() string {
|
||||
}
|
||||
}
|
||||
|
||||
func D3D12SDKVersion() uint32 {
|
||||
switch C.XSystemGetDeviceType() {
|
||||
case _XSystemDeviceType_XboxOne, _XSystemDeviceType_XboxOneS, _XSystemDeviceType_XboxOneX, _XSystemDeviceType_XboxOneXDevkit:
|
||||
return (1 << 16) | 10
|
||||
case _XSystemDeviceType_XboxScarlettLockhart, _XSystemDeviceType_XboxScarlettAnaconda, _XSystemDeviceType_XboxScarlettDevkit:
|
||||
return (2 << 16) | 4
|
||||
default:
|
||||
return 0
|
||||
}
|
||||
}
|
||||
|
||||
func init() {
|
||||
if r := C.XGameRuntimeInitialize(); uint32(r) != uint32(windows.S_OK) {
|
||||
panic(fmt.Sprintf("microsoftgdk: XSystemGetDeviceType failed: HRESULT(%d)", uint32(r)))
|
||||
|
@ -27,3 +27,7 @@ func MonitorResolution() (int, int) {
|
||||
func D3D12DLLName() string {
|
||||
return ""
|
||||
}
|
||||
|
||||
func D3D12SDKVersion() uint32 {
|
||||
return 0
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user