diff options
| author | 2019-07-12 02:00:04 -0300 | |
|---|---|---|
| committer | 2019-09-05 20:35:51 -0300 | |
| commit | 5edf24b51025fef4d78e5f9d4038267e472b2f55 (patch) | |
| tree | 0feeea93d5741eb2fae7b428ecd78791ac819cbb /src | |
| parent | texture_cache: Pass TIC to texture cache (diff) | |
| download | yuzu-5edf24b51025fef4d78e5f9d4038267e472b2f55.tar.gz yuzu-5edf24b51025fef4d78e5f9d4038267e472b2f55.tar.xz yuzu-5edf24b51025fef4d78e5f9d4038267e472b2f55.zip | |
gl_state: Add support for glBindImageTextures
Diffstat (limited to 'src')
| -rw-r--r-- | src/video_core/renderer_opengl/gl_state.cpp | 21 | ||||
| -rw-r--r-- | src/video_core/renderer_opengl/gl_state.h | 3 |
2 files changed, 24 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 { | |||
| 545 | } | 545 | } |
| 546 | } | 546 | } |
| 547 | 547 | ||
| 548 | void OpenGLState::ApplyImages() const { | ||
| 549 | bool has_delta{}; | ||
| 550 | std::size_t first{}; | ||
| 551 | std::size_t last{}; | ||
| 552 | for (std::size_t i = 0; i < std::size(images); ++i) { | ||
| 553 | if (!UpdateValue(cur_state.images[i], images[i])) { | ||
| 554 | continue; | ||
| 555 | } | ||
| 556 | if (!has_delta) { | ||
| 557 | first = i; | ||
| 558 | has_delta = true; | ||
| 559 | } | ||
| 560 | last = i; | ||
| 561 | } | ||
| 562 | if (has_delta) { | ||
| 563 | glBindImageTextures(static_cast<GLuint>(first), static_cast<GLsizei>(last - first + 1), | ||
| 564 | images.data() + first); | ||
| 565 | } | ||
| 566 | } | ||
| 567 | |||
| 548 | void OpenGLState::Apply() { | 568 | void OpenGLState::Apply() { |
| 549 | MICROPROFILE_SCOPE(OpenGL_State); | 569 | MICROPROFILE_SCOPE(OpenGL_State); |
| 550 | ApplyFramebufferState(); | 570 | ApplyFramebufferState(); |
| @@ -576,6 +596,7 @@ void OpenGLState::Apply() { | |||
| 576 | ApplyLogicOp(); | 596 | ApplyLogicOp(); |
| 577 | ApplyTextures(); | 597 | ApplyTextures(); |
| 578 | ApplySamplers(); | 598 | ApplySamplers(); |
| 599 | ApplyImages(); | ||
| 579 | if (dirty.polygon_offset) { | 600 | if (dirty.polygon_offset) { |
| 580 | ApplyPolygonOffset(); | 601 | ApplyPolygonOffset(); |
| 581 | dirty.polygon_offset = false; | 602 | dirty.polygon_offset = false; |
diff --git a/src/video_core/renderer_opengl/gl_state.h b/src/video_core/renderer_opengl/gl_state.h index fdf9a8a12..9748d60e2 100644 --- a/src/video_core/renderer_opengl/gl_state.h +++ b/src/video_core/renderer_opengl/gl_state.h | |||
| @@ -134,6 +134,8 @@ public: | |||
| 134 | }; | 134 | }; |
| 135 | std::array<TextureUnit, Tegra::Engines::Maxwell3D::Regs::NumTextureSamplers> texture_units; | 135 | std::array<TextureUnit, Tegra::Engines::Maxwell3D::Regs::NumTextureSamplers> texture_units; |
| 136 | 136 | ||
| 137 | std::array<GLuint, Tegra::Engines::Maxwell3D::Regs::NumImages> images{}; | ||
| 138 | |||
| 137 | struct { | 139 | struct { |
| 138 | GLuint read_framebuffer; // GL_READ_FRAMEBUFFER_BINDING | 140 | GLuint read_framebuffer; // GL_READ_FRAMEBUFFER_BINDING |
| 139 | GLuint draw_framebuffer; // GL_DRAW_FRAMEBUFFER_BINDING | 141 | GLuint draw_framebuffer; // GL_DRAW_FRAMEBUFFER_BINDING |
| @@ -220,6 +222,7 @@ public: | |||
| 220 | void ApplyLogicOp() const; | 222 | void ApplyLogicOp() const; |
| 221 | void ApplyTextures() const; | 223 | void ApplyTextures() const; |
| 222 | void ApplySamplers() const; | 224 | void ApplySamplers() const; |
| 225 | void ApplyImages() const; | ||
| 223 | void ApplyDepthClamp() const; | 226 | void ApplyDepthClamp() const; |
| 224 | void ApplyPolygonOffset() const; | 227 | void ApplyPolygonOffset() const; |
| 225 | void ApplyAlphaTest() const; | 228 | void ApplyAlphaTest() const; |