Skip to content

Commit 098d8ca

Browse files
authored
Merge pull request #5551 from connnnal/d3d-strings
Alias [^]u16 to Windows LPCWSTR
2 parents 1470c30 + 3a1171e commit 098d8ca

File tree

2 files changed

+21
-19
lines changed

2 files changed

+21
-19
lines changed

vendor/directx/d3d11/d3d11.odin

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ BOOL :: dxgi.BOOL
1919
UINT :: dxgi.UINT
2020
INT :: dxgi.INT
2121

22-
LPCWSTR :: [^]u16
22+
LPCWSTR :: windows.LPCWSTR
2323

2424
RECT :: dxgi.RECT
2525
SIZE :: dxgi.SIZE

vendor/directx/d3d12/d3d12.odin

Lines changed: 20 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ BOOL :: dxgi.BOOL
2222

2323
RECT :: dxgi.RECT
2424

25+
LPCWSTR :: win32.LPCWSTR
26+
2527
IModuleInstance :: d3d_compiler.ID3D11ModuleInstance
2628
IBlob :: d3d_compiler.ID3DBlob
2729
IModule :: d3d_compiler.ID3D11Module
@@ -680,7 +682,7 @@ IObject_VTable :: struct {
680682
GetPrivateData: proc "system" (this: ^IObject, guid: ^GUID, pDataSize: ^u32, pData: rawptr) -> HRESULT,
681683
SetPrivateData: proc "system" (this: ^IObject, guid: ^GUID, DataSize: u32, pData: rawptr) -> HRESULT,
682684
SetPrivateDataInterface: proc "system" (this: ^IObject, guid: ^GUID, pData: ^IUnknown) -> HRESULT,
683-
SetName: proc "system" (this: ^IObject, Name: [^]u16) -> HRESULT,
685+
SetName: proc "system" (this: ^IObject, Name: LPCWSTR) -> HRESULT,
684686
}
685687

686688

@@ -2714,9 +2716,9 @@ IDevice_VTable :: struct {
27142716
CreateHeap: proc "system" (this: ^IDevice, pDesc: ^HEAP_DESC, riid: ^IID, ppvHeap: ^rawptr) -> HRESULT,
27152717
CreatePlacedResource: proc "system" (this: ^IDevice, pHeap: ^IHeap, HeapOffset: u64, pDesc: ^RESOURCE_DESC, InitialState: RESOURCE_STATES, pOptimizedClearValue: ^CLEAR_VALUE, riid: ^IID, ppvResource: ^rawptr) -> HRESULT,
27162718
CreateReservedResource: proc "system" (this: ^IDevice, pDesc: ^RESOURCE_DESC, InitialState: RESOURCE_STATES, pOptimizedClearValue: ^CLEAR_VALUE, riid: ^IID, ppvResource: ^rawptr) -> HRESULT,
2717-
CreateSharedHandle: proc "system" (this: ^IDevice, pObject: ^IDeviceChild, pAttributes: ^win32.SECURITY_ATTRIBUTES, Access: u32, Name: [^]u16, pHandle: ^HANDLE) -> HRESULT,
2719+
CreateSharedHandle: proc "system" (this: ^IDevice, pObject: ^IDeviceChild, pAttributes: ^win32.SECURITY_ATTRIBUTES, Access: u32, Name: LPCWSTR, pHandle: ^HANDLE) -> HRESULT,
27182720
OpenSharedHandle: proc "system" (this: ^IDevice, NTHandle: HANDLE, riid: ^IID, ppvObj: ^rawptr) -> HRESULT,
2719-
OpenSharedHandleByName: proc "system" (this: ^IDevice, Name: [^]u16, Access: u32, pNTHandle: ^HANDLE) -> HRESULT,
2721+
OpenSharedHandleByName: proc "system" (this: ^IDevice, Name: LPCWSTR, Access: u32, pNTHandle: ^HANDLE) -> HRESULT,
27202722
MakeResident: proc "system" (this: ^IDevice, NumObjects: u32, ppObjects: [^]^IPageable) -> HRESULT,
27212723
Evict: proc "system" (this: ^IDevice, NumObjects: u32, ppObjects: [^]^IPageable) -> HRESULT,
27222724
CreateFence: proc "system" (this: ^IDevice, InitialValue: u64, Flags: FENCE_FLAGS, riid: ^IID, ppFence: ^rawptr) -> HRESULT,
@@ -2738,9 +2740,9 @@ IPipelineLibrary :: struct #raw_union {
27382740
}
27392741
IPipelineLibrary_VTable :: struct {
27402742
using id3d12devicechild_vtable: IDeviceChild_VTable,
2741-
StorePipeline: proc "system" (this: ^IPipelineLibrary, pName: [^]u16, pPipeline: ^IPipelineState) -> HRESULT,
2742-
LoadGraphicsPipeline: proc "system" (this: ^IPipelineLibrary, pName: [^]u16, pDesc: ^GRAPHICS_PIPELINE_STATE_DESC, riid: ^IID, ppPipelineState: ^rawptr) -> HRESULT,
2743-
LoadComputePipeline: proc "system" (this: ^IPipelineLibrary, pName: [^]u16, pDesc: ^COMPUTE_PIPELINE_STATE_DESC, riid: ^IID, ppPipelineState: ^rawptr) -> HRESULT,
2743+
StorePipeline: proc "system" (this: ^IPipelineLibrary, pName: LPCWSTR, pPipeline: ^IPipelineState) -> HRESULT,
2744+
LoadGraphicsPipeline: proc "system" (this: ^IPipelineLibrary, pName: LPCWSTR, pDesc: ^GRAPHICS_PIPELINE_STATE_DESC, riid: ^IID, ppPipelineState: ^rawptr) -> HRESULT,
2745+
LoadComputePipeline: proc "system" (this: ^IPipelineLibrary, pName: LPCWSTR, pDesc: ^COMPUTE_PIPELINE_STATE_DESC, riid: ^IID, ppPipelineState: ^rawptr) -> HRESULT,
27442746
GetSerializedSize: proc "system" (this: ^IPipelineLibrary) -> SIZE_T,
27452747
Serialize: proc "system" (this: ^IPipelineLibrary, pData: rawptr, DataSizeInBytes: SIZE_T) -> HRESULT,
27462748
}
@@ -2754,7 +2756,7 @@ IPipelineLibrary1 :: struct #raw_union {
27542756
}
27552757
IPipelineLibrary1_VTable :: struct {
27562758
using id3d12pipelinelibrary_vtable: IPipelineLibrary_VTable,
2757-
LoadPipeline: proc "system" (this: ^IPipelineLibrary1, pName: [^]u16, pDesc: ^PIPELINE_STATE_STREAM_DESC, riid: ^IID, ppPipelineState: ^rawptr) -> HRESULT,
2759+
LoadPipeline: proc "system" (this: ^IPipelineLibrary1, pName: LPCWSTR, pDesc: ^PIPELINE_STATE_STREAM_DESC, riid: ^IID, ppPipelineState: ^rawptr) -> HRESULT,
27582760
}
27592761

