diff --git a/source/blender/draw/engines/eevee_next/eevee_instance.cc b/source/blender/draw/engines/eevee_next/eevee_instance.cc index a8d6db72acd..9e3138f6bc6 100644 --- a/source/blender/draw/engines/eevee_next/eevee_instance.cc +++ b/source/blender/draw/engines/eevee_next/eevee_instance.cc @@ -327,6 +327,7 @@ bool Instance::do_probe_sync() const **/ void Instance::render_sample() { + GPU_debug_capture_begin(); if (sampling.finished_viewport()) { film.display(); return; @@ -345,6 +346,7 @@ void Instance::render_sample() main_view.render(); motion_blur.step(); + GPU_debug_capture_end(); } void Instance::render_read_result(RenderLayer *render_layer, const char *view_name) diff --git a/source/blender/gpu/tests/memory_layout_test.cc b/source/blender/gpu/tests/memory_layout_test.cc index 8e4eda29c99..7b277e8bade 100644 --- a/source/blender/gpu/tests/memory_layout_test.cc +++ b/source/blender/gpu/tests/memory_layout_test.cc @@ -112,4 +112,15 @@ TEST(std140, gpu_shader_2D_widget_base) EXPECT_EQ(offset, 272); } +TEST(std430, overlay_grid) +{ + uint32_t offset = 0; + + def_attr(shader::Type::VEC3, 0, 0, 12, &offset); + def_attr(shader::Type::INT, 0, 12, 16, &offset); + + align_end_of_struct(&offset); + EXPECT_EQ(offset, 16); +} + } // namespace blender::gpu diff --git a/source/blender/gpu/vulkan/vk_debug.cc b/source/blender/gpu/vulkan/vk_debug.cc index b5d0778e434..95cf83951c3 100644 --- a/source/blender/gpu/vulkan/vk_debug.cc +++ b/source/blender/gpu/vulkan/vk_debug.cc @@ -297,6 +297,9 @@ messenger_callback(VkDebugUtilsMessageSeverityFlagBitsEXT message_severity, debugging_tools.print_labels(callback_data); } + BLI_assert(callback_data->messageIdNumber != 0x47172512); + BLI_assert(callback_data->messageIdNumber != 0x2ba3a98e); + return VK_FALSE; }; diff --git a/source/blender/gpu/vulkan/vk_memory_layout.cc b/source/blender/gpu/vulkan/vk_memory_layout.cc index a7e87e2ea7f..ae0310d0a99 100644 --- a/source/blender/gpu/vulkan/vk_memory_layout.cc +++ b/source/blender/gpu/vulkan/vk_memory_layout.cc @@ -60,6 +60,7 @@ uint32_t Std430::element_components_len(const shader::Type type) case shader::Type::VEC3: case shader::Type::UVEC3: case shader::Type::IVEC3: + return 3; case shader::Type::VEC4: case shader::Type::UVEC4: case shader::Type::IVEC4: @@ -76,7 +77,31 @@ uint32_t Std430::element_components_len(const shader::Type type) uint32_t Std430::array_components_len(const shader::Type type) { - return Std430::element_components_len(type); + switch (type) { + case shader::Type::FLOAT: + case shader::Type::UINT: + case shader::Type::INT: + case shader::Type::BOOL: + return 1; + case shader::Type::VEC2: + case shader::Type::UVEC2: + case shader::Type::IVEC2: + return 2; + case shader::Type::VEC3: + case shader::Type::UVEC3: + case shader::Type::IVEC3: + case shader::Type::VEC4: + case shader::Type::UVEC4: + case shader::Type::IVEC4: + return 4; + case shader::Type::MAT3: + return 12; + case shader::Type::MAT4: + return 16; + default: + BLI_assert_msg(false, "Type not supported in dynamic structs."); + } + return 0; } uint32_t Std140::component_mem_size(const shader::Type /*type*/) diff --git a/source/blender/gpu/vulkan/vk_shader.cc b/source/blender/gpu/vulkan/vk_shader.cc index a3f54eb1607..0a6d7d13041 100644 --- a/source/blender/gpu/vulkan/vk_shader.cc +++ b/source/blender/gpu/vulkan/vk_shader.cc @@ -1006,7 +1006,7 @@ std::string VKShader::resources_declare(const shader::ShaderCreateInfo &info) co if (push_constants_storage != VKPushConstants::StorageType::NONE) { ss << "\n/* Push Constants. */\n"; if (push_constants_storage == VKPushConstants::StorageType::PUSH_CONSTANTS) { - ss << "layout(push_constant) uniform constants\n"; + ss << "layout(push_constant, std430) uniform constants\n"; } else if (push_constants_storage == VKPushConstants::StorageType::UNIFORM_BUFFER) { ss << "layout(binding = " << push_constants_layout.descriptor_set_location_get()