summaryrefslogtreecommitdiff
path: root/drivers/gles3/shaders/canvas.glsl
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gles3/shaders/canvas.glsl')
-rw-r--r--drivers/gles3/shaders/canvas.glsl16
1 files changed, 8 insertions, 8 deletions
diff --git a/drivers/gles3/shaders/canvas.glsl b/drivers/gles3/shaders/canvas.glsl
index 1c950c82d9..37187a86cc 100644
--- a/drivers/gles3/shaders/canvas.glsl
+++ b/drivers/gles3/shaders/canvas.glsl
@@ -116,9 +116,12 @@ void main() {
#ifdef USE_TEXTURE_RECT
-
- uv_interp = src_rect.xy + abs(src_rect.zw) * vertex;
- highp vec4 outvec = vec4(dst_rect.xy + dst_rect.zw * mix(vertex,vec2(1.0,1.0)-vertex,lessThan(src_rect.zw,vec2(0.0,0.0))),0.0,1.0);
+ if (dst_rect.z < 0) { // Transpose is encoded as negative dst_rect.z
+ uv_interp = src_rect.xy + abs(src_rect.zw) * vertex.yx;
+ } else {
+ uv_interp = src_rect.xy + abs(src_rect.zw) * vertex;
+ }
+ highp vec4 outvec = vec4(dst_rect.xy + abs(dst_rect.zw) * mix(vertex,vec2(1.0,1.0)-vertex,lessThan(src_rect.zw,vec2(0.0,0.0))),0.0,1.0);
#else
uv_interp = uv_attrib;
@@ -532,11 +535,11 @@ FRAGMENT_SHADER_CODE
#ifdef USE_RGBA_SHADOWS
-#define SHADOW_DEPTH(m_tex,m_uv) dot(texture2D((m_tex),(m_uv)),vec4(1.0 / (256.0 * 256.0 * 256.0),1.0 / (256.0 * 256.0),1.0 / 256.0,1) )
+#define SHADOW_DEPTH(m_tex,m_uv) dot(texture((m_tex),(m_uv)),vec4(1.0 / (256.0 * 256.0 * 256.0),1.0 / (256.0 * 256.0),1.0 / 256.0,1) )
#else
-#define SHADOW_DEPTH(m_tex,m_uv) (texture2D((m_tex),(m_uv)).r)
+#define SHADOW_DEPTH(m_tex,m_uv) (texture((m_tex),(m_uv)).r)
#endif
@@ -572,13 +575,11 @@ FRAGMENT_SHADER_CODE
#ifdef SHADOW_FILTER_PCF5
- SHADOW_TEST(su+shadowpixel_size*3.0);
SHADOW_TEST(su+shadowpixel_size*2.0);
SHADOW_TEST(su+shadowpixel_size);
SHADOW_TEST(su);
SHADOW_TEST(su-shadowpixel_size);
SHADOW_TEST(su-shadowpixel_size*2.0);
- SHADOW_TEST(su-shadowpixel_size*3.0);
shadow_attenuation/=5.0;
#endif
@@ -635,4 +636,3 @@ FRAGMENT_SHADER_CODE
frag_color = color;
}
-