Spreadsheet does not count changes by GPU Subdivision #103440

Open
opened 2022-12-23 16:28:30 +01:00 by Sun Kim · 4 comments
Contributor

System Information
Operating system: Windows-10-10.0.19045-SP0 64 Bits
Graphics card: Radeon RX 570 Series ATI Technologies Inc. 4.5.0 Core Profile Context 22.11.2.221130

Blender Version
Broken: version: 3.5.0 Alpha, branch: master, commit date: 2022-12-23 00:56, hash: f803a0a95b
Worked: n/a (never worked as far as I can see)

Short description of error
Spreadsheet does not count changes by GPU Subdivision.

See very similar issue with viewport stats: #98339

Exact steps for others to reproduce the error

  • Add Subdivision Surface modifier. Make sure that GPU Subdivision is enabled
  • See spreadsheet does not count changes by the modifier

SpreadsheetGPUSubdiv.mp4

**System Information** Operating system: Windows-10-10.0.19045-SP0 64 Bits Graphics card: Radeon RX 570 Series ATI Technologies Inc. 4.5.0 Core Profile Context 22.11.2.221130 **Blender Version** Broken: version: 3.5.0 Alpha, branch: master, commit date: 2022-12-23 00:56, hash: `f803a0a95b` Worked: n/a (never worked as far as I can see) **Short description of error** Spreadsheet does not count changes by GPU Subdivision. See very similar issue with viewport stats: #98339 **Exact steps for others to reproduce the error** - Add Subdivision Surface modifier. Make sure that GPU Subdivision is enabled - See spreadsheet does not count changes by the modifier [SpreadsheetGPUSubdiv.mp4](https://archive.blender.org/developer/F14086432/SpreadsheetGPUSubdiv.mp4)
Author
Contributor

Added subscriber: @persun

Added subscriber: @persun

Changed status from 'Needs Triage' to: 'Confirmed'

Changed status from 'Needs Triage' to: 'Confirmed'

Added subscriber: @mod_moder

Added subscriber: @mod_moder

It seems strange, but it looks like Object.runtime.geometry_set_eval does not contain the applying of the latest GPU subdivision... at least for now it looks like it to me.


The consequence of this is this:
(It works for me, but I don't think it's the correct way. It's more of a lack of confidence)
P3414: gpu subd ignore try to fix

diff --git a/source/blender/editors/space_spreadsheet/spreadsheet_data_source_geometry.cc b/source/blender/editors/space_spreadsheet/spreadsheet_data_source_geometry.cc
index 024b140a426..63d3d2f7272 100644
--- a/source/blender/editors/space_spreadsheet/spreadsheet_data_source_geometry.cc
+++ b/source/blender/editors/space_spreadsheet/spreadsheet_data_source_geometry.cc
@@ -15,6 +15,7 @@
 #include "BKE_mesh.h"
 #include "BKE_mesh_wrapper.h"
 #include "BKE_modifier.h"
+#include "BKE_object.h"
 #include "BKE_volume.h"
 
 #include "DNA_ID.h"
@@ -461,30 +462,34 @@ GeometrySet spreadsheet_get_display_geometry_set(const SpaceSpreadsheet *sspread
     }
   }
   else {
+    Mesh *mesh = nullptr;
     if (object_eval->mode == OB_MODE_EDIT && object_eval->type == OB_MESH) {
-      Mesh *mesh = BKE_modifier_get_evaluated_mesh_from_evaluated_object(object_eval);
+      mesh = BKE_object_get_evaluated_mesh(object_eval);
       if (mesh == nullptr) {
         return geometry_set;
       }
-      BKE_mesh_wrapper_ensure_mdata(mesh);
-      MeshComponent &mesh_component = geometry_set.get_component_for_write<MeshComponent>();
-      mesh_component.replace(mesh, GeometryOwnershipType::ReadOnly);
     }
     else {
       if (BLI_listbase_count(&sspreadsheet->viewer_path.path) == 1) {
         /* Use final evaluated object. */
+        mesh = BKE_object_get_evaluated_mesh(object_eval);
         if (object_eval->runtime.geometry_set_eval != nullptr) {
           geometry_set = *object_eval->runtime.geometry_set_eval;
         }
       }
-      else {
-        if (const ViewerNodeLog *viewer_log =
-                nodes::geo_eval_log::GeoModifierLog::find_viewer_node_log_for_path(
-                    sspreadsheet->viewer_path)) {
-          geometry_set = viewer_log->geometry;
-        }
-      }
     }
+
+    if (mesh) {
+      BKE_mesh_wrapper_ensure_mdata(mesh);
+      MeshComponent &mesh_component = geometry_set.get_component_for_write<MeshComponent>();
+      mesh_component.replace(mesh, GeometryOwnershipType::ReadOnly);
+      return geometry_set;
+    }
+  }
+  if (const ViewerNodeLog *viewer_log =
+          nodes::geo_eval_log::GeoModifierLog::find_viewer_node_log_for_path(
+              sspreadsheet->viewer_path)) {
+    geometry_set = viewer_log->geometry;
   }
   return geometry_set;
 }

