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

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: 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 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;
« 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