diff options
| author | ReinUsesLisp <reinuseslisp@airmail.cc> | 2019-07-12 02:00:04 -0300 |
|---|---|---|
| committer | ReinUsesLisp <reinuseslisp@airmail.cc> | 2019-09-05 20:35:51 -0300 |
| commit | 5edf24b51025fef4d78e5f9d4038267e472b2f55 (patch) | |
| tree | 0feeea93d5741eb2fae7b428ecd78791ac819cbb /src/video_core/renderer_opengl/gl_state.cpp | |
| parent | 2424eefad20b018bed72a0427cdeeabb08bea7b2 (diff) | |
gl_state: Add support for glBindImageTextures
Diffstat (limited to 'src/video_core/renderer_opengl/gl_state.cpp')
| -rw-r--r-- | src/video_core/renderer_opengl/gl_state.cpp | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/video_core/renderer_opengl/gl_state.cpp b/src/video_core/renderer_opengl/gl_state.cpp index f4777d0b0..a38f88182 100644 --- a/src/video_core/renderer_opengl/gl_state.cpp +++ b/src/video_core/renderer_opengl/gl_state.cpp @@ -545,6 +545,26 @@ void OpenGLState::ApplySamplers() const { } } +void OpenGLState::ApplyImages() const { + bool has_delta{}; + std::size_t first{}; + std::size_t last{}; + for (std::size_t i = 0; i < std::size(images); ++i) { + if (!UpdateValue(cur_state.images[i], images[i])) { + continue; + } + if (!has_delta) { + first = i; + has_delta = true; + } + last = i; + } + if (has_delta) { + glBindImageTextures(static_cast<GLuint>(first), static_cast<GLsizei>(last - first + 1), + images.data() + first); + } +} + void OpenGLState::Apply() { MICROPROFILE_SCOPE(OpenGL_State); ApplyFramebufferState(); @@ -576,6 +596,7 @@ void OpenGLState::Apply() { ApplyLogicOp(); ApplyTextures(); ApplySamplers(); + ApplyImages(); if (dirty.polygon_offset) { ApplyPolygonOffset(); dirty.polygon_offset = false; |
