diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2020-09-08 01:10:37 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2020-09-08 05:15:50 +0300 |
commit | 77f60a09310dad0cb41e2e2ec4a71f9bdb762e67 (patch) | |
tree | 4f01eefdae310450525712f955d03e7329eec07a /source/blender/gpu/intern | |
parent | f23400490e236ebbb01e6d2abfae6d8041aac2b1 (diff) |
GPUState: Encapsulate glFlush and glFinish inside the GLContext
Part of the Vulkan task T68990
Isolate the few remaining gl functions.
Diffstat (limited to 'source/blender/gpu/intern')
-rw-r--r-- | source/blender/gpu/intern/gpu_context_private.hh | 6 | ||||
-rw-r--r-- | source/blender/gpu/intern/gpu_state.cc | 4 |
2 files changed, 8 insertions, 2 deletions
diff --git a/source/blender/gpu/intern/gpu_context_private.hh b/source/blender/gpu/intern/gpu_context_private.hh index 3d92b4eb587..5344cc6fb87 100644 --- a/source/blender/gpu/intern/gpu_context_private.hh +++ b/source/blender/gpu/intern/gpu_context_private.hh @@ -76,6 +76,12 @@ struct GPUContext { virtual void activate(void) = 0; virtual void deactivate(void) = 0; + + /* Will push all pending commands to the GPU. */ + virtual void flush(void) = 0; + /* Will wait until the GPU has finished executing all command. */ + virtual void finish(void) = 0; + virtual void memory_statistics_get(int *total_mem, int *free_mem) = 0; bool is_active_on_thread(void); diff --git a/source/blender/gpu/intern/gpu_state.cc b/source/blender/gpu/intern/gpu_state.cc index 90c6efad2e8..a88dc1beb00 100644 --- a/source/blender/gpu/intern/gpu_state.cc +++ b/source/blender/gpu/intern/gpu_state.cc @@ -295,12 +295,12 @@ bool GPU_mipmap_enabled(void) void GPU_flush(void) { - glFlush(); + GPU_context_active_get()->flush(); } void GPU_finish(void) { - glFinish(); + GPU_context_active_get()->finish(); } void GPU_unpack_row_length_set(uint len) |