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
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
bb3e6f8
Add a new sample - subgroups operation
Patryk-Jastrzebski-Mobica Jun 12, 2023
e0cb8ea
Add ocean fft
Patryk-Jastrzebski-Mobica Jun 13, 2023
d563f62
Fix grid generation algorithm
Patryk-Jastrzebski-Mobica Jun 14, 2023
2b57067
Add compute pipeline and compute queue
Patryk-Jastrzebski-Mobica Jun 14, 2023
ea486ea
Add ability to resize the grid in the UI and a few small changes
Patryk-Jastrzebski-Mobica Jun 16, 2023
014fe37
Animated grid using the sine and cosine functions
Patryk-Jastrzebski-Mobica Jun 23, 2023
ebf2e8c
Add a new compute pipeline
Patryk-Jastrzebski-Mobica Jul 5, 2023
741c1c5
Fixed a descriptor set, the function generating random numbers has be…
Patryk-Jastrzebski-Mobica Jul 6, 2023
de6d054
Transfer of philips spectrum calculation from GPU to CPU.
Patryk-Jastrzebski-Mobica Aug 18, 2023
f052073
Refactoring and changes in graphic pipeline
Patryk-Jastrzebski-Mobica Sep 6, 2023
a7a2b14
Add the FBAttachment type
Krzysztof-Dmitruk-Mobica Sep 12, 2023
bdb3b31
Add butterfly precomp shader and texture
Krzysztof-Dmitruk-Mobica Sep 20, 2023
fd6d970
Add tilde textures and pipeline
Patryk-Jastrzebski-Mobica Sep 21, 2023
047e7f5
Refactor and add butterfly and tild texture generation
Patryk-Jastrzebski-Mobica Sep 26, 2023
9c31164
Some fixes
Patryk-Jastrzebski-Mobica Sep 26, 2023
2ab5a23
Fix access to input buffers
Patryk-Jastrzebski-Mobica Sep 26, 2023
2e26f5c
Add fft pipeline for rows
Patryk-Jastrzebski-Mobica Sep 28, 2023
cf16c81
Add vertical fft calculation
Patryk-Jastrzebski-Mobica Sep 29, 2023
e4b6eee
Add invert fft and clean-up
Patryk-Jastrzebski-Mobica Sep 29, 2023
b488050
Fix validation layer errors and fix tessellation shaders
Patryk-Jastrzebski-Mobica Oct 4, 2023
4e74a29
some fixes
Patryk-Jastrzebski-Mobica Oct 4, 2023
c28f322
Fix tilde_h_0 indexation
kdmitruk Oct 4, 2023
dc95647
Fix log_2_N rounding
Krzysztof-Dmitruk-Mobica Oct 6, 2023
d2a5b52
Some fixes, add tessellation
Patryk-Jastrzebski-Mobica Oct 11, 2023
09dc3a9
Fix a buttlefly pipeline
Patryk-Jastrzebski-Mobica Oct 11, 2023
5524b44
Add tilde_h_0 shader
Krzysztof-Dmitruk-Mobica Oct 10, 2023
3aa8449
Split fft steps into separate calls
Krzysztof-Dmitruk-Mobica Oct 13, 2023
cfdcef2
Fix input data randomization
Krzysztof-Dmitruk-Mobica Oct 13, 2023
fc762c7
Code cleanup
Krzysztof-Dmitruk-Mobica Oct 13, 2023
dddff03
rewrite the grid generation
Patryk-Jastrzebski-Mobica Oct 14, 2023
e52c772
fixed validation layers issues and add changes to ocean pipeline
Patryk-Jastrzebski-Mobica Oct 16, 2023
37feee2
animation fix
Patryk-Jastrzebski-Mobica Oct 16, 2023
fb35f7d
add normal map
Patryk-Jastrzebski-Mobica Oct 17, 2023
91d3edf
Fix interpolation of a tessellated grid
Krzysztof-Dmitruk-Mobica Oct 17, 2023
dedd573
some fixes and new ui params
Patryk-Jastrzebski-Mobica Oct 17, 2023
9a8d989
ui update
Patryk-Jastrzebski-Mobica Oct 17, 2023
8b53cd6
Add wind coordinate conversion
Krzysztof-Dmitruk-Mobica Oct 17, 2023
da33331
refactor
Patryk-Jastrzebski-Mobica Oct 18, 2023
6345881
shader clean-up
Patryk-Jastrzebski-Mobica Oct 18, 2023
fe174b1
add skybox
Patryk-Jastrzebski-Mobica Oct 18, 2023
3a200dc
rebase
Patryk-Jastrzebski-Mobica Oct 18, 2023
ebb8d25
update ui
Patryk-Jastrzebski-Mobica Oct 18, 2023
4cbe4df
fix normal map
Patryk-Jastrzebski-Mobica Oct 18, 2023
60d4809
add a new ui elements
Patryk-Jastrzebski-Mobica Oct 18, 2023
a6b4864
Add (broken) reflection
Krzysztof-Dmitruk-Mobica Oct 20, 2023
a0bc273
Fix skybox cliping issue
Patryk-Jastrzebski-Mobica Oct 24, 2023
68e4fe8
Merge branch 'subgroups_operations_ocean_fft' of github.com:Mobica/Vu…
Patryk-Jastrzebski-Mobica Oct 24, 2023
d4954d2
A rebase fix
Patryk-Jastrzebski-Mobica Oct 24, 2023
d887e5f
use initialisation functions to initialise objects
Patryk-Jastrzebski-Mobica Oct 25, 2023
ef7159e
[WIP] reflections experiments
Patryk-Jastrzebski-Mobica Nov 2, 2023
f6b125c
Convert a README.md file to a README.adoc file
Patryk-Jastrzebski-Mobica Nov 8, 2023
d09532f
[WIP] Add BRDF reflection
Patryk-Jastrzebski-Mobica Nov 15, 2023
a9ca1fb
Add pipeline barriers, update README file
Patryk-Jastrzebski-Mobica Nov 20, 2023
a67ff3e
Add a new sample - subgroups operation
Patryk-Jastrzebski-Mobica Jun 12, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
159 changes: 80 additions & 79 deletions samples/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -48,85 +48,86 @@ endforeach ()

