1
0
Fork 0

Merge pull request #114227 from BastiaanOlij/fix_asp_regression

Fix OpenGL motion vector regression
This commit is contained in:
Rémi Verschelde 2025-12-21 10:41:40 +01:00
commit eebf4143f1
No known key found for this signature in database
GPG Key ID: C3336907360768E1
2 changed files with 15 additions and 9 deletions

View File

@ -2411,8 +2411,8 @@ void RasterizerSceneGLES3::render_scene(const Ref<RenderSceneBuffers> &p_render_
scene_state.data.emissive_exposure_normalization = -1.0; // Use default exposure normalization.
bool enough_vertex_attribs_for_motion_blue = GLES3::Config::get_singleton()->max_vertex_attribs >= 22;
if (rt && rt->overridden.velocity_fbo != 0 && enough_vertex_attribs_for_motion_blue) {
bool enough_vertex_attribs_for_motion_vectors = GLES3::Config::get_singleton()->max_vertex_attribs >= 22;
if (rt && rt->overridden.velocity_fbo != 0 && enough_vertex_attribs_for_motion_vectors) {
// First frame we render motion vectors? Use our current data!
if (scene_state.prev_data_state == 0) {
scene_state.prev_data_state = 1;
@ -2534,7 +2534,7 @@ void RasterizerSceneGLES3::render_scene(const Ref<RenderSceneBuffers> &p_render_
scene_state.reset_gl_state();
GLuint motion_vectors_fbo = rt ? rt->overridden.velocity_fbo : 0;
if (motion_vectors_fbo != 0 && enough_vertex_attribs_for_motion_blue) {
if (motion_vectors_fbo != 0 && enough_vertex_attribs_for_motion_vectors) {
RENDER_TIMESTAMP("Motion Vectors Pass");
glBindFramebuffer(GL_FRAMEBUFFER, motion_vectors_fbo);

View File

@ -231,7 +231,10 @@ layout(std140) uniform SceneDataBlock { // ubo:2
scene_data_block;
#ifdef RENDER_MOTION_VECTORS
layout(std140) uniform SceneData prev_scene_data; // ubo:12
layout(std140) uniform PrevSceneDataBlock { // ubo:12
SceneData data;
}
prev_scene_data_block;
#endif
#ifndef RENDER_MOTION_VECTORS
@ -464,7 +467,10 @@ layout(std140) uniform MultiviewDataBlock { // ubo:8
multiview_data_block;
#ifdef RENDER_MOTION_VECTORS
layout(std140) uniform MultiviewData prev_multiview_data; // ubo:13
layout(std140) uniform PrevMultiviewDataBlock { // ubo:13
MultiviewData data;
}
prev_multiview_data_block;
#endif // RENDER_MOTION_VECTORS
#endif // USE_MULTIVIEW
@ -909,7 +915,7 @@ void main() {
compressed_aabb_position,
prev_world_transform,
model_flags,
prev_scene_data.data,
prev_scene_data_block.data,
#ifdef USE_INSTANCING
input_instance_xform0, input_instance_xform1, input_instance_xform2,
input_instance_color_custom_data,
@ -927,9 +933,9 @@ void main() {
uv2_attrib,
#endif
#ifdef USE_MULTIVIEW
prev_multiview_data.projection_matrix_view[ViewIndex],
prev_multiview_data.inv_projection_matrix_view[ViewIndex],
prev_multiview_data.eye_offset[ViewIndex].xyz,
prev_multiview_data_block.data.projection_matrix_view[ViewIndex],
prev_multiview_data_block.data.inv_projection_matrix_view[ViewIndex],
prev_multiview_data_block.data.eye_offset[ViewIndex].xyz,
#endif
uv_scale,
prev_clip_position);