Bind some fixed texture arrays only once

This commit is contained in:
2023-03-23 14:46:51 +00:00
parent ecd7a0fae0
commit 05d1d3d1eb
7 changed files with 15 additions and 16 deletions
+2 -2
View File
@@ -5,8 +5,8 @@ layout (location=0) out vec4 fCol;
layout (location=1) out vec4 fPos;
layout (location=2) out vec4 normal;
//layout (binding=0) uniform sampler2DArray tilesetSampler;
layout (binding=1) uniform sampler2DArray normalSampler;
layout (binding=2) uniform sampler2DArray diffuseSampler;
layout (binding=40) uniform sampler2DArray diffuseSampler;
layout (binding=41) uniform sampler2DArray normalSampler;
vec2 rotateV2 (float a, vec2 v)
{
return vec2(v.x*cos(a) - v.y*sin(a), v.x*sin(a) + v.y*cos(a));
+1 -1
View File
@@ -5,7 +5,7 @@ const vec2 winSize = vec2 (300.0,300.0);
// note that the above opening bracket should be the first in this file
// this is so that the window size can be extracted and the shader recompiled on
// the fly
uniform sampler2D screenTexture;
layout (binding = 0) uniform sampler2D screenTexture;
const float hOff = 3 / winSize.x;
const float vOff = 3 / winSize.y;
//const vec2 off[9] = vec2[]
+2 -2
View File
@@ -8,8 +8,8 @@ in vec4 gPos;
in vec4 gNorm;
in vec4 gColor;
in float gAng;
layout (binding=1) uniform sampler2DArray normalSampler;
layout (binding=2) uniform sampler2DArray diffuseSampler;
layout (binding=40) uniform sampler2DArray diffuseSampler;
layout (binding=41) uniform sampler2DArray normalSampler;
vec2 rotateV2 (float a, vec2 v)
{
return vec2(v.x*cos(a) - v.y*sin(a), v.x*sin(a) + v.y*cos(a));
+2 -2
View File
@@ -8,8 +8,8 @@ in vec4 gPos;
in vec4 gNorm;
in vec4 gColor;
in float gRot;
layout (binding=1) uniform sampler2DArray normalSampler;
layout (binding=2) uniform sampler2DArray diffuseSampler;
layout (binding=40) uniform sampler2DArray diffuseSampler;
layout (binding=41) uniform sampler2DArray normalSampler;
vec2 rotateV2 (float a, vec2 v)
{
return vec2(v.x*cos(a) - v.y*sin(a), v.x*sin(a) + v.y*cos(a));