Chromium Code Reviews| Index: gpu/command_buffer/service/gles2_cmd_apply_framebuffer_attachment_cmaa_intel.cc |
| diff --git a/gpu/command_buffer/service/gles2_cmd_apply_framebuffer_attachment_cmaa_intel.cc b/gpu/command_buffer/service/gles2_cmd_apply_framebuffer_attachment_cmaa_intel.cc |
| index 851c2bf79db7f7b11c0b02758831c51fc58dd71a..25f3eda2bd49171d5f69aa40655db81f95a10c92 100644 |
| --- a/gpu/command_buffer/service/gles2_cmd_apply_framebuffer_attachment_cmaa_intel.cc |
| +++ b/gpu/command_buffer/service/gles2_cmd_apply_framebuffer_attachment_cmaa_intel.cc |
| @@ -1370,6 +1370,7 @@ const char ApplyFramebufferAttachmentCMAAINTELResourceManager::cmaa_frag_s2_[] = |
| void CombineEdges() { |
| ivec3 screenPosIBase = ivec3(ivec2(gl_FragCoord.xy) * 2, 0); |
| vec3 screenPosBase = vec3(screenPosIBase); |
| + uvec2 notBottomLeft = uvec2(screenPosIBase.xy != ivec2(0, 0)); |
|
piman
2016/06/28 21:08:09
"screenPosIBase.xy != ivec2(0, 0)" is a boolean sc
dshwang
2016/06/29 10:35:56
sorry for obfuscated code, because I want to avoid
dshwang
2016/06/29 13:54:36
I actually wanted component wise comparison; notEq
|
| uint packedEdgesArray[3 * 3]; |
| // use only if it has the 'prev frame' flag:[sample * 255.0 - 127.5] |
| @@ -1387,12 +1388,15 @@ const char ApplyFramebufferAttachmentCMAAINTELResourceManager::cmaa_frag_s2_[] = |
| ivec2(1, 1)).r * 255.0 - 127.5); |
| packedEdgesArray[(0) * 3 + (0)] = 0u; |
| - packedEdgesArray[(1) * 3 + (0)] = sampA.w; |
| - packedEdgesArray[(2) * 3 + (0)] = sampA.z; |
| + // The bottom-most edge of the texture is not edge. |
| + // Note: texelFetch() on out of range gives an undefined value. |
| + packedEdgesArray[(1) * 3 + (0)] = sampA.w * notBottomLeft.y; |
| + packedEdgesArray[(2) * 3 + (0)] = sampA.z * notBottomLeft.y; |
| packedEdgesArray[(1) * 3 + (1)] = sampA.x; |
| packedEdgesArray[(2) * 3 + (1)] = sampA.y; |
| - packedEdgesArray[(0) * 3 + (1)] = sampB.w; |
| - packedEdgesArray[(0) * 3 + (2)] = sampB.x; |
| + // The left-most edge of the texture is not edge. |
| + packedEdgesArray[(0) * 3 + (1)] = sampB.w * notBottomLeft.x; |
| + packedEdgesArray[(0) * 3 + (2)] = sampB.x * notBottomLeft.x; |
| packedEdgesArray[(1) * 3 + (2)] = sampB.y; |
| packedEdgesArray[(2) * 3 + (2)] = sampC; |