-
-
Notifications
You must be signed in to change notification settings - Fork 389
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update D3D12 #812
base: 0.3
Are you sure you want to change the base?
Update D3D12 #812
Conversation
This PR probably depends on #807 and/or supersedes it |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR, as I'm in need of these new features as well :D
I tried to give some feedback in the hope to get this merged 👀
src/um/d3d12.rs
Outdated
@@ -1240,6 +1340,9 @@ STRUCT!{struct D3D12_TEX2DMS_ARRAY_SRV { | |||
FirstArraySlice: UINT, | |||
ArraySize: UINT, | |||
}} | |||
STRUCT!{struct D3D12_RAYTRACING_ACCELERATION_STRUCTURE_SRV { | |||
Location: UINT64, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
minor: D3D12_GPU_VIRTUAL_ADDRESS
instead of UINT64
src/um/d3d12.rs
Outdated
@@ -1901,6 +2005,15 @@ STRUCT!{struct D3D12_COMMAND_SIGNATURE_DESC { | |||
pArgumentDescs: *const D3D12_INDIRECT_ARGUMENT_DESC, | |||
NodeMask: UINT, | |||
}} | |||
STRUCT!{struct D3D12_WRITEBUFFERIMMEDIATE_PARAMETER { | |||
Dest: UINT64, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
D3D12_GPU_VIRTUAL_ADDRESS
src/um/d3d12.rs
Outdated
@@ -1901,6 +2005,15 @@ STRUCT!{struct D3D12_COMMAND_SIGNATURE_DESC { | |||
pArgumentDescs: *const D3D12_INDIRECT_ARGUMENT_DESC, | |||
NodeMask: UINT, | |||
}} | |||
STRUCT!{struct D3D12_WRITEBUFFERIMMEDIATE_PARAMETER { | |||
Dest: UINT64, | |||
Value: UINT, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
UINT32
src/um/d3d12.rs
Outdated
@@ -1972,7 +2085,8 @@ interface ID3D12CommandAllocator(ID3D12CommandAllocatorVtbl): ID3D12Pageable(ID3 | |||
}} | |||
RIDL!{#[uuid(0x0a753dcf, 0xc4d8, 0x4b91, 0xad, 0xf6, 0xbe, 0x5a, 0x60, 0xd9, 0x5a, 0x76)] | |||
interface ID3D12Fence(ID3D12FenceVtbl): ID3D12Pageable(ID3D12PageableVtbl) { | |||
fn GetCompletedValue() -> UINT64, | |||
fn GetCompletedValue( | |||
) -> u64, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this change should be removed imo
src/um/d3d12.rs
Outdated
RIDL!{#[uuid(0x7116d91c, 0xe7e4, 0x47ce, 0xb8, 0xc6, 0xec, 0x81, 0x68, 0xf4, 0x37, 0xe5)] | ||
interface ID3D12CommandList(ID3D12CommandListVtbl): ID3D12DeviceChild(ID3D12DeviceChildVtbl) { | ||
fn GetType() -> D3D12_COMMAND_LIST_TYPE, | ||
fn GetType( | ||
) -> D3D12_COMMAND_LIST_TYPE, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
formatting change
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Functions with no parameters should be single line.
src/um/d3d12.rs
Outdated
fn GetRequiredParameterResourceSize( | ||
Stage: D3D12_META_COMMAND_PARAMETER_STAGE, | ||
ParameterIndex: UINT, | ||
) -> u64, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
UINT64
src/um/d3d12.rs
Outdated
fn EmitRaytracingAccelerationStructurePostbuildInfo( | ||
pDesc: *const D3D12_RAYTRACING_ACCELERATION_STRUCTURE_POSTBUILD_INFO_DESC, | ||
NumSourceAccelerationStructures: UINT, | ||
pSourceAccelerationStructureData: *const UINT64, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
D3D12_GPU_VIRTUAL_ADDRESS
src/um/d3d12.rs
Outdated
pSourceAccelerationStructureData: *const UINT64, | ||
) -> (), | ||
fn CopyRaytracingAccelerationStructure( | ||
DestAccelerationStructureData: UINT64, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
D3D12_GPU_VIRTUAL_ADDRESS
src/um/d3d12.rs
Outdated
) -> (), | ||
fn CopyRaytracingAccelerationStructure( | ||
DestAccelerationStructureData: UINT64, | ||
SourceAccelerationStructureData: UINT64, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
D3D12_GPU_VIRTUAL_ADDRESS
src/um/d3d12.rs
Outdated
D3D12_AUTO_BREADCRUMB_OP_SETPIPELINESTATE1 = 39, | ||
}} | ||
STRUCT!{struct D3D12_AUTO_BREADCRUMB_NODE { | ||
pCommandListDebugNameA: *const INT8, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
c_char
and wchar_t
would be better imo
I created a corresponding PR: https://github.com/NovaMods/winapi-rs/pull/1 |
Should be ready now! (On a side note: There will be breaking changes to D3D12_VERSIONED_DEVICE_REMOVED_EXTENDED_DATA with the next two Win10 SDK updates..) |
.gitignore
Outdated
@@ -1,2 +1,4 @@ | |||
target/ | |||
Cargo.lock | |||
|
|||
.idea/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IDE specific files should go in your user profile .gitignore
, not this one.
build.rs
Outdated
@@ -6,6 +6,7 @@ | |||
use std::cell::Cell; | |||
use std::collections::HashMap; | |||
use std::env::var; | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Blank lines are evil.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
....why?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be ready |
This PR updates the D3D12 file to support everything up to the update that added DXR and renderpasses
Most of this update is untested. Testing it would require using it in a D3D12 renderer. I'm working on one, but it'll be a while
This PR resolves issue #789 and resolves part of #47