Regression: crash when resizing grayscale textures (eg. setting "Limit Size" to a small value) #103075

Closed
opened 2022-12-09 16:45:22 +01:00 by slwk1d · 20 comments

System Information
Operating system: Windows-10-10.0.19044-SP0 64 Bits
Graphics card: NVIDIA GeForce GTX 1080 Ti/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 527.56

Blender Version
Broken: version: 3.4.0, caused by 37533cd6cb
Worked: 3.3.1

Short description of error
In a scene with lots of materials and shaders, enabling "Limit Size" in Viewport Preferences and switching to Material Preview crashes Blender when compiling the shaders.

>	blender.exe!imb_gpu_get_data(const ImBuf * ibuf, const bool do_rescale, const int * rescale_size, const bool store_premultiplied, bool * r_freedata) Line 228	C

 	blender.exe!IMB_create_gpu_texture(const unsigned char * name, ImBuf * ibuf, bool use_high_bitdepth, bool use_premult) Line 364	C
 	blender.exe!image_get_gpu_texture(Image * ima, ImageUser * iuser, ImBuf * ibuf, eGPUTextureTarget textarget) Line 419	C++
 	blender.exe!BKE_image_get_gpu_texture(Image * image, ImageUser * iuser, ImBuf * ibuf) Line 452	C++
 	blender.exe!DRW_shgroup_add_material_resources(DRWShadingGroup * grp, GPUMaterial * material) Line 1824	C++
 	blender.exe!material_opaque(EEVEE_Data * vedata, EEVEE_ViewLayerData * sldata, Material * ma, const bool is_hair) Line 660	C
 	blender.exe!eevee_material_cache_get(EEVEE_Data * vedata, EEVEE_ViewLayerData * sldata, Object * ob, int slot, bool is_hair) Line 777	C
 	blender.exe!EEVEE_materials_cache_populate(EEVEE_Data * vedata, EEVEE_ViewLayerData * sldata, Object * ob, bool * cast_shadow) Line 826	C
 	blender.exe!EEVEE_cache_populate(void * vedata, Object * ob) Line 114	C
 	blender.exe!drw_engines_cache_populate(Object * ob) Line 1079	C
 	blender.exe!DRW_draw_render_loop_ex(Depsgraph * depsgraph, RenderEngineType * engine_type, ARegion * region, View3D * v3d, GPUViewport * viewport, const bContext * evil_C) Line 1732	C
 	blender.exe!DRW_draw_view(const bContext * C) Line 1636	C
 	blender.exe!view3d_draw_view(const bContext * C, ARegion * region) Line 1552	C++
 	blender.exe!view3d_main_region_draw(const bContext * C, ARegion * region) Line 1587	C++
 	blender.exe!ED_region_do_draw(bContext * C, ARegion * region) Line 551	C
 	blender.exe!wm_draw_window_offscreen(bContext * C, wmWindow * win, bool stereo) Line 929	C
 	blender.exe!wm_draw_window(bContext * C, wmWindow * win) Line 1096	C
 	blender.exe!wm_draw_update(bContext * C) Line 1354	C
 	blender.exe!WM_main(bContext * C) Line 647	C
 	blender.exe!main(int argc, const unsigned char * * UNUSED_argv_c) Line 589	C
 	[External Code]	

Originally I did a comparison video between 3.3.1 and 3.4, unfortunately being the scene very heavy compiling all the shaders in 3.3.1 was taking several minutes with Blender freezing, and the video was going too long, but at least in 3.3.1 doesn't crash.

The problem can be reproduced with the sample file "Blender 2.81 – The Junk Shop" available at https://www.blender.org/download/demo-files/

Exact steps for others to reproduce the error

  • Open attached .blend file
  • Go to {nav Preferences > Viewport > Textures} and change Limit Size to 128
  • In 3D View set Viewport Shading to Material Preview
    text_resize_crash.blend
