diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2022-05-05 12:59:34 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2022-05-05 12:59:34 +0300 |
commit | a85df96b4f320e2af2b7615be5b0083233ad3ed1 (patch) | |
tree | fac90f5711d334eb81f437c12ffd98f1e6a03653 /source/blender/draw | |
parent | 9ebf8a0c35a5f59133fcf883f0c818354ed0dd5e (diff) | |
parent | 94533ca4b8b880ff6d2e3db1a238add2b0ee31e0 (diff) |
Merge branch 'blender-v3.2-release'
Diffstat (limited to 'source/blender/draw')
21 files changed, 52 insertions, 42 deletions
diff --git a/source/blender/draw/engines/eevee_next/eevee_instance.cc b/source/blender/draw/engines/eevee_next/eevee_instance.cc index b369e536454..8fef1cf7fc5 100644 --- a/source/blender/draw/engines/eevee_next/eevee_instance.cc +++ b/source/blender/draw/engines/eevee_next/eevee_instance.cc @@ -54,7 +54,7 @@ void Instance::init(const int2 &output_res, main_view.init(output_res); } -void Instance::update_eval_members(void) +void Instance::update_eval_members() { scene = DEG_get_evaluated_scene(depsgraph); view_layer = DEG_get_evaluated_view_layer(depsgraph); @@ -133,11 +133,11 @@ void Instance::object_sync(Object *ob) ob_handle.reset_recalc_flag(); } -void Instance::end_sync(void) +void Instance::end_sync() { } -void Instance::render_sync(void) +void Instance::render_sync() { } @@ -151,7 +151,7 @@ void Instance::render_sync(void) * Conceptually renders one sample per pixel. * Everything based on random sampling should be done here (i.e: DRWViews jitter) **/ -void Instance::render_sample(void) +void Instance::render_sample() { main_view.render(); } diff --git a/source/blender/draw/engines/eevee_next/eevee_instance.hh b/source/blender/draw/engines/eevee_next/eevee_instance.hh index 0f085b0952a..c3cf08c8390 100644 --- a/source/blender/draw/engines/eevee_next/eevee_instance.hh +++ b/source/blender/draw/engines/eevee_next/eevee_instance.hh @@ -74,21 +74,21 @@ class Instance { const View3D *v3d = nullptr, const RegionView3D *rv3d = nullptr); - void begin_sync(void); + void begin_sync(); void object_sync(Object *ob); - void end_sync(void); + void end_sync(); - void render_sync(void); + void render_sync(); void render_frame(RenderLayer *render_layer, const char *view_name); void draw_viewport(DefaultFramebufferList *dfbl); private: - void render_sample(void); + void render_sample(); void mesh_sync(Object *ob, ObjectHandle &ob_handle); - void update_eval_members(void); + void update_eval_members(); }; } // namespace blender::eevee diff --git a/source/blender/draw/engines/eevee_next/eevee_material.cc b/source/blender/draw/engines/eevee_next/eevee_material.cc index f3132185683..7452e5c26a4 100644 --- a/source/blender/draw/engines/eevee_next/eevee_material.cc +++ b/source/blender/draw/engines/eevee_next/eevee_material.cc @@ -154,7 +154,7 @@ MaterialModule::~MaterialModule() BKE_id_free(nullptr, error_mat_); } -void MaterialModule::begin_sync(void) +void MaterialModule::begin_sync() { queued_shaders_count_ = 0; diff --git a/source/blender/draw/engines/eevee_next/eevee_material.hh b/source/blender/draw/engines/eevee_next/eevee_material.hh index 5c8188c7cf0..af9ff6bf6ba 100644 --- a/source/blender/draw/engines/eevee_next/eevee_material.hh +++ b/source/blender/draw/engines/eevee_next/eevee_material.hh @@ -115,7 +115,7 @@ struct MaterialKey { options = shader_uuid_from_material_type(surface_pipeline, geometry); } - uint64_t hash(void) const + uint64_t hash() const { BLI_assert(options < sizeof(*mat)); return (uint64_t)mat + options; @@ -150,7 +150,7 @@ struct ShaderKey { options = (options << 16u) | shader_closure_bits_from_flag(gpumat); } - uint64_t hash(void) const + uint64_t hash() const { return (uint64_t)shader + options; } @@ -238,7 +238,7 @@ class MaterialModule { MaterialModule(Instance &inst); ~MaterialModule(); - void begin_sync(void); + void begin_sync(); MaterialArray &material_array_get(Object *ob); Material &material_get(Object *ob, int mat_nr, eMaterialGeometry geometry_type); diff --git a/source/blender/draw/engines/eevee_next/eevee_pipeline.cc b/source/blender/draw/engines/eevee_next/eevee_pipeline.cc index 96415f6ae0f..e31372e770d 100644 --- a/source/blender/draw/engines/eevee_next/eevee_pipeline.cc +++ b/source/blender/draw/engines/eevee_next/eevee_pipeline.cc @@ -36,7 +36,7 @@ void WorldPipeline::sync(GPUMaterial *gpumat) DRW_shgroup_call_obmat(grp, DRW_cache_fullscreen_quad_get(), camera_mat.ptr()); } -void WorldPipeline::render(void) +void WorldPipeline::render() { DRW_draw_pass(world_ps_); } @@ -49,7 +49,7 @@ void WorldPipeline::render(void) * NPR materials (using Closure to RGBA) or material using ALPHA_BLEND. * \{ */ -void ForwardPipeline::sync(void) +void ForwardPipeline::sync() { { DRWState state = DRW_STATE_WRITE_DEPTH | DRW_STATE_DEPTH_LESS; diff --git a/source/blender/draw/engines/eevee_next/eevee_pipeline.hh b/source/blender/draw/engines/eevee_next/eevee_pipeline.hh index 14eac812e55..a5a6847f62e 100644 --- a/source/blender/draw/engines/eevee_next/eevee_pipeline.hh +++ b/source/blender/draw/engines/eevee_next/eevee_pipeline.hh @@ -37,7 +37,7 @@ class WorldPipeline { WorldPipeline(Instance &inst) : inst_(inst){}; void sync(GPUMaterial *gpumat); - void render(void); + void render(); }; /** \} */ @@ -63,7 +63,7 @@ class ForwardPipeline { public: ForwardPipeline(Instance &inst) : inst_(inst){}; - void sync(void); + void sync(); DRWShadingGroup *material_add(::Material *blender_mat, GPUMaterial *gpumat) { diff --git a/source/blender/draw/engines/eevee_next/eevee_sync.hh b/source/blender/draw/engines/eevee_next/eevee_sync.hh index 3f58ca14778..34357193d3e 100644 --- a/source/blender/draw/engines/eevee_next/eevee_sync.hh +++ b/source/blender/draw/engines/eevee_next/eevee_sync.hh @@ -77,7 +77,7 @@ struct ObjectKey { ObjectKey(Object *ob) : ObjectKey(ob, DRW_object_get_dupli(ob), DRW_object_get_dupli_parent(ob)){}; - uint64_t hash(void) const + uint64_t hash() const { return hash_value; } @@ -121,7 +121,7 @@ struct ObjectKey { struct ObjectHandle : public DrawData { ObjectKey object_key; - void reset_recalc_flag(void) + void reset_recalc_flag() { if (recalc != 0) { recalc = 0; @@ -130,7 +130,7 @@ struct ObjectHandle : public DrawData { }; struct WorldHandle : public DrawData { - void reset_recalc_flag(void) + void reset_recalc_flag() { if (recalc != 0) { recalc = 0; diff --git a/source/blender/draw/engines/eevee_next/eevee_view.cc b/source/blender/draw/engines/eevee_next/eevee_view.cc index 074bc8b02aa..de7341f814b 100644 --- a/source/blender/draw/engines/eevee_next/eevee_view.cc +++ b/source/blender/draw/engines/eevee_next/eevee_view.cc @@ -74,6 +74,7 @@ void ShadingView::sync(int2 render_extent_) } #else /* TEMP */ + UNUSED_VARS(face_matrix_); const DRWView *default_view = DRW_view_default_get(); DRW_view_winmat_get(default_view, winmat.ptr(), false); DRW_view_viewmat_get(default_view, viewmat.ptr(), false); @@ -96,7 +97,7 @@ void ShadingView::sync(int2 render_extent_) postfx_tx_.sync(); } -void ShadingView::render(void) +void ShadingView::render() { if (!is_enabled_) { return; @@ -180,7 +181,7 @@ GPUTexture *ShadingView::render_post(GPUTexture *input_tx) return input_tx; } -void ShadingView::update_view(void) +void ShadingView::update_view() { float4x4 viewmat, winmat; DRW_view_viewmat_get(main_view_, viewmat.ptr(), false); diff --git a/source/blender/draw/engines/eevee_next/eevee_view.hh b/source/blender/draw/engines/eevee_next/eevee_view.hh index e0ba4485365..e78a3222d8b 100644 --- a/source/blender/draw/engines/eevee_next/eevee_view.hh +++ b/source/blender/draw/engines/eevee_next/eevee_view.hh @@ -73,16 +73,16 @@ class ShadingView { ~ShadingView(){}; - void init(void); + void init(); void sync(int2 render_extent_); - void render(void); + void render(); GPUTexture *render_post(GPUTexture *input_tx); private: - void update_view(void); + void update_view(); }; /** \} */ @@ -135,14 +135,14 @@ class MainView { } } - void sync(void) + void sync() { for (auto i : IndexRange(6)) { shading_views_[i].sync(render_extent_); } } - void render(void) + void render() { for (auto i : IndexRange(6)) { shading_views_[i].render(); diff --git a/source/blender/draw/engines/eevee_next/eevee_world.hh b/source/blender/draw/engines/eevee_next/eevee_world.hh index ff5be774b90..05177928436 100644 --- a/source/blender/draw/engines/eevee_next/eevee_world.hh +++ b/source/blender/draw/engines/eevee_next/eevee_world.hh @@ -56,7 +56,7 @@ class World { public: World(Instance &inst) : inst_(inst){}; - void sync(void); + void sync(); }; /** \} */ diff --git a/source/blender/draw/engines/eevee_next/shaders/eevee_geom_curves_vert.glsl b/source/blender/draw/engines/eevee_next/shaders/eevee_geom_curves_vert.glsl index edf9e39e005..11f93ad0d14 100644 --- a/source/blender/draw/engines/eevee_next/shaders/eevee_geom_curves_vert.glsl +++ b/source/blender/draw/engines/eevee_next/shaders/eevee_geom_curves_vert.glsl @@ -6,7 +6,7 @@ #pragma BLENDER_REQUIRE(eevee_nodetree_lib.glsl) #pragma BLENDER_REQUIRE(eevee_surf_lib.glsl) -void main(void) +void main() { init_interface(); diff --git a/source/blender/draw/engines/eevee_next/shaders/eevee_geom_gpencil_vert.glsl b/source/blender/draw/engines/eevee_next/shaders/eevee_geom_gpencil_vert.glsl index bb1f93b4453..5b404ec5237 100644 --- a/source/blender/draw/engines/eevee_next/shaders/eevee_geom_gpencil_vert.glsl +++ b/source/blender/draw/engines/eevee_next/shaders/eevee_geom_gpencil_vert.glsl @@ -4,7 +4,7 @@ #pragma BLENDER_REQUIRE(eevee_attributes_lib.glsl) #pragma BLENDER_REQUIRE(eevee_surf_lib.glsl) -void main(void) +void main() { init_interface(); diff --git a/source/blender/draw/engines/eevee_next/shaders/eevee_geom_mesh_vert.glsl b/source/blender/draw/engines/eevee_next/shaders/eevee_geom_mesh_vert.glsl index 24d5a2c60b0..7b38057f41a 100644 --- a/source/blender/draw/engines/eevee_next/shaders/eevee_geom_mesh_vert.glsl +++ b/source/blender/draw/engines/eevee_next/shaders/eevee_geom_mesh_vert.glsl @@ -4,7 +4,7 @@ #pragma BLENDER_REQUIRE(eevee_nodetree_lib.glsl) #pragma BLENDER_REQUIRE(eevee_surf_lib.glsl) -void main(void) +void main() { init_interface(); diff --git a/source/blender/draw/engines/eevee_next/shaders/eevee_geom_world_vert.glsl b/source/blender/draw/engines/eevee_next/shaders/eevee_geom_world_vert.glsl index 6ce98f26c7e..cbf85ca56a9 100644 --- a/source/blender/draw/engines/eevee_next/shaders/eevee_geom_world_vert.glsl +++ b/source/blender/draw/engines/eevee_next/shaders/eevee_geom_world_vert.glsl @@ -7,7 +7,7 @@ #pragma BLENDER_REQUIRE(eevee_nodetree_lib.glsl) #pragma BLENDER_REQUIRE(eevee_surf_lib.glsl) -void main(void) +void main() { /* Fullscreen triangle. */ int v = gl_VertexID % 3; diff --git a/source/blender/draw/engines/eevee_next/shaders/eevee_surf_deferred_frag.glsl b/source/blender/draw/engines/eevee_next/shaders/eevee_surf_deferred_frag.glsl index 5500131c3e7..7848c4a0611 100644 --- a/source/blender/draw/engines/eevee_next/shaders/eevee_surf_deferred_frag.glsl +++ b/source/blender/draw/engines/eevee_next/shaders/eevee_surf_deferred_frag.glsl @@ -11,7 +11,7 @@ #pragma BLENDER_REQUIRE(eevee_surf_lib.glsl) #pragma BLENDER_REQUIRE(eevee_nodetree_lib.glsl) -void main(void) +void main() { init_globals(); diff --git a/source/blender/draw/engines/eevee_next/shaders/eevee_surf_depth_frag.glsl b/source/blender/draw/engines/eevee_next/shaders/eevee_surf_depth_frag.glsl index a635cf72e45..002eed91130 100644 --- a/source/blender/draw/engines/eevee_next/shaders/eevee_surf_depth_frag.glsl +++ b/source/blender/draw/engines/eevee_next/shaders/eevee_surf_depth_frag.glsl @@ -53,7 +53,7 @@ float hashed_alpha_threshold(float hash_scale, float hash_offset, vec3 P) return threshold; } -void main(void) +void main() { #ifdef MAT_TRANSPARENT init_globals(); diff --git a/source/blender/draw/engines/eevee_next/shaders/eevee_surf_forward_frag.glsl b/source/blender/draw/engines/eevee_next/shaders/eevee_surf_forward_frag.glsl index b3fbdb937f9..143e88dbe68 100644 --- a/source/blender/draw/engines/eevee_next/shaders/eevee_surf_forward_frag.glsl +++ b/source/blender/draw/engines/eevee_next/shaders/eevee_surf_forward_frag.glsl @@ -43,7 +43,7 @@ vec4 closure_to_rgba(Closure cl) return out_color; } -void main(void) +void main() { init_globals(); diff --git a/source/blender/draw/engines/eevee_next/shaders/eevee_surf_lib.glsl b/source/blender/draw/engines/eevee_next/shaders/eevee_surf_lib.glsl index 01a90bcb81b..0d8644c9901 100644 --- a/source/blender/draw/engines/eevee_next/shaders/eevee_surf_lib.glsl +++ b/source/blender/draw/engines/eevee_next/shaders/eevee_surf_lib.glsl @@ -27,7 +27,7 @@ vec3 barycentric_distances_get() } #endif -void init_globals_mesh(void) +void init_globals_mesh() { #if defined(USE_BARYCENTRICS) && defined(GPU_FRAGMENT_SHADER) && defined(MAT_GEOM_MESH) g_data.barycentric_coords = gpu_BaryCoord.xy; @@ -35,7 +35,7 @@ void init_globals_mesh(void) #endif } -void init_globals_curves(void) +void init_globals_curves() { /* Shade as a cylinder. */ float cos_theta = interp.curves_time_width / interp.curves_thickness; @@ -51,13 +51,13 @@ void init_globals_curves(void) #endif } -void init_globals_gpencil(void) +void init_globals_gpencil() { /* Undo backface flip as the gpencil normal is already pointing towards the camera. */ g_data.N = interp.N; } -void init_globals(void) +void init_globals() { /* Default values. */ g_data.P = interp.P; diff --git a/source/blender/draw/engines/eevee_next/shaders/eevee_surf_world_frag.glsl b/source/blender/draw/engines/eevee_next/shaders/eevee_surf_world_frag.glsl index 9901596623d..ac657afc922 100644 --- a/source/blender/draw/engines/eevee_next/shaders/eevee_surf_world_frag.glsl +++ b/source/blender/draw/engines/eevee_next/shaders/eevee_surf_world_frag.glsl @@ -11,7 +11,7 @@ #pragma BLENDER_REQUIRE(eevee_surf_lib.glsl) #pragma BLENDER_REQUIRE(eevee_nodetree_lib.glsl) -void main(void) +void main() { init_globals(); /* View position is passed to keep accuracy. */ diff --git a/source/blender/draw/intern/draw_shader.c b/source/blender/draw/intern/draw_shader.c index ffbae500e65..063aec24b94 100644 --- a/source/blender/draw/intern/draw_shader.c +++ b/source/blender/draw/intern/draw_shader.c @@ -43,8 +43,13 @@ static GPUShader *hair_refine_shader_transform_feedback_create( char *shader_src = BLI_string_joinN(datatoc_common_hair_lib_glsl, datatoc_common_hair_refine_vert_glsl); const char *var_names[1] = {"finalColor"}; - sh = DRW_shader_create_with_transform_feedback( - shader_src, NULL, "#define HAIR_PHASE_SUBDIV\n", GPU_SHADER_TFB_POINTS, var_names, 1); + sh = DRW_shader_create_with_transform_feedback(shader_src, + NULL, + "#define HAIR_PHASE_SUBDIV\n" + "#define USE_TF\n", + GPU_SHADER_TFB_POINTS, + var_names, + 1); MEM_freeN(shader_src); return sh; diff --git a/source/blender/draw/intern/shaders/common_hair_refine_vert.glsl b/source/blender/draw/intern/shaders/common_hair_refine_vert.glsl index a615dbd526b..6c784469e5b 100644 --- a/source/blender/draw/intern/shaders/common_hair_refine_vert.glsl +++ b/source/blender/draw/intern/shaders/common_hair_refine_vert.glsl @@ -1,5 +1,9 @@ #pragma BLENDER_REQUIRE(common_hair_lib.glsl) +#ifdef USE_TF +out vec4 finalColor; +#endif + void main(void) { float interp_time; |