mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-26 11:48:55 +01:00
internal/graphicsdriver/directx: fix a constant value for Xbox
Updates #2084
This commit is contained in:
parent
44cfb92cee
commit
348435f769
@ -367,15 +367,34 @@ const (
|
|||||||
type _D3D12_RESOURCE_STATES int32
|
type _D3D12_RESOURCE_STATES int32
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
_D3D12_RESOURCE_STATE_VERTEX_AND_CONSTANT_BUFFER _D3D12_RESOURCE_STATES = 0x1
|
||||||
|
_D3D12_RESOURCE_STATE_INDEX_BUFFER _D3D12_RESOURCE_STATES = 0x2
|
||||||
_D3D12_RESOURCE_STATE_RENDER_TARGET _D3D12_RESOURCE_STATES = 0x4
|
_D3D12_RESOURCE_STATE_RENDER_TARGET _D3D12_RESOURCE_STATES = 0x4
|
||||||
_D3D12_RESOURCE_STATE_DEPTH_WRITE _D3D12_RESOURCE_STATES = 0x10
|
_D3D12_RESOURCE_STATE_DEPTH_WRITE _D3D12_RESOURCE_STATES = 0x10
|
||||||
|
_D3D12_RESOURCE_STATE_NON_PIXEL_SHADER_RESOURCE _D3D12_RESOURCE_STATES = 0x40
|
||||||
_D3D12_RESOURCE_STATE_PIXEL_SHADER_RESOURCE _D3D12_RESOURCE_STATES = 0x80
|
_D3D12_RESOURCE_STATE_PIXEL_SHADER_RESOURCE _D3D12_RESOURCE_STATES = 0x80
|
||||||
|
_D3D12_RESOURCE_STATE_INDIRECT_ARGUMENT _D3D12_RESOURCE_STATES = 0x200
|
||||||
_D3D12_RESOURCE_STATE_COPY_DEST _D3D12_RESOURCE_STATES = 0x400
|
_D3D12_RESOURCE_STATE_COPY_DEST _D3D12_RESOURCE_STATES = 0x400
|
||||||
_D3D12_RESOURCE_STATE_COPY_SOURCE _D3D12_RESOURCE_STATES = 0x800
|
_D3D12_RESOURCE_STATE_COPY_SOURCE _D3D12_RESOURCE_STATES = 0x800
|
||||||
_D3D12_RESOURCE_STATE_GENERIC_READ _D3D12_RESOURCE_STATES = 0x1 | 0x2 | 0x40 | 0x80 | 0x200 | 0x800
|
|
||||||
_D3D12_RESOURCE_STATE_PRESENT _D3D12_RESOURCE_STATES = 0
|
_D3D12_RESOURCE_STATE_PRESENT _D3D12_RESOURCE_STATES = 0
|
||||||
)
|
)
|
||||||
|
|
||||||
|
func _D3D12_RESOURCE_STATE_GENERIC_READ() _D3D12_RESOURCE_STATES {
|
||||||
|
if microsoftgdk.IsXbox() {
|
||||||
|
return _D3D12_RESOURCE_STATE_VERTEX_AND_CONSTANT_BUFFER |
|
||||||
|
_D3D12_RESOURCE_STATE_INDEX_BUFFER |
|
||||||
|
_D3D12_RESOURCE_STATE_COPY_SOURCE |
|
||||||
|
_D3D12_RESOURCE_STATE_NON_PIXEL_SHADER_RESOURCE |
|
||||||
|
_D3D12_RESOURCE_STATE_PIXEL_SHADER_RESOURCE
|
||||||
|
}
|
||||||
|
return _D3D12_RESOURCE_STATE_VERTEX_AND_CONSTANT_BUFFER |
|
||||||
|
_D3D12_RESOURCE_STATE_INDEX_BUFFER |
|
||||||
|
_D3D12_RESOURCE_STATE_NON_PIXEL_SHADER_RESOURCE |
|
||||||
|
_D3D12_RESOURCE_STATE_PIXEL_SHADER_RESOURCE |
|
||||||
|
_D3D12_RESOURCE_STATE_INDIRECT_ARGUMENT |
|
||||||
|
_D3D12_RESOURCE_STATE_COPY_SOURCE
|
||||||
|
}
|
||||||
|
|
||||||
type _D3D12_ROOT_PARAMETER_TYPE int32
|
type _D3D12_ROOT_PARAMETER_TYPE int32
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
@ -424,7 +424,7 @@ func (g *Graphics) Initialize() (ferr error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func createBuffer(device *_ID3D12Device, bufferSize uint64, heapType _D3D12_HEAP_TYPE) (*_ID3D12Resource, error) {
|
func createBuffer(device *_ID3D12Device, bufferSize uint64, heapType _D3D12_HEAP_TYPE) (*_ID3D12Resource, error) {
|
||||||
state := _D3D12_RESOURCE_STATE_GENERIC_READ
|
state := _D3D12_RESOURCE_STATE_GENERIC_READ()
|
||||||
if heapType == _D3D12_HEAP_TYPE_READBACK {
|
if heapType == _D3D12_HEAP_TYPE_READBACK {
|
||||||
state = _D3D12_RESOURCE_STATE_COPY_DEST
|
state = _D3D12_RESOURCE_STATE_COPY_DEST
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user