OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "gpu/command_buffer/service/gles2_cmd_apply_framebuffer_attachment_cmaa
_intel.h" | 5 #include "gpu/command_buffer/service/gles2_cmd_apply_framebuffer_attachment_cmaa
_intel.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "gpu/command_buffer/service/framebuffer_manager.h" | 8 #include "gpu/command_buffer/service/framebuffer_manager.h" |
9 #include "gpu/command_buffer/service/gles2_cmd_decoder.h" | 9 #include "gpu/command_buffer/service/gles2_cmd_decoder.h" |
10 #include "ui/gl/gl_context.h" | 10 #include "ui/gl/gl_context.h" |
(...skipping 406 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
417 // bottom, left) edges; also create depth mask as above depth and mark | 417 // bottom, left) edges; also create depth mask as above depth and mark |
418 // potential Z sAND also copy source color data but only on edge pixels | 418 // potential Z sAND also copy source color data but only on edge pixels |
419 glUseProgram(edges_combine_shader_); | 419 glUseProgram(edges_combine_shader_); |
420 glUniform1f(0, 1.0f); | 420 glUniform1f(0, 1.0f); |
421 glUniform2f(1, 1.0f / width_, 1.0f / height_); | 421 glUniform2f(1, 1.0f / width_, 1.0f / height_); |
422 glDepthMask(GL_TRUE); | 422 glDepthMask(GL_TRUE); |
423 glDepthFunc(GL_ALWAYS); | 423 glDepthFunc(GL_ALWAYS); |
424 glColorMask(GL_FALSE, GL_FALSE, GL_FALSE, GL_FALSE); | 424 glColorMask(GL_FALSE, GL_FALSE, GL_FALSE, GL_FALSE); |
425 | 425 |
426 if (!is_gles31_compatible_) { | 426 if (!is_gles31_compatible_) { |
427 glUniform1i(edges_combine_shader_result_texture_float4_slot1_, 1); | |
428 glUniform1i(edges_combine_shader_result_texture_slot2_, 2); | 427 glUniform1i(edges_combine_shader_result_texture_slot2_, 2); |
429 } | 428 } |
430 glBindImageTextureEXT(1, dest_texture, 0, GL_FALSE, 0, GL_WRITE_ONLY, | |
431 GL_RGBA8); | |
432 glBindImageTextureEXT(2, edge_texture_a, 0, GL_FALSE, 0, GL_WRITE_ONLY, | 429 glBindImageTextureEXT(2, edge_texture_a, 0, GL_FALSE, 0, GL_WRITE_ONLY, |
433 edge_format); | 430 edge_format); |
434 | 431 |
435 glActiveTexture(GL_TEXTURE1); | 432 glActiveTexture(GL_TEXTURE1); |
436 glBindTexture(GL_TEXTURE_2D, edge_texture_b); | 433 glBindTexture(GL_TEXTURE_2D, edge_texture_b); |
437 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); | 434 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); |
438 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); | 435 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); |
439 | 436 |
440 glDrawArrays(GL_TRIANGLES, 0, 3); | 437 glDrawArrays(GL_TRIANGLES, 0, 3); |
441 } | 438 } |
(...skipping 1374 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1816 "void main() { \n" | 1813 "void main() { \n" |
1817 " ivec2 screenPosI = ivec2( gl_FragCoord.xy ); \n" | 1814 " ivec2 screenPosI = ivec2( gl_FragCoord.xy ); \n" |
1818 " vec4 pixel = texelFetch(inTexture, screenPosI, 0); \n" | 1815 " vec4 pixel = texelFetch(inTexture, screenPosI, 0); \n" |
1819 "#ifdef OUT_FBO \n" | 1816 "#ifdef OUT_FBO \n" |
1820 " outColor = pixel; \n" | 1817 " outColor = pixel; \n" |
1821 "#else \n" | 1818 "#else \n" |
1822 " imageStore(outTexture, screenPosI, pixel); \n" | 1819 " imageStore(outTexture, screenPosI, pixel); \n" |
1823 "#endif \n" | 1820 "#endif \n" |
1824 "} \n"; | 1821 "} \n"; |
1825 | 1822 |
1826 } // namespace gpu | 1823 } // namespace gpu |
OLD | NEW |