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] dx12: Implement shader module creation from SPIR-V #1546

Merged
merged 2 commits into from Oct 5, 2017

Conversation

@msiglreith
Copy link
Member

commented Oct 5, 2017

  • Implement shader module creation from SPIR-V binaries, including patching of descriptor sets for images and samplers (more patching needed for constant buffers, etc.) and invert y-axis to match Vulkan's coordinate system

  • Port quad example over to SPIR-V based shader modules

  • Use safer clear_attachments wrapper from ash

I'm not totally happy with all the error handling in create_shader_module but we don't know when SPIRV-Cross might throw an exception /:

@msiglreith msiglreith requested a review from kvark Oct 5, 2017

@kvark

kvark approved these changes Oct 5, 2017

Copy link
Member

left a comment

Looks great! one small thing to address, then r=me

"vs_main",
"main",
include_bytes!("shader/quad.hlsl"))
.create_shader_module(include_bytes!("data/vert.spv"))

This comment has been minimized.

Copy link
@kvark

kvark Oct 5, 2017

Member

Can we switch the vulkan path to also get SPIRV for consistency, merging them here?

@@ -761,10 +798,11 @@ impl d::Device<B> for Device {

let shader_blob = Self::compile_shader(
stage,
compile_options.shader_model,
hlsl::ShaderModel::V5_1,

This comment has been minimized.

Copy link
@grovesNL

grovesNL Oct 5, 2017

Member

It's already hardcoded above?

[ll] dx12: Implement shader module creation from SPIR-V
Port quad example over to use spirv binary shaders.

@msiglreith msiglreith force-pushed the msiglreith:ll_spirv_dx12 branch from f07ec1d to ab93fa4 Oct 5, 2017

@msiglreith

This comment has been minimized.

Copy link
Member Author

commented Oct 5, 2017

Thanks for the reviews! Addressed all points.
bors r=kvark

bors bot added a commit that referenced this pull request Oct 5, 2017

Merge #1546
1546: [ll] dx12: Implement shader module creation from SPIR-V r=kvark a=msiglreith

* Implement shader module creation from SPIR-V binaries, including patching of descriptor sets for images and samplers (more patching needed for constant buffers, etc.) and invert y-axis to match Vulkan's coordinate system

* Port quad example over to SPIR-V based shader modules

* Use safer `clear_attachments` wrapper from ash

I'm not totally happy with all the error handling in `create_shader_module` but we don't know when SPIRV-Cross might throw an exception /:
@@ -114,35 +114,14 @@ fn main() {
let (mut swap_chain, backbuffers) = surface.build_swapchain(swap_config, &queue);

// Setup renderpass and pipeline
// dx12 runtime shader compilation
#[cfg(feature = "dx12")]
#[cfg(any(feature = "vulkan", feature = "dx12"))]

This comment has been minimized.

Copy link
@kvark

kvark Oct 5, 2017

Member

🎉

@bors

This comment has been minimized.

Copy link
Contributor

commented Oct 5, 2017

Timed out

@kvark

This comment has been minimized.

Copy link
Member

commented Oct 5, 2017

those lovely OSX CI timeouts...
feel free to merge once Travis is done

@kvark kvark merged commit bdb0b2d into gfx-rs:ll Oct 5, 2017

2 of 3 checks passed

bors Timed out
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

@msiglreith msiglreith referenced this pull request Oct 6, 2017

Closed

[ll] dx12: Shader module creation from SPIR-V #1538

3 of 3 tasks complete

@msiglreith msiglreith deleted the msiglreith:ll_spirv_dx12 branch Oct 17, 2017

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