Skip to content
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

Open
wants to merge 70 commits into
base: 0.3
Choose a base branch
from
Open

Update D3D12 #812

wants to merge 70 commits into from

Conversation

DethRaid
Copy link

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

@DethRaid DethRaid mentioned this pull request Sep 21, 2019
@DethRaid
Copy link
Author

This PR probably depends on #807 and/or supersedes it

@retep998 retep998 added the waiting on review Waiting for a reviewer to review the PR label Sep 24, 2019
Copy link
Contributor

@msiglreith msiglreith left a 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,
Copy link
Contributor

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,
Copy link
Contributor

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,
Copy link
Contributor

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,
Copy link
Contributor

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,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

formatting change

Copy link
Owner

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,
Copy link
Contributor

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,
Copy link
Contributor

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,
Copy link
Contributor

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,
Copy link
Contributor

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,
Copy link
Contributor

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

@msiglreith
Copy link
Contributor

I created a corresponding PR: https://github.com/NovaMods/winapi-rs/pull/1

@msiglreith
Copy link
Contributor

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/
Copy link
Owner

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;

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Blank lines are evil.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

....why?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@msiglreith
Copy link
Contributor

Should be ready

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
waiting on review Waiting for a reviewer to review the PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants