Merge pull request #1253 from lioncash/explicit
video_core/gl_buffer_cache: Minor tidying changes
This commit is contained in:
commit
9b50dca2bb
|
@ -2,8 +2,10 @@
|
||||||
// Licensed under GPLv2 or any later version
|
// Licensed under GPLv2 or any later version
|
||||||
// Refer to the license.txt file included.
|
// Refer to the license.txt file included.
|
||||||
|
|
||||||
|
#include <cstring>
|
||||||
|
#include <memory>
|
||||||
|
|
||||||
#include "common/alignment.h"
|
#include "common/alignment.h"
|
||||||
#include "common/assert.h"
|
|
||||||
#include "core/core.h"
|
#include "core/core.h"
|
||||||
#include "core/memory.h"
|
#include "core/memory.h"
|
||||||
#include "video_core/renderer_opengl/gl_buffer_cache.h"
|
#include "video_core/renderer_opengl/gl_buffer_cache.h"
|
||||||
|
@ -75,7 +77,7 @@ void OGLBufferCache::Unmap() {
|
||||||
stream_buffer.Unmap(buffer_offset - buffer_offset_base);
|
stream_buffer.Unmap(buffer_offset - buffer_offset_base);
|
||||||
}
|
}
|
||||||
|
|
||||||
GLuint OGLBufferCache::GetHandle() {
|
GLuint OGLBufferCache::GetHandle() const {
|
||||||
return stream_buffer.GetHandle();
|
return stream_buffer.GetHandle();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -4,8 +4,8 @@
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#include <cstddef>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include <unordered_map>
|
|
||||||
|
|
||||||
#include "common/common_types.h"
|
#include "common/common_types.h"
|
||||||
#include "video_core/rasterizer_cache.h"
|
#include "video_core/rasterizer_cache.h"
|
||||||
|
@ -31,7 +31,7 @@ struct CachedBufferEntry final {
|
||||||
|
|
||||||
class OGLBufferCache final : public RasterizerCache<std::shared_ptr<CachedBufferEntry>> {
|
class OGLBufferCache final : public RasterizerCache<std::shared_ptr<CachedBufferEntry>> {
|
||||||
public:
|
public:
|
||||||
OGLBufferCache(size_t size);
|
explicit OGLBufferCache(size_t size);
|
||||||
|
|
||||||
GLintptr UploadMemory(Tegra::GPUVAddr gpu_addr, size_t size, size_t alignment = 4,
|
GLintptr UploadMemory(Tegra::GPUVAddr gpu_addr, size_t size, size_t alignment = 4,
|
||||||
bool cache = true);
|
bool cache = true);
|
||||||
|
@ -41,7 +41,7 @@ public:
|
||||||
void Map(size_t max_size);
|
void Map(size_t max_size);
|
||||||
void Unmap();
|
void Unmap();
|
||||||
|
|
||||||
GLuint GetHandle();
|
GLuint GetHandle() const;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void AlignBuffer(size_t alignment);
|
void AlignBuffer(size_t alignment);
|
||||||
|
@ -49,9 +49,9 @@ protected:
|
||||||
private:
|
private:
|
||||||
OGLStreamBuffer stream_buffer;
|
OGLStreamBuffer stream_buffer;
|
||||||
|
|
||||||
u8* buffer_ptr;
|
u8* buffer_ptr = nullptr;
|
||||||
GLintptr buffer_offset;
|
GLintptr buffer_offset = 0;
|
||||||
GLintptr buffer_offset_base;
|
GLintptr buffer_offset_base = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace OpenGL
|
} // namespace OpenGL
|
||||||
|
|
Reference in New Issue