mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-25 03:08:54 +01:00
Revert "internal/graphicsdriver/directx: refactoring: add syscallN"
This reverts commit 55a490736a
.
Reason: This has a potential risk of stack overflow.
Closes #2120
This commit is contained in:
parent
ecaa25faba
commit
d518e64e22
@ -38,37 +38,6 @@ func boolToUintptr(v bool) uintptr {
|
|||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
//go:nosplit
|
|
||||||
func syscallN(ptr uintptr, args ...uintptr) (r1, r2 uintptr, e windows.Errno) {
|
|
||||||
if ptr == 0 {
|
|
||||||
panic("directx: function pointer must not be 0")
|
|
||||||
}
|
|
||||||
switch len(args) {
|
|
||||||
case 0:
|
|
||||||
return syscall.Syscall(ptr, 0, 0, 0, 0)
|
|
||||||
case 1:
|
|
||||||
return syscall.Syscall(ptr, 1, args[0], 0, 0)
|
|
||||||
case 2:
|
|
||||||
return syscall.Syscall(ptr, 2, args[0], args[1], 0)
|
|
||||||
case 3:
|
|
||||||
return syscall.Syscall(ptr, 3, args[0], args[1], args[2])
|
|
||||||
case 4:
|
|
||||||
return syscall.Syscall6(ptr, 4, args[0], args[1], args[2], args[3], 0, 0)
|
|
||||||
case 5:
|
|
||||||
return syscall.Syscall6(ptr, 5, args[0], args[1], args[2], args[3], args[4], 0)
|
|
||||||
case 6:
|
|
||||||
return syscall.Syscall6(ptr, 6, args[0], args[1], args[2], args[3], args[4], args[5])
|
|
||||||
case 7:
|
|
||||||
return syscall.Syscall9(ptr, 7, args[0], args[1], args[2], args[3], args[4], args[5], args[6], 0, 0)
|
|
||||||
case 8:
|
|
||||||
return syscall.Syscall9(ptr, 8, args[0], args[1], args[2], args[3], args[4], args[5], args[6], args[7], 0)
|
|
||||||
case 9:
|
|
||||||
return syscall.Syscall9(ptr, 9, args[0], args[1], args[2], args[3], args[4], args[5], args[6], args[7], args[8])
|
|
||||||
default:
|
|
||||||
panic(fmt.Sprintf("directx: too many arguments: %d", len(args)))
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Reference:
|
// Reference:
|
||||||
// * https://github.com/microsoft/DirectX-Headers
|
// * https://github.com/microsoft/DirectX-Headers
|
||||||
// * https://github.com/microsoft/win32metadata
|
// * https://github.com/microsoft/win32metadata
|
||||||
@ -1136,11 +1105,11 @@ type _ID3D12CommandAllocator_Vtbl struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (i *_ID3D12CommandAllocator) Release() {
|
func (i *_ID3D12CommandAllocator) Release() {
|
||||||
syscallN(i.vtbl.Release, uintptr(unsafe.Pointer(i)))
|
syscall.Syscall(i.vtbl.Release, 1, uintptr(unsafe.Pointer(i)), 0, 0)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (i *_ID3D12CommandAllocator) Reset() error {
|
func (i *_ID3D12CommandAllocator) Reset() error {
|
||||||
r, _, _ := syscallN(i.vtbl.Reset, uintptr(unsafe.Pointer(i)))
|
r, _, _ := syscall.Syscall(i.vtbl.Reset, 1, uintptr(unsafe.Pointer(i)), 0, 0)
|
||||||
if uint32(r) != uint32(windows.S_OK) {
|
if uint32(r) != uint32(windows.S_OK) {
|
||||||
return fmt.Errorf("directx: ID3D12CommandAllocator::Reset failed: HRESULT(%d)", uint32(r))
|
return fmt.Errorf("directx: ID3D12CommandAllocator::Reset failed: HRESULT(%d)", uint32(r))
|
||||||
}
|
}
|
||||||
@ -1175,13 +1144,13 @@ type _ID3D12CommandQueue_Vtbl struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (i *_ID3D12CommandQueue) ExecuteCommandLists(ppCommandLists []*_ID3D12GraphicsCommandList) {
|
func (i *_ID3D12CommandQueue) ExecuteCommandLists(ppCommandLists []*_ID3D12GraphicsCommandList) {
|
||||||
syscallN(i.vtbl.ExecuteCommandLists, uintptr(unsafe.Pointer(i)),
|
syscall.Syscall(i.vtbl.ExecuteCommandLists, 3, uintptr(unsafe.Pointer(i)),
|
||||||
uintptr(len(ppCommandLists)), uintptr(unsafe.Pointer(&ppCommandLists[0])))
|
uintptr(len(ppCommandLists)), uintptr(unsafe.Pointer(&ppCommandLists[0])))
|
||||||
runtime.KeepAlive(ppCommandLists)
|
runtime.KeepAlive(ppCommandLists)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (i *_ID3D12CommandQueue) Signal(signal *_ID3D12Fence, value uint64) error {
|
func (i *_ID3D12CommandQueue) Signal(signal *_ID3D12Fence, value uint64) error {
|
||||||
r, _, _ := syscallN(i.vtbl.Signal, uintptr(unsafe.Pointer(i)),
|
r, _, _ := syscall.Syscall(i.vtbl.Signal, 3, uintptr(unsafe.Pointer(i)),
|
||||||
uintptr(unsafe.Pointer(signal)), uintptr(value))
|
uintptr(unsafe.Pointer(signal)), uintptr(value))
|
||||||
runtime.KeepAlive(signal)
|
runtime.KeepAlive(signal)
|
||||||
if uint32(r) != uint32(windows.S_OK) {
|
if uint32(r) != uint32(windows.S_OK) {
|
||||||
@ -1191,7 +1160,7 @@ func (i *_ID3D12CommandQueue) Signal(signal *_ID3D12Fence, value uint64) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (i *_ID3D12CommandQueue) Release() {
|
func (i *_ID3D12CommandQueue) Release() {
|
||||||
syscallN(i.vtbl.Release, uintptr(unsafe.Pointer(i)))
|
syscall.Syscall(i.vtbl.Release, 1, uintptr(unsafe.Pointer(i)), 0, 0)
|
||||||
}
|
}
|
||||||
|
|
||||||
type _ID3D12Debug struct {
|
type _ID3D12Debug struct {
|
||||||
@ -1211,11 +1180,11 @@ func (i *_ID3D12Debug) As(debug **_ID3D12Debug3) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (i *_ID3D12Debug) EnableDebugLayer() {
|
func (i *_ID3D12Debug) EnableDebugLayer() {
|
||||||
syscallN(i.vtbl.EnableDebugLayer, uintptr(unsafe.Pointer(i)))
|
syscall.Syscall(i.vtbl.EnableDebugLayer, 1, uintptr(unsafe.Pointer(i)), 0, 0)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (i *_ID3D12Debug) Release() {
|
func (i *_ID3D12Debug) Release() {
|
||||||
syscallN(i.vtbl.Release, uintptr(unsafe.Pointer(i)))
|
syscall.Syscall(i.vtbl.Release, 1, uintptr(unsafe.Pointer(i)), 0, 0)
|
||||||
}
|
}
|
||||||
|
|
||||||
type _ID3D12Debug3 struct {
|
type _ID3D12Debug3 struct {
|
||||||
@ -1234,7 +1203,7 @@ type _ID3D12Debug3_Vtbl struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (i *_ID3D12Debug3) SetEnableGPUBasedValidation(enable bool) {
|
func (i *_ID3D12Debug3) SetEnableGPUBasedValidation(enable bool) {
|
||||||
syscallN(i.vtbl.SetEnableGPUBasedValidation, uintptr(unsafe.Pointer(i)), boolToUintptr(enable))
|
syscall.Syscall(i.vtbl.SetEnableGPUBasedValidation, 2, uintptr(unsafe.Pointer(i)), boolToUintptr(enable), 0)
|
||||||
}
|
}
|
||||||
|
|
||||||
type _ID3D12DebugCommandList struct {
|
type _ID3D12DebugCommandList struct {
|
||||||
@ -1252,7 +1221,7 @@ type _ID3D12DebugCommandList_Vtbl struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (i *_ID3D12DebugCommandList) SetFeatureMask(mask _D3D12_DEBUG_FEATURE) error {
|
func (i *_ID3D12DebugCommandList) SetFeatureMask(mask _D3D12_DEBUG_FEATURE) error {
|
||||||
r, _, _ := syscallN(i.vtbl.SetFeatureMask, uintptr(unsafe.Pointer(i)), uintptr(mask))
|
r, _, _ := syscall.Syscall(i.vtbl.SetFeatureMask, 2, uintptr(unsafe.Pointer(i)), uintptr(mask), 0)
|
||||||
if uint32(r) != uint32(windows.S_OK) {
|
if uint32(r) != uint32(windows.S_OK) {
|
||||||
return fmt.Errorf("directx: ID3D12DebugCommandList::SetFeatureMask failed: HRESULT(%d)", uint32(r))
|
return fmt.Errorf("directx: ID3D12DebugCommandList::SetFeatureMask failed: HRESULT(%d)", uint32(r))
|
||||||
}
|
}
|
||||||
@ -1282,19 +1251,19 @@ func (i *_ID3D12DescriptorHeap) GetCPUDescriptorHandleForHeapStart() _D3D12_CPU_
|
|||||||
// There is a bug in the header file:
|
// There is a bug in the header file:
|
||||||
// https://stackoverflow.com/questions/34118929/getcpudescriptorhandleforheapstart-stack-corruption
|
// https://stackoverflow.com/questions/34118929/getcpudescriptorhandleforheapstart-stack-corruption
|
||||||
var handle _D3D12_CPU_DESCRIPTOR_HANDLE
|
var handle _D3D12_CPU_DESCRIPTOR_HANDLE
|
||||||
syscallN(i.vtbl.GetCPUDescriptorHandleForHeapStart, uintptr(unsafe.Pointer(i)), uintptr(unsafe.Pointer(&handle)))
|
syscall.Syscall(i.vtbl.GetCPUDescriptorHandleForHeapStart, 2, uintptr(unsafe.Pointer(i)), uintptr(unsafe.Pointer(&handle)), 0)
|
||||||
return handle
|
return handle
|
||||||
}
|
}
|
||||||
|
|
||||||
func (i *_ID3D12DescriptorHeap) GetGPUDescriptorHandleForHeapStart() _D3D12_GPU_DESCRIPTOR_HANDLE {
|
func (i *_ID3D12DescriptorHeap) GetGPUDescriptorHandleForHeapStart() _D3D12_GPU_DESCRIPTOR_HANDLE {
|
||||||
// This has the same issue as GetCPUDescriptorHandleForHeapStart.
|
// This has the same issue as GetCPUDescriptorHandleForHeapStart.
|
||||||
var handle _D3D12_GPU_DESCRIPTOR_HANDLE
|
var handle _D3D12_GPU_DESCRIPTOR_HANDLE
|
||||||
syscallN(i.vtbl.GetGPUDescriptorHandleForHeapStart, uintptr(unsafe.Pointer(i)), uintptr(unsafe.Pointer(&handle)))
|
syscall.Syscall(i.vtbl.GetGPUDescriptorHandleForHeapStart, 2, uintptr(unsafe.Pointer(i)), uintptr(unsafe.Pointer(&handle)), 0)
|
||||||
return handle
|
return handle
|
||||||
}
|
}
|
||||||
|
|
||||||
func (i *_ID3D12DescriptorHeap) Release() {
|
func (i *_ID3D12DescriptorHeap) Release() {
|
||||||
syscallN(i.vtbl.Release, uintptr(unsafe.Pointer(i)))
|
syscall.Syscall(i.vtbl.Release, 1, uintptr(unsafe.Pointer(i)), 0, 0)
|
||||||
}
|
}
|
||||||
|
|
||||||
type _ID3D12Device struct {
|
type _ID3D12Device struct {
|
||||||
@ -1351,8 +1320,9 @@ type _ID3D12Device_Vtbl struct {
|
|||||||
|
|
||||||
func (i *_ID3D12Device) CreateCommandAllocator(typ _D3D12_COMMAND_LIST_TYPE) (*_ID3D12CommandAllocator, error) {
|
func (i *_ID3D12Device) CreateCommandAllocator(typ _D3D12_COMMAND_LIST_TYPE) (*_ID3D12CommandAllocator, error) {
|
||||||
var commandAllocator *_ID3D12CommandAllocator
|
var commandAllocator *_ID3D12CommandAllocator
|
||||||
r, _, _ := syscallN(i.vtbl.CreateCommandAllocator, uintptr(unsafe.Pointer(i)),
|
r, _, _ := syscall.Syscall6(i.vtbl.CreateCommandAllocator, 4, uintptr(unsafe.Pointer(i)),
|
||||||
uintptr(typ), uintptr(unsafe.Pointer(&_IID_ID3D12CommandAllocator)), uintptr(unsafe.Pointer(&commandAllocator)))
|
uintptr(typ), uintptr(unsafe.Pointer(&_IID_ID3D12CommandAllocator)), uintptr(unsafe.Pointer(&commandAllocator)),
|
||||||
|
0, 0)
|
||||||
if uint32(r) != uint32(windows.S_OK) {
|
if uint32(r) != uint32(windows.S_OK) {
|
||||||
return nil, fmt.Errorf("directx: ID3D12Device::CreateCommandAllocator failed: HRESULT(%d)", uint32(r))
|
return nil, fmt.Errorf("directx: ID3D12Device::CreateCommandAllocator failed: HRESULT(%d)", uint32(r))
|
||||||
}
|
}
|
||||||
@ -1361,10 +1331,10 @@ func (i *_ID3D12Device) CreateCommandAllocator(typ _D3D12_COMMAND_LIST_TYPE) (*_
|
|||||||
|
|
||||||
func (i *_ID3D12Device) CreateCommandList(nodeMask uint32, typ _D3D12_COMMAND_LIST_TYPE, pCommandAllocator *_ID3D12CommandAllocator, pInitialState *_ID3D12PipelineState) (*_ID3D12GraphicsCommandList, error) {
|
func (i *_ID3D12Device) CreateCommandList(nodeMask uint32, typ _D3D12_COMMAND_LIST_TYPE, pCommandAllocator *_ID3D12CommandAllocator, pInitialState *_ID3D12PipelineState) (*_ID3D12GraphicsCommandList, error) {
|
||||||
var commandList *_ID3D12GraphicsCommandList
|
var commandList *_ID3D12GraphicsCommandList
|
||||||
r, _, _ := syscallN(i.vtbl.CreateCommandList,
|
r, _, _ := syscall.Syscall9(i.vtbl.CreateCommandList, 7,
|
||||||
uintptr(unsafe.Pointer(i)), uintptr(nodeMask), uintptr(typ),
|
uintptr(unsafe.Pointer(i)), uintptr(nodeMask), uintptr(typ),
|
||||||
uintptr(unsafe.Pointer(pCommandAllocator)), uintptr(unsafe.Pointer(pInitialState)), uintptr(unsafe.Pointer(&_IID_ID3D12GraphicsCommandList)),
|
uintptr(unsafe.Pointer(pCommandAllocator)), uintptr(unsafe.Pointer(pInitialState)), uintptr(unsafe.Pointer(&_IID_ID3D12GraphicsCommandList)),
|
||||||
uintptr(unsafe.Pointer(&commandList)))
|
uintptr(unsafe.Pointer(&commandList)), 0, 0)
|
||||||
runtime.KeepAlive(pCommandAllocator)
|
runtime.KeepAlive(pCommandAllocator)
|
||||||
runtime.KeepAlive(pInitialState)
|
runtime.KeepAlive(pInitialState)
|
||||||
if uint32(r) != uint32(windows.S_OK) {
|
if uint32(r) != uint32(windows.S_OK) {
|
||||||
@ -1375,10 +1345,10 @@ func (i *_ID3D12Device) CreateCommandList(nodeMask uint32, typ _D3D12_COMMAND_LI
|
|||||||
|
|
||||||
func (i *_ID3D12Device) CreateCommittedResource(pHeapProperties *_D3D12_HEAP_PROPERTIES, heapFlags _D3D12_HEAP_FLAGS, pDesc *_D3D12_RESOURCE_DESC, initialResourceState _D3D12_RESOURCE_STATES, pOptimizedClearValue *_D3D12_CLEAR_VALUE) (*_ID3D12Resource, error) {
|
func (i *_ID3D12Device) CreateCommittedResource(pHeapProperties *_D3D12_HEAP_PROPERTIES, heapFlags _D3D12_HEAP_FLAGS, pDesc *_D3D12_RESOURCE_DESC, initialResourceState _D3D12_RESOURCE_STATES, pOptimizedClearValue *_D3D12_CLEAR_VALUE) (*_ID3D12Resource, error) {
|
||||||
var resource *_ID3D12Resource
|
var resource *_ID3D12Resource
|
||||||
r, _, _ := syscallN(i.vtbl.CreateCommittedResource,
|
r, _, _ := syscall.Syscall9(i.vtbl.CreateCommittedResource, 8,
|
||||||
uintptr(unsafe.Pointer(i)), uintptr(unsafe.Pointer(pHeapProperties)), uintptr(heapFlags),
|
uintptr(unsafe.Pointer(i)), uintptr(unsafe.Pointer(pHeapProperties)), uintptr(heapFlags),
|
||||||
uintptr(unsafe.Pointer(pDesc)), uintptr(initialResourceState), uintptr(unsafe.Pointer(pOptimizedClearValue)),
|
uintptr(unsafe.Pointer(pDesc)), uintptr(initialResourceState), uintptr(unsafe.Pointer(pOptimizedClearValue)),
|
||||||
uintptr(unsafe.Pointer(&_IID_ID3D12Resource)), uintptr(unsafe.Pointer(&resource)))
|
uintptr(unsafe.Pointer(&_IID_ID3D12Resource)), uintptr(unsafe.Pointer(&resource)), 0)
|
||||||
runtime.KeepAlive(pHeapProperties)
|
runtime.KeepAlive(pHeapProperties)
|
||||||
runtime.KeepAlive(pDesc)
|
runtime.KeepAlive(pDesc)
|
||||||
runtime.KeepAlive(pOptimizedClearValue)
|
runtime.KeepAlive(pOptimizedClearValue)
|
||||||
@ -1390,8 +1360,9 @@ func (i *_ID3D12Device) CreateCommittedResource(pHeapProperties *_D3D12_HEAP_PRO
|
|||||||
|
|
||||||
func (i *_ID3D12Device) CreateCommandQueue(desc *_D3D12_COMMAND_QUEUE_DESC) (*_ID3D12CommandQueue, error) {
|
func (i *_ID3D12Device) CreateCommandQueue(desc *_D3D12_COMMAND_QUEUE_DESC) (*_ID3D12CommandQueue, error) {
|
||||||
var commandQueue *_ID3D12CommandQueue
|
var commandQueue *_ID3D12CommandQueue
|
||||||
r, _, _ := syscallN(i.vtbl.CreateCommandQueue, uintptr(unsafe.Pointer(i)),
|
r, _, _ := syscall.Syscall6(i.vtbl.CreateCommandQueue, 4, uintptr(unsafe.Pointer(i)),
|
||||||
uintptr(unsafe.Pointer(desc)), uintptr(unsafe.Pointer(&_IID_ID3D12CommandQueue)), uintptr(unsafe.Pointer(&commandQueue)))
|
uintptr(unsafe.Pointer(desc)), uintptr(unsafe.Pointer(&_IID_ID3D12CommandQueue)), uintptr(unsafe.Pointer(&commandQueue)),
|
||||||
|
0, 0)
|
||||||
runtime.KeepAlive(desc)
|
runtime.KeepAlive(desc)
|
||||||
if uint32(r) != uint32(windows.S_OK) {
|
if uint32(r) != uint32(windows.S_OK) {
|
||||||
return nil, fmt.Errorf("directx: ID3D12Device::CreateCommandQueue failed: HRESULT(%d)", uint32(r))
|
return nil, fmt.Errorf("directx: ID3D12Device::CreateCommandQueue failed: HRESULT(%d)", uint32(r))
|
||||||
@ -1400,15 +1371,16 @@ func (i *_ID3D12Device) CreateCommandQueue(desc *_D3D12_COMMAND_QUEUE_DESC) (*_I
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (i *_ID3D12Device) CreateConstantBufferView(pDesc *_D3D12_CONSTANT_BUFFER_VIEW_DESC, destDescriptor _D3D12_CPU_DESCRIPTOR_HANDLE) {
|
func (i *_ID3D12Device) CreateConstantBufferView(pDesc *_D3D12_CONSTANT_BUFFER_VIEW_DESC, destDescriptor _D3D12_CPU_DESCRIPTOR_HANDLE) {
|
||||||
syscallN(i.vtbl.CreateConstantBufferView, uintptr(unsafe.Pointer(i)),
|
syscall.Syscall(i.vtbl.CreateConstantBufferView, 3, uintptr(unsafe.Pointer(i)),
|
||||||
uintptr(unsafe.Pointer(pDesc)), uintptr(destDescriptor.ptr))
|
uintptr(unsafe.Pointer(pDesc)), uintptr(destDescriptor.ptr))
|
||||||
runtime.KeepAlive(pDesc)
|
runtime.KeepAlive(pDesc)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (i *_ID3D12Device) CreateDescriptorHeap(desc *_D3D12_DESCRIPTOR_HEAP_DESC) (*_ID3D12DescriptorHeap, error) {
|
func (i *_ID3D12Device) CreateDescriptorHeap(desc *_D3D12_DESCRIPTOR_HEAP_DESC) (*_ID3D12DescriptorHeap, error) {
|
||||||
var descriptorHeap *_ID3D12DescriptorHeap
|
var descriptorHeap *_ID3D12DescriptorHeap
|
||||||
r, _, _ := syscallN(i.vtbl.CreateDescriptorHeap, uintptr(unsafe.Pointer(i)),
|
r, _, _ := syscall.Syscall6(i.vtbl.CreateDescriptorHeap, 4, uintptr(unsafe.Pointer(i)),
|
||||||
uintptr(unsafe.Pointer(desc)), uintptr(unsafe.Pointer(&_IID_ID3D12DescriptorHeap)), uintptr(unsafe.Pointer(&descriptorHeap)))
|
uintptr(unsafe.Pointer(desc)), uintptr(unsafe.Pointer(&_IID_ID3D12DescriptorHeap)), uintptr(unsafe.Pointer(&descriptorHeap)),
|
||||||
|
0, 0)
|
||||||
runtime.KeepAlive(desc)
|
runtime.KeepAlive(desc)
|
||||||
if uint32(r) != uint32(windows.S_OK) {
|
if uint32(r) != uint32(windows.S_OK) {
|
||||||
return nil, fmt.Errorf("directx: ID3D12Device::CreateDescriptorHeap failed: HRESULT(%d)", uint32(r))
|
return nil, fmt.Errorf("directx: ID3D12Device::CreateDescriptorHeap failed: HRESULT(%d)", uint32(r))
|
||||||
@ -1417,8 +1389,9 @@ func (i *_ID3D12Device) CreateDescriptorHeap(desc *_D3D12_DESCRIPTOR_HEAP_DESC)
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (i *_ID3D12Device) CreateDepthStencilView(pResource *_ID3D12Resource, pDesc *_D3D12_DEPTH_STENCIL_VIEW_DESC, destDescriptor _D3D12_CPU_DESCRIPTOR_HANDLE) {
|
func (i *_ID3D12Device) CreateDepthStencilView(pResource *_ID3D12Resource, pDesc *_D3D12_DEPTH_STENCIL_VIEW_DESC, destDescriptor _D3D12_CPU_DESCRIPTOR_HANDLE) {
|
||||||
syscallN(i.vtbl.CreateDepthStencilView, uintptr(unsafe.Pointer(i)),
|
syscall.Syscall6(i.vtbl.CreateDepthStencilView, 4, uintptr(unsafe.Pointer(i)),
|
||||||
uintptr(unsafe.Pointer(pResource)), uintptr(unsafe.Pointer(pDesc)), destDescriptor.ptr)
|
uintptr(unsafe.Pointer(pResource)), uintptr(unsafe.Pointer(pDesc)), destDescriptor.ptr,
|
||||||
|
0, 0)
|
||||||
runtime.KeepAlive(pResource)
|
runtime.KeepAlive(pResource)
|
||||||
runtime.KeepAlive(pDesc)
|
runtime.KeepAlive(pDesc)
|
||||||
}
|
}
|
||||||
@ -1426,8 +1399,9 @@ func (i *_ID3D12Device) CreateDepthStencilView(pResource *_ID3D12Resource, pDesc
|
|||||||
func (i *_ID3D12Device) CreateFence(initialValue uint64, flags _D3D12_FENCE_FLAGS) (*_ID3D12Fence, error) {
|
func (i *_ID3D12Device) CreateFence(initialValue uint64, flags _D3D12_FENCE_FLAGS) (*_ID3D12Fence, error) {
|
||||||
// TODO: Does this work on a 32bit machine?
|
// TODO: Does this work on a 32bit machine?
|
||||||
var fence *_ID3D12Fence
|
var fence *_ID3D12Fence
|
||||||
r, _, _ := syscallN(i.vtbl.CreateFence, uintptr(unsafe.Pointer(i)),
|
r, _, _ := syscall.Syscall6(i.vtbl.CreateFence, 5, uintptr(unsafe.Pointer(i)),
|
||||||
uintptr(initialValue), uintptr(flags), uintptr(unsafe.Pointer(&_IID_ID3D12Fence)), uintptr(unsafe.Pointer(&fence)))
|
uintptr(initialValue), uintptr(flags), uintptr(unsafe.Pointer(&_IID_ID3D12Fence)), uintptr(unsafe.Pointer(&fence)),
|
||||||
|
0)
|
||||||
if uint32(r) != uint32(windows.S_OK) {
|
if uint32(r) != uint32(windows.S_OK) {
|
||||||
return nil, fmt.Errorf("directx: ID3D12Device::CreateFence failed: HRESULT(%d)", uint32(r))
|
return nil, fmt.Errorf("directx: ID3D12Device::CreateFence failed: HRESULT(%d)", uint32(r))
|
||||||
}
|
}
|
||||||
@ -1436,8 +1410,9 @@ func (i *_ID3D12Device) CreateFence(initialValue uint64, flags _D3D12_FENCE_FLAG
|
|||||||
|
|
||||||
func (i *_ID3D12Device) CreateGraphicsPipelineState(pDesc *_D3D12_GRAPHICS_PIPELINE_STATE_DESC) (*_ID3D12PipelineState, error) {
|
func (i *_ID3D12Device) CreateGraphicsPipelineState(pDesc *_D3D12_GRAPHICS_PIPELINE_STATE_DESC) (*_ID3D12PipelineState, error) {
|
||||||
var pipelineState *_ID3D12PipelineState
|
var pipelineState *_ID3D12PipelineState
|
||||||
r, _, _ := syscallN(i.vtbl.CreateGraphicsPipelineState, uintptr(unsafe.Pointer(i)),
|
r, _, _ := syscall.Syscall6(i.vtbl.CreateGraphicsPipelineState, 4, uintptr(unsafe.Pointer(i)),
|
||||||
uintptr(unsafe.Pointer(pDesc)), uintptr(unsafe.Pointer(&_IID_ID3D12PipelineState)), uintptr(unsafe.Pointer(&pipelineState)))
|
uintptr(unsafe.Pointer(pDesc)), uintptr(unsafe.Pointer(&_IID_ID3D12PipelineState)), uintptr(unsafe.Pointer(&pipelineState)),
|
||||||
|
0, 0)
|
||||||
runtime.KeepAlive(pDesc)
|
runtime.KeepAlive(pDesc)
|
||||||
if uint32(r) != uint32(windows.S_OK) {
|
if uint32(r) != uint32(windows.S_OK) {
|
||||||
return nil, fmt.Errorf("directx: ID3D12Device::CreateGraphicsPipelineState failed: HRESULT(%d)", uint32(r))
|
return nil, fmt.Errorf("directx: ID3D12Device::CreateGraphicsPipelineState failed: HRESULT(%d)", uint32(r))
|
||||||
@ -1446,15 +1421,16 @@ func (i *_ID3D12Device) CreateGraphicsPipelineState(pDesc *_D3D12_GRAPHICS_PIPEL
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (i *_ID3D12Device) CreateRenderTargetView(pResource *_ID3D12Resource, pDesc *_D3D12_RENDER_TARGET_VIEW_DESC, destDescriptor _D3D12_CPU_DESCRIPTOR_HANDLE) {
|
func (i *_ID3D12Device) CreateRenderTargetView(pResource *_ID3D12Resource, pDesc *_D3D12_RENDER_TARGET_VIEW_DESC, destDescriptor _D3D12_CPU_DESCRIPTOR_HANDLE) {
|
||||||
syscallN(i.vtbl.CreateRenderTargetView, uintptr(unsafe.Pointer(i)),
|
syscall.Syscall6(i.vtbl.CreateRenderTargetView, 4, uintptr(unsafe.Pointer(i)),
|
||||||
uintptr(unsafe.Pointer(pResource)), uintptr(unsafe.Pointer(pDesc)), destDescriptor.ptr)
|
uintptr(unsafe.Pointer(pResource)), uintptr(unsafe.Pointer(pDesc)), destDescriptor.ptr,
|
||||||
|
0, 0)
|
||||||
runtime.KeepAlive(pResource)
|
runtime.KeepAlive(pResource)
|
||||||
runtime.KeepAlive(pDesc)
|
runtime.KeepAlive(pDesc)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (i *_ID3D12Device) CreateRootSignature(nodeMask uint32, pBlobWithRootSignature uintptr, blobLengthInBytes uintptr) (*_ID3D12RootSignature, error) {
|
func (i *_ID3D12Device) CreateRootSignature(nodeMask uint32, pBlobWithRootSignature uintptr, blobLengthInBytes uintptr) (*_ID3D12RootSignature, error) {
|
||||||
var signature *_ID3D12RootSignature
|
var signature *_ID3D12RootSignature
|
||||||
r, _, _ := syscallN(i.vtbl.CreateRootSignature, uintptr(unsafe.Pointer(i)),
|
r, _, _ := syscall.Syscall6(i.vtbl.CreateRootSignature, 6, uintptr(unsafe.Pointer(i)),
|
||||||
uintptr(nodeMask), pBlobWithRootSignature, blobLengthInBytes,
|
uintptr(nodeMask), pBlobWithRootSignature, blobLengthInBytes,
|
||||||
uintptr(unsafe.Pointer(&_IID_ID3D12RootSignature)), uintptr(unsafe.Pointer(&signature)))
|
uintptr(unsafe.Pointer(&_IID_ID3D12RootSignature)), uintptr(unsafe.Pointer(&signature)))
|
||||||
if uint32(r) != uint32(windows.S_OK) {
|
if uint32(r) != uint32(windows.S_OK) {
|
||||||
@ -1464,19 +1440,21 @@ func (i *_ID3D12Device) CreateRootSignature(nodeMask uint32, pBlobWithRootSignat
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (i *_ID3D12Device) CreateSampler(pDesc *_D3D12_SAMPLER_DESC, destDescriptor _D3D12_CPU_DESCRIPTOR_HANDLE) {
|
func (i *_ID3D12Device) CreateSampler(pDesc *_D3D12_SAMPLER_DESC, destDescriptor _D3D12_CPU_DESCRIPTOR_HANDLE) {
|
||||||
syscallN(i.vtbl.CreateSampler, uintptr(unsafe.Pointer(i)), uintptr(unsafe.Pointer(pDesc)), destDescriptor.ptr)
|
syscall.Syscall(i.vtbl.CreateSampler, 3, uintptr(unsafe.Pointer(i)),
|
||||||
|
uintptr(unsafe.Pointer(pDesc)), destDescriptor.ptr)
|
||||||
runtime.KeepAlive(pDesc)
|
runtime.KeepAlive(pDesc)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (i *_ID3D12Device) CreateShaderResourceView(pResource *_ID3D12Resource, pDesc *_D3D12_SHADER_RESOURCE_VIEW_DESC, destDescriptor _D3D12_CPU_DESCRIPTOR_HANDLE) {
|
func (i *_ID3D12Device) CreateShaderResourceView(pResource *_ID3D12Resource, pDesc *_D3D12_SHADER_RESOURCE_VIEW_DESC, destDescriptor _D3D12_CPU_DESCRIPTOR_HANDLE) {
|
||||||
syscallN(i.vtbl.CreateShaderResourceView, uintptr(unsafe.Pointer(i)),
|
syscall.Syscall6(i.vtbl.CreateShaderResourceView, 4, uintptr(unsafe.Pointer(i)),
|
||||||
uintptr(unsafe.Pointer(pResource)), uintptr(unsafe.Pointer(pDesc)), destDescriptor.ptr)
|
uintptr(unsafe.Pointer(pResource)), uintptr(unsafe.Pointer(pDesc)), destDescriptor.ptr,
|
||||||
|
0, 0)
|
||||||
runtime.KeepAlive(pResource)
|
runtime.KeepAlive(pResource)
|
||||||
runtime.KeepAlive(pDesc)
|
runtime.KeepAlive(pDesc)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (i *_ID3D12Device) GetCopyableFootprints(pResourceDesc *_D3D12_RESOURCE_DESC, firstSubresource uint32, numSubresources uint32, baseOffset uint64) (layouts _D3D12_PLACED_SUBRESOURCE_FOOTPRINT, numRows uint, rowSizeInBytes uint64, totalBytes uint64) {
|
func (i *_ID3D12Device) GetCopyableFootprints(pResourceDesc *_D3D12_RESOURCE_DESC, firstSubresource uint32, numSubresources uint32, baseOffset uint64) (layouts _D3D12_PLACED_SUBRESOURCE_FOOTPRINT, numRows uint, rowSizeInBytes uint64, totalBytes uint64) {
|
||||||
syscallN(i.vtbl.GetCopyableFootprints, uintptr(unsafe.Pointer(i)),
|
syscall.Syscall9(i.vtbl.GetCopyableFootprints, 9, uintptr(unsafe.Pointer(i)),
|
||||||
uintptr(unsafe.Pointer(pResourceDesc)), uintptr(firstSubresource), uintptr(numSubresources),
|
uintptr(unsafe.Pointer(pResourceDesc)), uintptr(firstSubresource), uintptr(numSubresources),
|
||||||
uintptr(baseOffset), uintptr(unsafe.Pointer(&layouts)), uintptr(unsafe.Pointer(&numRows)),
|
uintptr(baseOffset), uintptr(unsafe.Pointer(&layouts)), uintptr(unsafe.Pointer(&numRows)),
|
||||||
uintptr(unsafe.Pointer(&rowSizeInBytes)), uintptr(unsafe.Pointer(&totalBytes)))
|
uintptr(unsafe.Pointer(&rowSizeInBytes)), uintptr(unsafe.Pointer(&totalBytes)))
|
||||||
@ -1485,12 +1463,13 @@ func (i *_ID3D12Device) GetCopyableFootprints(pResourceDesc *_D3D12_RESOURCE_DES
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (i *_ID3D12Device) GetDescriptorHandleIncrementSize(descriptorHeapType _D3D12_DESCRIPTOR_HEAP_TYPE) uint32 {
|
func (i *_ID3D12Device) GetDescriptorHandleIncrementSize(descriptorHeapType _D3D12_DESCRIPTOR_HEAP_TYPE) uint32 {
|
||||||
r, _, _ := syscallN(i.vtbl.GetDescriptorHandleIncrementSize, uintptr(unsafe.Pointer(i)), uintptr(descriptorHeapType))
|
r, _, _ := syscall.Syscall(i.vtbl.GetDescriptorHandleIncrementSize, 2, uintptr(unsafe.Pointer(i)),
|
||||||
|
uintptr(descriptorHeapType), 0)
|
||||||
return uint32(r)
|
return uint32(r)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (i *_ID3D12Device) GetDeviceRemovedReason() error {
|
func (i *_ID3D12Device) GetDeviceRemovedReason() error {
|
||||||
r, _, _ := syscallN(i.vtbl.GetDeviceRemovedReason, uintptr(unsafe.Pointer(i)))
|
r, _, _ := syscall.Syscall(i.vtbl.GetDeviceRemovedReason, 1, uintptr(unsafe.Pointer(i)), 0, 0)
|
||||||
if uint32(r) != uint32(windows.S_OK) {
|
if uint32(r) != uint32(windows.S_OK) {
|
||||||
return fmt.Errorf("directx: ID3D12Device::GetDeviceRemovedReason failed: HRESULT(%d)", uint32(r))
|
return fmt.Errorf("directx: ID3D12Device::GetDeviceRemovedReason failed: HRESULT(%d)", uint32(r))
|
||||||
}
|
}
|
||||||
@ -1518,17 +1497,18 @@ type _ID3D12Fence_Vtbl struct {
|
|||||||
|
|
||||||
func (i *_ID3D12Fence) GetCompletedValue() uint64 {
|
func (i *_ID3D12Fence) GetCompletedValue() uint64 {
|
||||||
// TODO: Does this work on a 32bit machine?
|
// TODO: Does this work on a 32bit machine?
|
||||||
r, _, _ := syscallN(i.vtbl.GetCompletedValue, uintptr(unsafe.Pointer(i)))
|
r, _, _ := syscall.Syscall(i.vtbl.GetCompletedValue, 1, uintptr(unsafe.Pointer(i)), 0, 0)
|
||||||
return uint64(r)
|
return uint64(r)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (i *_ID3D12Fence) Release() {
|
func (i *_ID3D12Fence) Release() {
|
||||||
syscallN(i.vtbl.Release, uintptr(unsafe.Pointer(i)))
|
syscall.Syscall(i.vtbl.Release, 1, uintptr(unsafe.Pointer(i)), 0, 0)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (i *_ID3D12Fence) SetEventOnCompletion(value uint64, hEvent windows.Handle) error {
|
func (i *_ID3D12Fence) SetEventOnCompletion(value uint64, hEvent windows.Handle) error {
|
||||||
// TODO: Does this work on a 32bit machine?
|
// TODO: Does this work on a 32bit machine?
|
||||||
r, _, _ := syscallN(i.vtbl.SetEventOnCompletion, uintptr(unsafe.Pointer(i)), uintptr(value), uintptr(hEvent))
|
r, _, _ := syscall.Syscall(i.vtbl.SetEventOnCompletion, 3, uintptr(unsafe.Pointer(i)),
|
||||||
|
uintptr(value), uintptr(hEvent))
|
||||||
if uint32(r) != uint32(windows.S_OK) {
|
if uint32(r) != uint32(windows.S_OK) {
|
||||||
return fmt.Errorf("directx: ID3D12Fence::SetEventOnCompletion failed: HRESULT(%d)", uint32(r))
|
return fmt.Errorf("directx: ID3D12Fence::SetEventOnCompletion failed: HRESULT(%d)", uint32(r))
|
||||||
}
|
}
|
||||||
@ -1604,20 +1584,22 @@ type _ID3D12GraphicsCommandList_Vtbl struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (i *_ID3D12GraphicsCommandList) ClearDepthStencilView(depthStencilView _D3D12_CPU_DESCRIPTOR_HANDLE, clearFlags _D3D12_CLEAR_FLAGS, depth float32, stencil uint8, numRects uint32, pRects *_D3D12_RECT) {
|
func (i *_ID3D12GraphicsCommandList) ClearDepthStencilView(depthStencilView _D3D12_CPU_DESCRIPTOR_HANDLE, clearFlags _D3D12_CLEAR_FLAGS, depth float32, stencil uint8, numRects uint32, pRects *_D3D12_RECT) {
|
||||||
syscallN(i.vtbl.ClearDepthStencilView, uintptr(unsafe.Pointer(i)),
|
syscall.Syscall9(i.vtbl.ClearDepthStencilView, 7, uintptr(unsafe.Pointer(i)),
|
||||||
depthStencilView.ptr, uintptr(clearFlags), uintptr(math.Float32bits(depth)),
|
depthStencilView.ptr, uintptr(clearFlags), uintptr(math.Float32bits(depth)),
|
||||||
uintptr(stencil), uintptr(numRects), uintptr(unsafe.Pointer(pRects)))
|
uintptr(stencil), uintptr(numRects), uintptr(unsafe.Pointer(pRects)),
|
||||||
|
0, 0)
|
||||||
runtime.KeepAlive(pRects)
|
runtime.KeepAlive(pRects)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (i *_ID3D12GraphicsCommandList) ClearRenderTargetView(pRenderTargetView _D3D12_CPU_DESCRIPTOR_HANDLE, colorRGBA [4]float32, numRects uint32, pRects *_D3D12_RECT) {
|
func (i *_ID3D12GraphicsCommandList) ClearRenderTargetView(pRenderTargetView _D3D12_CPU_DESCRIPTOR_HANDLE, colorRGBA [4]float32, numRects uint32, pRects *_D3D12_RECT) {
|
||||||
syscallN(i.vtbl.ClearRenderTargetView, uintptr(unsafe.Pointer(i)),
|
syscall.Syscall6(i.vtbl.ClearRenderTargetView, 5, uintptr(unsafe.Pointer(i)),
|
||||||
pRenderTargetView.ptr, uintptr(unsafe.Pointer(&colorRGBA[0])), uintptr(numRects), uintptr(unsafe.Pointer(pRects)))
|
pRenderTargetView.ptr, uintptr(unsafe.Pointer(&colorRGBA[0])), uintptr(numRects), uintptr(unsafe.Pointer(pRects)),
|
||||||
|
0)
|
||||||
runtime.KeepAlive(pRenderTargetView)
|
runtime.KeepAlive(pRenderTargetView)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (i *_ID3D12GraphicsCommandList) Close() error {
|
func (i *_ID3D12GraphicsCommandList) Close() error {
|
||||||
r, _, _ := syscallN(i.vtbl.Close, uintptr(unsafe.Pointer(i)))
|
r, _, _ := syscall.Syscall(i.vtbl.Close, 1, uintptr(unsafe.Pointer(i)), 0, 0)
|
||||||
if uint32(r) != uint32(windows.S_OK) {
|
if uint32(r) != uint32(windows.S_OK) {
|
||||||
return fmt.Errorf("directx: ID3D12GraphicsCommandList::Close failed: HRESULT(%d)", uint32(r))
|
return fmt.Errorf("directx: ID3D12GraphicsCommandList::Close failed: HRESULT(%d)", uint32(r))
|
||||||
}
|
}
|
||||||
@ -1625,56 +1607,62 @@ func (i *_ID3D12GraphicsCommandList) Close() error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (i *_ID3D12GraphicsCommandList) CopyTextureRegion_PlacedFootPrint_SubresourceIndex(pDst *_D3D12_TEXTURE_COPY_LOCATION_PlacedFootPrint, dstX uint32, dstY uint32, dstZ uint32, pSrc *_D3D12_TEXTURE_COPY_LOCATION_SubresourceIndex, pSrcBox *_D3D12_BOX) {
|
func (i *_ID3D12GraphicsCommandList) CopyTextureRegion_PlacedFootPrint_SubresourceIndex(pDst *_D3D12_TEXTURE_COPY_LOCATION_PlacedFootPrint, dstX uint32, dstY uint32, dstZ uint32, pSrc *_D3D12_TEXTURE_COPY_LOCATION_SubresourceIndex, pSrcBox *_D3D12_BOX) {
|
||||||
syscallN(i.vtbl.CopyTextureRegion, uintptr(unsafe.Pointer(i)),
|
syscall.Syscall9(i.vtbl.CopyTextureRegion, 7, uintptr(unsafe.Pointer(i)),
|
||||||
uintptr(unsafe.Pointer(pDst)), uintptr(dstX), uintptr(dstY),
|
uintptr(unsafe.Pointer(pDst)), uintptr(dstX), uintptr(dstY),
|
||||||
uintptr(dstZ), uintptr(unsafe.Pointer(pSrc)), uintptr(unsafe.Pointer(pSrcBox)))
|
uintptr(dstZ), uintptr(unsafe.Pointer(pSrc)), uintptr(unsafe.Pointer(pSrcBox)),
|
||||||
|
0, 0)
|
||||||
runtime.KeepAlive(pDst)
|
runtime.KeepAlive(pDst)
|
||||||
runtime.KeepAlive(pSrc)
|
runtime.KeepAlive(pSrc)
|
||||||
runtime.KeepAlive(pSrcBox)
|
runtime.KeepAlive(pSrcBox)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (i *_ID3D12GraphicsCommandList) CopyTextureRegion_SubresourceIndex_PlacedFootPrint(pDst *_D3D12_TEXTURE_COPY_LOCATION_SubresourceIndex, dstX uint32, dstY uint32, dstZ uint32, pSrc *_D3D12_TEXTURE_COPY_LOCATION_PlacedFootPrint, pSrcBox *_D3D12_BOX) {
|
func (i *_ID3D12GraphicsCommandList) CopyTextureRegion_SubresourceIndex_PlacedFootPrint(pDst *_D3D12_TEXTURE_COPY_LOCATION_SubresourceIndex, dstX uint32, dstY uint32, dstZ uint32, pSrc *_D3D12_TEXTURE_COPY_LOCATION_PlacedFootPrint, pSrcBox *_D3D12_BOX) {
|
||||||
syscallN(i.vtbl.CopyTextureRegion, uintptr(unsafe.Pointer(i)),
|
syscall.Syscall9(i.vtbl.CopyTextureRegion, 7, uintptr(unsafe.Pointer(i)),
|
||||||
uintptr(unsafe.Pointer(pDst)), uintptr(dstX), uintptr(dstY),
|
uintptr(unsafe.Pointer(pDst)), uintptr(dstX), uintptr(dstY),
|
||||||
uintptr(dstZ), uintptr(unsafe.Pointer(pSrc)), uintptr(unsafe.Pointer(pSrcBox)))
|
uintptr(dstZ), uintptr(unsafe.Pointer(pSrc)), uintptr(unsafe.Pointer(pSrcBox)),
|
||||||
|
0, 0)
|
||||||
runtime.KeepAlive(pDst)
|
runtime.KeepAlive(pDst)
|
||||||
runtime.KeepAlive(pSrc)
|
runtime.KeepAlive(pSrc)
|
||||||
runtime.KeepAlive(pSrcBox)
|
runtime.KeepAlive(pSrcBox)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (i *_ID3D12GraphicsCommandList) DrawIndexedInstanced(indexCountPerInstance uint32, instanceCount uint32, startIndexLocation uint32, baseVertexLocation int32, startInstanceLocation uint32) {
|
func (i *_ID3D12GraphicsCommandList) DrawIndexedInstanced(indexCountPerInstance uint32, instanceCount uint32, startIndexLocation uint32, baseVertexLocation int32, startInstanceLocation uint32) {
|
||||||
syscallN(i.vtbl.DrawIndexedInstanced, uintptr(unsafe.Pointer(i)),
|
syscall.Syscall6(i.vtbl.DrawIndexedInstanced, 6, uintptr(unsafe.Pointer(i)),
|
||||||
uintptr(indexCountPerInstance), uintptr(instanceCount), uintptr(startIndexLocation), uintptr(baseVertexLocation), uintptr(startInstanceLocation))
|
uintptr(indexCountPerInstance), uintptr(instanceCount), uintptr(startIndexLocation), uintptr(baseVertexLocation), uintptr(startInstanceLocation))
|
||||||
}
|
}
|
||||||
|
|
||||||
func (i *_ID3D12GraphicsCommandList) IASetIndexBuffer(pView *_D3D12_INDEX_BUFFER_VIEW) {
|
func (i *_ID3D12GraphicsCommandList) IASetIndexBuffer(pView *_D3D12_INDEX_BUFFER_VIEW) {
|
||||||
syscallN(i.vtbl.IASetIndexBuffer, uintptr(unsafe.Pointer(i)), uintptr(unsafe.Pointer(pView)))
|
syscall.Syscall(i.vtbl.IASetIndexBuffer, 2, uintptr(unsafe.Pointer(i)),
|
||||||
|
uintptr(unsafe.Pointer(pView)), 0)
|
||||||
runtime.KeepAlive(pView)
|
runtime.KeepAlive(pView)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (i *_ID3D12GraphicsCommandList) IASetPrimitiveTopology(primitiveTopology _D3D_PRIMITIVE_TOPOLOGY) {
|
func (i *_ID3D12GraphicsCommandList) IASetPrimitiveTopology(primitiveTopology _D3D_PRIMITIVE_TOPOLOGY) {
|
||||||
syscallN(i.vtbl.IASetPrimitiveTopology, uintptr(unsafe.Pointer(i)), uintptr(primitiveTopology))
|
syscall.Syscall(i.vtbl.IASetPrimitiveTopology, 2, uintptr(unsafe.Pointer(i)),
|
||||||
|
uintptr(primitiveTopology), 0)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (i *_ID3D12GraphicsCommandList) IASetVertexBuffers(startSlot uint32, numViews uint32, pViews *_D3D12_VERTEX_BUFFER_VIEW) {
|
func (i *_ID3D12GraphicsCommandList) IASetVertexBuffers(startSlot uint32, numViews uint32, pViews *_D3D12_VERTEX_BUFFER_VIEW) {
|
||||||
syscallN(i.vtbl.IASetVertexBuffers, uintptr(unsafe.Pointer(i)),
|
syscall.Syscall6(i.vtbl.IASetVertexBuffers, 4, uintptr(unsafe.Pointer(i)),
|
||||||
uintptr(startSlot), uintptr(numViews), uintptr(unsafe.Pointer(pViews)))
|
uintptr(startSlot), uintptr(numViews), uintptr(unsafe.Pointer(pViews)),
|
||||||
|
0, 0)
|
||||||
runtime.KeepAlive(pViews)
|
runtime.KeepAlive(pViews)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (i *_ID3D12GraphicsCommandList) OMSetRenderTargets(numRenderTargetDescriptors uint32, pRenderTargetDescriptors *_D3D12_CPU_DESCRIPTOR_HANDLE, rtsSingleHandleToDescriptorRange bool, pDepthStencilDescriptor *_D3D12_CPU_DESCRIPTOR_HANDLE) {
|
func (i *_ID3D12GraphicsCommandList) OMSetRenderTargets(numRenderTargetDescriptors uint32, pRenderTargetDescriptors *_D3D12_CPU_DESCRIPTOR_HANDLE, rtsSingleHandleToDescriptorRange bool, pDepthStencilDescriptor *_D3D12_CPU_DESCRIPTOR_HANDLE) {
|
||||||
syscallN(i.vtbl.OMSetRenderTargets, uintptr(unsafe.Pointer(i)),
|
syscall.Syscall6(i.vtbl.OMSetRenderTargets, 5, uintptr(unsafe.Pointer(i)),
|
||||||
uintptr(numRenderTargetDescriptors), uintptr(unsafe.Pointer(pRenderTargetDescriptors)), boolToUintptr(rtsSingleHandleToDescriptorRange), uintptr(unsafe.Pointer(pDepthStencilDescriptor)))
|
uintptr(numRenderTargetDescriptors), uintptr(unsafe.Pointer(pRenderTargetDescriptors)), boolToUintptr(rtsSingleHandleToDescriptorRange), uintptr(unsafe.Pointer(pDepthStencilDescriptor)),
|
||||||
|
0)
|
||||||
runtime.KeepAlive(pRenderTargetDescriptors)
|
runtime.KeepAlive(pRenderTargetDescriptors)
|
||||||
runtime.KeepAlive(pDepthStencilDescriptor)
|
runtime.KeepAlive(pDepthStencilDescriptor)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (i *_ID3D12GraphicsCommandList) OMSetStencilRef(stencilRef uint32) {
|
func (i *_ID3D12GraphicsCommandList) OMSetStencilRef(stencilRef uint32) {
|
||||||
syscallN(i.vtbl.OMSetStencilRef, uintptr(unsafe.Pointer(i)), uintptr(stencilRef))
|
syscall.Syscall(i.vtbl.OMSetStencilRef, 2, uintptr(unsafe.Pointer(i)), uintptr(stencilRef), 0)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (i *_ID3D12GraphicsCommandList) QueryInterface(riid *windows.GUID, ppvObject *unsafe.Pointer) error {
|
func (i *_ID3D12GraphicsCommandList) QueryInterface(riid *windows.GUID, ppvObject *unsafe.Pointer) error {
|
||||||
r, _, _ := syscallN(i.vtbl.QueryInterface, uintptr(unsafe.Pointer(i)),
|
r, _, _ := syscall.Syscall(i.vtbl.QueryInterface, 3, uintptr(unsafe.Pointer(i)),
|
||||||
uintptr(unsafe.Pointer(riid)), uintptr(unsafe.Pointer(ppvObject)))
|
uintptr(unsafe.Pointer(riid)), uintptr(unsafe.Pointer(ppvObject)))
|
||||||
runtime.KeepAlive(riid)
|
runtime.KeepAlive(riid)
|
||||||
if uint32(r) != uint32(windows.S_OK) {
|
if uint32(r) != uint32(windows.S_OK) {
|
||||||
@ -1684,11 +1672,11 @@ func (i *_ID3D12GraphicsCommandList) QueryInterface(riid *windows.GUID, ppvObjec
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (i *_ID3D12GraphicsCommandList) Release() {
|
func (i *_ID3D12GraphicsCommandList) Release() {
|
||||||
syscallN(i.vtbl.Release, uintptr(unsafe.Pointer(i)))
|
syscall.Syscall(i.vtbl.Release, 1, uintptr(unsafe.Pointer(i)), 0, 0)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (i *_ID3D12GraphicsCommandList) Reset(pAllocator *_ID3D12CommandAllocator, pInitialState *_ID3D12PipelineState) error {
|
func (i *_ID3D12GraphicsCommandList) Reset(pAllocator *_ID3D12CommandAllocator, pInitialState *_ID3D12PipelineState) error {
|
||||||
r, _, _ := syscallN(i.vtbl.Reset, uintptr(unsafe.Pointer(i)),
|
r, _, _ := syscall.Syscall(i.vtbl.Reset, 3, uintptr(unsafe.Pointer(i)),
|
||||||
uintptr(unsafe.Pointer(pAllocator)), uintptr(unsafe.Pointer(pInitialState)))
|
uintptr(unsafe.Pointer(pAllocator)), uintptr(unsafe.Pointer(pInitialState)))
|
||||||
runtime.KeepAlive(pAllocator)
|
runtime.KeepAlive(pAllocator)
|
||||||
runtime.KeepAlive(pInitialState)
|
runtime.KeepAlive(pInitialState)
|
||||||
@ -1699,41 +1687,43 @@ func (i *_ID3D12GraphicsCommandList) Reset(pAllocator *_ID3D12CommandAllocator,
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (i *_ID3D12GraphicsCommandList) ResourceBarrier(numBarriers uint32, pBarriers *_D3D12_RESOURCE_BARRIER_Transition) {
|
func (i *_ID3D12GraphicsCommandList) ResourceBarrier(numBarriers uint32, pBarriers *_D3D12_RESOURCE_BARRIER_Transition) {
|
||||||
syscallN(i.vtbl.ResourceBarrier, uintptr(unsafe.Pointer(i)),
|
syscall.Syscall(i.vtbl.ResourceBarrier, 3, uintptr(unsafe.Pointer(i)),
|
||||||
uintptr(numBarriers), uintptr(unsafe.Pointer(pBarriers)))
|
uintptr(numBarriers), uintptr(unsafe.Pointer(pBarriers)))
|
||||||
runtime.KeepAlive(pBarriers)
|
runtime.KeepAlive(pBarriers)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (i *_ID3D12GraphicsCommandList) RSSetViewports(numViewports uint32, pViewports *_D3D12_VIEWPORT) {
|
func (i *_ID3D12GraphicsCommandList) RSSetViewports(numViewports uint32, pViewports *_D3D12_VIEWPORT) {
|
||||||
syscallN(i.vtbl.RSSetViewports, uintptr(unsafe.Pointer(i)),
|
syscall.Syscall(i.vtbl.RSSetViewports, 3, uintptr(unsafe.Pointer(i)),
|
||||||
uintptr(numViewports), uintptr(unsafe.Pointer(pViewports)))
|
uintptr(numViewports), uintptr(unsafe.Pointer(pViewports)))
|
||||||
runtime.KeepAlive(pViewports)
|
runtime.KeepAlive(pViewports)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (i *_ID3D12GraphicsCommandList) RSSetScissorRects(numRects uint32, pRects *_D3D12_RECT) {
|
func (i *_ID3D12GraphicsCommandList) RSSetScissorRects(numRects uint32, pRects *_D3D12_RECT) {
|
||||||
syscallN(i.vtbl.RSSetScissorRects, uintptr(unsafe.Pointer(i)),
|
syscall.Syscall(i.vtbl.RSSetScissorRects, 3, uintptr(unsafe.Pointer(i)),
|
||||||
uintptr(numRects), uintptr(unsafe.Pointer(pRects)))
|
uintptr(numRects), uintptr(unsafe.Pointer(pRects)))
|
||||||
runtime.KeepAlive(pRects)
|
runtime.KeepAlive(pRects)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (i *_ID3D12GraphicsCommandList) SetDescriptorHeaps(ppDescriptorHeaps []*_ID3D12DescriptorHeap) {
|
func (i *_ID3D12GraphicsCommandList) SetDescriptorHeaps(ppDescriptorHeaps []*_ID3D12DescriptorHeap) {
|
||||||
syscallN(i.vtbl.SetDescriptorHeaps, uintptr(unsafe.Pointer(i)),
|
syscall.Syscall(i.vtbl.SetDescriptorHeaps, 3, uintptr(unsafe.Pointer(i)),
|
||||||
uintptr(len(ppDescriptorHeaps)), uintptr(unsafe.Pointer(&ppDescriptorHeaps[0])))
|
uintptr(len(ppDescriptorHeaps)), uintptr(unsafe.Pointer(&ppDescriptorHeaps[0])))
|
||||||
runtime.KeepAlive(ppDescriptorHeaps)
|
runtime.KeepAlive(ppDescriptorHeaps)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (i *_ID3D12GraphicsCommandList) SetGraphicsRootDescriptorTable(rootParameterIndex uint32, baseDescriptor _D3D12_GPU_DESCRIPTOR_HANDLE) {
|
func (i *_ID3D12GraphicsCommandList) SetGraphicsRootDescriptorTable(rootParameterIndex uint32, baseDescriptor _D3D12_GPU_DESCRIPTOR_HANDLE) {
|
||||||
syscallN(i.vtbl.SetGraphicsRootDescriptorTable, uintptr(unsafe.Pointer(i)),
|
syscall.Syscall(i.vtbl.SetGraphicsRootDescriptorTable, 3, uintptr(unsafe.Pointer(i)),
|
||||||
uintptr(rootParameterIndex), uintptr(baseDescriptor.ptr))
|
uintptr(rootParameterIndex), uintptr(baseDescriptor.ptr))
|
||||||
}
|
}
|
||||||
|
|
||||||
func (i *_ID3D12GraphicsCommandList) SetGraphicsRootSignature(pRootSignature *_ID3D12RootSignature) {
|
func (i *_ID3D12GraphicsCommandList) SetGraphicsRootSignature(pRootSignature *_ID3D12RootSignature) {
|
||||||
syscallN(i.vtbl.SetGraphicsRootSignature, uintptr(unsafe.Pointer(i)), uintptr(unsafe.Pointer(pRootSignature)))
|
syscall.Syscall(i.vtbl.SetGraphicsRootSignature, 2, uintptr(unsafe.Pointer(i)),
|
||||||
|
uintptr(unsafe.Pointer(pRootSignature)), 0)
|
||||||
runtime.KeepAlive(pRootSignature)
|
runtime.KeepAlive(pRootSignature)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (i *_ID3D12GraphicsCommandList) SetPipelineState(pPipelineState *_ID3D12PipelineState) {
|
func (i *_ID3D12GraphicsCommandList) SetPipelineState(pPipelineState *_ID3D12PipelineState) {
|
||||||
syscallN(i.vtbl.SetPipelineState, uintptr(unsafe.Pointer(i)), uintptr(unsafe.Pointer(pPipelineState)))
|
syscall.Syscall(i.vtbl.SetPipelineState, 2, uintptr(unsafe.Pointer(i)),
|
||||||
|
uintptr(unsafe.Pointer(pPipelineState)), 0)
|
||||||
runtime.KeepAlive(pPipelineState)
|
runtime.KeepAlive(pPipelineState)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1755,7 +1745,7 @@ type _ID3D12PipelineState_Vtbl struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (i *_ID3D12PipelineState) Release() {
|
func (i *_ID3D12PipelineState) Release() {
|
||||||
syscallN(i.vtbl.Release, uintptr(unsafe.Pointer(i)))
|
syscall.Syscall(i.vtbl.Release, 1, uintptr(unsafe.Pointer(i)), 0, 0)
|
||||||
}
|
}
|
||||||
|
|
||||||
type _ID3D12Resource struct {
|
type _ID3D12Resource struct {
|
||||||
@ -1781,19 +1771,20 @@ type _ID3D12Resource_Vtbl struct {
|
|||||||
|
|
||||||
func (i *_ID3D12Resource) GetDesc() _D3D12_RESOURCE_DESC {
|
func (i *_ID3D12Resource) GetDesc() _D3D12_RESOURCE_DESC {
|
||||||
var resourceDesc _D3D12_RESOURCE_DESC
|
var resourceDesc _D3D12_RESOURCE_DESC
|
||||||
syscallN(i.vtbl.GetDesc, uintptr(unsafe.Pointer(i)), uintptr(unsafe.Pointer(&resourceDesc)))
|
syscall.Syscall(i.vtbl.GetDesc, 2, uintptr(unsafe.Pointer(i)), uintptr(unsafe.Pointer(&resourceDesc)), 0)
|
||||||
return resourceDesc
|
return resourceDesc
|
||||||
}
|
}
|
||||||
|
|
||||||
func (i *_ID3D12Resource) GetGPUVirtualAddress() _D3D12_GPU_VIRTUAL_ADDRESS {
|
func (i *_ID3D12Resource) GetGPUVirtualAddress() _D3D12_GPU_VIRTUAL_ADDRESS {
|
||||||
r, _, _ := syscallN(i.vtbl.GetGPUVirtualAddress, uintptr(unsafe.Pointer(i)))
|
r, _, _ := syscall.Syscall(i.vtbl.GetGPUVirtualAddress, 1, uintptr(unsafe.Pointer(i)), 0, 0)
|
||||||
return _D3D12_GPU_VIRTUAL_ADDRESS(r)
|
return _D3D12_GPU_VIRTUAL_ADDRESS(r)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (i *_ID3D12Resource) Map(subresource uint32, pReadRange *_D3D12_RANGE) (uintptr, error) {
|
func (i *_ID3D12Resource) Map(subresource uint32, pReadRange *_D3D12_RANGE) (uintptr, error) {
|
||||||
var data uintptr
|
var data uintptr
|
||||||
r, _, _ := syscallN(i.vtbl.Map, uintptr(unsafe.Pointer(i)),
|
r, _, _ := syscall.Syscall6(i.vtbl.Map, 4, uintptr(unsafe.Pointer(i)),
|
||||||
uintptr(subresource), uintptr(unsafe.Pointer(pReadRange)), uintptr(unsafe.Pointer(&data)))
|
uintptr(subresource), uintptr(unsafe.Pointer(pReadRange)), uintptr(unsafe.Pointer(&data)),
|
||||||
|
0, 0)
|
||||||
runtime.KeepAlive(pReadRange)
|
runtime.KeepAlive(pReadRange)
|
||||||
if uint32(r) != uint32(windows.S_OK) {
|
if uint32(r) != uint32(windows.S_OK) {
|
||||||
return 0, fmt.Errorf("directx: ID3D12Resource::Map failed: HRESULT(%d)", uint32(r))
|
return 0, fmt.Errorf("directx: ID3D12Resource::Map failed: HRESULT(%d)", uint32(r))
|
||||||
@ -1802,11 +1793,11 @@ func (i *_ID3D12Resource) Map(subresource uint32, pReadRange *_D3D12_RANGE) (uin
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (i *_ID3D12Resource) Release() {
|
func (i *_ID3D12Resource) Release() {
|
||||||
syscallN(i.vtbl.Release, uintptr(unsafe.Pointer(i)))
|
syscall.Syscall(i.vtbl.Release, 1, uintptr(unsafe.Pointer(i)), 0, 0)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (i *_ID3D12Resource) Unmap(subresource uint32, pWrittenRange *_D3D12_RANGE) {
|
func (i *_ID3D12Resource) Unmap(subresource uint32, pWrittenRange *_D3D12_RANGE) {
|
||||||
syscallN(i.vtbl.Unmap, uintptr(unsafe.Pointer(i)),
|
syscall.Syscall(i.vtbl.Unmap, 3, uintptr(unsafe.Pointer(i)),
|
||||||
uintptr(subresource), uintptr(unsafe.Pointer(pWrittenRange)))
|
uintptr(subresource), uintptr(unsafe.Pointer(pWrittenRange)))
|
||||||
runtime.KeepAlive(pWrittenRange)
|
runtime.KeepAlive(pWrittenRange)
|
||||||
}
|
}
|
||||||
@ -1825,17 +1816,19 @@ type _ID3DBlob_Vtbl struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (i *_ID3DBlob) GetBufferPointer() uintptr {
|
func (i *_ID3DBlob) GetBufferPointer() uintptr {
|
||||||
r, _, _ := syscallN(i.vtbl.GetBufferPointer, uintptr(unsafe.Pointer(i)))
|
r, _, _ := syscall.Syscall(i.vtbl.GetBufferPointer, 1, uintptr(unsafe.Pointer(i)),
|
||||||
|
0, 0)
|
||||||
return r
|
return r
|
||||||
}
|
}
|
||||||
|
|
||||||
func (i *_ID3DBlob) GetBufferSize() uintptr {
|
func (i *_ID3DBlob) GetBufferSize() uintptr {
|
||||||
r, _, _ := syscallN(i.vtbl.GetBufferSize, uintptr(unsafe.Pointer(i)))
|
r, _, _ := syscall.Syscall(i.vtbl.GetBufferSize, 1, uintptr(unsafe.Pointer(i)),
|
||||||
|
0, 0)
|
||||||
return r
|
return r
|
||||||
}
|
}
|
||||||
|
|
||||||
func (i *_ID3DBlob) Release() {
|
func (i *_ID3DBlob) Release() {
|
||||||
syscallN(i.vtbl.Release, uintptr(unsafe.Pointer(i)))
|
syscall.Syscall(i.vtbl.Release, 1, uintptr(unsafe.Pointer(i)), 0, 0)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (i *_ID3DBlob) String() string {
|
func (i *_ID3DBlob) String() string {
|
||||||
@ -1866,12 +1859,12 @@ type _IDXGIAdapter1_Vtbl struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (i *_IDXGIAdapter1) Release() {
|
func (i *_IDXGIAdapter1) Release() {
|
||||||
syscallN(i.vtbl.Release, uintptr(unsafe.Pointer(i)))
|
syscall.Syscall(i.vtbl.Release, 1, uintptr(unsafe.Pointer(i)), 0, 0)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (i *_IDXGIAdapter1) GetDesc1() (*_DXGI_ADAPTER_DESC1, error) {
|
func (i *_IDXGIAdapter1) GetDesc1() (*_DXGI_ADAPTER_DESC1, error) {
|
||||||
var desc _DXGI_ADAPTER_DESC1
|
var desc _DXGI_ADAPTER_DESC1
|
||||||
r, _, _ := syscallN(i.vtbl.GetDesc1, uintptr(unsafe.Pointer(i)), uintptr(unsafe.Pointer(&desc)))
|
r, _, _ := syscall.Syscall(i.vtbl.GetDesc1, 2, uintptr(unsafe.Pointer(i)), uintptr(unsafe.Pointer(&desc)), 0)
|
||||||
if uint32(r) != uint32(windows.S_OK) {
|
if uint32(r) != uint32(windows.S_OK) {
|
||||||
return nil, fmt.Errorf("directx: IDXGIAdapter1::GetDesc1 failed: HRESULT(%d)", uint32(r))
|
return nil, fmt.Errorf("directx: IDXGIAdapter1::GetDesc1 failed: HRESULT(%d)", uint32(r))
|
||||||
}
|
}
|
||||||
@ -1916,9 +1909,9 @@ type _IDXGIFactory4_Vtbl struct {
|
|||||||
|
|
||||||
func (i *_IDXGIFactory4) CreateSwapChainForComposition(pDevice unsafe.Pointer, pDesc *_DXGI_SWAP_CHAIN_DESC1, pRestrictToOutput *_IDXGIOutput) (*_IDXGISwapChain1, error) {
|
func (i *_IDXGIFactory4) CreateSwapChainForComposition(pDevice unsafe.Pointer, pDesc *_DXGI_SWAP_CHAIN_DESC1, pRestrictToOutput *_IDXGIOutput) (*_IDXGISwapChain1, error) {
|
||||||
var swapChain *_IDXGISwapChain1
|
var swapChain *_IDXGISwapChain1
|
||||||
r, _, _ := syscallN(i.vtbl.CreateSwapChainForComposition,
|
r, _, _ := syscall.Syscall6(i.vtbl.CreateSwapChainForComposition, 5,
|
||||||
uintptr(unsafe.Pointer(i)), uintptr(pDevice), uintptr(unsafe.Pointer(pDesc)),
|
uintptr(unsafe.Pointer(i)), uintptr(pDevice), uintptr(unsafe.Pointer(pDesc)),
|
||||||
uintptr(unsafe.Pointer(pRestrictToOutput)), uintptr(unsafe.Pointer(&swapChain)))
|
uintptr(unsafe.Pointer(pRestrictToOutput)), uintptr(unsafe.Pointer(&swapChain)), 0)
|
||||||
runtime.KeepAlive(pDesc)
|
runtime.KeepAlive(pDesc)
|
||||||
runtime.KeepAlive(pRestrictToOutput)
|
runtime.KeepAlive(pRestrictToOutput)
|
||||||
if uint32(r) != uint32(windows.S_OK) {
|
if uint32(r) != uint32(windows.S_OK) {
|
||||||
@ -1929,10 +1922,10 @@ func (i *_IDXGIFactory4) CreateSwapChainForComposition(pDevice unsafe.Pointer, p
|
|||||||
|
|
||||||
func (i *_IDXGIFactory4) CreateSwapChainForHwnd(pDevice unsafe.Pointer, hWnd windows.HWND, pDesc *_DXGI_SWAP_CHAIN_DESC1, pFullscreenDesc *_DXGI_SWAP_CHAIN_FULLSCREEN_DESC, pRestrictToOutput *_IDXGIOutput) (*_IDXGISwapChain1, error) {
|
func (i *_IDXGIFactory4) CreateSwapChainForHwnd(pDevice unsafe.Pointer, hWnd windows.HWND, pDesc *_DXGI_SWAP_CHAIN_DESC1, pFullscreenDesc *_DXGI_SWAP_CHAIN_FULLSCREEN_DESC, pRestrictToOutput *_IDXGIOutput) (*_IDXGISwapChain1, error) {
|
||||||
var swapChain *_IDXGISwapChain1
|
var swapChain *_IDXGISwapChain1
|
||||||
r, _, _ := syscallN(i.vtbl.CreateSwapChainForHwnd,
|
r, _, _ := syscall.Syscall9(i.vtbl.CreateSwapChainForHwnd, 7,
|
||||||
uintptr(unsafe.Pointer(i)), uintptr(pDevice), uintptr(hWnd),
|
uintptr(unsafe.Pointer(i)), uintptr(pDevice), uintptr(hWnd),
|
||||||
uintptr(unsafe.Pointer(pDesc)), uintptr(unsafe.Pointer(pFullscreenDesc)), uintptr(unsafe.Pointer(pRestrictToOutput)),
|
uintptr(unsafe.Pointer(pDesc)), uintptr(unsafe.Pointer(pFullscreenDesc)), uintptr(unsafe.Pointer(pRestrictToOutput)),
|
||||||
uintptr(unsafe.Pointer(&swapChain)))
|
uintptr(unsafe.Pointer(&swapChain)), 0, 0)
|
||||||
runtime.KeepAlive(pDesc)
|
runtime.KeepAlive(pDesc)
|
||||||
runtime.KeepAlive(pFullscreenDesc)
|
runtime.KeepAlive(pFullscreenDesc)
|
||||||
runtime.KeepAlive(pRestrictToOutput)
|
runtime.KeepAlive(pRestrictToOutput)
|
||||||
@ -1944,7 +1937,7 @@ func (i *_IDXGIFactory4) CreateSwapChainForHwnd(pDevice unsafe.Pointer, hWnd win
|
|||||||
|
|
||||||
func (i *_IDXGIFactory4) EnumAdapters1(adapter uint32) (*_IDXGIAdapter1, error) {
|
func (i *_IDXGIFactory4) EnumAdapters1(adapter uint32) (*_IDXGIAdapter1, error) {
|
||||||
var ptr *_IDXGIAdapter1
|
var ptr *_IDXGIAdapter1
|
||||||
r, _, _ := syscallN(i.vtbl.EnumAdapters1, uintptr(unsafe.Pointer(i)), uintptr(adapter), uintptr(unsafe.Pointer(&ptr)))
|
r, _, _ := syscall.Syscall(i.vtbl.EnumAdapters1, 3, uintptr(unsafe.Pointer(i)), uintptr(adapter), uintptr(unsafe.Pointer(&ptr)))
|
||||||
if uint32(r) != uint32(windows.S_OK) {
|
if uint32(r) != uint32(windows.S_OK) {
|
||||||
return nil, fmt.Errorf("directx: IDXGIFactory4::EnumAdapters1 failed: HRESULT(%d)", uint32(r))
|
return nil, fmt.Errorf("directx: IDXGIFactory4::EnumAdapters1 failed: HRESULT(%d)", uint32(r))
|
||||||
}
|
}
|
||||||
@ -1953,7 +1946,7 @@ func (i *_IDXGIFactory4) EnumAdapters1(adapter uint32) (*_IDXGIAdapter1, error)
|
|||||||
|
|
||||||
func (i *_IDXGIFactory4) EnumWarpAdapter() (*_IDXGIAdapter1, error) {
|
func (i *_IDXGIFactory4) EnumWarpAdapter() (*_IDXGIAdapter1, error) {
|
||||||
var ptr *_IDXGIAdapter1
|
var ptr *_IDXGIAdapter1
|
||||||
r, _, _ := syscallN(i.vtbl.EnumWarpAdapter, uintptr(unsafe.Pointer(i)), uintptr(unsafe.Pointer(&_IID_IDXGIAdapter1)), uintptr(unsafe.Pointer(&ptr)))
|
r, _, _ := syscall.Syscall(i.vtbl.EnumWarpAdapter, 3, uintptr(unsafe.Pointer(i)), uintptr(unsafe.Pointer(&_IID_IDXGIAdapter1)), uintptr(unsafe.Pointer(&ptr)))
|
||||||
if uint32(r) != uint32(windows.S_OK) {
|
if uint32(r) != uint32(windows.S_OK) {
|
||||||
return nil, fmt.Errorf("directx: IDXGIFactory4::EnumWarpAdapter failed: HRESULT(%d)", uint32(r))
|
return nil, fmt.Errorf("directx: IDXGIFactory4::EnumWarpAdapter failed: HRESULT(%d)", uint32(r))
|
||||||
}
|
}
|
||||||
@ -1961,7 +1954,7 @@ func (i *_IDXGIFactory4) EnumWarpAdapter() (*_IDXGIAdapter1, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (i *_IDXGIFactory4) Release() {
|
func (i *_IDXGIFactory4) Release() {
|
||||||
syscallN(i.vtbl.Release, uintptr(unsafe.Pointer(i)))
|
syscall.Syscall(i.vtbl.Release, 1, uintptr(unsafe.Pointer(i)), 0, 0)
|
||||||
}
|
}
|
||||||
|
|
||||||
type _IDXGIOutput struct {
|
type _IDXGIOutput struct {
|
||||||
@ -2008,7 +2001,7 @@ type _ID3D12RootSignature_Vtbl struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (i *_ID3D12RootSignature) Release() {
|
func (i *_ID3D12RootSignature) Release() {
|
||||||
syscallN(i.vtbl.Release, uintptr(unsafe.Pointer(i)))
|
syscall.Syscall(i.vtbl.Release, 1, uintptr(unsafe.Pointer(i)), 0, 0)
|
||||||
}
|
}
|
||||||
|
|
||||||
type _IDXGISwapChain1 struct {
|
type _IDXGISwapChain1 struct {
|
||||||
@ -2104,8 +2097,9 @@ type _IDXGISwapChain4_Vtbl struct {
|
|||||||
|
|
||||||
func (i *_IDXGISwapChain4) GetBuffer(buffer uint32) (*_ID3D12Resource, error) {
|
func (i *_IDXGISwapChain4) GetBuffer(buffer uint32) (*_ID3D12Resource, error) {
|
||||||
var resource *_ID3D12Resource
|
var resource *_ID3D12Resource
|
||||||
r, _, _ := syscallN(i.vtbl.GetBuffer, uintptr(unsafe.Pointer(i)),
|
r, _, _ := syscall.Syscall6(i.vtbl.GetBuffer, 4, uintptr(unsafe.Pointer(i)),
|
||||||
uintptr(buffer), uintptr(unsafe.Pointer(&_IID_ID3D12Resource)), uintptr(unsafe.Pointer(&resource)))
|
uintptr(buffer), uintptr(unsafe.Pointer(&_IID_ID3D12Resource)), uintptr(unsafe.Pointer(&resource)),
|
||||||
|
0, 0)
|
||||||
if uint32(r) != uint32(windows.S_OK) {
|
if uint32(r) != uint32(windows.S_OK) {
|
||||||
return nil, fmt.Errorf("directx: IDXGISwapChain4::GetBuffer failed: HRESULT(%d)", uint32(r))
|
return nil, fmt.Errorf("directx: IDXGISwapChain4::GetBuffer failed: HRESULT(%d)", uint32(r))
|
||||||
}
|
}
|
||||||
@ -2113,12 +2107,12 @@ func (i *_IDXGISwapChain4) GetBuffer(buffer uint32) (*_ID3D12Resource, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (i *_IDXGISwapChain4) GetCurrentBackBufferIndex() uint32 {
|
func (i *_IDXGISwapChain4) GetCurrentBackBufferIndex() uint32 {
|
||||||
r, _, _ := syscallN(i.vtbl.GetCurrentBackBufferIndex, uintptr(unsafe.Pointer(i)))
|
r, _, _ := syscall.Syscall(i.vtbl.GetCurrentBackBufferIndex, 1, uintptr(unsafe.Pointer(i)), 0, 0)
|
||||||
return uint32(r)
|
return uint32(r)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (i *_IDXGISwapChain4) Present(syncInterval uint32, flags uint32) error {
|
func (i *_IDXGISwapChain4) Present(syncInterval uint32, flags uint32) error {
|
||||||
r, _, _ := syscallN(i.vtbl.Present, uintptr(unsafe.Pointer(i)), uintptr(syncInterval), uintptr(flags))
|
r, _, _ := syscall.Syscall(i.vtbl.Present, 3, uintptr(unsafe.Pointer(i)), uintptr(syncInterval), uintptr(flags))
|
||||||
if uint32(r) != uint32(windows.S_OK) {
|
if uint32(r) != uint32(windows.S_OK) {
|
||||||
return fmt.Errorf("directx: IDXGISwapChain4::Present failed: HRESULT(%d)", uint32(r))
|
return fmt.Errorf("directx: IDXGISwapChain4::Present failed: HRESULT(%d)", uint32(r))
|
||||||
}
|
}
|
||||||
@ -2126,7 +2120,7 @@ func (i *_IDXGISwapChain4) Present(syncInterval uint32, flags uint32) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (i *_IDXGISwapChain4) ResizeBuffers(bufferCount uint32, width uint32, height uint32, newFormat _DXGI_FORMAT, swapChainFlags uint32) error {
|
func (i *_IDXGISwapChain4) ResizeBuffers(bufferCount uint32, width uint32, height uint32, newFormat _DXGI_FORMAT, swapChainFlags uint32) error {
|
||||||
r, _, _ := syscallN(i.vtbl.ResizeBuffers,
|
r, _, _ := syscall.Syscall6(i.vtbl.ResizeBuffers, 6,
|
||||||
uintptr(unsafe.Pointer(i)), uintptr(bufferCount), uintptr(width),
|
uintptr(unsafe.Pointer(i)), uintptr(bufferCount), uintptr(width),
|
||||||
uintptr(height), uintptr(newFormat), uintptr(swapChainFlags))
|
uintptr(height), uintptr(newFormat), uintptr(swapChainFlags))
|
||||||
if uint32(r) != uint32(windows.S_OK) {
|
if uint32(r) != uint32(windows.S_OK) {
|
||||||
@ -2136,5 +2130,5 @@ func (i *_IDXGISwapChain4) ResizeBuffers(bufferCount uint32, width uint32, heigh
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (i *_IDXGISwapChain4) Release() {
|
func (i *_IDXGISwapChain4) Release() {
|
||||||
syscallN(i.vtbl.Release, uintptr(unsafe.Pointer(i)))
|
syscall.Syscall(i.vtbl.Release, 1, uintptr(unsafe.Pointer(i)), 0, 0)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user