Page MenuHome

GPU: add memory barriers for vertex and index buffers
ClosedPublic

Authored by Kévin Dietrich (kevindietrich) on Dec 16 2021, 4:23 PM.

Details

Summary

This adds memory barriers to use with GPU_memory_barrier to ensure that
writes to a vertex or index buffer issued before the barrier are
completed after it, so they can be safely read later by another shader.

GPU_BARRIER_VERTEX_ATTRIB_ARRAY should be used for vertex buffers (GPUVertBuf),
and GPU_BARRIER_ELEMENT_ARRAY should be used for index buffers (GPUIndexBuf).

Diff Detail

Repository
rB Blender

Event Timeline

Kévin Dietrich (kevindietrich) requested review of this revision.Dec 16 2021, 4:23 PM
Kévin Dietrich (kevindietrich) created this revision.
Clément Foucault (fclem) requested changes to this revision.Dec 18 2021, 12:36 AM
Clément Foucault (fclem) added inline comments.
source/blender/gpu/GPU_state.h
47

You need to edit the max enum too here.

This revision now requires changes to proceed.Dec 18 2021, 12:36 AM

Fix max enum value used for default enum operators

This revision is now accepted and ready to land.Dec 18 2021, 12:50 AM