[Piglit] [PATCH] blit-scaled-linear: minor shader code improvements
Neha Bhende
bhenden at vmware.com
Tue Jul 11 20:14:01 UTC 2017
Looks good to me.
Reviewed-by: Neha Bhende<bhenden at vmware.com>
Regards,
Neha
________________________________
From: Brian Paul <brianp at vmware.com>
Sent: Tuesday, July 11, 2017 1:09:29 PM
To: piglit at lists.freedesktop.org
Cc: Charmaine Lee; Neha Bhende; Brian Paul
Subject: [PATCH] blit-scaled-linear: minor shader code improvements
Use vector operations instead of scalar.
Simplify vec2 constructor usage.
---
tests/spec/arb_framebuffer_object/blit-scaled-linear.cpp | 12 +++++-------
1 file changed, 5 insertions(+), 7 deletions(-)
diff --git a/tests/spec/arb_framebuffer_object/blit-scaled-linear.cpp b/tests/spec/arb_framebuffer_object/blit-scaled-linear.cpp
index bdc6cd8..37ed7c4 100644
--- a/tests/spec/arb_framebuffer_object/blit-scaled-linear.cpp
+++ b/tests/spec/arb_framebuffer_object/blit-scaled-linear.cpp
@@ -80,17 +80,15 @@ compile_shader(void)
"{\n"
" vec2 f;\n"
" vec4 c0, c1, c2, c3;\n"
- " vec2 tex_coord = textureCoord - vec2(0.5, 0.5);\n"
+ " vec2 tex_coord = textureCoord - vec2(0.5);\n"
"\n"
" tex_coord.xy = clamp(tex_coord.xy,\n"
- " vec2(0.0, 0.0),\n"
- " vec2 (xmax - 1.0, ymax - 1.0));\n"
+ " vec2(0.0),\n"
+ " vec2(xmax, ymax) - vec2(1.0));\n"
"\n"
- " f.x = fract(tex_coord.x);\n"
- " f.y = fract(tex_coord.y);\n"
+ " f = fract(tex_coord);\n"
"\n"
- " tex_coord.x = tex_coord.x - f.x;\n"
- " tex_coord.y = tex_coord.y - f.y;\n"
+ " tex_coord = tex_coord - f;\n"
"\n"
" c0 = texture2DRect(tex2d, tex_coord.xy + vec2(0, 0));\n"
" c1 = texture2DRect(tex2d, tex_coord.xy + vec2(1, 0));\n"
--
1.9.1
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/piglit/attachments/20170711/6041b631/attachment-0001.html>
More information about the Piglit
mailing list