5 changed files with 70 additions and 13 deletions
-
2src/video_core/CMakeLists.txt
-
27src/video_core/renderer_opengl/gl_device.cpp
-
25src/video_core/renderer_opengl/gl_device.h
-
25src/video_core/renderer_opengl/gl_rasterizer.cpp
-
4src/video_core/renderer_opengl/gl_rasterizer.h
@ -0,0 +1,27 @@ |
|||||
|
// Copyright 2019 yuzu Emulator Project
|
||||
|
// Licensed under GPLv2 or any later version
|
||||
|
// Refer to the license.txt file included.
|
||||
|
|
||||
|
#include <cstddef>
|
||||
|
#include <glad/glad.h>
|
||||
|
|
||||
|
#include "video_core/renderer_opengl/gl_device.h"
|
||||
|
|
||||
|
namespace OpenGL { |
||||
|
|
||||
|
namespace { |
||||
|
template <typename T> |
||||
|
T GetInteger(GLenum pname) { |
||||
|
GLint temporary; |
||||
|
glGetIntegerv(pname, &temporary); |
||||
|
return static_cast<T>(temporary); |
||||
|
} |
||||
|
} // Anonymous namespace
|
||||
|
|
||||
|
Device::Device() = default; |
||||
|
|
||||
|
void Device::Initialize() { |
||||
|
uniform_buffer_alignment = GetInteger<std::size_t>(GL_UNIFORM_BUFFER_OFFSET_ALIGNMENT); |
||||
|
} |
||||
|
|
||||
|
} // namespace OpenGL
|
||||
@ -0,0 +1,25 @@ |
|||||
|
// Copyright 2019 yuzu Emulator Project |
||||
|
// Licensed under GPLv2 or any later version |
||||
|
// Refer to the license.txt file included. |
||||
|
|
||||
|
#pragma once |
||||
|
|
||||
|
#include <cstddef> |
||||
|
|
||||
|
namespace OpenGL { |
||||
|
|
||||
|
class Device { |
||||
|
public: |
||||
|
Device(); |
||||
|
|
||||
|
void Initialize(); |
||||
|
|
||||
|
std::size_t GetUniformBufferAlignment() const { |
||||
|
return uniform_buffer_alignment; |
||||
|
} |
||||
|
|
||||
|
private: |
||||
|
std::size_t uniform_buffer_alignment{}; |
||||
|
}; |
||||
|
|
||||
|
} // namespace OpenGL |
||||
Write
Preview
Loading…
Cancel
Save
Reference in new issue