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

Add new sample for shader debugprintf #945

Merged
merged 25 commits into from
Mar 25, 2024
Merged
Changes from 1 commit
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
c41713d
Added new shader debzgprrintf sample
SaschaWillems Feb 21, 2024
d6cce0f
Note on descriptor size
SaschaWillems Feb 22, 2024
a38a5a4
Display shaderdebutprintf output in UI
SaschaWillems Feb 22, 2024
a6d10d2
Proper extension structure chaining
SaschaWillems Feb 22, 2024
2a8fa5e
Restructure code
SaschaWillems Feb 22, 2024
4029d53
Minor adjustments
SaschaWillems Feb 23, 2024
75239af
Use VK 1.1, clean up messages for UI display
SaschaWillems Feb 25, 2024
a012609
Enable instance extensions
SaschaWillems Feb 29, 2024
136e1ce
Merge branch 'main' into shader_printf
SaschaWillems Feb 29, 2024
b9730ff
Started working on documentation/tutorial
SaschaWillems Feb 29, 2024
439cdb3
Fixed link
SaschaWillems Feb 29, 2024
24c7cd5
Merge branch 'main' into shader_printf
SaschaWillems Mar 6, 2024
2f13dbd
Minor reordering
SaschaWillems Mar 6, 2024
1bb0137
Tutorial fpr shader printf
SaschaWillems Mar 6, 2024
42fc8b1
Update tutorial
SaschaWillems Mar 7, 2024
0e20fa1
Code adjustments based on review
SaschaWillems Mar 7, 2024
2948b1d
Clang-format...
SaschaWillems Mar 7, 2024
bb2db05
Merge branch 'main' into shader_printf
SaschaWillems Mar 11, 2024
481c3bf
Merge branch 'main' into shader_printf
SaschaWillems Mar 15, 2024
4ed5efc
Add new argument to custom instance creation so that extensions enabl…
SaschaWillems Mar 15, 2024
49103cd
Add function to check if sample has a valid instance
SaschaWillems Mar 15, 2024
47f2b36
Adjust to recent framework changes
SaschaWillems Mar 15, 2024
29c93cc
Doc fix
SaschaWillems Mar 15, 2024
3bd4c20
Typo
SaschaWillems Mar 15, 2024
2aa7960
Add sample to cmake ordered list
SaschaWillems Mar 15, 2024
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
16 changes: 7 additions & 9 deletions samples/extensions/shader_debugprintf/shader_debugprintf.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -414,20 +414,18 @@ void ShaderDebugPrintf::create_instance()
enabled_extensions.push_back(VK_EXT_DEBUG_UTILS_EXTENSION_NAME);
enabled_extensions.push_back(VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_EXTENSION_NAME);

std::vector<VkValidationFeatureEnableEXT> validation_feature_enables = {VK_VALIDATION_FEATURE_ENABLE_DEBUG_PRINTF_EXT};
std::vector<VkValidationFeatureDisableEXT> disables{};

VkValidationFeaturesEXT validation_features{VK_STRUCTURE_TYPE_VALIDATION_FEATURES_EXT};
validation_features.enabledValidationFeatureCount = 1;
validation_features.pEnabledValidationFeatures = validation_feature_enables.data();
validation_features.pDisabledValidationFeatures = 0;
validation_features.pDisabledValidationFeatures = disables.data();

VkApplicationInfo app_info{VK_STRUCTURE_TYPE_APPLICATION_INFO};
app_info.pApplicationName = "Shader debugprintf";
app_info.pEngineName = "Vulkan Samples";
app_info.apiVersion = VK_API_VERSION_1_1;

// Shader printf is a feature of the validation layers that needs to be enabled
std::vector<VkValidationFeatureEnableEXT> validation_feature_enables = {VK_VALIDATION_FEATURE_ENABLE_DEBUG_PRINTF_EXT};

VkValidationFeaturesEXT validation_features{VK_STRUCTURE_TYPE_VALIDATION_FEATURES_EXT};
validation_features.enabledValidationFeatureCount = 1;
SaschaWillems marked this conversation as resolved.
Show resolved Hide resolved
validation_features.pEnabledValidationFeatures = validation_feature_enables.data();

std::vector<const char *> validation_layers = {"VK_LAYER_KHRONOS_validation"};

VkInstanceCreateInfo instance_create_info{VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO};
Expand Down