Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(155)

Unified Diff: gpu/command_buffer/service/gles2_cmd_apply_framebuffer_attachment_cmaa_intel.cc

Issue 2103893003: gpu, cmaa: don't blend the leftmost and bottom-most edges. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: use notEqual for component wise comparison Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 85d9edc06ab9f8d88c8db47eabc0380be1674785..1743265d0de83383ac96b2f6893a7adc6013c474 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(notEqual(screenPosIBase.xy, ivec2(0, 0)));
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;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698