It seems strange, but it looks like `Object.runtime.geometry_set_eval` does not contain the applying of the latest GPU subdivision... at least for now it looks like it to me. --- The consequence of this is this: (It works for me, but I don't think it's the correct way. It's more of a lack of confidence) [P3414: gpu subd ignore try to fix](https://archive.blender.org/developer/P3414.txt) ```diff diff --git a/source/blender/editors/space_spreadsheet/spreadsheet_data_source_geometry.cc b/source/blender/editors/space_spreadsheet/spreadsheet_data_source_geometry.cc index 024b140a426..63d3d2f7272 100644 --- a/source/blender/editors/space_spreadsheet/spreadsheet_data_source_geometry.cc +++ b/source/blender/editors/space_spreadsheet/spreadsheet_data_source_geometry.cc @@ -15,6 +15,7 @@ #include "BKE_mesh.h" #include "BKE_mesh_wrapper.h" #include "BKE_modifier.h" +#include "BKE_object.h" #include "BKE_volume.h" #include "DNA_ID.h" @@ -461,30 +462,34 @@ GeometrySet spreadsheet_get_display_geometry_set(const SpaceSpreadsheet *sspread } } else { + Mesh *mesh = nullptr; if (object_eval->mode == OB_MODE_EDIT && object_eval->type == OB_MESH) { - Mesh *mesh = BKE_modifier_get_evaluated_mesh_from_evaluated_object(object_eval); + mesh = BKE_object_get_evaluated_mesh(object_eval); if (mesh == nullptr) { return geometry_set; } - BKE_mesh_wrapper_ensure_mdata(mesh); - MeshComponent &mesh_component = geometry_set.get_component_for_write<MeshComponent>(); - mesh_component.replace(mesh, GeometryOwnershipType::ReadOnly); } else { if (BLI_listbase_count(&sspreadsheet->viewer_path.path) == 1) { /* Use final evaluated object. */ + mesh = BKE_object_get_evaluated_mesh(object_eval); if (object_eval->runtime.geometry_set_eval != nullptr) { geometry_set = *object_eval->runtime.geometry_set_eval; } } - else { - if (const ViewerNodeLog *viewer_log = - nodes::geo_eval_log::GeoModifierLog::find_viewer_node_log_for_path( - sspreadsheet->viewer_path)) { - geometry_set = viewer_log->geometry; - } - } } + + if (mesh) { + BKE_mesh_wrapper_ensure_mdata(mesh); + MeshComponent &mesh_component = geometry_set.get_component_for_write<MeshComponent>(); + mesh_component.replace(mesh, GeometryOwnershipType::ReadOnly); + return geometry_set; + } + } + if (const ViewerNodeLog *viewer_log = + nodes::geo_eval_log::GeoModifierLog::find_viewer_node_log_for_path( + sspreadsheet->viewer_path)) { + geometry_set = viewer_log->geometry; } return geometry_set; } ```
Philipp Oeser removed the
Interest
Nodes & Physics
label 2023-02-10 08:43:16 +01:00
Philipp Oeser added the
Interest
Modeling
label 2023-02-10 11:18:19 +01:00
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#103440
No description provided.