Compiler Error C1061 due to too many nested if/else in MANTA_main.cpp #76276
Labels
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
7 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#76276
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This bug was introduced by commit
21485e94
. As a result, Blender can no longer be compiled on Windows after that commit.When compiling in Windows (using Visual Studio 2017 or 2019), error C1061 results:
This is due to the commit above adding more if/else clauses than 128 which exceeds the hard compiler limit for MSBuild. Also, this is a really inelegant block of string tests, and probably could use a cleanup/refactor anyway.
Added subscriber: @Nikhil.Net
Added subscriber: @EitanSomething
Can you post this on https://devtalk.blender.org.
Roger - doing it now!
Posted here: https://devtalk.blender.org/t/new-windows-compiler-error-introduced-by-mantaflow-change/12929
Added subscribers: @sebbas, @ankitm
Changed status from 'Needs Triage' to: 'Confirmed'
It has been brought to @sebbas' attention.
This issue was referenced by
713ad9d971
Changed status from 'Confirmed' to: 'Resolved'
This comment was removed by @Nikhil.Net
@sebbas I finished the code changes that would convert the long chain of if statements into a switch, which I think would be faster to execute. Since you had to remove the else statements, that means each if is getting evaluated per call to the function. Let me know if you'd like me to submit a pull request for you to review, or if there's a better way you want me to send for your review.
Also, feel free to tell me to take a hike if this is not worth doing - this is my first potential code submission and I am more than happy to fade to the background and submit at a later time.
Added subscriber: @LazyDodo
@Nikhil.Net Yes, if you have a patch that would certainly be helpful.
@LazyDodo Or did you already come up with a refactor?
So, I do have a tested/working patch that would allow potentially unlimited values going forward with no need of nested if/else, but I regret to say I am a bit of a noob at submitting it. I'm reading thru the developer docs on it right now to get the process down.
Ok, great. Instead of using arcanist (the tool to submit patches on phabricator) you can also upload the
git diff
output (can be done through "Submit Code" on the frontpage ). I can review it and commit on your behalf.i did have a refactor but i trashed it after i saw you already had a committed a fix
it pretty much turned
into
i theoretically could see small perf increase since it's not doing all kinds of bogus string compares if the result is already known, but depending a bit on how often this is called, unsure if it will be a measurable
@sebbas I have created the following diff and set you as a reviewer (I think I did that right): https://developer.blender.org/D7581
Thanks for feedback, and looking forward to your thoughts.
Added subscriber: @ErickNyanduKabongo
Hello guys,
@LazyDodo Is this the same problem that i m having or should i start another thread in Devtalk?
Here is the full log in Pasteall > https://pasteall.org/im58
Thanks in advance for your help :)
@ErickNyanduKabongo That's a different issue :)
also already fixed.
Thanks :)