mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-21 05:09:34 -06:00
Run code through the advanced tool 'sed' to remove trailing whitespace.
This commit is contained in:
@ -47,7 +47,7 @@ FramebufferManager::FramebufferManager(int targetWidth, int targetHeight, int ms
|
||||
m_resolvedColorTexture = 0;
|
||||
m_resolvedDepthTexture = 0;
|
||||
m_xfbFramebuffer = 0;
|
||||
|
||||
|
||||
m_targetWidth = targetWidth;
|
||||
m_targetHeight = targetHeight;
|
||||
|
||||
@ -95,7 +95,7 @@ FramebufferManager::FramebufferManager(int targetWidth, int targetHeight, int ms
|
||||
glBindTexture(getFbType(), m_efbDepth);
|
||||
glTexParameteri(getFbType(), GL_TEXTURE_MAX_LEVEL, 0);
|
||||
glTexImage2D(getFbType(), 0, depthType, m_targetWidth, m_targetHeight, 0, GL_DEPTH_COMPONENT, GL_UNSIGNED_INT, NULL);
|
||||
|
||||
|
||||
glBindTexture(getFbType(), m_resolvedColorTexture);
|
||||
glTexParameteri(getFbType(), GL_TEXTURE_MAX_LEVEL, 0);
|
||||
glTexImage2D(getFbType(), 0, GL_RGBA, m_targetWidth, m_targetHeight, 0, GL_RGBA, GL_UNSIGNED_BYTE, NULL);
|
||||
@ -177,14 +177,14 @@ FramebufferManager::FramebufferManager(int targetWidth, int targetHeight, int ms
|
||||
// Create XFB framebuffer; targets will be created elsewhere.
|
||||
|
||||
glGenFramebuffers(1, &m_xfbFramebuffer);
|
||||
|
||||
|
||||
// EFB framebuffer is currently bound, make sure to clear its alpha value to 1.f
|
||||
glViewport(0, 0, m_targetWidth, m_targetHeight);
|
||||
glScissor(0, 0, m_targetWidth, m_targetHeight);
|
||||
glClearColor(0.f, 0.f, 0.f, 1.f);
|
||||
glClearDepthf(1.0f);
|
||||
glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT);
|
||||
|
||||
|
||||
// reinterpret pixel format
|
||||
glGenBuffers(1, &m_pixel_format_vbo);
|
||||
glGenVertexArrays(1, &m_pixel_format_vao);
|
||||
@ -192,7 +192,7 @@ FramebufferManager::FramebufferManager(int targetWidth, int targetHeight, int ms
|
||||
glBindBuffer(GL_ARRAY_BUFFER, m_pixel_format_vbo);
|
||||
glEnableVertexAttribArray(SHADER_POSITION_ATTRIB);
|
||||
glVertexAttribPointer(SHADER_POSITION_ATTRIB, 2, GL_FLOAT, 0, sizeof(GLfloat)*2, NULL);
|
||||
|
||||
|
||||
float vertices[] = {
|
||||
-1.0, -1.0,
|
||||
1.0, -1.0,
|
||||
@ -200,14 +200,14 @@ FramebufferManager::FramebufferManager(int targetWidth, int targetHeight, int ms
|
||||
1.0, 1.0,
|
||||
};
|
||||
glBufferData(GL_ARRAY_BUFFER, sizeof(vertices), vertices, GL_STATIC_DRAW);
|
||||
|
||||
char vs[] =
|
||||
|
||||
char vs[] =
|
||||
"ATTRIN vec2 rawpos;\n"
|
||||
"void main(void) {\n"
|
||||
" gl_Position = vec4(rawpos,0,1);\n"
|
||||
"}\n";
|
||||
|
||||
char ps_rgba6_to_rgb8[] =
|
||||
|
||||
char ps_rgba6_to_rgb8[] =
|
||||
"uniform sampler2DRect samp9;\n"
|
||||
"COLOROUT(ocol0)\n"
|
||||
"void main()\n"
|
||||
@ -220,8 +220,8 @@ FramebufferManager::FramebufferManager(int targetWidth, int targetHeight, int ms
|
||||
" dst8.a = 255;\n"
|
||||
" ocol0 = float4(dst8) / 255.f;\n"
|
||||
"}";
|
||||
|
||||
char ps_rgb8_to_rgba6[] =
|
||||
|
||||
char ps_rgb8_to_rgba6[] =
|
||||
"uniform sampler2DRect samp9;\n"
|
||||
"COLOROUT(ocol0)\n"
|
||||
"void main()\n"
|
||||
@ -234,11 +234,11 @@ FramebufferManager::FramebufferManager(int targetWidth, int targetHeight, int ms
|
||||
" dst6.a = src8.b & 0x3F;\n"
|
||||
" ocol0 = float4(dst6) / 63.f;\n"
|
||||
"}";
|
||||
|
||||
|
||||
if(g_ogl_config.eSupportedGLSLVersion != GLSLES2)
|
||||
{
|
||||
// HACK: This shaders aren't glsles2 compatible as glsles2 don't support bit operations
|
||||
// it could be workaround by floor + frac + tons off additions, but I think it isn't worth
|
||||
// it could be workaround by floor + frac + tons off additions, but I think it isn't worth
|
||||
ProgramShaderCache::CompileShader(m_pixel_format_shaders[0], vs, ps_rgb8_to_rgba6);
|
||||
ProgramShaderCache::CompileShader(m_pixel_format_shaders[1], vs, ps_rgba6_to_rgb8);
|
||||
}
|
||||
@ -273,7 +273,7 @@ FramebufferManager::~FramebufferManager()
|
||||
glDeleteRenderbuffers(2, glObj);
|
||||
m_efbColor = 0;
|
||||
m_efbDepth = 0;
|
||||
|
||||
|
||||
// reinterpret pixel format
|
||||
glDeleteVertexArrays(1, &m_pixel_format_vao);
|
||||
glDeleteBuffers(1, &m_pixel_format_vbo);
|
||||
@ -386,9 +386,9 @@ void FramebufferManager::ReinterpretPixelData(unsigned int convtype)
|
||||
return;
|
||||
}
|
||||
g_renderer->ResetAPIState();
|
||||
|
||||
|
||||
GLuint src_texture = 0;
|
||||
|
||||
|
||||
if(m_msaaSamples > 1)
|
||||
{
|
||||
// MSAA mode, so resolve first
|
||||
@ -402,7 +402,7 @@ void FramebufferManager::ReinterpretPixelData(unsigned int convtype)
|
||||
|
||||
// Return to EFB.
|
||||
glBindFramebuffer(GL_DRAW_FRAMEBUFFER, m_efbFramebuffer);
|
||||
|
||||
|
||||
src_texture = m_resolvedColorTexture;
|
||||
}
|
||||
else
|
||||
@ -411,18 +411,18 @@ void FramebufferManager::ReinterpretPixelData(unsigned int convtype)
|
||||
src_texture = m_efbColor;
|
||||
m_efbColor = m_resolvedColorTexture;
|
||||
m_resolvedColorTexture = src_texture;
|
||||
|
||||
|
||||
// also switch them on fbo
|
||||
glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, getFbType(), m_efbColor, 0);
|
||||
}
|
||||
glViewport(0,0, m_targetWidth, m_targetHeight);
|
||||
glActiveTexture(GL_TEXTURE0 + 9);
|
||||
glBindTexture(getFbType(), src_texture);
|
||||
|
||||
|
||||
m_pixel_format_shaders[convtype ? 1 : 0].Bind();
|
||||
glBindVertexArray(m_pixel_format_vao);
|
||||
glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
|
||||
|
||||
|
||||
g_renderer->RestoreAPIState();
|
||||
}
|
||||
|
||||
@ -452,7 +452,7 @@ void XFBSource::DecodeToTexture(u32 xfbAddr, u32 fbWidth, u32 fbHeight)
|
||||
void XFBSource::CopyEFB(float Gamma)
|
||||
{
|
||||
g_renderer->ResetAPIState();
|
||||
|
||||
|
||||
// Copy EFB data to XFB and restore render target again
|
||||
glBindFramebuffer(GL_READ_FRAMEBUFFER, FramebufferManager::GetEFBFramebuffer());
|
||||
glBindFramebuffer(GL_DRAW_FRAMEBUFFER, FramebufferManager::GetXFBFramebuffer());
|
||||
@ -469,7 +469,7 @@ void XFBSource::CopyEFB(float Gamma)
|
||||
|
||||
// Return to EFB.
|
||||
FramebufferManager::SetFramebuffer(0);
|
||||
|
||||
|
||||
g_renderer->RestoreAPIState();
|
||||
|
||||
}
|
||||
@ -479,7 +479,7 @@ XFBSourceBase* FramebufferManager::CreateXFBSource(unsigned int target_width, un
|
||||
GLuint texture;
|
||||
|
||||
glGenTextures(1, &texture);
|
||||
|
||||
|
||||
glActiveTexture(GL_TEXTURE0 + 9);
|
||||
glBindTexture(GL_TEXTURE_2D, texture);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_LEVEL, 0);
|
||||
|
Reference in New Issue
Block a user