diff options
| author | 2023-06-13 00:32:16 -0400 | |
|---|---|---|
| committer | 2023-06-13 00:59:42 -0400 | |
| commit | 925586f97bb4a2f13b602d145cdd3aa00c7177fa (patch) | |
| tree | a7bb918bf3dd173a571cb65ed3783c7d45d4be68 /src/video_core/renderer_opengl | |
| parent | Merge pull request #10746 from bunnei/update-android-settings (diff) | |
| download | yuzu-925586f97bb4a2f13b602d145cdd3aa00c7177fa.tar.gz yuzu-925586f97bb4a2f13b602d145cdd3aa00c7177fa.tar.xz yuzu-925586f97bb4a2f13b602d145cdd3aa00c7177fa.zip | |
buffer_cache_base: Specify buffer type in HostBindings
Avoid reinterpret-casting from void pointer since the type is already known at compile time.
Diffstat (limited to 'src/video_core/renderer_opengl')
| -rw-r--r-- | src/video_core/renderer_opengl/gl_buffer_cache.cpp | 19 | ||||
| -rw-r--r-- | src/video_core/renderer_opengl/gl_buffer_cache.h | 6 |
2 files changed, 13 insertions, 12 deletions
diff --git a/src/video_core/renderer_opengl/gl_buffer_cache.cpp b/src/video_core/renderer_opengl/gl_buffer_cache.cpp index 0cc546a3a..38d553d3c 100644 --- a/src/video_core/renderer_opengl/gl_buffer_cache.cpp +++ b/src/video_core/renderer_opengl/gl_buffer_cache.cpp | |||
| @@ -232,12 +232,12 @@ void BufferCacheRuntime::BindVertexBuffer(u32 index, Buffer& buffer, u32 offset, | |||
| 232 | } | 232 | } |
| 233 | } | 233 | } |
| 234 | 234 | ||
| 235 | void BufferCacheRuntime::BindVertexBuffers(VideoCommon::HostBindings& bindings) { | 235 | void BufferCacheRuntime::BindVertexBuffers(VideoCommon::HostBindings<Buffer>& bindings) { |
| 236 | for (u32 index = 0; index < bindings.buffers.size(); index++) { | 236 | for (u32 index = 0; index < bindings.buffers.size(); ++index) { |
| 237 | BindVertexBuffer( | 237 | BindVertexBuffer(bindings.min_index + index, *bindings.buffers[index], |
| 238 | bindings.min_index + index, *reinterpret_cast<Buffer*>(bindings.buffers[index]), | 238 | static_cast<u32>(bindings.offsets[index]), |
| 239 | static_cast<u32>(bindings.offsets[index]), static_cast<u32>(bindings.sizes[index]), | 239 | static_cast<u32>(bindings.sizes[index]), |
| 240 | static_cast<u32>(bindings.strides[index])); | 240 | static_cast<u32>(bindings.strides[index])); |
| 241 | } | 241 | } |
| 242 | } | 242 | } |
| 243 | 243 | ||
| @@ -329,10 +329,9 @@ void BufferCacheRuntime::BindTransformFeedbackBuffer(u32 index, Buffer& buffer, | |||
| 329 | static_cast<GLintptr>(offset), static_cast<GLsizeiptr>(size)); | 329 | static_cast<GLintptr>(offset), static_cast<GLsizeiptr>(size)); |
| 330 | } | 330 | } |
| 331 | 331 | ||
| 332 | void BufferCacheRuntime::BindTransformFeedbackBuffers(VideoCommon::HostBindings& bindings) { | 332 | void BufferCacheRuntime::BindTransformFeedbackBuffers(VideoCommon::HostBindings<Buffer>& bindings) { |
| 333 | for (u32 index = 0; index < bindings.buffers.size(); index++) { | 333 | for (u32 index = 0; index < bindings.buffers.size(); ++index) { |
| 334 | glBindBufferRange(GL_TRANSFORM_FEEDBACK_BUFFER, index, | 334 | glBindBufferRange(GL_TRANSFORM_FEEDBACK_BUFFER, index, bindings.buffers[index]->Handle(), |
| 335 | reinterpret_cast<Buffer*>(bindings.buffers[index])->Handle(), | ||
| 336 | static_cast<GLintptr>(bindings.offsets[index]), | 335 | static_cast<GLintptr>(bindings.offsets[index]), |
| 337 | static_cast<GLsizeiptr>(bindings.sizes[index])); | 336 | static_cast<GLsizeiptr>(bindings.sizes[index])); |
| 338 | } | 337 | } |
diff --git a/src/video_core/renderer_opengl/gl_buffer_cache.h b/src/video_core/renderer_opengl/gl_buffer_cache.h index e4e000284..41b746f3b 100644 --- a/src/video_core/renderer_opengl/gl_buffer_cache.h +++ b/src/video_core/renderer_opengl/gl_buffer_cache.h | |||
| @@ -87,7 +87,8 @@ public: | |||
| 87 | void BindIndexBuffer(Buffer& buffer, u32 offset, u32 size); | 87 | void BindIndexBuffer(Buffer& buffer, u32 offset, u32 size); |
| 88 | 88 | ||
| 89 | void BindVertexBuffer(u32 index, Buffer& buffer, u32 offset, u32 size, u32 stride); | 89 | void BindVertexBuffer(u32 index, Buffer& buffer, u32 offset, u32 size, u32 stride); |
| 90 | void BindVertexBuffers(VideoCommon::HostBindings& bindings); | 90 | |
| 91 | void BindVertexBuffers(VideoCommon::HostBindings<Buffer>& bindings); | ||
| 91 | 92 | ||
| 92 | void BindUniformBuffer(size_t stage, u32 binding_index, Buffer& buffer, u32 offset, u32 size); | 93 | void BindUniformBuffer(size_t stage, u32 binding_index, Buffer& buffer, u32 offset, u32 size); |
| 93 | 94 | ||
| @@ -100,7 +101,8 @@ public: | |||
| 100 | bool is_written); | 101 | bool is_written); |
| 101 | 102 | ||
| 102 | void BindTransformFeedbackBuffer(u32 index, Buffer& buffer, u32 offset, u32 size); | 103 | void BindTransformFeedbackBuffer(u32 index, Buffer& buffer, u32 offset, u32 size); |
| 103 | void BindTransformFeedbackBuffers(VideoCommon::HostBindings& bindings); | 104 | |
| 105 | void BindTransformFeedbackBuffers(VideoCommon::HostBindings<Buffer>& bindings); | ||
| 104 | 106 | ||
| 105 | void BindTextureBuffer(Buffer& buffer, u32 offset, u32 size, | 107 | void BindTextureBuffer(Buffer& buffer, u32 offset, u32 size, |
| 106 | VideoCore::Surface::PixelFormat format); | 108 | VideoCore::Surface::PixelFormat format); |