diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2022-02-06 03:16:32 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2022-02-06 03:16:32 +0300 |
commit | a3f79499b280e84d7d08d107ff95032a4620ce41 (patch) | |
tree | 4c0c15351e353015198e7b68eb253eba69961234 | |
parent | 26f413d1f8034ec9c43bcbfbd287972826eba7c4 (diff) |
EEVEE: Fix float4x4 usage
8 files changed, 13 insertions, 15 deletions
diff --git a/source/blender/draw/engines/eevee/eevee_camera.cc b/source/blender/draw/engines/eevee/eevee_camera.cc index b7555fb7cb0..c6fb4068730 100644 --- a/source/blender/draw/engines/eevee/eevee_camera.cc +++ b/source/blender/draw/engines/eevee/eevee_camera.cc @@ -120,8 +120,8 @@ void Camera::sync(void) data.uv_bias = float2(0.0f); } else { - data.viewmat.identity(); - data.viewinv.identity(); + data.viewmat = float4x4::identity(); + data.viewinv = float4x4::identity(); perspective_m4(data.winmat.ptr(), -0.1f, 0.1f, -0.1f, 0.1f, 0.1f, 1.0f); data.wininv = data.winmat.inverted(); data.persmat = data.winmat * data.viewmat; diff --git a/source/blender/draw/engines/eevee/eevee_depth_of_field.cc b/source/blender/draw/engines/eevee/eevee_depth_of_field.cc index 6940eb705ce..6f100aaa2a9 100644 --- a/source/blender/draw/engines/eevee/eevee_depth_of_field.cc +++ b/source/blender/draw/engines/eevee/eevee_depth_of_field.cc @@ -69,7 +69,7 @@ void DepthOfField::init(void) jitter_radius_ = 0.0f; } -void DepthOfField::sync(const float4x4 winmat, int2 input_extent) +void DepthOfField::sync(const float4x4 &winmat, int2 input_extent) { const Object *camera_object_eval = inst_.camera_eval_object; const ::Camera *cam = (camera_object_eval) ? @@ -169,7 +169,7 @@ void DepthOfField::sync(const float4x4 winmat, int2 input_extent) } } -void DepthOfField::jitter_apply(float4x4 winmat, float4x4 viewmat) +void DepthOfField::jitter_apply(float4x4 &winmat, float4x4 &viewmat) { if (jitter_radius_ == 0.0f) { return; diff --git a/source/blender/draw/engines/eevee/eevee_depth_of_field.hh b/source/blender/draw/engines/eevee/eevee_depth_of_field.hh index afcbec981b4..81e796a1fbf 100644 --- a/source/blender/draw/engines/eevee/eevee_depth_of_field.hh +++ b/source/blender/draw/engines/eevee/eevee_depth_of_field.hh @@ -141,10 +141,10 @@ class DepthOfField { void init(); - void sync(const float4x4 winmat, int2 input_extent); + void sync(const float4x4 &winmat, int2 input_extent); /** Apply Depth Of Field jittering to the view and projection matrices.. */ - void jitter_apply(float4x4 winmat, float4x4 viewmat); + void jitter_apply(float4x4 &winmat, float4x4 &viewmat); /** Will swap input and output texture if rendering happens. The actual output of this function * is in intput_tx. */ diff --git a/source/blender/draw/engines/eevee/eevee_lightprobe.cc b/source/blender/draw/engines/eevee/eevee_lightprobe.cc index 3c985ccccd4..4426fcaa4ad 100644 --- a/source/blender/draw/engines/eevee/eevee_lightprobe.cc +++ b/source/blender/draw/engines/eevee/eevee_lightprobe.cc @@ -199,8 +199,7 @@ void LightProbeModule::cubemap_prepare(float3 position, int cube_res = sce_eevee.gi_cubemap_resolution; int cube_mip_count = (int)log2_ceil_u(cube_res); - float4x4 viewmat; - viewmat.identity(); + float4x4 viewmat = float4x4::identity(); negate_v3_v3(viewmat[3], position); /* TODO(fclem) We might want to have theses as temporary textures. */ diff --git a/source/blender/draw/engines/eevee/eevee_lookdev.cc b/source/blender/draw/engines/eevee/eevee_lookdev.cc index d2daa527ca9..23cf433d77a 100644 --- a/source/blender/draw/engines/eevee/eevee_lookdev.cc +++ b/source/blender/draw/engines/eevee/eevee_lookdev.cc @@ -214,10 +214,10 @@ bool LookDev::sync_world(void) return true; } -void LookDev::rotation_get(float4x4 r_mat) +void LookDev::rotation_get(float4x4 &r_mat) { if (studiolight_ == nullptr) { - r_mat.identity(); + r_mat = float4x4::identity(); } else { axis_angle_to_mat4_single(r_mat.ptr(), 'Z', rotation_); diff --git a/source/blender/draw/engines/eevee/eevee_lookdev.hh b/source/blender/draw/engines/eevee/eevee_lookdev.hh index ff97e646585..5956784400f 100644 --- a/source/blender/draw/engines/eevee/eevee_lookdev.hh +++ b/source/blender/draw/engines/eevee/eevee_lookdev.hh @@ -101,7 +101,7 @@ class LookDev { bool render_background(void); void render_overlay(GPUFrameBuffer *view_fb); - void rotation_get(float4x4 r_mat); + void rotation_get(float4x4 &r_mat); private: bool do_overlay(const int2 &output_res, const rcti *render_border); diff --git a/source/blender/draw/engines/eevee/eevee_shading.cc b/source/blender/draw/engines/eevee/eevee_shading.cc index 6506b168413..6ea9ff52f6b 100644 --- a/source/blender/draw/engines/eevee/eevee_shading.cc +++ b/source/blender/draw/engines/eevee/eevee_shading.cc @@ -41,8 +41,7 @@ void BackgroundPass::sync(GPUMaterial *gpumat, GPUTexture *lookdev_tx) background_ps_ = DRW_pass_create("Background", state); /* Push a matrix at the same location as the camera. */ - float4x4 camera_mat; - camera_mat.identity(); + float4x4 camera_mat = float4x4::identity(); copy_v3_v3(camera_mat[3], inst_.camera.data_get().viewinv[3]); DRWShadingGroup *grp = DRW_shgroup_material_create(gpumat, background_ps_); diff --git a/source/blender/draw/engines/eevee/eevee_view.hh b/source/blender/draw/engines/eevee/eevee_view.hh index 0f46f03f1f4..3c87f94fdf3 100644 --- a/source/blender/draw/engines/eevee/eevee_view.hh +++ b/source/blender/draw/engines/eevee/eevee_view.hh @@ -170,8 +170,8 @@ class LightProbeView { void sync(Texture &color_tx, Texture &depth_tx, - const float4x4 winmat, - const float4x4 viewmat, + const float4x4 &winmat, + const float4x4 &viewmat, bool is_only_background); void render(void); |