Commit: 98aad59d377703de495014db4203fc6153db6a8c Author: Miguel Pozo Date: Fri Jan 27 16:20:43 2023 +0100 Branches: tmp-workbench-rewrite2 https://developer.blender.org/rB98aad59d377703de495014db4203fc6153db6a8c
Revert "Use the same object id across object submeshes" This reverts commit 45bc00d298a71c77b73728c7e88995f05d070726. =================================================================== M source/blender/draw/engines/workbench/shaders/infos/workbench_prepass_info.hh M source/blender/draw/engines/workbench/shaders/workbench_prepass_vert.glsl M source/blender/draw/engines/workbench/workbench_defines.hh M source/blender/draw/engines/workbench/workbench_engine.cc M source/blender/draw/engines/workbench/workbench_mesh_passes.cc M source/blender/draw/engines/workbench/workbench_private.hh =================================================================== diff --git a/source/blender/draw/engines/workbench/shaders/infos/workbench_prepass_info.hh b/source/blender/draw/engines/workbench/shaders/infos/workbench_prepass_info.hh index f0a89859c44..92452eefed2 100644 --- a/source/blender/draw/engines/workbench/shaders/infos/workbench_prepass_info.hh +++ b/source/blender/draw/engines/workbench/shaders/infos/workbench_prepass_info.hh @@ -40,7 +40,6 @@ GPU_SHADER_CREATE_INFO(workbench_next_mesh) .vertex_in(2, Type::VEC4, "ac") .vertex_in(3, Type::VEC2, "au") .vertex_source("workbench_prepass_vert.glsl") - .storage_buf(WB_OBJECT_ID_SLOT, Qualifier::READ, "uint", "object_id_data[]") .additional_info("draw_modelmat_new") .additional_info("draw_resource_handle_new"); diff --git a/source/blender/draw/engines/workbench/shaders/workbench_prepass_vert.glsl b/source/blender/draw/engines/workbench/shaders/workbench_prepass_vert.glsl index 2f82cd2379d..7fcfb9b1c54 100644 --- a/source/blender/draw/engines/workbench/shaders/workbench_prepass_vert.glsl +++ b/source/blender/draw/engines/workbench/shaders/workbench_prepass_vert.glsl @@ -19,9 +19,5 @@ void main() workbench_material_data_get( resource_handle, ac.rgb, color_interp, alpha_interp, _roughness, metallic); -#ifdef WORKBENCH_NEXT - object_id = int(uint(object_id_data[resource_handle]) & 0xFFFFu) + 1; -#else object_id = int(uint(resource_handle) & 0xFFFFu) + 1; -#endif } diff --git a/source/blender/draw/engines/workbench/workbench_defines.hh b/source/blender/draw/engines/workbench/workbench_defines.hh index c69225b197a..4dfd69d9d50 100644 --- a/source/blender/draw/engines/workbench/workbench_defines.hh +++ b/source/blender/draw/engines/workbench/workbench_defines.hh @@ -5,7 +5,6 @@ #define WB_TILE_ARRAY_SLOT 2 #define WB_TILE_DATA_SLOT 3 #define WB_MATERIAL_SLOT 0 -#define WB_OBJECT_ID_SLOT 1 #define WB_WORLD_SLOT 4 #define WB_RESOLVE_GROUP_SIZE 8 diff --git a/source/blender/draw/engines/workbench/workbench_engine.cc b/source/blender/draw/engines/workbench/workbench_engine.cc index 78ac2b2349f..a04f61418f6 100644 --- a/source/blender/draw/engines/workbench/workbench_engine.cc +++ b/source/blender/draw/engines/workbench/workbench_engine.cc @@ -80,7 +80,6 @@ class Instance { void end_sync() { resources.material_buf.push_update(); - resources.object_id_buf.push_update(); } void object_sync(Manager &manager, ObjectRef &ob_ref) @@ -203,8 +202,6 @@ class Instance { ResourceHandle _handle = i == 0 ? handle : manager.resource_handle(ob_ref); Material &mat = resources.material_buf.get_or_resize(_handle.resource_index()); - resources.object_id_buf.get_or_resize( - _handle.resource_index()) = handle.resource_index(); if (::Material *_mat = BKE_object_material_get_eval(ob_ref.object, i + 1)) { mat = Material(*_mat); @@ -245,7 +242,6 @@ class Instance { if (batch) { Material &mat = resources.material_buf.get_or_resize(handle.resource_index()); - resources.object_id_buf.get_or_resize(handle.resource_index()) = handle.resource_index(); if (object_state.color_type == V3D_SHADING_OBJECT_COLOR) { mat = Material(*ob_ref.object); diff --git a/source/blender/draw/engines/workbench/workbench_mesh_passes.cc b/source/blender/draw/engines/workbench/workbench_mesh_passes.cc index d926b0c015d..bc90f26b33d 100644 --- a/source/blender/draw/engines/workbench/workbench_mesh_passes.cc +++ b/source/blender/draw/engines/workbench/workbench_mesh_passes.cc @@ -23,7 +23,6 @@ void MeshPass::init_pass(SceneResources &resources, DRWState state, int clip_pla state_set(state, clip_planes); bind_texture(WB_MATCAP_SLOT, resources.matcap_tx); bind_ssbo(WB_MATERIAL_SLOT, &resources.material_buf); - bind_ssbo(WB_OBJECT_ID_SLOT, &resources.object_id_buf); bind_ubo(WB_WORLD_SLOT, resources.world_buf); if (clip_planes > 0) { bind_ubo(DRW_CLIPPING_UBO_SLOT, resources.clip_planes_buf); diff --git a/source/blender/draw/engines/workbench/workbench_private.hh b/source/blender/draw/engines/workbench/workbench_private.hh index b00202e3a69..086553ca5c1 100644 --- a/source/blender/draw/engines/workbench/workbench_private.hh +++ b/source/blender/draw/engines/workbench/workbench_private.hh @@ -148,7 +148,6 @@ struct SceneResources { TextureFromPool depth_in_front_tx = "wb_depth_in_front_tx"; StorageVectorBuffer<Material> material_buf = {"material_buf"}; - StorageVectorBuffer<uint> object_id_buf = {"object_id_buf"}; UniformBuffer<WorldData> world_buf = {}; UniformArrayBuffer<float4, 6> clip_planes_buf; _______________________________________________ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org List details, subscription details or unsubscribe: https://lists.blender.org/mailman/listinfo/bf-blender-cvs