27602762
MULTIPLE_FENCE_WAIT_FLAGS :: distinct bit_set[MULTIPLE_FENCE_WAIT_FLAG; u32]
@@ -2961,7 +2963,7 @@ META_COMMAND_PARAMETER_STAGE :: enum i32 {
29612963
}
29622964

29632965
META_COMMAND_PARAMETER_DESC :: struct {
2964-
Name: [^]u16,
2966+
Name: LPCWSTR,
29652967
Type: META_COMMAND_PARAMETER_TYPE,
29662968
Flags: META_COMMAND_PARAMETER_FLAGS,
29672969
RequiredResourceState: RESOURCE_STATES,
@@ -2991,7 +2993,7 @@ GRAPHICS_STATES :: enum i32 {
29912993

29922994
META_COMMAND_DESC :: struct {
29932995
Id: GUID,
2994-
Name: [^]u16,
2996+
Name: LPCWSTR,
29952997
InitializationDirtyState: GRAPHICS_STATES,
29962998
ExecutionDirtyState: GRAPHICS_STATES,
29972999
}
@@ -3012,8 +3014,8 @@ IStateObjectProperties :: struct #raw_union {
30123014
}
30133015
IStateObjectProperties_VTable :: struct {
30143016
using iunknown_vtable: IUnknown_VTable,
3015-
GetShaderIdentifier: proc "system" (this: ^IStateObjectProperties, pExportName: [^]u16) -> rawptr,
3016-
GetShaderStackSize: proc "system" (this: ^IStateObjectProperties, pExportName: [^]u16) -> u64,
3017+
GetShaderIdentifier: proc "system" (this: ^IStateObjectProperties, pExportName: LPCWSTR) -> rawptr,
3018+
GetShaderStackSize: proc "system" (this: ^IStateObjectProperties, pExportName: LPCWSTR) -> u64,
30173019
GetPipelineStackSize: proc "system" (this: ^IStateObjectProperties) -> u64,
30183020
SetPipelineStackSize: proc "system" (this: ^IStateObjectProperties, PipelineStackSizeInBytes: u64),
30193021
}
@@ -3067,8 +3069,8 @@ EXPORT_FLAG :: enum u32 {
30673069
}
30683070

30693071
EXPORT_DESC :: struct {
3070-
Name: [^]u16,
3071-
ExportToRename: [^]u16,
3072+
Name: LPCWSTR,
3073+
ExportToRename: LPCWSTR,
30723074
Flags: EXPORT_FLAGS,
30733075
}
30743076

@@ -3414,9 +3416,9 @@ AUTO_BREADCRUMB_OP :: enum i32 {
34143416

34153417
AUTO_BREADCRUMB_NODE :: struct {
34163418
pCommandListDebugNameA: cstring,
3417-
pCommandListDebugNameW: [^]u16,
3419+
pCommandListDebugNameW: LPCWSTR,
34183420
pCommandQueueDebugNameA: cstring,
3419-
pCommandQueueDebugNameW: [^]u16,
3421+
pCommandQueueDebugNameW: LPCWSTR,
34203422
pCommandList: ^IGraphicsCommandList,
34213423
pCommandQueue: ^ICommandQueue,
34223424
BreadcrumbCount: u32,
@@ -3427,14 +3429,14 @@ AUTO_BREADCRUMB_NODE :: struct {
34273429

34283430
DRED_BREADCRUMB_CONTEXT :: struct {
34293431
BreadcrumbIndex: u32,
3430-
pContextString: [^]u16,
3432+
pContextString: LPCWSTR,
34313433
}
34323434

34333435
AUTO_BREADCRUMB_NODE1 :: struct {
34343436
pCommandListDebugNameA: cstring,
3435-
pCommandListDebugNameW: [^]u16,
3437+
pCommandListDebugNameW: LPCWSTR,
34363438
pCommandQueueDebugNameA: cstring,
3437-
pCommandQueueDebugNameW: [^]u16,
3439+
pCommandQueueDebugNameW: LPCWSTR,
34383440
pCommandList: ^IGraphicsCommandList,
34393441
pCommandQueue: ^ICommandQueue,
34403442
BreadcrumbCount: u32,

0 commit comments

Comments
 (0)