# Order of the sample ids
set(ORDER_LIST
#API Samples
"hello_triangle"
"dynamic_uniform_buffers"
"texture_loading"
"hdr"
"instancing"
"compute_nbody"
"terrain_tessellation"
"hlsl"

#Extension Samples
"dynamic_rendering"
"conservative_rasterization"
"fragment_shading_rate"
"fragment_shading_rate_dynamic"
"full_screen_exclusive"
"calibrated_timestamps"
"graphics_pipeline_library"
"memory_budget"
"mesh_shader_culling"
"push_descriptors"
"ray_queries"
"ray_tracing_basic"
"ray_tracing_extended"
"ray_tracing_reflection"
"timeline_semaphore"
"shader_object"
"synchronization_2"
"buffer_device_address"
"descriptor_indexing"
"portability"
"vertex_dynamic_state"
"extended_dynamic_state2"
"logic_op_dynamic_state"
"patch_control_points"
"fragment_shader_barycentric"
"gshader_to_mshader"
"color_write_enable"

#Performance Samples
"swapchain_images"
"surface_rotation"
"pipeline_cache"
"descriptor_management"
"constant_data"
"render_passes"
"msaa"
"subpasses"
"pipeline_barriers"
"wait_idle"
"layout_transitions"
"specialization_constants"
"command_buffer_usage"
"multithreading_render_passes"
"afbc"
"16bit_storage_input_output"
"16bit_arithmetic"
"async_compute"
"multi_draw_indirect"
"texture_compression_comparison"

#Tooling samples
"profiles"

#HPP API Samples
"hpp_compute_nbody"
"hpp_dynamic_uniform_buffers"
"hpp_hdr"
"hpp_hello_triangle"
"hpp_hlsl_shaders"
"hpp_instancing"
"hpp_separate_image_sampler"
"hpp_terrain_tessellation"
"hpp_texture_loading"
"hpp_texture_mipmap_generation"

#HPP Performance Samples
"hpp_pipeline_cache"
"hpp_swapchain_images")
#API Samples
"hello_triangle"
"dynamic_uniform_buffers"
"texture_loading"
"hdr"
"instancing"
"compute_nbody"
"terrain_tessellation"
"hlsl"

#Extension Samples
"dynamic_rendering"
"conservative_rasterization"
"fragment_shading_rate"
"fragment_shading_rate_dynamic"
"full_screen_exclusive"
"calibrated_timestamps"
"graphics_pipeline_library"
"memory_budget"
"mesh_shader_culling"
"push_descriptors"
"ray_queries"
"ray_tracing_basic"
"ray_tracing_extended"
"ray_tracing_reflection"
"timeline_semaphore"
"shader_object"
"synchronization_2"
"buffer_device_address"
"descriptor_indexing"
"portability"
"vertex_dynamic_state"
"extended_dynamic_state2"
"logic_op_dynamic_state"
"patch_control_points"
"fragment_shader_barycentric"
"gshader_to_mshader"
"color_write_enable"
"subgroups_operations"

#Performance Samples
"swapchain_images"
"surface_rotation"
"pipeline_cache"
"descriptor_management"
"constant_data"
"render_passes"
"msaa"
"subpasses"
"pipeline_barriers"
"wait_idle"
"layout_transitions"
"specialization_constants"
"command_buffer_usage"
"multithreading_render_passes"
"afbc"
"16bit_storage_input_output"
"16bit_arithmetic"
"async_compute"
"multi_draw_indirect"
"texture_compression_comparison"

