Skip to content

Commit 0d29e52

Browse files
authored
Merge pull request #72 from cortex-command-community/gl3.0
Gl3.0
2 parents 0064800 + 129bb34 commit 0d29e52

File tree

9 files changed

+9039
-2994
lines changed

9 files changed

+9039
-2994
lines changed

Data/Base.rte/Shaders/Blit8.frag

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// Blit8.frag
2-
#version 330 core
2+
#version 130
33

44
in vec2 textureUV;
55

Data/Base.rte/Shaders/Blit8.vert

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
#version 330 core
1+
#version 130
22

3-
layout(location = 0) in vec2 rteVertexPosition;
4-
layout(location = 1) in vec2 rteTexUV;
3+
in vec2 rteVertexPosition;
4+
in vec2 rteTexUV;
55

66
out vec2 textureUV;
77

Data/Base.rte/Shaders/PostProcess.frag

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#version 330 core
1+
#version 130
22

33
in vec2 textureUV;
44

Data/Base.rte/Shaders/PostProcess.vert

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
#version 330 core
1+
#version 130
22

3-
layout(location = 0) in vec2 rteVertexPosition;
4-
layout(location = 1) in vec2 rteTexUV;
3+
in vec2 rteVertexPosition;
4+
in vec2 rteTexUV;
55

66
out vec2 textureUV;
77

Data/Base.rte/Shaders/ScreenBlit.frag

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#version 330 core
1+
#version 130
22

33
in vec2 textureUV;
44

Data/Base.rte/Shaders/ScreenBlit.vert

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
#version 330 core
1+
#version 130
22

3-
layout(location = 0) in vec2 rteVertexPosition;
4-
layout(location = 1) in vec2 rteTexUV;
3+
in vec2 rteVertexPosition;
4+
in vec2 rteTexUV;
55

66
out vec2 textureUV;
77

Source/Managers/WindowMan.cpp

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
#include "glm/gtc/matrix_transform.hpp"
1616
#include "glm/gtc/epsilon.hpp"
1717
#include "tracy/Tracy.hpp"
18-
#include "tracy/TracyOpenGL.hpp"
1918

2019
#ifdef __linux__
2120
#include "Resources/cccp.xpm"
@@ -99,8 +98,8 @@ void WindowMan::Initialize() {
9998

10099
SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1);
101100
SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 3);
102-
SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 3);
103-
SDL_GL_SetAttribute(SDL_GL_CONTEXT_PROFILE_MASK, SDL_GL_CONTEXT_PROFILE_CORE);
101+
SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 0);
102+
SDL_GL_SetAttribute(SDL_GL_CONTEXT_PROFILE_MASK, SDL_GL_CONTEXT_PROFILE_COMPATIBILITY);
104103
CreatePrimaryWindow();
105104
InitializeOpenGL();
106105
CreateBackBufferTexture();
@@ -206,7 +205,6 @@ void WindowMan::InitializeOpenGL() {
206205
GL_CHECK(glGenTextures(1, &m_BackBuffer32Texture));
207206
GL_CHECK(glGenTextures(1, &m_ScreenBufferTexture));
208207
GL_CHECK(glGenFramebuffers(1, &m_ScreenBufferFBO));
209-
TracyGpuContext;
210208
}
211209

212210
void WindowMan::CreateBackBufferTexture() {
@@ -697,7 +695,6 @@ void WindowMan::ClearRenderer(bool clearFrameMan) {
697695
}
698696

699697
void WindowMan::UploadFrame() {
700-
TracyGpuZone("Upload Frame");
701698
GL_CHECK(glDisable(GL_DEPTH_TEST));
702699

703700
GL_CHECK(glBindFramebuffer(GL_FRAMEBUFFER, m_ScreenBufferFBO));
@@ -709,22 +706,19 @@ void WindowMan::UploadFrame() {
709706

710707
GL_CHECK(glEnable(GL_BLEND));
711708
if (m_DrawPostProcessBuffer) {
712-
TracyGpuZone("Upload Post Process Buffer");
713709
GL_CHECK(glBindTexture(GL_TEXTURE_2D, g_PostProcessMan.GetPostProcessColorBuffer()));
714710
GL_CHECK(glActiveTexture(GL_TEXTURE1));
715711
GL_CHECK(glBindTexture(GL_TEXTURE_2D, m_BackBuffer32Texture));
716712
GL_CHECK(glPixelStorei(GL_UNPACK_ALIGNMENT, 4));
717713
GL_CHECK(glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, g_FrameMan.GetBackBuffer32()->w, g_FrameMan.GetBackBuffer32()->h, GL_RGBA, GL_UNSIGNED_BYTE, g_FrameMan.GetBackBuffer32()->line[0]));
718714
} else {
719-
TracyGpuZone("Upload no Post Process Buffer");
720715
GL_CHECK(glBindTexture(GL_TEXTURE_2D, 0));
721716
GL_CHECK(glActiveTexture(GL_TEXTURE1));
722717
GL_CHECK(glBindTexture(GL_TEXTURE_2D, m_BackBuffer32Texture));
723718
GL_CHECK(glPixelStorei(GL_UNPACK_ALIGNMENT, 4));
724719
GL_CHECK(glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, g_FrameMan.GetBackBuffer32()->w, g_FrameMan.GetBackBuffer32()->h, 0, GL_RGBA, GL_UNSIGNED_BYTE, g_FrameMan.GetBackBuffer32()->line[0]));
725720
}
726721
{
727-
TracyGpuZone("Setup Draw Screen");
728722
GL_CHECK(glBindVertexArray(m_ScreenVAO));
729723
m_ScreenBlitShader->Use();
730724
m_ScreenBlitShader->SetInt(m_ScreenBlitShader->GetTextureUniform(), 0);
@@ -739,13 +733,11 @@ void WindowMan::UploadFrame() {
739733
GL_CHECK(glBindTexture(GL_TEXTURE_2D, m_ScreenBufferTexture));
740734
}
741735
if (m_MultiDisplayWindows.empty()) {
742-
TracyGpuZone("Swap Window");
743736
GL_CHECK(glViewport(m_PrimaryWindowViewport->x, m_PrimaryWindowViewport->y, m_PrimaryWindowViewport->w, m_PrimaryWindowViewport->h));
744737
m_ScreenBlitShader->SetMatrix4f(m_ScreenBlitShader->GetTransformUniform(), glm::mat4(1.0f));
745738
GL_CHECK(glDrawArrays(GL_TRIANGLE_STRIP, 0, 4));
746739
SDL_GL_SwapWindow(m_PrimaryWindow.get());
747740
} else {
748-
TracyGpuZone("Swap Multi Display");
749741
for (size_t i = 0; i < m_MultiDisplayWindows.size(); ++i) {
750742
SDL_GL_MakeCurrent(m_MultiDisplayWindows.at(i).get(), m_GLContext.get());
751743
int windowW, windowH;
@@ -757,6 +749,5 @@ void WindowMan::UploadFrame() {
757749
SDL_GL_SwapWindow(m_MultiDisplayWindows.at(i).get());
758750
}
759751
}
760-
TracyGpuCollect;
761752
FrameMark;
762753
}

0 commit comments

Comments
 (0)