Skip to content

Commit

Permalink
Actually enable the robustness2 ext.
Browse files Browse the repository at this point in the history
  • Loading branch information
Themaister committed Feb 20, 2025
1 parent 83f380f commit 8732378
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
9 changes: 5 additions & 4 deletions tests/assets/shaders/robustness2.comp
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
#version 450
#extension GL_EXT_scalar_block_layout : require

layout(local_size_x = 1) in;

layout(set = 0, binding = 0) readonly buffer Buf0
layout(set = 0, binding = 0, scalar) readonly buffer Buf0
{
layout(offset = 16) mat2x4 m;
layout(offset = 16) vec4 m;
};

layout(set = 0, binding = 1) writeonly buffer Output
Expand All @@ -14,6 +15,6 @@ layout(set = 0, binding = 1) writeonly buffer Output

void main()
{
mat2x4 loaded = m;
data = loaded;
vec4 loaded = m;
data = mat2x4(loaded, loaded);
}
2 changes: 1 addition & 1 deletion tests/robustness2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ static int main_inner()
buf.size = sizeof(vec4) * 2;
auto output_ssbo = dev.create_buffer(buf);

cmd->set_storage_buffer(0, 0, *input_ssbo, 0, 28);
cmd->set_storage_buffer(0, 0, *input_ssbo, 0, 32);
cmd->set_storage_buffer(0, 1, *output_ssbo);
cmd->dispatch(1, 1, 1);
cmd->barrier(VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT, VK_ACCESS_2_SHADER_STORAGE_WRITE_BIT,
Expand Down
3 changes: 3 additions & 0 deletions vulkan/context.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1482,7 +1482,10 @@ bool Context::create_device(VkPhysicalDevice gpu_, VkSurfaceKHR surface,
}

if ((flags & CONTEXT_CREATION_ENABLE_ROBUSTNESS_2_BIT) != 0 && has_extension(VK_EXT_ROBUSTNESS_2_EXTENSION_NAME))
{
enabled_extensions.push_back(VK_EXT_ROBUSTNESS_2_EXTENSION_NAME);
ADD_CHAIN(ext.robustness2_features, ROBUSTNESS_2_FEATURES_EXT);
}

if ((flags & CONTEXT_CREATION_ENABLE_ADVANCED_WSI_BIT) != 0 && requires_swapchain)
{
Expand Down

0 comments on commit 8732378

Please sign in to comment.