Fix #95477: Cycles Metal support for large textures #104579

Open
Michael Jones (Apple) wants to merge 5 commits from Michael-Jones/blender:LargeTextureSupport into main

When changing the target branch, be careful to rebase the branch in your fork to match. See documentation.

MTLTexture dimensions must be <= 16384.

T95477 reported a crash resulting from large texture usage. This was upgraded to a non-fatal error in D14074, and now this new patch fixes the underlying issue by enabling support for texture dimensions > 16384. This is achieved using software texel fetch & filtering. The additional code required for this causes a small but measurable drop in performance, so we only compile the extra code if it is needed.

MTLTexture dimensions must be <= 16384. T95477 reported a crash resulting from large texture usage. This was upgraded to a non-fatal error in D14074, and now this new patch fixes the underlying issue by enabling support for texture dimensions > 16384. This is achieved using software texel fetch & filtering. The additional code required for this causes a small but measurable drop in performance, so we only compile the extra code if it is needed.
Michael Jones (Apple) added 2 commits 2023-02-10 17:01:08 +01:00
3089b27300 Cycles: Support for texture dimensions > 16K on Metal
This patch enables large textures on Metal by falling back to software emulated texture filtering on textures which are too large to be a MTLTexture.
buildbot/vexp-code-patch-coordinator Build done. Details
b75f467c8f
Avoid compiling s/w texture filtering if not needed
Michael Jones (Apple) requested review from Brecht Van Lommel 2023-02-10 17:01:18 +01:00

@blender-bot build

@blender-bot build
Blender Bot added this to the Render & Cycles project 2023-02-10 17:35:32 +01:00
Michael Jones (Apple) added 3 commits 2023-02-10 17:57:33 +01:00

Seems the Metal tests are failing, as far as I can tell the latest changes would not fix it but will kick the bot again anyway (which you can do also by the way).
@blender-bot build

Seems the Metal tests are failing, as far as I can tell the latest changes would not fix it but will kick the bot again anyway (which you can do also by the way). @blender-bot build
Brecht Van Lommel requested changes 2023-02-15 12:58:25 +01:00
Brecht Van Lommel left a comment
Owner

Mark as requesting changes.

Mark as requesting changes.
Brecht Van Lommel changed title from Cycles: Fix T95477 - support large textures on Metal instead of giving error to Fix #95477: Cycles Metal support for large textures 2023-03-10 13:46:47 +01:00
Some checks failed
buildbot/vexp-code-patch-coordinator Build done.
This pull request has changes conflicting with the target branch.
  • intern/cycles/device/metal/device_impl.mm
  • intern/cycles/device/metal/queue.mm
  • intern/cycles/kernel/device/metal/compat.h
  • intern/cycles/kernel/device/metal/context_begin.h

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u LargeTextureSupport:Michael-Jones-LargeTextureSupport
git checkout Michael-Jones-LargeTextureSupport
Sign in to join this conversation.
No reviewers
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 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#104579
No description provided.