mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2026-02-01 12:03:15 +00:00
Yellow squiggly lines begone! Done automatically on .cpp files through `run-clang-tidy`, with manual corrections to the mistakes. If an import is directly used, but is technically unnecessary since it's recursively imported by something else, it is *not* removed. The tool doesn't touch .h files, so I did some of them by hand while fixing errors due to old recursive imports. Not everything is removed, but the cleanup should be substantial enough. Because this done on Linux, code that isn't used on it is mostly untouched. (Hopefully no open PR is depending on these imports...)
59 lines
1.8 KiB
C++
59 lines
1.8 KiB
C++
// Copyright 2008 Dolphin Emulator Project
|
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
|
|
|
#pragma once
|
|
|
|
#include <array>
|
|
#include <memory>
|
|
|
|
#include "Common/CommonTypes.h"
|
|
#include "Common/GL/GLExtensions/GLExtensions.h"
|
|
#include "VideoCommon/NativeVertexFormat.h"
|
|
#include "VideoCommon/VertexManagerBase.h"
|
|
|
|
namespace OGL
|
|
{
|
|
class StreamBuffer;
|
|
class GLVertexFormat : public NativeVertexFormat
|
|
{
|
|
public:
|
|
GLVertexFormat(const PortableVertexDeclaration& vtx_decl);
|
|
~GLVertexFormat() override;
|
|
|
|
GLuint VAO;
|
|
};
|
|
|
|
// Handles the OpenGL details of drawing lots of vertices quickly.
|
|
// Other functionality is moving out.
|
|
class VertexManager final : public VertexManagerBase
|
|
{
|
|
public:
|
|
VertexManager();
|
|
~VertexManager() override;
|
|
|
|
bool Initialize() override;
|
|
|
|
void UploadUtilityUniforms(const void* uniforms, u32 uniforms_size) override;
|
|
bool UploadTexelBuffer(const void* data, u32 data_size, TexelBufferFormat format,
|
|
u32* out_offset) override;
|
|
bool UploadTexelBuffer(const void* data, u32 data_size, TexelBufferFormat format, u32* out_offset,
|
|
const void* palette_data, u32 palette_size,
|
|
TexelBufferFormat palette_format, u32* out_palette_offset) override;
|
|
|
|
GLuint GetVertexBufferHandle() const;
|
|
GLuint GetIndexBufferHandle() const;
|
|
|
|
protected:
|
|
void ResetBuffer(u32 vertex_stride) override;
|
|
void CommitBuffer(u32 num_vertices, u32 vertex_stride, u32 num_indices, u32* out_base_vertex,
|
|
u32* out_base_index) override;
|
|
void UploadUniforms() override;
|
|
|
|
private:
|
|
std::unique_ptr<StreamBuffer> m_vertex_buffer;
|
|
std::unique_ptr<StreamBuffer> m_index_buffer;
|
|
std::unique_ptr<StreamBuffer> m_texel_buffer;
|
|
std::array<GLuint, NUM_TEXEL_BUFFER_FORMATS> m_texel_buffer_views{};
|
|
};
|
|
} // namespace OGL
|