Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClément Foucault <foucault.clem@gmail.com>2022-02-04 21:46:40 +0300
committerClément Foucault <foucault.clem@gmail.com>2022-02-04 22:21:41 +0300
commit03fbb3de2436d805766db9371ed17963348fce17 (patch)
tree19eedf87ba949835cc43e6dd4aaee3e9b0070baa /source/blender/gpu
parent66e9ee1a2f3daef4030b2b7d44fd6bea592e8b78 (diff)
GPUState: Add more barrier types
This will be useful when compute shader will be used more. Refer to the opengl documentation for their meaning. https://www.khronos.org/registry/OpenGL-Refpages/gl4/html/glMemoryBarrier.xhtml
Diffstat (limited to 'source/blender/gpu')
-rw-r--r--source/blender/gpu/GPU_state.h13
-rw-r--r--source/blender/gpu/opengl/gl_state.hh13
2 files changed, 19 insertions, 7 deletions
diff --git a/source/blender/gpu/GPU_state.h b/source/blender/gpu/GPU_state.h
index 22cd7eab927..bd52b8321bb 100644
--- a/source/blender/gpu/GPU_state.h
+++ b/source/blender/gpu/GPU_state.h
@@ -37,11 +37,14 @@ ENUM_OPERATORS(eGPUWriteMask, GPU_WRITE_COLOR)
typedef enum eGPUBarrier {
GPU_BARRIER_NONE = 0,
- GPU_BARRIER_SHADER_IMAGE_ACCESS = (1 << 0),
- GPU_BARRIER_TEXTURE_FETCH = (1 << 1),
- GPU_BARRIER_SHADER_STORAGE = (1 << 2),
- GPU_BARRIER_VERTEX_ATTRIB_ARRAY = (1 << 3),
- GPU_BARRIER_ELEMENT_ARRAY = (1 << 4),
+ GPU_BARRIER_COMMAND = (1 << 0),
+ GPU_BARRIER_FRAMEBUFFER = (1 << 1),
+ GPU_BARRIER_SHADER_IMAGE_ACCESS = (1 << 2),
+ GPU_BARRIER_SHADER_STORAGE = (1 << 3),
+ GPU_BARRIER_TEXTURE_FETCH = (1 << 4),
+ GPU_BARRIER_TEXTURE_UPDATE = (1 << 5),
+ GPU_BARRIER_VERTEX_ATTRIB_ARRAY = (1 << 6),
+ GPU_BARRIER_ELEMENT_ARRAY = (1 << 7),
} eGPUBarrier;
ENUM_OPERATORS(eGPUBarrier, GPU_BARRIER_ELEMENT_ARRAY)
diff --git a/source/blender/gpu/opengl/gl_state.hh b/source/blender/gpu/opengl/gl_state.hh
index 83ff3ffc9e9..5985f1583f2 100644
--- a/source/blender/gpu/opengl/gl_state.hh
+++ b/source/blender/gpu/opengl/gl_state.hh
@@ -124,11 +124,20 @@ static inline GLbitfield to_gl(eGPUBarrier barrier_bits)
if (barrier_bits & GPU_BARRIER_SHADER_IMAGE_ACCESS) {
barrier |= GL_SHADER_IMAGE_ACCESS_BARRIER_BIT;
}
+ if (barrier_bits & GPU_BARRIER_SHADER_STORAGE) {
+ barrier |= GL_SHADER_STORAGE_BARRIER_BIT;
+ }
if (barrier_bits & GPU_BARRIER_TEXTURE_FETCH) {
barrier |= GL_TEXTURE_FETCH_BARRIER_BIT;
}
- if (barrier_bits & GPU_BARRIER_SHADER_STORAGE) {
- barrier |= GL_SHADER_STORAGE_BARRIER_BIT;
+ if (barrier_bits & GPU_BARRIER_TEXTURE_UPDATE) {
+ barrier |= GL_TEXTURE_UPDATE_BARRIER_BIT;
+ }
+ if (barrier_bits & GPU_BARRIER_COMMAND) {
+ barrier |= GL_COMMAND_BARRIER_BIT;
+ }
+ if (barrier_bits & GPU_BARRIER_FRAMEBUFFER) {
+ barrier |= GL_FRAMEBUFFER_BARRIER_BIT;
}
if (barrier_bits & GPU_BARRIER_VERTEX_ATTRIB_ARRAY) {
barrier |= GL_VERTEX_ATTRIB_ARRAY_BARRIER_BIT;