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

Fix D3D12 sample #2084

Merged
merged 1 commit into from Oct 3, 2022
Merged

Fix D3D12 sample #2084

merged 1 commit into from Oct 3, 2022

Conversation

kennykerr
Copy link
Collaborator

This fixes the D3D sample mentioned here: #2082

The issue was detected using App Verifier and stems from an unsafe From implementation, which I will fix separately as it is rather involved.

@@ -426,17 +426,17 @@ mod d3d12_hello_triangle {
let asset_path = exe_path.parent().unwrap();
let shaders_hlsl_path = asset_path.join("shaders.hlsl");
let shaders_hlsl = shaders_hlsl_path.to_str().unwrap();
let shaders_hlsl = PCWSTR::from(&shaders_hlsl.into());
let shaders_hlsl: HSTRING = shaders_hlsl.into();
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

A temporary HSTRING was being created and then used in the subsequent calls to D3DCompileFromFile.

@kennykerr kennykerr requested a review from riverar October 3, 2022 14:33
Copy link
Collaborator

@riverar riverar left a comment

Choose a reason for hiding this comment

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

Thanks!

@kennykerr kennykerr merged commit 931a9f6 into master Oct 3, 2022
@kennykerr kennykerr deleted the fix-d3d branch October 3, 2022 14:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants