Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClément Foucault <foucault.clem@gmail.com>2022-10-01 21:55:00 +0300
committerClément Foucault <foucault.clem@gmail.com>2022-10-01 22:25:21 +0300
commit4847bcdbe10b4f7f84657749a651c3af3a430b1c (patch)
tree6355f26e441708d362d5599635ba30122faee5f2 /source/blender/draw/intern/draw_view.cc
parent520d111eca55941dd0924998927ec1a994895f54 (diff)
DRW: Split ViewProjectionMatrix in order to increase precisiontmp-drw-split-matrix
This also removes the need to compute the persmat and saves some memory from the `ViewInfos` struct. This is needed to allow multiview support. Initial testing found no major performance regression during vertex heavy workload. Differential Revision: https://developer.blender.org/D16125
Diffstat (limited to 'source/blender/draw/intern/draw_view.cc')
-rw-r--r--source/blender/draw/intern/draw_view.cc8
1 files changed, 4 insertions, 4 deletions
diff --git a/source/blender/draw/intern/draw_view.cc b/source/blender/draw/intern/draw_view.cc
index cb0e1370c28..1e739cf0871 100644
--- a/source/blender/draw/intern/draw_view.cc
+++ b/source/blender/draw/intern/draw_view.cc
@@ -21,8 +21,6 @@ void View::sync(const float4x4 &view_mat, const float4x4 &win_mat)
data_.viewinv = view_mat.inverted();
data_.winmat = win_mat;
data_.wininv = win_mat.inverted();
- data_.persmat = data_.winmat * data_.viewmat;
- data_.persinv = data_.persmat.inverted();
/* Should not be used anymore. */
data_.viewcamtexcofac = float4(1.0f, 1.0f, 0.0f, 0.0f);
@@ -83,7 +81,8 @@ void View::frustum_boundbox_calc(BoundBox &bbox)
void View::frustum_culling_planes_calc()
{
- planes_from_projmat(data_.persmat.ptr(),
+ float4x4 persmat = data_.winmat * data_.viewmat;
+ planes_from_projmat(persmat.ptr(),
data_.frustum_planes[0],
data_.frustum_planes[5],
data_.frustum_planes[1],
@@ -298,7 +297,8 @@ void View::compute_visibility(ObjectBoundsBuf &bounds, uint resource_len, bool d
}
#ifdef DEBUG
if (debug_freeze) {
- drw_debug_matrix_as_bbox(data_freeze_.persinv, float4(0, 1, 0, 1));
+ float4x4 persmat = data_freeze_.winmat * data_freeze_.viewmat;
+ drw_debug_matrix_as_bbox(persmat.inverted(), float4(0, 1, 0, 1));
}
#endif
frozen_ = debug_freeze;