**System Information** Operating system: Windows-10-10.0.19044-SP0 64 Bits Graphics card: NVIDIA GeForce GTX 1080 Ti/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 527.56 **Blender Version** Broken: version: 3.4.0, caused by 37533cd6cb Worked: 3.3.1 **Short description of error** In a scene with lots of materials and shaders, enabling "Limit Size" in Viewport Preferences and switching to Material Preview crashes Blender when compiling the shaders. ``` > blender.exe!imb_gpu_get_data(const ImBuf * ibuf, const bool do_rescale, const int * rescale_size, const bool store_premultiplied, bool * r_freedata) Line 228 C blender.exe!IMB_create_gpu_texture(const unsigned char * name, ImBuf * ibuf, bool use_high_bitdepth, bool use_premult) Line 364 C blender.exe!image_get_gpu_texture(Image * ima, ImageUser * iuser, ImBuf * ibuf, eGPUTextureTarget textarget) Line 419 C++ blender.exe!BKE_image_get_gpu_texture(Image * image, ImageUser * iuser, ImBuf * ibuf) Line 452 C++ blender.exe!DRW_shgroup_add_material_resources(DRWShadingGroup * grp, GPUMaterial * material) Line 1824 C++ blender.exe!material_opaque(EEVEE_Data * vedata, EEVEE_ViewLayerData * sldata, Material * ma, const bool is_hair) Line 660 C blender.exe!eevee_material_cache_get(EEVEE_Data * vedata, EEVEE_ViewLayerData * sldata, Object * ob, int slot, bool is_hair) Line 777 C blender.exe!EEVEE_materials_cache_populate(EEVEE_Data * vedata, EEVEE_ViewLayerData * sldata, Object * ob, bool * cast_shadow) Line 826 C blender.exe!EEVEE_cache_populate(void * vedata, Object * ob) Line 114 C blender.exe!drw_engines_cache_populate(Object * ob) Line 1079 C blender.exe!DRW_draw_render_loop_ex(Depsgraph * depsgraph, RenderEngineType * engine_type, ARegion * region, View3D * v3d, GPUViewport * viewport, const bContext * evil_C) Line 1732 C blender.exe!DRW_draw_view(const bContext * C) Line 1636 C blender.exe!view3d_draw_view(const bContext * C, ARegion * region) Line 1552 C++ blender.exe!view3d_main_region_draw(const bContext * C, ARegion * region) Line 1587 C++ blender.exe!ED_region_do_draw(bContext * C, ARegion * region) Line 551 C blender.exe!wm_draw_window_offscreen(bContext * C, wmWindow * win, bool stereo) Line 929 C blender.exe!wm_draw_window(bContext * C, wmWindow * win) Line 1096 C blender.exe!wm_draw_update(bContext * C) Line 1354 C blender.exe!WM_main(bContext * C) Line 647 C blender.exe!main(int argc, const unsigned char * * UNUSED_argv_c) Line 589 C [External Code] ``` Originally I did a comparison video between 3.3.1 and 3.4, unfortunately being the scene very heavy compiling all the shaders in 3.3.1 was taking several minutes with Blender freezing, and the video was going too long, but at least in 3.3.1 doesn't crash. The problem can be reproduced with the sample file "Blender 2.81 – The Junk Shop" available at https://www.blender.org/download/demo-files/ **Exact steps for others to reproduce the error** - Open attached .blend file - Go to {nav Preferences > Viewport > Textures} and change `Limit Size` to 128 - In 3D View set `Viewport Shading` to `Material Preview` [text_resize_crash.blend](https://archive.blender.org/developer/F14054508/text_resize_crash.blend)
Author

Added subscriber: @Slowwkidd

Added subscriber: @Slowwkidd

#103594 was marked as duplicate of this issue

#103594 was marked as duplicate of this issue

#103078 was marked as duplicate of this issue

#103078 was marked as duplicate of this issue
slwk1d changed title from In a heavy scene with lots of materials and shaders, compiling shaders with EEVEE crashes Blender to Enabling "Limit Size" in Viewport Preferences and switching to Material Preview crashes Blender in a scene with lots of shaders 2022-12-09 20:03:06 +01:00

Added subscriber: @Dege

Added subscriber: @Dege

Added subscriber: @mano-wii

Added subscriber: @mano-wii

I can't attach the file unfortunately, to reproduce this I suggest trying opening a heavy scene with many materials, enable any number in Preferences>Viewport>Textures>Limit Size and activate Material Preview mode.

Steps like this hardly help. The problem may depend on numerous other factors.
We can spend hours setting up a complex scene with hundreds of materials and still not replicate the problem.

But luckily I was able to replicate what appears to be the same problem using the example file The Junk Shop which can be downloaded at https://www.blender.org/download/demo-files/

I'll edit the description so we can confirm and forward this report.

> I can't attach the file unfortunately, to reproduce this I suggest trying opening a heavy scene with many materials, enable any number in Preferences>Viewport>Textures>Limit Size and activate Material Preview mode. Steps like this hardly help. The problem may depend on numerous other factors. We can spend hours setting up a complex scene with hundreds of materials and still not replicate the problem. But luckily I was able to replicate what appears to be the same problem using the example file `The Junk Shop` which can be downloaded at https://www.blender.org/download/demo-files/ I'll edit the description so we can confirm and forward this report.
Germano Cavalcante changed title from Enabling "Limit Size" in Viewport Preferences and switching to Material Preview crashes Blender in a scene with lots of shaders to Regression: crash with some textures when setting "Limit Size" to a small value 2022-12-12 19:50:41 +01:00

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

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

