Manually tweak source formatting and then re-run clang-format
This commit is contained in:
parent
784b96d87f
commit
396a8d91a4
169 changed files with 805 additions and 809 deletions
|
@ -136,8 +136,7 @@ RasterizerOpenGL::RasterizerOpenGL() : shader_dirty(true) {
|
|||
SyncDepthWriteMask();
|
||||
}
|
||||
|
||||
RasterizerOpenGL::~RasterizerOpenGL() {
|
||||
}
|
||||
RasterizerOpenGL::~RasterizerOpenGL() {}
|
||||
|
||||
/**
|
||||
* This is a helper function to resolve an issue with opposite quaternions being interpolated by
|
||||
|
@ -1156,9 +1155,10 @@ void RasterizerOpenGL::SyncBlendColor() {
|
|||
|
||||
void RasterizerOpenGL::SyncFogColor() {
|
||||
const auto& regs = Pica::g_state.regs;
|
||||
uniform_block_data.data.fog_color = {regs.fog_color.r.Value() / 255.0f,
|
||||
regs.fog_color.g.Value() / 255.0f,
|
||||
regs.fog_color.b.Value() / 255.0f};
|
||||
uniform_block_data.data.fog_color = {
|
||||
regs.fog_color.r.Value() / 255.0f, regs.fog_color.g.Value() / 255.0f,
|
||||
regs.fog_color.b.Value() / 255.0f,
|
||||
};
|
||||
uniform_block_data.dirty = true;
|
||||
}
|
||||
|
||||
|
|
|
@ -41,12 +41,9 @@ struct ScreenInfo;
|
|||
* two separate shaders sharing the same key.
|
||||
*
|
||||
* We use a union because "implicitly-defined copy/move constructor for a union X copies the object
|
||||
* representation of X."
|
||||
* and "implicitly-defined copy assignment operator for a union X copies the object representation
|
||||
* (3.9) of X."
|
||||
* = Bytewise copy instead of memberwise copy.
|
||||
* This is important because the padding bytes are included in the hash and comparison between
|
||||
* objects.
|
||||
* representation of X." and "implicitly-defined copy assignment operator for a union X copies the
|
||||
* object representation (3.9) of X." = Bytewise copy instead of memberwise copy. This is important
|
||||
* because the padding bytes are included in the hash and comparison between objects.
|
||||
*/
|
||||
union PicaShaderConfig {
|
||||
|
||||
|
|
|
@ -522,8 +522,8 @@ CachedSurface* RasterizerCacheOpenGL::GetSurfaceRect(const CachedSurface& params
|
|||
return GetSurface(params, match_res_scale, load_if_create);
|
||||
}
|
||||
|
||||
CachedSurface*
|
||||
RasterizerCacheOpenGL::GetTextureSurface(const Pica::Regs::FullTextureConfig& config) {
|
||||
CachedSurface* RasterizerCacheOpenGL::GetTextureSurface(
|
||||
const Pica::Regs::FullTextureConfig& config) {
|
||||
Pica::DebugUtils::TextureInfo info =
|
||||
Pica::DebugUtils::TextureInfo::FromPicaRegister(config.config, config.format);
|
||||
|
||||
|
|
|
@ -212,8 +212,8 @@ public:
|
|||
|
||||
/// Gets the color and depth surfaces and rect (resolution scaled) based on the framebuffer
|
||||
/// configuration
|
||||
std::tuple<CachedSurface*, CachedSurface*, MathUtil::Rectangle<int>>
|
||||
GetFramebufferSurfaces(const Pica::Regs::FramebufferConfig& config);
|
||||
std::tuple<CachedSurface*, CachedSurface*, MathUtil::Rectangle<int>> GetFramebufferSurfaces(
|
||||
const Pica::Regs::FramebufferConfig& config);
|
||||
|
||||
/// Attempt to get a surface that exactly matches the fill region and format
|
||||
CachedSurface* TryGetFillSurface(const GPU::Regs::MemoryFillConfig& config);
|
||||
|
|
|
@ -293,9 +293,7 @@ static void AppendAlphaTestCondition(std::string& out, Regs::CompareFunc func) {
|
|||
case CompareFunc::LessThanOrEqual:
|
||||
case CompareFunc::GreaterThan:
|
||||
case CompareFunc::GreaterThanOrEqual: {
|
||||
static const char* op[] = {
|
||||
"!=", "==", ">=", ">", "<=", "<",
|
||||
};
|
||||
static const char* op[] = {"!=", "==", ">=", ">", "<=", "<"};
|
||||
unsigned index = (unsigned)func - (unsigned)CompareFunc::Equal;
|
||||
out += "int(last_tex_env_out.a * 255.0f) " + std::string(op[index]) + " alphatest_ref";
|
||||
break;
|
||||
|
|
|
@ -26,7 +26,7 @@ namespace PicaToGL {
|
|||
inline GLenum TextureFilterMode(Pica::Regs::TextureConfig::TextureFilter mode) {
|
||||
static const GLenum filter_mode_table[] = {
|
||||
GL_NEAREST, // TextureFilter::Nearest
|
||||
GL_LINEAR // TextureFilter::Linear
|
||||
GL_LINEAR, // TextureFilter::Linear
|
||||
};
|
||||
|
||||
// Range check table for input
|
||||
|
@ -55,7 +55,7 @@ inline GLenum WrapMode(Pica::Regs::TextureConfig::WrapMode mode) {
|
|||
GL_CLAMP_TO_EDGE, // WrapMode::ClampToEdge
|
||||
GL_CLAMP_TO_BORDER, // WrapMode::ClampToBorder
|
||||
GL_REPEAT, // WrapMode::Repeat
|
||||
GL_MIRRORED_REPEAT // WrapMode::MirroredRepeat
|
||||
GL_MIRRORED_REPEAT, // WrapMode::MirroredRepeat
|
||||
};
|
||||
|
||||
// Range check table for input
|
||||
|
@ -192,7 +192,7 @@ inline GLenum StencilOp(Pica::Regs::StencilAction action) {
|
|||
GL_DECR, // StencilAction::Decrement
|
||||
GL_INVERT, // StencilAction::Invert
|
||||
GL_INCR_WRAP, // StencilAction::IncrementWrap
|
||||
GL_DECR_WRAP // StencilAction::DecrementWrap
|
||||
GL_DECR_WRAP, // StencilAction::DecrementWrap
|
||||
};
|
||||
|
||||
// Range check table for input
|
||||
|
@ -207,12 +207,16 @@ inline GLenum StencilOp(Pica::Regs::StencilAction action) {
|
|||
}
|
||||
|
||||
inline GLvec4 ColorRGBA8(const u32 color) {
|
||||
return {{(color >> 0 & 0xFF) / 255.0f, (color >> 8 & 0xFF) / 255.0f,
|
||||
(color >> 16 & 0xFF) / 255.0f, (color >> 24 & 0xFF) / 255.0f}};
|
||||
return {{
|
||||
(color >> 0 & 0xFF) / 255.0f, (color >> 8 & 0xFF) / 255.0f, (color >> 16 & 0xFF) / 255.0f,
|
||||
(color >> 24 & 0xFF) / 255.0f,
|
||||
}};
|
||||
}
|
||||
|
||||
inline std::array<GLfloat, 3> LightColor(const Pica::Regs::LightColor& color) {
|
||||
return {{color.r / 255.0f, color.g / 255.0f, color.b / 255.0f}};
|
||||
return {{
|
||||
color.r / 255.0f, color.g / 255.0f, color.b / 255.0f,
|
||||
}};
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
|
|
@ -87,15 +87,13 @@ struct ScreenRectVertex {
|
|||
* by a 3x2 matrix.
|
||||
*/
|
||||
static std::array<GLfloat, 3 * 2> MakeOrthographicMatrix(const float width, const float height) {
|
||||
std::array<GLfloat, 3 * 2> matrix;
|
||||
std::array<GLfloat, 3 * 2> matrix; // Laid out in column-major order
|
||||
|
||||
matrix[0] = 2.f / width;
|
||||
matrix[2] = 0.f;
|
||||
matrix[4] = -1.f;
|
||||
matrix[1] = 0.f;
|
||||
matrix[3] = -2.f / height;
|
||||
matrix[5] = 1.f;
|
||||
// clang-format off
|
||||
matrix[0] = 2.f / width; matrix[2] = 0.f; matrix[4] = -1.f;
|
||||
matrix[1] = 0.f; matrix[3] = -2.f / height; matrix[5] = 1.f;
|
||||
// Last matrix row is implicitly assumed to be [0, 0, 1].
|
||||
// clang-format on
|
||||
|
||||
return matrix;
|
||||
}
|
||||
|
@ -107,8 +105,7 @@ RendererOpenGL::RendererOpenGL() {
|
|||
}
|
||||
|
||||
/// RendererOpenGL destructor
|
||||
RendererOpenGL::~RendererOpenGL() {
|
||||
}
|
||||
RendererOpenGL::~RendererOpenGL() {}
|
||||
|
||||
/// Swap buffers (render frame)
|
||||
void RendererOpenGL::SwapBuffers() {
|
||||
|
@ -215,8 +212,7 @@ void RendererOpenGL::LoadFBToScreenInfo(const GPU::Regs::FramebufferConfig& fram
|
|||
|
||||
// Update existing texture
|
||||
// TODO: Test what happens on hardware when you change the framebuffer dimensions so that
|
||||
// they
|
||||
// differ from the LCD resolution.
|
||||
// they differ from the LCD resolution.
|
||||
// TODO: Applications could theoretically crash Citra here by specifying too large
|
||||
// framebuffer sizes. We should make sure that this cannot happen.
|
||||
glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, framebuffer.width, framebuffer.height,
|
||||
|
@ -231,10 +227,8 @@ void RendererOpenGL::LoadFBToScreenInfo(const GPU::Regs::FramebufferConfig& fram
|
|||
}
|
||||
|
||||
/**
|
||||
* Fills active OpenGL texture with the given RGB color.
|
||||
* Since the color is solid, the texture can be 1x1 but will stretch across whatever it's rendered
|
||||
* on.
|
||||
* This has the added benefit of being *really fast*.
|
||||
* Fills active OpenGL texture with the given RGB color. Since the color is solid, the texture can
|
||||
* be 1x1 but will stretch across whatever it's rendered on.
|
||||
*/
|
||||
void RendererOpenGL::LoadColorToActiveGLTexture(u8 color_r, u8 color_g, u8 color_b,
|
||||
const TextureInfo& texture) {
|
||||
|
@ -424,8 +418,7 @@ void RendererOpenGL::DrawScreens() {
|
|||
}
|
||||
|
||||
/// Updates the framerate
|
||||
void RendererOpenGL::UpdateFramerate() {
|
||||
}
|
||||
void RendererOpenGL::UpdateFramerate() {}
|
||||
|
||||
/**
|
||||
* Set the emulator window to use for renderer
|
||||
|
@ -513,5 +506,4 @@ bool RendererOpenGL::Init() {
|
|||
}
|
||||
|
||||
/// Shutdown the renderer
|
||||
void RendererOpenGL::ShutDown() {
|
||||
}
|
||||
void RendererOpenGL::ShutDown() {}
|
||||
|
|
|
@ -81,11 +81,14 @@ private:
|
|||
OGLVertexArray vertex_array;
|
||||
OGLBuffer vertex_buffer;
|
||||
OGLShader shader;
|
||||
std::array<ScreenInfo, 2>
|
||||
screen_infos; ///< Display information for top and bottom screens respectively
|
||||
|
||||
/// Display information for top and bottom screens respectively
|
||||
std::array<ScreenInfo, 2> screen_infos;
|
||||
|
||||
// Shader uniform location indices
|
||||
GLuint uniform_modelview_matrix;
|
||||
GLuint uniform_color_texture;
|
||||
|
||||
// Shader attribute input indices
|
||||
GLuint attrib_position;
|
||||
GLuint attrib_tex_coord;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue