Remove unused struct fields in VoxelGIData

This reduces the struct size from 112 bytes to 96 bytes.
This commit is contained in:
Hugo Locurcio 2021-11-28 23:09:30 +01:00
parent 69a194f051
commit 36106dba3b
No known key found for this signature in database
GPG Key ID: 39E8F8BE30B0A49C
4 changed files with 28 additions and 44 deletions

View File

@ -602,19 +602,15 @@ public:
}; };
struct VoxelGIData { struct VoxelGIData {
float xform[16]; float xform[16]; // 64 - 64
float bounds[3];
float dynamic_range;
float bias; float bounds[3]; // 12 - 76
float normal_bias; float dynamic_range; // 4 - 80
uint32_t blend_ambient;
uint32_t texture_slot;
uint32_t pad0; float bias; // 4 - 84
uint32_t pad1; float normal_bias; // 4 - 88
uint32_t pad2; uint32_t blend_ambient; // 4 - 92
uint32_t mipmaps; uint32_t mipmaps; // 4 - 96
}; };
struct PushConstant { struct PushConstant {

View File

@ -68,19 +68,15 @@ sdfgi;
#define MAX_VOXEL_GI_INSTANCES 8 #define MAX_VOXEL_GI_INSTANCES 8
struct VoxelGIData { struct VoxelGIData {
mat4 xform; mat4 xform; // 64 - 64
vec3 bounds;
float dynamic_range;
float bias; vec3 bounds; // 12 - 76
float normal_bias; float dynamic_range; // 4 - 80
bool blend_ambient;
uint texture_slot;
uint pad0; float bias; // 4 - 84
uint pad1; float normal_bias; // 4 - 88
uint pad2; bool blend_ambient; // 4 - 92
uint mipmaps; uint mipmaps; // 4 - 96
}; };
layout(set = 0, binding = 16, std140) uniform VoxelGIs { layout(set = 0, binding = 16, std140) uniform VoxelGIs {

View File

@ -305,19 +305,15 @@ layout(set = 1, binding = 15) uniform texture2DArray sdfgi_lightprobe_texture;
layout(set = 1, binding = 16) uniform texture3D sdfgi_occlusion_cascades; layout(set = 1, binding = 16) uniform texture3D sdfgi_occlusion_cascades;
struct VoxelGIData { struct VoxelGIData {
mat4 xform; mat4 xform; // 64 - 64
vec3 bounds;
float dynamic_range;
float bias; vec3 bounds; // 12 - 76
float normal_bias; float dynamic_range; // 4 - 80
bool blend_ambient;
uint texture_slot;
float anisotropy_strength; float bias; // 4 - 84
float ambient_occlusion; float normal_bias; // 4 - 88
float ambient_occlusion_size; bool blend_ambient; // 4 - 92
uint mipmaps; uint mipmaps; // 4 - 96
}; };
layout(set = 1, binding = 17, std140) uniform VoxelGIs { layout(set = 1, binding = 17, std140) uniform VoxelGIs {

View File

@ -76,19 +76,15 @@ layout(set = 0, binding = 10) uniform sampler shadow_sampler;
#define MAX_VOXEL_GI_INSTANCES 8 #define MAX_VOXEL_GI_INSTANCES 8
struct VoxelGIData { struct VoxelGIData {
mat4 xform; mat4 xform; // 64 - 64
vec3 bounds;
float dynamic_range;
float bias; vec3 bounds; // 12 - 76
float normal_bias; float dynamic_range; // 4 - 80
bool blend_ambient;
uint texture_slot;
float anisotropy_strength; float bias; // 4 - 84
float ambient_occlusion; float normal_bias; // 4 - 88
float ambient_occlusion_size; bool blend_ambient; // 4 - 92
uint mipmaps; uint mipmaps; // 4 - 96
}; };
layout(set = 0, binding = 11, std140) uniform VoxelGIs { layout(set = 0, binding = 11, std140) uniform VoxelGIs {