diff options
author | Brian Paul <brianp@vmware.com> | 2017-07-11 13:09:22 -0600 |
---|---|---|
committer | Brian Paul <brianp@vmware.com> | 2017-07-11 16:02:32 -0600 |
commit | 2ce37e06755fdfe09464e5d00a8c2aed74abe30a (patch) | |
tree | 7a7c0ba9c38e18740a641eb80885082800177c3e | |
parent | 056fa0b918ffed32db42432db1c7ee3b06e253a5 (diff) |
blit-scaled-linear: minor shader code improvements
Use vector operations instead of scalar.
Simplify vec2 constructor usage.
Reviewed-by: Neha Bhende<bhenden@vmware.com>
-rw-r--r-- | tests/spec/arb_framebuffer_object/blit-scaled-linear.cpp | 12 |
1 files 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 bdc6cd8fc..37ed7c478 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" |