From 99b110cc9908503094097d902ce6b7bec5989343 Mon Sep 17 00:00:00 2001 From: Vincent Lejeune Date: Fri, 29 Aug 2014 01:26:27 +0200 Subject: [PATCH] Use uvec2 instead of sampler2D --- data/shaders/instanced_shadow.geom | 4 ++-- data/shaders/instanced_shadowref.frag | 4 ++-- data/shaders/instanciedgrassshadow.vert | 6 +++--- data/shaders/instanciedshadow.vert | 6 +++--- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/data/shaders/instanced_shadow.geom b/data/shaders/instanced_shadow.geom index 1ecc55a46..a1a851e65 100644 --- a/data/shaders/instanced_shadow.geom +++ b/data/shaders/instanced_shadow.geom @@ -2,14 +2,14 @@ layout(triangles) in; layout(triangle_strip, max_vertices=3) out; #ifdef GL_ARB_bindless_texture -flat in sampler2D hdle[3]; +flat in uvec2 hdle[3]; #endif in vec2 tc[3]; in int layerId[3]; out vec2 uv; #ifdef GL_ARB_bindless_texture -out flat sampler2D handle; +out flat uvec2 handle; #endif void main(void) diff --git a/data/shaders/instanced_shadowref.frag b/data/shaders/instanced_shadowref.frag index 7ed4ab3ae..0706edb1d 100644 --- a/data/shaders/instanced_shadowref.frag +++ b/data/shaders/instanced_shadowref.frag @@ -3,7 +3,7 @@ uniform sampler2D tex; #endif #ifdef GL_ARB_bindless_texture -flat in sampler2D handle; +flat in uvec2 handle; #endif in vec2 uv; in vec4 color; @@ -12,7 +12,7 @@ out vec4 FragColor; void main(void) { #ifdef GL_ARB_bindless_texture - vec4 col = texture(handle, uv); + vec4 col = texture(sampler2D(handle), uv); #else vec4 col = texture(tex, uv); #endif diff --git a/data/shaders/instanciedgrassshadow.vert b/data/shaders/instanciedgrassshadow.vert index 005bb7198..e78f020eb 100644 --- a/data/shaders/instanciedgrassshadow.vert +++ b/data/shaders/instanciedgrassshadow.vert @@ -10,7 +10,7 @@ layout(location = 7) in vec3 Origin; layout(location = 8) in vec3 Orientation; layout(location = 9) in vec3 Scale; #ifdef GL_ARB_bindless_texture -layout(location = 10) in sampler2D Handle; +layout(location = 10) in uvec2 Handle; #endif #else @@ -26,13 +26,13 @@ in vec3 Scale; #ifdef VSLayer out vec2 uv; #ifdef GL_ARB_bindless_texture -flat out sampler2D handle; +flat out uvec2 handle; #endif #else out vec2 tc; out int layerId; #ifdef GL_ARB_bindless_texture -flat out sampler2D hdle; +flat out uvec2 hdle; #endif #endif diff --git a/data/shaders/instanciedshadow.vert b/data/shaders/instanciedshadow.vert index db027af72..20b9d87f1 100644 --- a/data/shaders/instanciedshadow.vert +++ b/data/shaders/instanciedshadow.vert @@ -8,7 +8,7 @@ layout(location = 7) in vec3 Origin; layout(location = 8) in vec3 Orientation; layout(location = 9) in vec3 Scale; #ifdef GL_ARB_bindless_texture -layout(location = 10) in sampler2D Handle; +layout(location = 10) in uvec2 Handle; #endif #else @@ -23,13 +23,13 @@ in vec3 Scale; #ifdef VSLayer out vec2 uv; #ifdef GL_ARB_bindless_texture -flat out sampler2D handle; +flat out uvec2 handle; #endif #else out vec2 tc; out int layerId; #ifdef GL_ARB_bindless_texture -flat out sampler2D hdle; +flat out uvec2 hdle; #endif #endif