EEVEE: Document attribute and property limitations #104697

Merged
Aaron Carlisle merged 1 commits from deadpin/blender-manual:deadpin-patch-1 into blender-v4.1-release 2024-02-18 01:27:41 +01:00

Related to blender/blender#108534


Folks keep running into this it seems so I put the PR together to get things moving.

There looks to be 2 limits but one of them seems a bit broken.

/* Hardware limit is 16. Position attribute is always needed so we reduce to 15.
 * This makes sure the GPUVertexFormat name buffer does not overflow. */
#define GPU_MAX_ATTR 15

/* Determined by the maximum uniform buffer size divided by chunk size. */
#define GPU_MAX_UNIFORM_ATTR 8

The first, from an empirical test seems to indicate 14 useful Geometry Node attributes before the shader "breaks". Are we off by one somewhere?

The second, from blender/blender#117967, is correctly handled when Custom Object Properties are set.

Related to https://projects.blender.org/blender/blender/issues/108534 ---- Folks keep running into this it seems so I put the PR together to get things moving. There looks to be 2 limits but one of them seems a bit broken. ``` /* Hardware limit is 16. Position attribute is always needed so we reduce to 15. * This makes sure the GPUVertexFormat name buffer does not overflow. */ #define GPU_MAX_ATTR 15 /* Determined by the maximum uniform buffer size divided by chunk size. */ #define GPU_MAX_UNIFORM_ATTR 8 ``` The first, from an empirical test seems to indicate 14 useful Geometry Node attributes before the shader "breaks". Are we off by one somewhere? The second, from https://projects.blender.org/blender/blender/issues/117967, is correctly handled when Custom Object Properties are set.
Jesse Yurkovich added 1 commit 2024-02-08 08:44:15 +01:00
Related to blender/blender#108534

----
Folks keep running into this it seems so I put the PR together to get things moving.

There looks to be 2 limits but one of them seems a bit broken.

```
/* Hardware limit is 16. Position attribute is always needed so we reduce to 15.
 * This makes sure the GPUVertexFormat name buffer does not overflow. */
#define GPU_MAX_ATTR 15

/* Determined by the maximum uniform buffer size divided by chunk size. */
#define GPU_MAX_UNIFORM_ATTR 8
```

The first, from an empirical test seems to indicate 14 useful Geometry Node attributes before the shader "breaks".  Are we off by one somewhere?

The second, from blender/blender#117967, is correctly handled when Custom Object Properties are set.
Jesse Yurkovich requested review from Philipp Oeser 2024-02-08 08:44:32 +01:00
Jesse Yurkovich requested review from Jeroen Bakker 2024-02-08 08:44:32 +01:00
Jeroen Bakker requested review from Clément Foucault 2024-02-08 20:40:51 +01:00
Member

Clement is better suited to review this as it concerns some internal areas of EEVEE.

Clement is better suited to review this as it concerns some internal areas of EEVEE.
Jeroen Bakker refused to review 2024-02-08 20:41:40 +01:00
Author
Member

To fill in more details, the reason why I've put 14 here is that it looks like it's not only the Position attribute that is reserved behind the scenes, but the nor Normal attribute as well.

When trying to use 15 geometry node attributes:

GPU_material_compile: Attribute "nor" overlap one or more index from another attribute. Note that mat4 takes up 4 indices. While merging eevee_legacy_material_surface_vert

GPU_material_compile: Attribute "nor" overlap one or more index from another attribute. Note that mat4 takes up 4 indices. While merging eevee_legacy_material_surface_frag_opaque

When trying to use 16 attributes:

GPU_material_compile: Attribute "pos" overlap one or more index from another attribute. Note that mat4 takes up 4 indices. While merging eevee_legacy_material_surface_vert

GPU_material_compile: Attribute "nor" overlap one or more index from another attribute. Note that mat4 takes up 4 indices. While merging eevee_legacy_material_surface_vert

GPU_material_compile: Attribute "pos" overlap one or more index from another attribute. Note that mat4 takes up 4 indices. While merging eevee_legacy_material_surface_frag_opaque

GPU_material_compile: Attribute "nor" overlap one or more index from another attribute. Note that mat4 takes up 4 indices. While merging eevee_legacy_material_surface_frag_opaque
To fill in more details, the reason why I've put 14 here is that it looks like it's not only the Position attribute that is reserved behind the scenes, but the `nor` Normal attribute as well. When trying to use 15 geometry node attributes: ``` GPU_material_compile: Attribute "nor" overlap one or more index from another attribute. Note that mat4 takes up 4 indices. While merging eevee_legacy_material_surface_vert GPU_material_compile: Attribute "nor" overlap one or more index from another attribute. Note that mat4 takes up 4 indices. While merging eevee_legacy_material_surface_frag_opaque ``` When trying to use 16 attributes: ``` GPU_material_compile: Attribute "pos" overlap one or more index from another attribute. Note that mat4 takes up 4 indices. While merging eevee_legacy_material_surface_vert GPU_material_compile: Attribute "nor" overlap one or more index from another attribute. Note that mat4 takes up 4 indices. While merging eevee_legacy_material_surface_vert GPU_material_compile: Attribute "pos" overlap one or more index from another attribute. Note that mat4 takes up 4 indices. While merging eevee_legacy_material_surface_frag_opaque GPU_material_compile: Attribute "nor" overlap one or more index from another attribute. Note that mat4 takes up 4 indices. While merging eevee_legacy_material_surface_frag_opaque ```

This is correct. The normal used to be optional but isn't nowadays.

So the limit is actually 14 attributes until we do some big refactoring of the attribute fetching.

This is correct. The normal used to be optional but isn't nowadays. So the limit is actually 14 attributes until we do some big refactoring of the attribute fetching.
Aaron Carlisle approved these changes 2024-02-18 01:27:23 +01:00
Aaron Carlisle merged commit e651fcdaac into blender-v4.1-release 2024-02-18 01:27:41 +01:00

I'm late, but I just noticed this. I think this "attributes from Geometry Nodes" is misleading: the limit applies to Geometry attibutes, as in, attributes associated with vertices. IIRC the same limit will apply to ordinary UV maps, vertex colors, etc.

Also, the 8 attribute limit applies to any Object and Instancer attributes, whether they be custom properties, built-in properties, or instance attributes provided by those same geometry nodes.

I think the correct phrasing would be just that: referring to the mode dropdown of the Attribute node:

  • Only 14 attributes of the Geometry type are supported per material, including attributes accessed through dedicated nodes like UV maps.
  • Only 8 attributes of the Object or Instancer type are supported per material.
I'm late, but I just noticed this. I think this "attributes from Geometry Nodes" is misleading: the limit applies to Geometry attibutes, as in, attributes associated with vertices. IIRC the same limit will apply to ordinary UV maps, vertex colors, etc. Also, the 8 attribute limit applies to any Object and Instancer attributes, whether they be custom properties, built-in properties, or instance attributes provided by those same geometry nodes. I think the correct phrasing would be just that: referring to the mode dropdown of the Attribute node: > - Only 14 attributes of the Geometry type are supported per material, including attributes accessed through dedicated nodes like UV maps. > - Only 8 attributes of the Object or Instancer type are supported per material.
Sign in to join this conversation.
No Milestone
No project
No Assignees
5 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-manual#104697
No description provided.