Fix: GPU Incorrect Padding For Globals

A float array use different alignment and reservation rules on
GPU versus CPU. Before this change the _pad1 was aligned to 16 bytes as
it was defined as an array, but on CPU this alignment doesn't
happen.

This is fixed by using 3 floats in stead of a float array for padding.

Pull Request: https://projects.blender.org/blender/blender/pulls/112565
This commit is contained in:
Jeroen Bakker 2023-09-19 12:10:31 +02:00
parent 2d70f46265
commit 39e6776689
1 changed files with 1 additions and 1 deletions

View File

@ -135,7 +135,7 @@ struct GlobalsUboStorage {
float size_checker;
float size_vertex_gpencil;
float fresnel_mix_edit;
float _pad[3];
float _pad1, _pad2, _pad3;
};
BLI_STATIC_ASSERT_ALIGN(GlobalsUboStorage, 16)