1
0
Fork 0

Add structure padding where necessary for push constants.

Co-authored-by: Skyth <19259897+blueskythlikesclouds@users.noreply.github.com>
This commit is contained in:
Dario 2025-12-16 15:50:58 -03:00 committed by Rémi Verschelde
parent 805c9d4b18
commit 703b3f3dc2
No known key found for this signature in database
GPG Key ID: C3336907360768E1
14 changed files with 27 additions and 9 deletions

View File

@ -1249,7 +1249,6 @@ void CopyEffects::octmap_filter(RID p_source_octmap, const Vector<RID> &p_dest_o
OctmapFilterPushConstant push_constant;
push_constant.border_size[0] = p_border_size;
push_constant.border_size[1] = 1.0f - p_border_size * 2.0f;
push_constant.size = 320;
Vector<RD::Uniform> uniforms;
for (int i = 0; i < p_dest_octmap.size(); i++) {

View File

@ -237,7 +237,7 @@ private:
struct CopyToOctmapPushConstant {
float border_size;
float pad[3];
uint32_t pad[3];
};
struct CopyToOctmap {
@ -282,8 +282,8 @@ private:
struct OctmapFilterPushConstant {
float border_size[2];
uint32_t size;
uint32_t pad;
uint32_t pad1;
uint32_t pad2;
};
struct OctmapFilterRasterPushConstant {

View File

@ -71,7 +71,7 @@ private:
float reprojection_matrix[16];
float resolution[2];
uint32_t force_derive_from_depth;
float pad;
uint32_t pad;
};
struct {

View File

@ -65,7 +65,7 @@ private:
float upscaled_height;
float sharpness;
int pass;
int _unused0, _unused1;
int pad[2];
};
FsrUpscaleShaderRD fsr_shader;

View File

@ -27,6 +27,9 @@ layout(set = 0, binding = 0) uniform samplerCube source_cube;
layout(push_constant, std430) uniform Params {
float border_size;
uint pad1;
uint pad2;
uint pad3;
}
params;

View File

@ -60,6 +60,8 @@ layout(push_constant, std430) uniform Params {
float upscaled_height;
float sharpness;
int pass;
int pad1;
int pad2;
}
params;

View File

@ -30,7 +30,8 @@ layout(location = 0) out vec4 frag_color;
layout(push_constant, std430) uniform Params {
highp mat4 reprojection_matrix;
vec2 resolution;
bool force_derive_from_depth;
uint force_derive_from_depth;
uint pad;
}
params;
@ -55,7 +56,7 @@ void main() {
vec2 cell_pos_pixel = floor(pos_pixel / cell_size) * cell_size + (cell_size * 0.5f);
vec2 cell_pos_uv = cell_pos_pixel / params.resolution;
vec2 cell_pos_velocity = textureLod(source_velocity, cell_pos_uv, 0.0f).xy;
bool derive_velocity = params.force_derive_from_depth || all(lessThanEqual(cell_pos_velocity, vec2(-1.0f, -1.0f)));
bool derive_velocity = bool(params.force_derive_from_depth) || all(lessThanEqual(cell_pos_velocity, vec2(-1.0f, -1.0f)));
if (derive_velocity) {
float depth = textureLod(source_depth, cell_pos_uv, 0.0f).x;
cell_pos_velocity = derive_motion_vector(cell_pos_uv, depth, params.reprojection_matrix);

View File

@ -37,7 +37,7 @@ layout(OCTMAP_FORMAT, set = 1, binding = 0) uniform restrict writeonly image2D d
layout(push_constant, std430) uniform Params {
float border_size;
uint size;
uint pad;
uint pad1;
uint pad2;
}
params;

View File

@ -28,7 +28,10 @@
#include "../oct_inc.glsl"
layout(push_constant, std430) uniform Params {
float border_size;
uint size;
uint pad1;
uint pad2;
}
params;
@ -64,7 +67,10 @@ void main() {
#include "../oct_inc.glsl"
layout(push_constant, std430) uniform Params {
float border_size;
uint size;
uint pad1;
uint pad2;
}
params;

View File

@ -29,6 +29,9 @@ layout(push_constant, std430) uniform Params {
float depth_tolerance;
bool orthogonal;
int view_index;
int pad1;
int pad2;
int pad3;
}
params;

View File

@ -13,6 +13,7 @@ layout(rgba8, set = 0, binding = 3) uniform restrict writeonly image2D dest_norm
layout(push_constant, std430) uniform Params {
ivec2 screen_size;
ivec2 pad;
}
params;

View File

@ -12,6 +12,7 @@ layout(set = 0, binding = 1) uniform restrict writeonly image2D dest;
layout(push_constant, std430) uniform Params {
ivec2 screen_size;
uint mip_level;
int pad;
}
params;

View File

@ -11,6 +11,7 @@ layout(r32f, set = 0, binding = 1) uniform restrict writeonly image2D dest;
layout(push_constant, std430) uniform Params {
ivec2 screen_size;
ivec2 pad;
}
params;

View File

@ -16,6 +16,7 @@ layout(rgba16f, set = 0, binding = 6) uniform restrict writeonly image2D output_
layout(push_constant, std430) uniform Params {
ivec2 screen_size;
ivec2 pad;
}
params;