#Tooling samples
"profiles"

#HPP API Samples
"hpp_compute_nbody"
"hpp_dynamic_uniform_buffers"
"hpp_hdr"
"hpp_hello_triangle"
"hpp_hlsl_shaders"
"hpp_instancing"
"hpp_separate_image_sampler"
"hpp_terrain_tessellation"
"hpp_texture_loading"
"hpp_texture_mipmap_generation"

#HPP Performance Samples
"hpp_pipeline_cache"
"hpp_swapchain_images")

# Orders the sample ids by the order list above
set(ORDERED_LIST)
Expand Down
41 changes: 41 additions & 0 deletions samples/extensions/subgroups_operations/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Copyright (c) 2023, Mobica Limited
#
# SPDX-License-Identifier: Apache-2.0
#
# Licensed under the Apache License, Version 2.0 the "License";
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.


get_filename_component(FOLDER_NAME ${CMAKE_CURRENT_LIST_DIR} NAME)
get_filename_component(PARENT_DIR ${CMAKE_CURRENT_LIST_DIR} PATH)
get_filename_component(CATEGORY_NAME ${PARENT_DIR} NAME)

add_sample(
ID ${FOLDER_NAME}
CATEGORY ${CATEGORY_NAME}
AUTHOR "Mobica"
NAME "subgroups_operations"
DESCRIPTION "Demonstrates the use of a subgroups feature"
SHADER_FILES_GLSL
"subgroups_operations/skybox.vert"
"subgroups_operations/skybox.frag"
"subgroups_operations/ocean.vert"
"subgroups_operations/ocean.frag"
"subgroups_operations/ocean.tesc"
"subgroups_operations/ocean.tese"
"subgroups_operations/fft_invert.comp"
"subgroups_operations/butterfly_precomp.comp"
"subgroups_operations/fft_tilde_h.comp"
"subgroups_operations/fft_tilde_h0.comp"
"subgroups_operations/fft_normal_map.comp"
"subgroups_operations/fft.comp")

39 changes: 39 additions & 0 deletions samples/extensions/subgroups_operations/README.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<!-- - Copyright (c) 2023, Mobica Limited - - SPDX-License-Identifier: Apache-2.0 - - Licensed under the Apache License, Version 2.0 the "License"; - you may not use this file except in compliance with the License.
- You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0
- - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and - limitations under the License.
- -->

# Subgroups Operations

## Overview

This sample demonstrates how to use and enable the Subgroups operations feature.
image:image/image.png[]

## GLSL Shaders

In shader enable `GL_KHR_shader_subgroup_basic` extension.
TODO: add more description

## Enabling the Feature

To enable the subgroups feature in the Vulkan API you must create a Vulkan instance with a minimum version of version 1.1. Enable the extension `VK_EXT_subgroup_size_control` and get the subgroup properties of a physical device

```C++
VkPhysicalDeviceSubgroupProperties subgroups_properties;
subgroups_properties.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_PROPERTIES;
subgroups_properties.pNext = VK_NULL_HANDLE;

VkPhysicalDeviceProperties2 device_properties2 = {};
device_properties2.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2;
device_properties2.pNext = &subgroups_properties;
vkGetPhysicalDeviceProperties2(gpu.get_handle(), &device_properties2);
```

TODO: add more description

## Additional information

More about subgroups you can read [in this article](https://www.khronos.org/blog/vulkan-subgroup-tutorial).
Documentation: https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VkPhysicalDeviceSubgroupProperties.html
51 changes: 51 additions & 0 deletions samples/extensions/subgroups_operations/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
<!--
- Copyright (c) 2023, Mobica Limited
-
- SPDX-License-Identifier: Apache-2.0
-
- Licensed under the Apache License, Version 2.0 the "License";
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
-->

# Subgroups Operations


## Overview

This sample demonstrates how to use and enable the Subgroups operations feature.


## GLSL Shaders
In shader enable `GL_KHR_shader_subgroup_basic` extension.
TODO: add more description


## Enabling the Feature

To enable the subgroups feature in the Vulkan API you must create a Vulkan instance with a minimum version of version 1.1. Enable the extension `VK_EXT_subgroup_size_control` and get the subgroup properties of a physical device
```C++
VkPhysicalDeviceSubgroupProperties subgroups_properties;
subgroups_properties.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_PROPERTIES;
subgroups_properties.pNext = VK_NULL_HANDLE;

VkPhysicalDeviceProperties2 device_properties2 = {};
device_properties2.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2;
device_properties2.pNext = &subgroups_properties;
vkGetPhysicalDeviceProperties2(gpu.get_handle(), &device_properties2);
```
TODO: add more description

## Additional information

More about subgroups you can read [in this article](https://www.khronos.org/blog/vulkan-subgroup-tutorial).
Documentation: https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VkPhysicalDeviceSubgroupProperties.html
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading