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

WIP: Add a new sample - subgroups operations #715

Open
wants to merge 54 commits into
base: main
Choose a base branch
from

Conversation

Patryk-Jastrzebski-Mobica
Copy link
Contributor

Description

Please include a summary of the change, new sample or fixed issue. Please also include relevant motivation and context.
Please read the contribution guidelines

Fixes #

General Checklist:

Please ensure the following points are checked:

  • My code follows the coding style
  • I have reviewed file licenses
  • I have updated the header Copyright to reflect the current year (CI build will fail if Copyright is out of date)
  • I have commented any added functions (in line with Doxygen)
  • I have commented any code that could be hard to understand
  • My changes do not add any new compiler warnings
  • My changes do not add any new validation layer errors or warnings
  • I have used existing framework/helper functions where possible
  • My changes build on Windows, Linux, macOS and Android. Otherwise I have documented any exceptions
  • My changes do not add any regressions
  • I have tested every sample to ensure everything runs correctly
  • This PR describes the scope and expected impact of the changes I am making

Sample Checklist

If your PR contains a new or modified sample, these further checks must be carried out in addition to the General Checklist:

  • I have tested the sample on at least one compliant Vulkan implementation
  • If the sample is vendor-specific, I have tagged it appropriately
  • I have stated on what implementation the sample has been tested so that others can test on different implementations and platforms
  • Any dependent assets have been merged and published in downstream modules
  • For new samples, I have added a paragraph with a summary to the appropriate chapter in the samples readme

@Patryk-Jastrzebski-Mobica Patryk-Jastrzebski-Mobica changed the title WIP: Add a new sample - subgroups operation WIP: Add a new sample - subgroups operations Jun 12, 2023
VK_CHECK(vkAllocateDescriptorSets(get_device().get_handle(), &alloc_info, &compute.descriptor_set));
}

void SubgroupsOperations::preapre_compute_pipeline_layout()

Choose a reason for hiding this comment

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

typo. Should be "prepare_compute_pipeline_layout"

VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER,
1u,
&image_descriptor)};
vkUpdateDescriptorSets(get_device().get_handle(), static_cast<uint32_t>(write_descriptor_sets.size()), write_descriptor_sets.data(), 0u, NULL);

Choose a reason for hiding this comment

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

How about using nullptr instead of NULL? The last argument of vkUpdateDescriptorSets is a pointer to an array of VkCopyDescriptorSet so nullptr better suggest that is the pointer

Copy link
Contributor Author

Choose a reason for hiding this comment

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

out to date

VkViewport viewport = vkb::initializers::viewport(static_cast<float>(width), static_cast<float>(height), 0.0f, 1.0f);
vkCmdSetViewport(draw_cmd_buffers[i], 0u, 1u, &viewport);

VkRect2D scissor = vkb::initializers::rect2D(width, height, 0, 0);

Choose a reason for hiding this comment

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

Perhaps it can be explicitly cast by static_cast<int32_t>(width) and static_cast<int32_t>(height). This is not necessary, just a small suggestion


// draw texture
{
vkCmdBindDescriptorSets(draw_cmd_buffers[i], VK_PIPELINE_BIND_POINT_GRAPHICS, texture_object.pipeline.pipeline_layout, 0, 1, &texture_object.descriptor_set, 0, nullptr);

Choose a reason for hiding this comment

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

For code style consistency I suggest to add "u" to numbers
vkCmdBindDescriptorSets(draw_cmd_buffers[i], VK_PIPELINE_BIND_POINT_GRAPHICS, texture_object.pipeline.pipeline_layout, 0u, 1u, &texture_object.descriptor_set, 0u, nullptr);

Copy link
Contributor Author

Choose a reason for hiding this comment

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

out to date

vkCmdBindPipeline(draw_cmd_buffers[i], VK_PIPELINE_BIND_POINT_GRAPHICS, texture_object.pipeline.pipeline);

VkDeviceSize offset[] = {0};
vkCmdBindVertexBuffers(draw_cmd_buffers[i], 0, 1, texture_object.buffers.vertex->get(), offset);

Choose a reason for hiding this comment

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

For code style consistency I suggest to add "u" to unsigned int arguments

Copy link
Contributor Author

Choose a reason for hiding this comment

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

out to date

vkCmdBindVertexBuffers(draw_cmd_buffers[i], 0, 1, texture_object.buffers.vertex->get(), offset);
vkCmdBindIndexBuffer(draw_cmd_buffers[i], texture_object.buffers.index->get_handle(), 0, VK_INDEX_TYPE_UINT32);

vkCmdDrawIndexed(draw_cmd_buffers[i], texture_object.buffers.index_count, 1u, 0u, 0u, 0u);

Choose a reason for hiding this comment

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

vertexOffset argument is int32_t so it should be
vkCmdDrawIndexed(draw_cmd_buffers[i], texture_object.buffers.index_count, 1u, 0u, 0, 0u);

Copy link
Contributor Author

Choose a reason for hiding this comment

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

out to date


struct GuiSettings
{
int32_t selected_filtr = 0;

Choose a reason for hiding this comment

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

typo. Should be selected_filter

Copy link
Contributor Author

Choose a reason for hiding this comment

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

out to date

int32_t selected_filtr = 0;
static std::vector<std::string> init_filters_name()
{
std::vector<std::string> filtrs = {

Choose a reason for hiding this comment

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

typo. Should be std::vectorstd::string filters

Copy link
Contributor Author

Choose a reason for hiding this comment

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

out to date

@asuessenbach
Copy link
Contributor

That's a nice little sample!
Is it still work in progress, as the title says?
Would it be easy to extend that sample by adding a non-subgroups path for comparison?

@Patryk-Jastrzebski-Mobica
Copy link
Contributor Author

Hi @asuessenbach,
Yes, I'm still working on this sample. I'm currently implementing the FFT algorithm. Next week, I plan to push another commit/change with the vertex animation ready.
And as for the last question, I cannot answer you yet.

@SaschaWillems
Copy link
Collaborator

Any update on this? Having a subgroups sample would be very much appreciated :)

@SaschaWillems
Copy link
Collaborator

Any updates on this sample? Having a subgroup sample would be a great addition :)

@Patryk-Jastrzebski-Mobica
Copy link
Contributor Author

Hi @SaschaWillems, I apologise for not updating for such a long time. Unfortunately the implementation of the sample is not yet finished. I still have some work left to do:

  • implement BRDF reflections,

  • fixing problems with pipeline barriers - on the Intel Iris Xe the sample runs stable, but on the RTX 2060 it crash after a few seconds,

  • adding a description to the README file.

@SaschaWillems
Copy link
Collaborator

No need to apologize. Your work is very much appreciated and I'm happy to hear that this sample is coming along :)

@SaschaWillems
Copy link
Collaborator

Any update on this?

@CLAassistant
Copy link

CLAassistant commented Mar 20, 2024

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
2 out of 3 committers have signed the CLA.

✅ Patryk-Jastrzebski-Mobica
✅ Krzysztof-Dmitruk-Mobica
❌ kdmitruk
You have signed the CLA already but the status is still pending? Let us recheck it.

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

7 participants