Skip to content

Commit

Permalink
fix(gl): remove shader version declarations
Browse files Browse the repository at this point in the history
  • Loading branch information
luishfonseca committed Jun 14, 2024
1 parent d1dcc42 commit 857eebe
Show file tree
Hide file tree
Showing 14 changed files with 1 addition and 38 deletions.
5 changes: 1 addition & 4 deletions core/samples/gl/compute/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ int main()

{
auto vs = renderDevice.createShaderStage(gl::Stage::Vertex, R"glsl(
#version 330 core
in vec2 position;
in vec2 uv;
Expand All @@ -35,8 +33,6 @@ int main()
)glsl");

auto ps = renderDevice.createShaderStage(gl::Stage::Pixel, R"glsl(
#version 330 core
in vec2 fragUV;
out vec4 color;
Expand All @@ -48,6 +44,7 @@ int main()
}
)glsl");

// FIXME: createShaderStage will inject #version 330 core, so this will fail.
auto cs = renderDevice.createShaderStage(gl::Stage::Compute, R"glsl(
#version 430 core
Expand Down
2 changes: 0 additions & 2 deletions engine/assets/render/bloom.fs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#version 330 core

#define DOWNSCALE_PASS 0
#define UPSCALE_PASS 1
#define COMBINE_PASS 2
Expand Down
2 changes: 0 additions & 2 deletions engine/assets/render/bloom_extract.fs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#version 330 core

uniform sampler2D inputTexture;

uniform vec3 luminance;
Expand Down
2 changes: 0 additions & 2 deletions engine/assets/render/deferred_shading.fs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#version 330 core

in vec2 fragUv;

uniform sampler2D positionTexture;
Expand Down
2 changes: 0 additions & 2 deletions engine/assets/render/g_buffer_rasterizer.fs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#version 330 core

in vec3 fragPosition;
in vec3 fragNormal;
in vec3 fragAlbedo;
Expand Down
2 changes: 0 additions & 2 deletions engine/assets/render/g_buffer_rasterizer.vs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#version 330 core

in uvec3 position;
in uint normal;
in uint material;
Expand Down
2 changes: 0 additions & 2 deletions engine/assets/render/screen_quad.vs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#version 330 core

in vec4 position;
in vec2 uv;

Expand Down
2 changes: 0 additions & 2 deletions engine/assets/render/ssao_base.fs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#version 330 core

#define MAX_KERNEL_SIZE 64

in vec2 fragUv;
Expand Down
2 changes: 0 additions & 2 deletions engine/assets/render/ssao_blur.fs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#version 330 core

in vec2 fragUv;

uniform sampler2D ssaoTexture;
Expand Down
2 changes: 0 additions & 2 deletions engine/assets/render/tone_mapping.fs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#version 330 core

in vec2 fragUv;

uniform sampler2D hdrTexture;
Expand Down
2 changes: 0 additions & 2 deletions engine/assets/ui/color_rect.fs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#version 330 core

layout(std140) uniform PerElement
{
vec2 xRange;
Expand Down
2 changes: 0 additions & 2 deletions engine/assets/ui/element.vs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#version 330 core

in vec3 position;

layout(std140) uniform PerElement
Expand Down
8 changes: 0 additions & 8 deletions engine/src/gizmos/renderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ CUBOS_REFLECT_IMPL(GizmosRenderer)
void GizmosRenderer::initDrawPipeline()
{
auto vs = renderDevice->createShaderStage(Stage::Vertex, R"(
#version 330 core
in vec3 position;
uniform MVP
Expand All @@ -31,8 +29,6 @@ void GizmosRenderer::initDrawPipeline()
)");

auto ps = renderDevice->createShaderStage(Stage::Pixel, R"(
#version 330 core
out vec4 color;
uniform vec3 objColor;
Expand All @@ -49,8 +45,6 @@ void GizmosRenderer::initDrawPipeline()
void GizmosRenderer::initIdPipeline()
{
auto vs = renderDevice->createShaderStage(Stage::Vertex, R"(
#version 330 core
in vec3 position;
uniform MVP
Expand All @@ -65,8 +59,6 @@ void GizmosRenderer::initIdPipeline()
)");

auto ps = renderDevice->createShaderStage(Stage::Pixel, R"(
#version 330 core
uniform uint gizmo;
out uvec2 idOutput;
Expand Down
4 changes: 0 additions & 4 deletions engine/src/imgui/imgui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -203,8 +203,6 @@ static void createDeviceObjects()

// Setup shader pipeline.
auto vs = rd.createShaderStage(gl::Stage::Vertex, R"glsl(
#version 330 core
layout (location = 0) in vec2 position;
layout (location = 1) in vec2 uv;
layout (location = 2) in vec4 color;
Expand All @@ -225,8 +223,6 @@ void main()
)glsl");

auto ps = rd.createShaderStage(gl::Stage::Pixel, R"glsl(
#version 330 core
uniform sampler2D tex;
in vec2 fragUv;
Expand Down

0 comments on commit 857eebe

Please sign in to comment.