From 925586f97bb4a2f13b602d145cdd3aa00c7177fa Mon Sep 17 00:00:00 2001 From: Morph <39850852+Morph1984@users.noreply.github.com> Date: Tue, 13 Jun 2023 00:32:16 -0400 Subject: buffer_cache_base: Specify buffer type in HostBindings Avoid reinterpret-casting from void pointer since the type is already known at compile time. --- src/video_core/renderer_opengl/gl_buffer_cache.cpp | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) (limited to 'src/video_core/renderer_opengl/gl_buffer_cache.cpp') 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, } } -void BufferCacheRuntime::BindVertexBuffers(VideoCommon::HostBindings& bindings) { - for (u32 index = 0; index < bindings.buffers.size(); index++) { - BindVertexBuffer( - bindings.min_index + index, *reinterpret_cast(bindings.buffers[index]), - static_cast(bindings.offsets[index]), static_cast(bindings.sizes[index]), - static_cast(bindings.strides[index])); +void BufferCacheRuntime::BindVertexBuffers(VideoCommon::HostBindings& bindings) { + for (u32 index = 0; index < bindings.buffers.size(); ++index) { + BindVertexBuffer(bindings.min_index + index, *bindings.buffers[index], + static_cast(bindings.offsets[index]), + static_cast(bindings.sizes[index]), + static_cast(bindings.strides[index])); } } @@ -329,10 +329,9 @@ void BufferCacheRuntime::BindTransformFeedbackBuffer(u32 index, Buffer& buffer, static_cast(offset), static_cast(size)); } -void BufferCacheRuntime::BindTransformFeedbackBuffers(VideoCommon::HostBindings& bindings) { - for (u32 index = 0; index < bindings.buffers.size(); index++) { - glBindBufferRange(GL_TRANSFORM_FEEDBACK_BUFFER, index, - reinterpret_cast(bindings.buffers[index])->Handle(), +void BufferCacheRuntime::BindTransformFeedbackBuffers(VideoCommon::HostBindings& bindings) { + for (u32 index = 0; index < bindings.buffers.size(); ++index) { + glBindBufferRange(GL_TRANSFORM_FEEDBACK_BUFFER, index, bindings.buffers[index]->Handle(), static_cast(bindings.offsets[index]), static_cast(bindings.sizes[index])); } -- cgit v1.2.3