diff options
author | Jeroen Bakker <jbakker> | 2020-10-19 09:08:49 +0300 |
---|---|---|
committer | Jeroen Bakker <jeroen@blender.org> | 2020-10-19 09:14:07 +0300 |
commit | 1ceb91d1b3947fda67a70a2eff785a964e625ca2 (patch) | |
tree | 1a5dec250336f208496248cfc84c8f4f97f9aedb /source/blender/draw/intern/draw_cache_extract.h | |
parent | b2e067d98ccf43657404b917b13ad5275f1c96e2 (diff) |
Fix T81167: Texture Painting with Paint mask enabled, (de)selecting faces causes a mess with texture slots
Issue caused by {9582797d4b50} in b2.90. The surface per material used
an index buffer owned by the batch. These index buffers are created at
the same time the surface tris index buffer was created. When a material
per batch buffer was invalidated it used the surface tris index buffer
rendering all materials on all surfaces making the last draw command
render succeed.
This patch stores the surface tris per material in the cache so they can
be reused. There is also no need to use the `saved_elem_ranges` anymore as they are
now part of the cache.
The ugly bit of the implementation is that in `extract_tris_finish` the
MeshBufferCache is retrieved. But as this part was already documented as
a hack and it is something that is only used for final meshes. Other
solutions would impact performance or made the fix not condensed
(passing parameters that shouldn't be used).
Reviewed By: Clément Foucault
Differential Revision: https://developer.blender.org/D9136
Diffstat (limited to 'source/blender/draw/intern/draw_cache_extract.h')
-rw-r--r-- | source/blender/draw/intern/draw_cache_extract.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/source/blender/draw/intern/draw_cache_extract.h b/source/blender/draw/intern/draw_cache_extract.h index 2094da0328b..a0679ba6442 100644 --- a/source/blender/draw/intern/draw_cache_extract.h +++ b/source/blender/draw/intern/draw_cache_extract.h @@ -142,6 +142,8 @@ typedef struct MeshBufferCache { GPUIndexBuf *edituv_points; GPUIndexBuf *edituv_fdots; } ibo; + /* Index buffer per material. These are subranges of `ibo.tris` */ + GPUIndexBuf **tris_per_mat; } MeshBufferCache; typedef enum DRWBatchFlag { |