Could you also look at https:*developer.blender.org/T103078 ?
It is the same bug

Could you also look at [https:*developer.blender.org/T103078 ](https:*developer.blender.org/T103078)? It is the same bug

Added subscriber: @Jeroen-Bakker

Added subscriber: @Jeroen-Bakker

In #103075#1459275, @Dege wrote:
Could you also look at https:*developer.blender.org/T103078 ?
It is the same bug

From the information in the comments, it seems to be the same problem.
Therefore I will merge the reports.

> In #103075#1459275, @Dege wrote: > Could you also look at [https:*developer.blender.org/T103078 ](https:*developer.blender.org/T103078)? > It is the same bug From the information in the comments, it seems to be the same problem. Therefore I will merge the reports.

Added subscriber: @mod_moder

Added subscriber: @mod_moder

Added subscriber: @padone

Added subscriber: @padone
Germano Cavalcante changed title from Regression: crash with some textures when setting "Limit Size" to a small value to Regression: crash when resizing grayscale textures (eg. setting "Limit Size" to a small value) 2023-01-02 14:31:17 +01:00

Added subscriber: @alinsa-4

Added subscriber: @alinsa-4

@Jeroen-Bakker I see that this is not assigned yet, not that I want to push but eevee is quite unusable this way. Either fix this or roll back your 37533cd6cb patch please. If you need a simple test scene look at my bug report it's a cube with the diffuse shader and a single grayscale texture, this alone triggers the issue.

@Jeroen-Bakker I see that this is not assigned yet, not that I want to push but eevee is quite unusable this way. Either fix this or roll back your 37533cd6cb patch please. If you need a simple test scene look at my bug report it's a cube with the diffuse shader and a single grayscale texture, this alone triggers the issue.

Added subscriber: @Alex-Gorbunov

Added subscriber: @Alex-Gorbunov

This issue was referenced by f3df7b4fbd

This issue was referenced by f3df7b4fbde52291984ea6cf6e110ffc6395ac30
Member

Changed status from 'Confirmed' to: 'Resolved'

Changed status from 'Confirmed' to: 'Resolved'
Jeroen Bakker self-assigned this 2023-01-09 09:48:08 +01:00

@Jeroen-Bakker Not to push if you guys have any reason but I see 3.4.1 is not fixed yet. You're distributing as "stable" a broken version of blender where eevee doesn't work.

Do you have any idea when 3.4.2 will be released with the fix ?

@Jeroen-Bakker Not to push if you guys have any reason but I see 3.4.1 is not fixed yet. You're distributing as "stable" a broken version of blender where eevee doesn't work. Do you have any idea when 3.4.2 will be released with the fix ?
Member

Hi @padone

It isn't planned to have a 3.4.2 release as it isn't an LTS release and the release of Blender 3.5 is getting closer each day. You can use Blender 3.3 LTS or 3.5 Beta for now.

We are not able to create a release for each fix being done. Doing a release takes time for multiple people, time we need to spent on making the next version of Blender better. We normally fix issues to be included in the next release. LTS is an exception where it is possible to back-port a fix to this version.

We do deliver an alpha/beta version of Blender most of the time the day after the fix has been applied to the next version.

Hi @padone It isn't planned to have a 3.4.2 release as it isn't an LTS release and the release of Blender 3.5 is getting closer each day. You can use Blender 3.3 LTS or 3.5 Beta for now. We are not able to create a release for each fix being done. Doing a release takes time for multiple people, time we need to spent on making the next version of Blender better. We normally fix issues to be included in the next release. LTS is an exception where it is possible to back-port a fix to this version. We do deliver an alpha/beta version of Blender most of the time the day after the fix has been applied to the next version.

Thank you @Jeroen-Bakker I will warn our group and the daz people about this. I'm confused because this means only LTS is production ready, while other versions don't get important fixes and are released as stable anyway. Makes little sense to me but I take your word for this.

Then for production we have to stick to 3.3 until the next LTS.

Thank you @Jeroen-Bakker I will warn our group and the daz people about this. I'm confused because this means only LTS is production ready, while other versions don't get important fixes and are released as stable anyway. Makes little sense to me but I take your word for this. Then for production we have to stick to 3.3 until the next LTS.
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
9 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#103075
No description provided.