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

Proper PSO errors, with constant offsets matching #1004

Merged
merged 12 commits into from Aug 9, 2016

Conversation

@sectopod
Copy link
Contributor

commented Jul 27, 2016

API-breaking change (although no one will notice):

  • proper PSO creation errors now
  • matching the offsets of constant buffer elements, including arrays of structures

Fixes #722, fixes #896

@kvark

This comment has been minimized.

Copy link
Member

commented Jul 27, 2016

I assume arrays are the biggest problem, and it interferes with #898.
Perhaps, we can match only the first element offset and the stride of it? No need to go through all the elements.

@sectopod sectopod changed the title [WIP] Constant buffer elements matching [WIP] Proper PSO errors, with constant offsets matching Jul 28, 2016

@kvark

This comment has been minimized.

Copy link
Member

commented Jul 28, 2016

Please provide an example error message now that we can cheer on it ;)

@sectopod

This comment has been minimized.

Copy link
Contributor Author

commented Aug 2, 2016

My windows machine HDD has failed. Unfortunately, I'll not be able to finish this fix properly for the DX samples to run. Good news is - all the code is here, in PR, I didn't lose anything locally. If someone wants to pick it up and fix DX samples - would be great!

@sectopod

This comment has been minimized.

Copy link
Contributor Author

commented Aug 7, 2016

Heads up - I've got the new windows setup working, will be able to finish this PR myself.

@sectopod

This comment has been minimized.

Copy link
Contributor Author

commented Aug 9, 2016

Example error for a mismatched offset inside a constant buffer:

thread 'main' panicked at 'called Result::unwrap() on an Err value: DescriptorInit(ConstantBuffer("Locals", Some(Offset("u_Transform", 0))))', ../src/libcore\result.rs:785

@sectopod sectopod changed the title [WIP] Proper PSO errors, with constant offsets matching Proper PSO errors, with constant offsets matching Aug 9, 2016

@sectopod

This comment has been minimized.

Copy link
Contributor Author

commented Aug 9, 2016

I didn't bump the crate versions, but other than that - the PR is ready to go!

@kvark

This comment has been minimized.

Copy link
Member

commented Aug 9, 2016

At last, it has arrived!
@homu r+

@homu

This comment has been minimized.

Copy link
Contributor

commented Aug 9, 2016

📌 Commit fc7b7b9 has been approved by kvark

@homu homu merged commit fc7b7b9 into gfx-rs:master Aug 9, 2016

2 checks passed

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

homu added a commit that referenced this pull request Aug 9, 2016

Auto merge of #1004 - sectopod:cbuf, r=kvark
Proper PSO errors, with constant offsets matching

API-breaking change (although no one will notice)

Fixes #722, fixes #896

Status: some DX11 examples fail to match CB elements: `deferred`, `ubo_tilemap`.
@homu

This comment has been minimized.

Copy link
Contributor

commented Aug 9, 2016

⚡️ Test exempted - status

@@ -86,6 +86,27 @@ fn map_texture_type(tt: winapi::D3D_SRV_DIMENSION) -> s::TextureType {
}
}

fn map_container(stype: &winapi::D3D11_SHADER_TYPE_DESC) -> s::ContainerType {
use gfx_core::shade::Dimension as Dim;
//TODO: use `match` when winapi allows

This comment has been minimized.

Copy link
@kvark

kvark Aug 9, 2016

Member

@retep998 is this something on your radar?

This comment has been minimized.

Copy link
@retep998

retep998 Aug 9, 2016

Oh, the method I use for enums in winapi 0.2 doesn't allow you to match on it? Well, this will be fixed in winapi 0.3 for sure because I will be making enums simple integer constants and you can definitely match on integers.

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