rt: reviewer's fixes

This commit is contained in:
LifeKILLED 2023-01-30 05:15:41 +04:00
parent c4881f57c9
commit 2627cb97af
3 changed files with 9 additions and 8 deletions

View File

@ -751,7 +751,7 @@ static struct {
vk_render_geometry_t geometries[MAX_DYNAMIC_GEOMETRY];
} g_dynamic_model = {0};
matrix4x4 *VK_RenderGetLastFrameTransform() {
matrix4x4 *VK_RenderGetLastFrameTransform( void ) {
return &g_dynamic_model.model.prev_transform;
}

View File

@ -104,4 +104,4 @@ void VK_RenderEndRTX( VkCommandBuffer cmdbuf, VkImageView img_dst_view, VkImage
void VK_Render_FIXME_Barrier( VkCommandBuffer cmdbuf );
matrix4x4* VK_RenderGetLastFrameTransform();
matrix4x4* VK_RenderGetLastFrameTransform( void );

View File

@ -81,6 +81,8 @@ static struct {
qboolean reload_pipeline;
qboolean reload_lighting;
matrix4x4 prev_inv_proj, prev_inv_view;
} g_rtx = {0};
static int findResource(const char *name) {
@ -156,12 +158,11 @@ static void prepareUniformBuffer( const vk_ray_frame_render_args_t *args, int fr
Matrix4x4_Invert_Full(view_inv, *args->view);
Matrix4x4_ToArrayFloatGL(view_inv, (float*)ubo->inv_view);
// last frame matrices
static matrix4x4 prev_inv_proj, prev_inv_view;
Matrix4x4_ToArrayFloatGL(prev_inv_proj, (float*)ubo->prev_inv_proj);
Matrix4x4_ToArrayFloatGL(prev_inv_view, (float*)ubo->prev_inv_view);
Matrix4x4_Copy(prev_inv_view, view_inv);
Matrix4x4_Copy(prev_inv_proj, proj_inv);
// previous frame matrices
Matrix4x4_ToArrayFloatGL(g_rtx.prev_inv_proj, (float*)ubo->prev_inv_proj);
Matrix4x4_ToArrayFloatGL(g_rtx.prev_inv_view, (float*)ubo->prev_inv_view);
Matrix4x4_Copy(g_rtx.prev_inv_view, view_inv);
Matrix4x4_Copy(g_rtx.prev_inv_proj, proj_inv);
ubo->ray_cone_width = atanf((2.0f*tanf(DEG2RAD(fov_angle_y) * 0.5f)) / (float)FRAME_HEIGHT);
ubo->random_seed = (uint32_t)gEngine.COM_RandomLong(0, INT32_MAX);