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

Pushconstants fixes #18

Merged

Conversation

janisozaur
Copy link
Contributor

Fixes for PushConstants example

@@ -291,7 +291,7 @@ void App::get_luminance_data(std::shared_ptr<float>* out_result_ptr,

luminance_data_size = sizeof(float) * N_TRIANGLES;

luminance_data_ptr.reset(new float[luminance_data_size / sizeof(float)]);
luminance_data_ptr.reset(new float[luminance_data_size / sizeof(float)], [](float *data) { delete [] data; });
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you replace the lambda func with a std::default_delete<float[]>() ? Having gone through the pain of enabling the "warings = errors" mode, I'd rather not add new C++11 requirements to the project.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

updated

Since the data was allocated with `operator new[]`, it has to be deleted
with `operator delete[]` rather than default `delete`
@janisozaur janisozaur force-pushed the pushconstants-fixes branch from cc80ac8 to 846e5cf Compare March 28, 2017 05:20
@DominikWitczakAMD DominikWitczakAMD merged commit 7eb4b4a into GPUOpen-Archive:master Mar 28, 2017
@janisozaur janisozaur deleted the pushconstants-fixes branch March 28, 2017 07:40
DominikWitczakAMD added a commit that referenced this pull request Apr 4, 2019
Fix #134: Assertion failure when using specialization constants
Address #18: Add CMake option to use alternative glslang snapshot
Address #75: Replace in_releaseable_sets wioth descriptor pool create flags in DescriptorSetGroup::create()
Address #104: Pipeline cache to use for a particular device can now be specified in DeviceCreateInfo.
Address #59: Change add_vertex_attribute() to add_vertex_binding()
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.

2 participants