Fix #114302: EEVEE Next: Curves material compilation errors #114598

Merged
Miguel Pozo merged 3 commits from pragma37/blender:pull-fix-curves-attributes into main 2023-11-23 15:48:04 +01:00
Member

Add missing includes and remove the attribute functions from fragment shaders.

Note that the only reason the vertex shader check is needed is because eevee_surf_shadow_frag.glsl includes eevee_attributes_lib.glsl, which I don't think is actually required (?).
The only other fragments that include it are surf_world_frag.glsl and eevee_surf_occupancy_frag.glsl (which I'm pretty sure it's just a leftover from a copy-paste).

So it may be best to remove those attribute_lib includes instead?

Add missing includes and remove the attribute functions from fragment shaders. Note that the only reason the vertex shader check is needed is because `eevee_surf_shadow_frag.glsl` includes `eevee_attributes_lib.glsl`, which I don't think is actually required (?). The only other fragments that include it are `surf_world_frag.glsl` and `eevee_surf_occupancy_frag.glsl` (which I'm pretty sure it's just a leftover from a copy-paste). So it may be best to remove those `attribute_lib` includes instead?
Miguel Pozo added the
Interest
EEVEE
Module
EEVEE & Viewport
labels 2023-11-07 20:08:35 +01:00
Miguel Pozo requested review from Clément Foucault 2023-11-07 20:09:06 +01:00
Clément Foucault requested changes 2023-11-21 19:35:48 +01:00
Clément Foucault left a comment
Member

So it may be best to remove those attribute_lib includes instead?

Yes it is better to do that. I'm pretty sure this is the result of copy paste error.

> So it may be best to remove those attribute_lib includes instead? Yes it is better to do that. I'm pretty sure this is the result of copy paste error.
Miguel Pozo force-pushed pull-fix-curves-attributes from 33244ab525 to d935b507de 2023-11-22 16:09:55 +01:00 Compare
Author
Member

Actually, I think I got this wrong eevee_surf_shadow_frag calls attrib_load() so the vertex shader check is still needed.
I've removed the require from shadow and occupancy frags, though.

Actually, I think I got this wrong `eevee_surf_shadow_frag` calls `attrib_load()` so the vertex shader check is still needed. I've removed the require from shadow and occupancy frags, though.
Clément Foucault requested changes 2023-11-22 16:20:59 +01:00
@ -172,6 +173,8 @@ float attr_load_float(float attr)
* Per attribute scope follows loading order.
* \{ */
# pragma BLENDER_REQUIRE(common_hair_lib.glsl) /* TODO rename to curve. */

This will add common_hair to all shaders. The BLENDER_REQUIRE directives do not obey the other preprocessor directives as we just string detect them.

The fix is to reorder the includes in the curve vertex shader to include the common_hair_lib.glsl before this eevee_attributes_lib.glsl.

This will add common_hair to all shaders. The `BLENDER_REQUIRE` directives do not obey the other preprocessor directives as we just string detect them. The fix is to reorder the includes in the curve vertex shader to include the `common_hair_lib.glsl` before this `eevee_attributes_lib.glsl`.
Author
Member

I know, but it does nothing unless HAIR_SHADER is defined.
I'd really like to avoid requires not working because it expects other requires before them.
It can easily get into an include hell situation.

I know, but it does nothing unless `HAIR_SHADER` is defined. I'd really like to avoid requires not working because it expects other requires before them. It can easily get into an include hell situation.

Ok. Then just move this at the top of the file with a comment saying why it is required.

Ok. Then just move this at the top of the file with a comment saying why it is required.
Author
Member

Doesn't leaving it there make it already clear why it's needed?
The point clouds block does the same.

Doesn't leaving it there make it already clear why it's needed? The point clouds block does the same.

Just like sprinkling #include throughout a file is not good for readability. Please move the other as well. These can become quite annoying to debug if they are not at the top of the file.

Just like sprinkling `#include` throughout a file is not good for readability. Please move the other as well. These can become quite annoying to debug if they are not at the top of the file.
Miguel Pozo added 1 commit 2023-11-23 15:35:23 +01:00
Clément Foucault approved these changes 2023-11-23 15:40:36 +01:00
Miguel Pozo merged commit 3197881ca3 into main 2023-11-23 15:48:04 +01:00
Miguel Pozo deleted branch pull-fix-curves-attributes 2023-11-23 15:48:06 +01:00
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 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#114598
No description provided.