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

[ll] D3D12 backend MVP #1330

Merged
merged 20 commits into from Jul 12, 2017

Conversation

@kvark
Copy link
Member

commented Jun 22, 2017

Fixes #1353
Also brings some improvements to core and metal backends.

@msiglreith
Copy link
Member

left a comment

Nice to see some work on the backend 🌻

@@ -97,17 +97,71 @@ impl Factory {
}
Ok(native::ShaderLib { shaders: shader_map })
}

pub fn create_descriptor_heap_impl(device: &mut ComPtr<winapi::ID3D12Device>,

This comment has been minimized.

Copy link
@msiglreith

msiglreith Jun 22, 2017

Member

Could you annotate that this as a non-shader visible/cpu heap?

},
core::HeapType {
id: 1,
properties: memory::CPU_VISIBLE | memory::CPU_CACHED,

This comment has been minimized.

Copy link
@msiglreith

msiglreith Jun 22, 2017

Member

Does D3D12 have non-coherent memory? Vulkan requires to explicitly flush non-coherent memory via vkFlush/InvalidateMappedMemoryRanges. I don't recall if there is a similar restriction on d3d12 (map/unmap?).

@kvark

This comment has been minimized.

Copy link
Member Author

commented Jul 11, 2017

Progress is real, landing imminent:
gfx-dx12

@kvark kvark force-pushed the kvark:bind2 branch from e206edc to 80848b7 Jul 11, 2017

@kvark kvark changed the title [WIP] [ll] D3D12 backend MVP [ll] D3D12 backend MVP Jul 12, 2017

@msiglreith
Copy link
Member

left a comment

Great!

Edit: I can't say something about the metall changes but @JohnColanduoni seems to have already approved it on gitter.

};

if state_src == state_dst {
warn!("Image pipeline barrier requested with no effect: {:?}", barrier);

This comment has been minimized.

Copy link
@msiglreith

msiglreith Jul 12, 2017

Member

This doesn't necessarily indicate that something redundant has been done but we should indeed skip them.

fn clear_color(&mut self, rtv: &native::RenderTargetView, value: command::ClearColor) {
let clear_color = match value {
command::ClearColor::Float(c) => c,
command::ClearColor::Int(c) => [c[0] as FLOAT, c[1] as FLOAT, c[2] as FLOAT, c[3] as FLOAT], // TODO: error?

This comment has been minimized.

Copy link
@msiglreith

msiglreith Jul 12, 2017

Member

(Casts are probably wrong here, requiring to keep the same bits but that's something we rather need to test in the future..)

render_area: target::Rect,
clear_values: &[command::ClearValue]
) -> Self {
let color_views = framebuffer.color.iter().map(|view| view.handle).collect::<Vec<_>>();

This comment has been minimized.

Copy link
@msiglreith

msiglreith Jul 12, 2017

Member

nit: formatting

clear_values: &[command::ClearValue]
) -> Self {
let color_views = framebuffer.color.iter().map(|view| view.handle).collect::<Vec<_>>();
assert!(framebuffer.depth_stencil.len() <= 1);

This comment has been minimized.

Copy link
@msiglreith

msiglreith Jul 12, 2017

Member

Whats the motivation behind this check?

pub struct DescriptorHeap {
pub inner: ComPtr<winapi::ID3D12DescriptorHeap>,
//TODO: hide members?

This comment has been minimized.

Copy link
@msiglreith

msiglreith Jul 12, 2017

Member

Sounds like a good place for pub(crate) 😄

@kvark kvark force-pushed the kvark:bind2 branch from 40447ef to aac9e83 Jul 12, 2017

@kvark kvark force-pushed the kvark:bind2 branch from a6df31c to dd915fc Jul 12, 2017

@kvark

This comment has been minimized.

Copy link
Member Author

commented Jul 12, 2017

Looks green enough :) Merging, at last!

@kvark kvark merged commit f1d53bb into gfx-rs:master Jul 12, 2017

1 of 2 checks passed

continuous-integration/travis-ci/pr The Travis CI build is in progress
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details

@kvark kvark deleted the kvark:bind2 branch Jul 12, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.