Skip to content

Commit 76fcfa6

Browse files
committed
Fix code formatting and alignment in compute shader derivatives sample
Aligns variable declarations, adjusts whitespace, and removes trailing spaces to improve code readability and maintain consistent formatting throughout the sample.
1 parent 448582e commit 76fcfa6

1 file changed

Lines changed: 13 additions & 13 deletions

File tree

samples/extensions/compute_shader_derivatives/compute_shader_derivatives.cpp

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -248,10 +248,10 @@ void ComputeShaderDerivatives::create_compute_pipeline()
248248
vkUpdateDescriptorSets(device, 1, &write, 0, nullptr);
249249

250250
// Load compute shader based on selected derivative group mode
251-
const char *comp_path = use_quads_ ?
252-
"compute_shader_derivatives/slang/derivatives_quad.comp.spv" :
253-
"compute_shader_derivatives/slang/derivatives_linear.comp.spv";
254-
VkPipelineShaderStageCreateInfo stage = load_shader(comp_path, VK_SHADER_STAGE_COMPUTE_BIT);
251+
const char *comp_path = use_quads_ ?
252+
"compute_shader_derivatives/slang/derivatives_quad.comp.spv" :
253+
"compute_shader_derivatives/slang/derivatives_linear.comp.spv";
254+
VkPipelineShaderStageCreateInfo stage = load_shader(comp_path, VK_SHADER_STAGE_COMPUTE_BIT);
255255

256256
VkComputePipelineCreateInfo compute_ci{VK_STRUCTURE_TYPE_COMPUTE_PIPELINE_CREATE_INFO};
257257
compute_ci.stage = stage;
@@ -381,15 +381,15 @@ void ComputeShaderDerivatives::create_graphics_pipeline()
381381

382382
bool ComputeShaderDerivatives::prepare(const vkb::ApplicationOptions &options)
383383
{
384-
if (!ApiVulkanSample::prepare(options))
385-
{
386-
return false;
387-
}
384+
if (!ApiVulkanSample::prepare(options))
385+
{
386+
return false;
387+
}
388388

389389
// Decide which derivative group to use at runtime based on enabled device features.
390390
// Prefer Quads when available; otherwise, fall back to Linear.
391391
VkPhysicalDeviceComputeShaderDerivativesFeaturesKHR csd_features{VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COMPUTE_SHADER_DERIVATIVES_FEATURES_KHR};
392-
VkPhysicalDeviceFeatures2 features2{VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2};
392+
VkPhysicalDeviceFeatures2 features2{VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2};
393393
features2.pNext = &csd_features;
394394
vkGetPhysicalDeviceFeatures2(get_device().get_gpu().get_handle(), &features2);
395395
use_quads_ = (csd_features.computeDerivativeGroupQuads == VK_TRUE);
@@ -400,10 +400,10 @@ bool ComputeShaderDerivatives::prepare(const vkb::ApplicationOptions &options)
400400
return false;
401401
}
402402

403-
// Create resources in order: image, buffer, then pipelines
404-
create_storage_image();
405-
create_output_buffer_and_descriptors();
406-
create_compute_pipeline();
403+
// Create resources in order: image, buffer, then pipelines
404+
create_storage_image();
405+
create_output_buffer_and_descriptors();
406+
create_compute_pipeline();
407407
create_graphics_pipeline();
408408

409409
prepared = true;

0 commit comments

Comments
 (0)