ProgramStore.java revision 7d5f5e7c8943e043a422ad51c85d4e1684c37e28
122534176fb5c1257130ef4ee589739ca42766a32Jason Sams/* 222534176fb5c1257130ef4ee589739ca42766a32Jason Sams * Copyright (C) 2008 The Android Open Source Project 322534176fb5c1257130ef4ee589739ca42766a32Jason Sams * 422534176fb5c1257130ef4ee589739ca42766a32Jason Sams * Licensed under the Apache License, Version 2.0 (the "License"); 522534176fb5c1257130ef4ee589739ca42766a32Jason Sams * you may not use this file except in compliance with the License. 622534176fb5c1257130ef4ee589739ca42766a32Jason Sams * You may obtain a copy of the License at 722534176fb5c1257130ef4ee589739ca42766a32Jason Sams * 822534176fb5c1257130ef4ee589739ca42766a32Jason Sams * http://www.apache.org/licenses/LICENSE-2.0 922534176fb5c1257130ef4ee589739ca42766a32Jason Sams * 1022534176fb5c1257130ef4ee589739ca42766a32Jason Sams * Unless required by applicable law or agreed to in writing, software 1122534176fb5c1257130ef4ee589739ca42766a32Jason Sams * distributed under the License is distributed on an "AS IS" BASIS, 1222534176fb5c1257130ef4ee589739ca42766a32Jason Sams * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1322534176fb5c1257130ef4ee589739ca42766a32Jason Sams * See the License for the specific language governing permissions and 1422534176fb5c1257130ef4ee589739ca42766a32Jason Sams * limitations under the License. 1522534176fb5c1257130ef4ee589739ca42766a32Jason Sams */ 1622534176fb5c1257130ef4ee589739ca42766a32Jason Sams 1722534176fb5c1257130ef4ee589739ca42766a32Jason Samspackage android.renderscript; 1822534176fb5c1257130ef4ee589739ca42766a32Jason Sams 1922534176fb5c1257130ef4ee589739ca42766a32Jason Sams 2022534176fb5c1257130ef4ee589739ca42766a32Jason Samsimport android.util.Log; 2122534176fb5c1257130ef4ee589739ca42766a32Jason Sams 2222534176fb5c1257130ef4ee589739ca42766a32Jason Sams 2322534176fb5c1257130ef4ee589739ca42766a32Jason Sams/** 2411518acc8c416023d8c2192b441a1767205676d9Robert Ly * <p>ProgramStore contains a set of parameters that control how 25623c54dd1605d802bb6bfdd0d266a191d4f2d88cAlex Sakhartchouk * the graphics hardware handles writes to the framebuffer. 2611518acc8c416023d8c2192b441a1767205676d9Robert Ly * It could be used to:</p> 2711518acc8c416023d8c2192b441a1767205676d9Robert Ly * <ul> 2811518acc8c416023d8c2192b441a1767205676d9Robert Ly * <li>enable/disable depth testing</li> 2911518acc8c416023d8c2192b441a1767205676d9Robert Ly * <li>specify wheather depth writes are performed</li> 3011518acc8c416023d8c2192b441a1767205676d9Robert Ly * <li>setup various blending modes for use in effects like 3111518acc8c416023d8c2192b441a1767205676d9Robert Ly * transparency</li> 3211518acc8c416023d8c2192b441a1767205676d9Robert Ly * <li>define write masks for color components written into the 3311518acc8c416023d8c2192b441a1767205676d9Robert Ly * framebuffer</li> 3411518acc8c416023d8c2192b441a1767205676d9Robert Ly * </ul> 3522534176fb5c1257130ef4ee589739ca42766a32Jason Sams * 3622534176fb5c1257130ef4ee589739ca42766a32Jason Sams **/ 3722534176fb5c1257130ef4ee589739ca42766a32Jason Samspublic class ProgramStore extends BaseObj { 38623c54dd1605d802bb6bfdd0d266a191d4f2d88cAlex Sakhartchouk /** 39623c54dd1605d802bb6bfdd0d266a191d4f2d88cAlex Sakhartchouk * Specifies the function used to determine whether a fragment 40623c54dd1605d802bb6bfdd0d266a191d4f2d88cAlex Sakhartchouk * will be drawn during the depth testing stage in the rendering 41623c54dd1605d802bb6bfdd0d266a191d4f2d88cAlex Sakhartchouk * pipeline by comparing its value with that already in the depth 42623c54dd1605d802bb6bfdd0d266a191d4f2d88cAlex Sakhartchouk * buffer. DepthFunc is only valid when depth buffer is present 43623c54dd1605d802bb6bfdd0d266a191d4f2d88cAlex Sakhartchouk * and depth testing is enabled 44623c54dd1605d802bb6bfdd0d266a191d4f2d88cAlex Sakhartchouk */ 45b4d7bb6872f523b4318144202e119766ed9054edAlex Sakhartchouk public enum DepthFunc { 46623c54dd1605d802bb6bfdd0d266a191d4f2d88cAlex Sakhartchouk 47623c54dd1605d802bb6bfdd0d266a191d4f2d88cAlex Sakhartchouk /** 48623c54dd1605d802bb6bfdd0d266a191d4f2d88cAlex Sakhartchouk * Always drawn 49623c54dd1605d802bb6bfdd0d266a191d4f2d88cAlex Sakhartchouk */ 5022534176fb5c1257130ef4ee589739ca42766a32Jason Sams ALWAYS (0), 51623c54dd1605d802bb6bfdd0d266a191d4f2d88cAlex Sakhartchouk /** 52623c54dd1605d802bb6bfdd0d266a191d4f2d88cAlex Sakhartchouk * Drawn if the incoming depth value is less than that in the 53623c54dd1605d802bb6bfdd0d266a191d4f2d88cAlex Sakhartchouk * depth buffer 54623c54dd1605d802bb6bfdd0d266a191d4f2d88cAlex Sakhartchouk */ 5522534176fb5c1257130ef4ee589739ca42766a32Jason Sams LESS (1), 56623c54dd1605d802bb6bfdd0d266a191d4f2d88cAlex Sakhartchouk /** 57623c54dd1605d802bb6bfdd0d266a191d4f2d88cAlex Sakhartchouk * Drawn if the incoming depth value is less or equal to that in 58623c54dd1605d802bb6bfdd0d266a191d4f2d88cAlex Sakhartchouk * the depth buffer 59623c54dd1605d802bb6bfdd0d266a191d4f2d88cAlex Sakhartchouk */ 60b4d7bb6872f523b4318144202e119766ed9054edAlex Sakhartchouk LESS_OR_EQUAL (2), 61623c54dd1605d802bb6bfdd0d266a191d4f2d88cAlex Sakhartchouk /** 62623c54dd1605d802bb6bfdd0d266a191d4f2d88cAlex Sakhartchouk * Drawn if the incoming depth value is greater than that in the 63623c54dd1605d802bb6bfdd0d266a191d4f2d88cAlex Sakhartchouk * depth buffer 64623c54dd1605d802bb6bfdd0d266a191d4f2d88cAlex Sakhartchouk */ 6522534176fb5c1257130ef4ee589739ca42766a32Jason Sams GREATER (3), 66623c54dd1605d802bb6bfdd0d266a191d4f2d88cAlex Sakhartchouk /** 67623c54dd1605d802bb6bfdd0d266a191d4f2d88cAlex Sakhartchouk * Drawn if the incoming depth value is greater or equal to that 68623c54dd1605d802bb6bfdd0d266a191d4f2d88cAlex Sakhartchouk * in the depth buffer 69623c54dd1605d802bb6bfdd0d266a191d4f2d88cAlex Sakhartchouk */ 70b4d7bb6872f523b4318144202e119766ed9054edAlex Sakhartchouk GREATER_OR_EQUAL (4), 71623c54dd1605d802bb6bfdd0d266a191d4f2d88cAlex Sakhartchouk /** 72623c54dd1605d802bb6bfdd0d266a191d4f2d88cAlex Sakhartchouk * Drawn if the incoming depth value is equal to that in the 73623c54dd1605d802bb6bfdd0d266a191d4f2d88cAlex Sakhartchouk * depth buffer 74623c54dd1605d802bb6bfdd0d266a191d4f2d88cAlex Sakhartchouk */ 7522534176fb5c1257130ef4ee589739ca42766a32Jason Sams EQUAL (5), 76623c54dd1605d802bb6bfdd0d266a191d4f2d88cAlex Sakhartchouk /** 77623c54dd1605d802bb6bfdd0d266a191d4f2d88cAlex Sakhartchouk * Drawn if the incoming depth value is not equal to that in the 78623c54dd1605d802bb6bfdd0d266a191d4f2d88cAlex Sakhartchouk * depth buffer 79623c54dd1605d802bb6bfdd0d266a191d4f2d88cAlex Sakhartchouk */ 80b4d7bb6872f523b4318144202e119766ed9054edAlex Sakhartchouk NOT_EQUAL (6); 8122534176fb5c1257130ef4ee589739ca42766a32Jason Sams 8222534176fb5c1257130ef4ee589739ca42766a32Jason Sams int mID; 8322534176fb5c1257130ef4ee589739ca42766a32Jason Sams DepthFunc(int id) { 8422534176fb5c1257130ef4ee589739ca42766a32Jason Sams mID = id; 8522534176fb5c1257130ef4ee589739ca42766a32Jason Sams } 8622534176fb5c1257130ef4ee589739ca42766a32Jason Sams } 8722534176fb5c1257130ef4ee589739ca42766a32Jason Sams 88623c54dd1605d802bb6bfdd0d266a191d4f2d88cAlex Sakhartchouk /** 89623c54dd1605d802bb6bfdd0d266a191d4f2d88cAlex Sakhartchouk * Specifies the functions used to combine incoming pixels with 90623c54dd1605d802bb6bfdd0d266a191d4f2d88cAlex Sakhartchouk * those already in the frame buffer. 91623c54dd1605d802bb6bfdd0d266a191d4f2d88cAlex Sakhartchouk * 92623c54dd1605d802bb6bfdd0d266a191d4f2d88cAlex Sakhartchouk * BlendSrcFunc describes how the coefficient used to scale the 93623c54dd1605d802bb6bfdd0d266a191d4f2d88cAlex Sakhartchouk * source pixels during the blending operation is computed 94623c54dd1605d802bb6bfdd0d266a191d4f2d88cAlex Sakhartchouk * 95623c54dd1605d802bb6bfdd0d266a191d4f2d88cAlex Sakhartchouk */ 9622534176fb5c1257130ef4ee589739ca42766a32Jason Sams public enum BlendSrcFunc { 9722534176fb5c1257130ef4ee589739ca42766a32Jason Sams ZERO (0), 9822534176fb5c1257130ef4ee589739ca42766a32Jason Sams ONE (1), 9922534176fb5c1257130ef4ee589739ca42766a32Jason Sams DST_COLOR (2), 10022534176fb5c1257130ef4ee589739ca42766a32Jason Sams ONE_MINUS_DST_COLOR (3), 10122534176fb5c1257130ef4ee589739ca42766a32Jason Sams SRC_ALPHA (4), 10222534176fb5c1257130ef4ee589739ca42766a32Jason Sams ONE_MINUS_SRC_ALPHA (5), 10322534176fb5c1257130ef4ee589739ca42766a32Jason Sams DST_ALPHA (6), 104eab4c75b09aa81ea093c2b9fbb3dbc2016c9bd6eJason Sams ONE_MINUS_DST_ALPHA (7), 10522534176fb5c1257130ef4ee589739ca42766a32Jason Sams SRC_ALPHA_SATURATE (8); 10622534176fb5c1257130ef4ee589739ca42766a32Jason Sams 10722534176fb5c1257130ef4ee589739ca42766a32Jason Sams int mID; 10822534176fb5c1257130ef4ee589739ca42766a32Jason Sams BlendSrcFunc(int id) { 10922534176fb5c1257130ef4ee589739ca42766a32Jason Sams mID = id; 11022534176fb5c1257130ef4ee589739ca42766a32Jason Sams } 11122534176fb5c1257130ef4ee589739ca42766a32Jason Sams } 11222534176fb5c1257130ef4ee589739ca42766a32Jason Sams 113623c54dd1605d802bb6bfdd0d266a191d4f2d88cAlex Sakhartchouk /** 114623c54dd1605d802bb6bfdd0d266a191d4f2d88cAlex Sakhartchouk * Specifies the functions used to combine incoming pixels with 115623c54dd1605d802bb6bfdd0d266a191d4f2d88cAlex Sakhartchouk * those already in the frame buffer. 116623c54dd1605d802bb6bfdd0d266a191d4f2d88cAlex Sakhartchouk * 117623c54dd1605d802bb6bfdd0d266a191d4f2d88cAlex Sakhartchouk * BlendDstFunc describes how the coefficient used to scale the 118623c54dd1605d802bb6bfdd0d266a191d4f2d88cAlex Sakhartchouk * pixels already in the framebuffer is computed during the 119623c54dd1605d802bb6bfdd0d266a191d4f2d88cAlex Sakhartchouk * blending operation 120623c54dd1605d802bb6bfdd0d266a191d4f2d88cAlex Sakhartchouk * 121623c54dd1605d802bb6bfdd0d266a191d4f2d88cAlex Sakhartchouk */ 12222534176fb5c1257130ef4ee589739ca42766a32Jason Sams public enum BlendDstFunc { 12322534176fb5c1257130ef4ee589739ca42766a32Jason Sams ZERO (0), 12422534176fb5c1257130ef4ee589739ca42766a32Jason Sams ONE (1), 12522534176fb5c1257130ef4ee589739ca42766a32Jason Sams SRC_COLOR (2), 12622534176fb5c1257130ef4ee589739ca42766a32Jason Sams ONE_MINUS_SRC_COLOR (3), 12722534176fb5c1257130ef4ee589739ca42766a32Jason Sams SRC_ALPHA (4), 12822534176fb5c1257130ef4ee589739ca42766a32Jason Sams ONE_MINUS_SRC_ALPHA (5), 12922534176fb5c1257130ef4ee589739ca42766a32Jason Sams DST_ALPHA (6), 130eab4c75b09aa81ea093c2b9fbb3dbc2016c9bd6eJason Sams ONE_MINUS_DST_ALPHA (7); 13122534176fb5c1257130ef4ee589739ca42766a32Jason Sams 13222534176fb5c1257130ef4ee589739ca42766a32Jason Sams int mID; 13322534176fb5c1257130ef4ee589739ca42766a32Jason Sams BlendDstFunc(int id) { 13422534176fb5c1257130ef4ee589739ca42766a32Jason Sams mID = id; 13522534176fb5c1257130ef4ee589739ca42766a32Jason Sams } 13622534176fb5c1257130ef4ee589739ca42766a32Jason Sams } 13722534176fb5c1257130ef4ee589739ca42766a32Jason Sams 1387d5f5e7c8943e043a422ad51c85d4e1684c37e28Alex Sakhartchouk DepthFunc mDepthFunc; 1397d5f5e7c8943e043a422ad51c85d4e1684c37e28Alex Sakhartchouk boolean mDepthMask; 1407d5f5e7c8943e043a422ad51c85d4e1684c37e28Alex Sakhartchouk boolean mColorMaskR; 1417d5f5e7c8943e043a422ad51c85d4e1684c37e28Alex Sakhartchouk boolean mColorMaskG; 1427d5f5e7c8943e043a422ad51c85d4e1684c37e28Alex Sakhartchouk boolean mColorMaskB; 1437d5f5e7c8943e043a422ad51c85d4e1684c37e28Alex Sakhartchouk boolean mColorMaskA; 1447d5f5e7c8943e043a422ad51c85d4e1684c37e28Alex Sakhartchouk BlendSrcFunc mBlendSrc; 1457d5f5e7c8943e043a422ad51c85d4e1684c37e28Alex Sakhartchouk BlendDstFunc mBlendDst; 1467d5f5e7c8943e043a422ad51c85d4e1684c37e28Alex Sakhartchouk boolean mDither; 14722534176fb5c1257130ef4ee589739ca42766a32Jason Sams 14822534176fb5c1257130ef4ee589739ca42766a32Jason Sams ProgramStore(int id, RenderScript rs) { 1490de9444aa6c25d2c586e8204a6168d10e67376e0Alex Sakhartchouk super(id, rs); 15022534176fb5c1257130ef4ee589739ca42766a32Jason Sams } 15122534176fb5c1257130ef4ee589739ca42766a32Jason Sams 152623c54dd1605d802bb6bfdd0d266a191d4f2d88cAlex Sakhartchouk /** 1537d5f5e7c8943e043a422ad51c85d4e1684c37e28Alex Sakhartchouk * @hide 1547d5f5e7c8943e043a422ad51c85d4e1684c37e28Alex Sakhartchouk * @return depth function 1557d5f5e7c8943e043a422ad51c85d4e1684c37e28Alex Sakhartchouk */ 1567d5f5e7c8943e043a422ad51c85d4e1684c37e28Alex Sakhartchouk public DepthFunc getDepthFunc() { 1577d5f5e7c8943e043a422ad51c85d4e1684c37e28Alex Sakhartchouk return mDepthFunc; 1587d5f5e7c8943e043a422ad51c85d4e1684c37e28Alex Sakhartchouk } 1597d5f5e7c8943e043a422ad51c85d4e1684c37e28Alex Sakhartchouk 1607d5f5e7c8943e043a422ad51c85d4e1684c37e28Alex Sakhartchouk /** 1617d5f5e7c8943e043a422ad51c85d4e1684c37e28Alex Sakhartchouk * @hide 1627d5f5e7c8943e043a422ad51c85d4e1684c37e28Alex Sakhartchouk * @return whether depth writes are enabled 1637d5f5e7c8943e043a422ad51c85d4e1684c37e28Alex Sakhartchouk */ 1647d5f5e7c8943e043a422ad51c85d4e1684c37e28Alex Sakhartchouk public boolean getDepthMaskEnabled() { 1657d5f5e7c8943e043a422ad51c85d4e1684c37e28Alex Sakhartchouk return mDepthMask; 1667d5f5e7c8943e043a422ad51c85d4e1684c37e28Alex Sakhartchouk } 1677d5f5e7c8943e043a422ad51c85d4e1684c37e28Alex Sakhartchouk 1687d5f5e7c8943e043a422ad51c85d4e1684c37e28Alex Sakhartchouk /** 1697d5f5e7c8943e043a422ad51c85d4e1684c37e28Alex Sakhartchouk * @hide 1707d5f5e7c8943e043a422ad51c85d4e1684c37e28Alex Sakhartchouk * @return red color channel mask 1717d5f5e7c8943e043a422ad51c85d4e1684c37e28Alex Sakhartchouk */ 1727d5f5e7c8943e043a422ad51c85d4e1684c37e28Alex Sakhartchouk public boolean getColorMaskREnabled() { 1737d5f5e7c8943e043a422ad51c85d4e1684c37e28Alex Sakhartchouk return mColorMaskR; 1747d5f5e7c8943e043a422ad51c85d4e1684c37e28Alex Sakhartchouk } 1757d5f5e7c8943e043a422ad51c85d4e1684c37e28Alex Sakhartchouk 1767d5f5e7c8943e043a422ad51c85d4e1684c37e28Alex Sakhartchouk /** 1777d5f5e7c8943e043a422ad51c85d4e1684c37e28Alex Sakhartchouk * @hide 1787d5f5e7c8943e043a422ad51c85d4e1684c37e28Alex Sakhartchouk * @return green color channel mask 1797d5f5e7c8943e043a422ad51c85d4e1684c37e28Alex Sakhartchouk */ 1807d5f5e7c8943e043a422ad51c85d4e1684c37e28Alex Sakhartchouk public boolean getColorMaskGEnabled() { 1817d5f5e7c8943e043a422ad51c85d4e1684c37e28Alex Sakhartchouk return mColorMaskG; 1827d5f5e7c8943e043a422ad51c85d4e1684c37e28Alex Sakhartchouk } 1837d5f5e7c8943e043a422ad51c85d4e1684c37e28Alex Sakhartchouk 1847d5f5e7c8943e043a422ad51c85d4e1684c37e28Alex Sakhartchouk /** 1857d5f5e7c8943e043a422ad51c85d4e1684c37e28Alex Sakhartchouk * @hide 1867d5f5e7c8943e043a422ad51c85d4e1684c37e28Alex Sakhartchouk * @return blue color channel mask 1877d5f5e7c8943e043a422ad51c85d4e1684c37e28Alex Sakhartchouk */ 1887d5f5e7c8943e043a422ad51c85d4e1684c37e28Alex Sakhartchouk public boolean getColorMaskBEnabled() { 1897d5f5e7c8943e043a422ad51c85d4e1684c37e28Alex Sakhartchouk return mColorMaskB; 1907d5f5e7c8943e043a422ad51c85d4e1684c37e28Alex Sakhartchouk } 1917d5f5e7c8943e043a422ad51c85d4e1684c37e28Alex Sakhartchouk 1927d5f5e7c8943e043a422ad51c85d4e1684c37e28Alex Sakhartchouk /** 1937d5f5e7c8943e043a422ad51c85d4e1684c37e28Alex Sakhartchouk * @hide 1947d5f5e7c8943e043a422ad51c85d4e1684c37e28Alex Sakhartchouk * @return alpha channel mask 1957d5f5e7c8943e043a422ad51c85d4e1684c37e28Alex Sakhartchouk */ 1967d5f5e7c8943e043a422ad51c85d4e1684c37e28Alex Sakhartchouk public boolean getColorMaskAEnabled() { 1977d5f5e7c8943e043a422ad51c85d4e1684c37e28Alex Sakhartchouk return mColorMaskA; 1987d5f5e7c8943e043a422ad51c85d4e1684c37e28Alex Sakhartchouk } 1997d5f5e7c8943e043a422ad51c85d4e1684c37e28Alex Sakhartchouk 2007d5f5e7c8943e043a422ad51c85d4e1684c37e28Alex Sakhartchouk /** 2017d5f5e7c8943e043a422ad51c85d4e1684c37e28Alex Sakhartchouk * @hide 2027d5f5e7c8943e043a422ad51c85d4e1684c37e28Alex Sakhartchouk * @return source blend function 2037d5f5e7c8943e043a422ad51c85d4e1684c37e28Alex Sakhartchouk */ 2047d5f5e7c8943e043a422ad51c85d4e1684c37e28Alex Sakhartchouk public BlendSrcFunc getBlendSrcFunc() { 2057d5f5e7c8943e043a422ad51c85d4e1684c37e28Alex Sakhartchouk return mBlendSrc; 2067d5f5e7c8943e043a422ad51c85d4e1684c37e28Alex Sakhartchouk } 2077d5f5e7c8943e043a422ad51c85d4e1684c37e28Alex Sakhartchouk 2087d5f5e7c8943e043a422ad51c85d4e1684c37e28Alex Sakhartchouk /** 2097d5f5e7c8943e043a422ad51c85d4e1684c37e28Alex Sakhartchouk * @hide 2107d5f5e7c8943e043a422ad51c85d4e1684c37e28Alex Sakhartchouk * @return destination blend function 2117d5f5e7c8943e043a422ad51c85d4e1684c37e28Alex Sakhartchouk */ 2127d5f5e7c8943e043a422ad51c85d4e1684c37e28Alex Sakhartchouk public BlendDstFunc getBlendDstFunc() { 2137d5f5e7c8943e043a422ad51c85d4e1684c37e28Alex Sakhartchouk return mBlendDst; 2147d5f5e7c8943e043a422ad51c85d4e1684c37e28Alex Sakhartchouk } 2157d5f5e7c8943e043a422ad51c85d4e1684c37e28Alex Sakhartchouk 2167d5f5e7c8943e043a422ad51c85d4e1684c37e28Alex Sakhartchouk /** 2177d5f5e7c8943e043a422ad51c85d4e1684c37e28Alex Sakhartchouk * @hide 2187d5f5e7c8943e043a422ad51c85d4e1684c37e28Alex Sakhartchouk * @return whether dither is enabled 2197d5f5e7c8943e043a422ad51c85d4e1684c37e28Alex Sakhartchouk */ 2207d5f5e7c8943e043a422ad51c85d4e1684c37e28Alex Sakhartchouk public boolean getDitherEnabled() { 2217d5f5e7c8943e043a422ad51c85d4e1684c37e28Alex Sakhartchouk return mDither; 2227d5f5e7c8943e043a422ad51c85d4e1684c37e28Alex Sakhartchouk } 2237d5f5e7c8943e043a422ad51c85d4e1684c37e28Alex Sakhartchouk 2247d5f5e7c8943e043a422ad51c85d4e1684c37e28Alex Sakhartchouk /** 225623c54dd1605d802bb6bfdd0d266a191d4f2d88cAlex Sakhartchouk * Returns a pre-defined program store object with the following 226623c54dd1605d802bb6bfdd0d266a191d4f2d88cAlex Sakhartchouk * characteristics: 227623c54dd1605d802bb6bfdd0d266a191d4f2d88cAlex Sakhartchouk * - incoming pixels are drawn if their depth value is less than 228623c54dd1605d802bb6bfdd0d266a191d4f2d88cAlex Sakhartchouk * the stored value in the depth buffer. If the pixel is 229623c54dd1605d802bb6bfdd0d266a191d4f2d88cAlex Sakhartchouk * drawn, its value is also stored in the depth buffer 230623c54dd1605d802bb6bfdd0d266a191d4f2d88cAlex Sakhartchouk * - incoming pixels override the value stored in the color 231623c54dd1605d802bb6bfdd0d266a191d4f2d88cAlex Sakhartchouk * buffer if it passes the depth test 232623c54dd1605d802bb6bfdd0d266a191d4f2d88cAlex Sakhartchouk * 233f5c876e82d7cc647ba94d29eb914e64b7977c303Alex Sakhartchouk * @param rs Context to which the program will belong. 234623c54dd1605d802bb6bfdd0d266a191d4f2d88cAlex Sakhartchouk **/ 235d36f248eaf06c569010649902df653da1a9e2accAlex Sakhartchouk public static ProgramStore BLEND_NONE_DEPTH_TEST(RenderScript rs) { 236d36f248eaf06c569010649902df653da1a9e2accAlex Sakhartchouk if(rs.mProgramStore_BLEND_NONE_DEPTH_TEST == null) { 23732e09b5891da0174f161d99e2d3ebe67d6efa39cAlex Sakhartchouk ProgramStore.Builder builder = new ProgramStore.Builder(rs); 23832e09b5891da0174f161d99e2d3ebe67d6efa39cAlex Sakhartchouk builder.setDepthFunc(ProgramStore.DepthFunc.LESS); 23932e09b5891da0174f161d99e2d3ebe67d6efa39cAlex Sakhartchouk builder.setBlendFunc(BlendSrcFunc.ONE, BlendDstFunc.ZERO); 240b4d7bb6872f523b4318144202e119766ed9054edAlex Sakhartchouk builder.setDitherEnabled(false); 241b4d7bb6872f523b4318144202e119766ed9054edAlex Sakhartchouk builder.setDepthMaskEnabled(true); 242d36f248eaf06c569010649902df653da1a9e2accAlex Sakhartchouk rs.mProgramStore_BLEND_NONE_DEPTH_TEST = builder.create(); 24332e09b5891da0174f161d99e2d3ebe67d6efa39cAlex Sakhartchouk } 244d36f248eaf06c569010649902df653da1a9e2accAlex Sakhartchouk return rs.mProgramStore_BLEND_NONE_DEPTH_TEST; 24532e09b5891da0174f161d99e2d3ebe67d6efa39cAlex Sakhartchouk } 246623c54dd1605d802bb6bfdd0d266a191d4f2d88cAlex Sakhartchouk /** 247623c54dd1605d802bb6bfdd0d266a191d4f2d88cAlex Sakhartchouk * Returns a pre-defined program store object with the following 248623c54dd1605d802bb6bfdd0d266a191d4f2d88cAlex Sakhartchouk * characteristics: 249623c54dd1605d802bb6bfdd0d266a191d4f2d88cAlex Sakhartchouk * - incoming pixels always pass the depth test and their value 250623c54dd1605d802bb6bfdd0d266a191d4f2d88cAlex Sakhartchouk * is not stored in the depth buffer 251623c54dd1605d802bb6bfdd0d266a191d4f2d88cAlex Sakhartchouk * - incoming pixels override the value stored in the color 252623c54dd1605d802bb6bfdd0d266a191d4f2d88cAlex Sakhartchouk * buffer 253623c54dd1605d802bb6bfdd0d266a191d4f2d88cAlex Sakhartchouk * 254f5c876e82d7cc647ba94d29eb914e64b7977c303Alex Sakhartchouk * @param rs Context to which the program will belong. 255623c54dd1605d802bb6bfdd0d266a191d4f2d88cAlex Sakhartchouk **/ 256b4d7bb6872f523b4318144202e119766ed9054edAlex Sakhartchouk public static ProgramStore BLEND_NONE_DEPTH_NONE(RenderScript rs) { 257d36f248eaf06c569010649902df653da1a9e2accAlex Sakhartchouk if(rs.mProgramStore_BLEND_NONE_DEPTH_NO_DEPTH == null) { 25832e09b5891da0174f161d99e2d3ebe67d6efa39cAlex Sakhartchouk ProgramStore.Builder builder = new ProgramStore.Builder(rs); 25932e09b5891da0174f161d99e2d3ebe67d6efa39cAlex Sakhartchouk builder.setDepthFunc(ProgramStore.DepthFunc.ALWAYS); 26032e09b5891da0174f161d99e2d3ebe67d6efa39cAlex Sakhartchouk builder.setBlendFunc(BlendSrcFunc.ONE, BlendDstFunc.ZERO); 261b4d7bb6872f523b4318144202e119766ed9054edAlex Sakhartchouk builder.setDitherEnabled(false); 262b4d7bb6872f523b4318144202e119766ed9054edAlex Sakhartchouk builder.setDepthMaskEnabled(false); 263d36f248eaf06c569010649902df653da1a9e2accAlex Sakhartchouk rs.mProgramStore_BLEND_NONE_DEPTH_NO_DEPTH = builder.create(); 26432e09b5891da0174f161d99e2d3ebe67d6efa39cAlex Sakhartchouk } 265d36f248eaf06c569010649902df653da1a9e2accAlex Sakhartchouk return rs.mProgramStore_BLEND_NONE_DEPTH_NO_DEPTH; 26632e09b5891da0174f161d99e2d3ebe67d6efa39cAlex Sakhartchouk } 267623c54dd1605d802bb6bfdd0d266a191d4f2d88cAlex Sakhartchouk /** 268623c54dd1605d802bb6bfdd0d266a191d4f2d88cAlex Sakhartchouk * Returns a pre-defined program store object with the following 269623c54dd1605d802bb6bfdd0d266a191d4f2d88cAlex Sakhartchouk * characteristics: 270623c54dd1605d802bb6bfdd0d266a191d4f2d88cAlex Sakhartchouk * - incoming pixels are drawn if their depth value is less than 271623c54dd1605d802bb6bfdd0d266a191d4f2d88cAlex Sakhartchouk * the stored value in the depth buffer. If the pixel is 272623c54dd1605d802bb6bfdd0d266a191d4f2d88cAlex Sakhartchouk * drawn, its value is also stored in the depth buffer 273623c54dd1605d802bb6bfdd0d266a191d4f2d88cAlex Sakhartchouk * - if the incoming (Source) pixel passes depth test, its value 274623c54dd1605d802bb6bfdd0d266a191d4f2d88cAlex Sakhartchouk * is combined with the stored color (Dest) using the 275623c54dd1605d802bb6bfdd0d266a191d4f2d88cAlex Sakhartchouk * following formula 276623c54dd1605d802bb6bfdd0d266a191d4f2d88cAlex Sakhartchouk * Final.RGB = Source.RGB * Source.A + Dest.RGB * (1 - Source.A) 277623c54dd1605d802bb6bfdd0d266a191d4f2d88cAlex Sakhartchouk * 278f5c876e82d7cc647ba94d29eb914e64b7977c303Alex Sakhartchouk * @param rs Context to which the program will belong. 279623c54dd1605d802bb6bfdd0d266a191d4f2d88cAlex Sakhartchouk **/ 280d36f248eaf06c569010649902df653da1a9e2accAlex Sakhartchouk public static ProgramStore BLEND_ALPHA_DEPTH_TEST(RenderScript rs) { 281d36f248eaf06c569010649902df653da1a9e2accAlex Sakhartchouk if(rs.mProgramStore_BLEND_ALPHA_DEPTH_TEST == null) { 28232e09b5891da0174f161d99e2d3ebe67d6efa39cAlex Sakhartchouk ProgramStore.Builder builder = new ProgramStore.Builder(rs); 28332e09b5891da0174f161d99e2d3ebe67d6efa39cAlex Sakhartchouk builder.setDepthFunc(ProgramStore.DepthFunc.LESS); 28432e09b5891da0174f161d99e2d3ebe67d6efa39cAlex Sakhartchouk builder.setBlendFunc(BlendSrcFunc.SRC_ALPHA, BlendDstFunc.ONE_MINUS_SRC_ALPHA); 285b4d7bb6872f523b4318144202e119766ed9054edAlex Sakhartchouk builder.setDitherEnabled(false); 286b4d7bb6872f523b4318144202e119766ed9054edAlex Sakhartchouk builder.setDepthMaskEnabled(true); 287d36f248eaf06c569010649902df653da1a9e2accAlex Sakhartchouk rs.mProgramStore_BLEND_ALPHA_DEPTH_TEST = builder.create(); 28832e09b5891da0174f161d99e2d3ebe67d6efa39cAlex Sakhartchouk } 289d36f248eaf06c569010649902df653da1a9e2accAlex Sakhartchouk return rs.mProgramStore_BLEND_ALPHA_DEPTH_TEST; 29032e09b5891da0174f161d99e2d3ebe67d6efa39cAlex Sakhartchouk } 291623c54dd1605d802bb6bfdd0d266a191d4f2d88cAlex Sakhartchouk /** 292623c54dd1605d802bb6bfdd0d266a191d4f2d88cAlex Sakhartchouk * Returns a pre-defined program store object with the following 293623c54dd1605d802bb6bfdd0d266a191d4f2d88cAlex Sakhartchouk * characteristics: 294623c54dd1605d802bb6bfdd0d266a191d4f2d88cAlex Sakhartchouk * - incoming pixels always pass the depth test and their value 295623c54dd1605d802bb6bfdd0d266a191d4f2d88cAlex Sakhartchouk * is not stored in the depth buffer 296623c54dd1605d802bb6bfdd0d266a191d4f2d88cAlex Sakhartchouk * - incoming pixel's value is combined with the stored color 297623c54dd1605d802bb6bfdd0d266a191d4f2d88cAlex Sakhartchouk * (Dest) using the following formula 298623c54dd1605d802bb6bfdd0d266a191d4f2d88cAlex Sakhartchouk * Final.RGB = Source.RGB * Source.A + Dest.RGB * (1 - Source.A) 299623c54dd1605d802bb6bfdd0d266a191d4f2d88cAlex Sakhartchouk * 300f5c876e82d7cc647ba94d29eb914e64b7977c303Alex Sakhartchouk * @param rs Context to which the program will belong. 301623c54dd1605d802bb6bfdd0d266a191d4f2d88cAlex Sakhartchouk **/ 302b4d7bb6872f523b4318144202e119766ed9054edAlex Sakhartchouk public static ProgramStore BLEND_ALPHA_DEPTH_NONE(RenderScript rs) { 303d36f248eaf06c569010649902df653da1a9e2accAlex Sakhartchouk if(rs.mProgramStore_BLEND_ALPHA_DEPTH_NO_DEPTH == null) { 30432e09b5891da0174f161d99e2d3ebe67d6efa39cAlex Sakhartchouk ProgramStore.Builder builder = new ProgramStore.Builder(rs); 30532e09b5891da0174f161d99e2d3ebe67d6efa39cAlex Sakhartchouk builder.setDepthFunc(ProgramStore.DepthFunc.ALWAYS); 30632e09b5891da0174f161d99e2d3ebe67d6efa39cAlex Sakhartchouk builder.setBlendFunc(BlendSrcFunc.SRC_ALPHA, BlendDstFunc.ONE_MINUS_SRC_ALPHA); 307b4d7bb6872f523b4318144202e119766ed9054edAlex Sakhartchouk builder.setDitherEnabled(false); 308b4d7bb6872f523b4318144202e119766ed9054edAlex Sakhartchouk builder.setDepthMaskEnabled(false); 309d36f248eaf06c569010649902df653da1a9e2accAlex Sakhartchouk rs.mProgramStore_BLEND_ALPHA_DEPTH_NO_DEPTH = builder.create(); 31032e09b5891da0174f161d99e2d3ebe67d6efa39cAlex Sakhartchouk } 311d36f248eaf06c569010649902df653da1a9e2accAlex Sakhartchouk return rs.mProgramStore_BLEND_ALPHA_DEPTH_NO_DEPTH; 31232e09b5891da0174f161d99e2d3ebe67d6efa39cAlex Sakhartchouk } 31322534176fb5c1257130ef4ee589739ca42766a32Jason Sams 314623c54dd1605d802bb6bfdd0d266a191d4f2d88cAlex Sakhartchouk /** 315623c54dd1605d802bb6bfdd0d266a191d4f2d88cAlex Sakhartchouk * Builder class for ProgramStore object. If the builder is left 316623c54dd1605d802bb6bfdd0d266a191d4f2d88cAlex Sakhartchouk * empty, the equivalent of BLEND_NONE_DEPTH_NONE would be 317623c54dd1605d802bb6bfdd0d266a191d4f2d88cAlex Sakhartchouk * returned 318623c54dd1605d802bb6bfdd0d266a191d4f2d88cAlex Sakhartchouk */ 31922534176fb5c1257130ef4ee589739ca42766a32Jason Sams public static class Builder { 32022534176fb5c1257130ef4ee589739ca42766a32Jason Sams RenderScript mRS; 32122534176fb5c1257130ef4ee589739ca42766a32Jason Sams DepthFunc mDepthFunc; 32222534176fb5c1257130ef4ee589739ca42766a32Jason Sams boolean mDepthMask; 32322534176fb5c1257130ef4ee589739ca42766a32Jason Sams boolean mColorMaskR; 32422534176fb5c1257130ef4ee589739ca42766a32Jason Sams boolean mColorMaskG; 32522534176fb5c1257130ef4ee589739ca42766a32Jason Sams boolean mColorMaskB; 32622534176fb5c1257130ef4ee589739ca42766a32Jason Sams boolean mColorMaskA; 32722534176fb5c1257130ef4ee589739ca42766a32Jason Sams BlendSrcFunc mBlendSrc; 32822534176fb5c1257130ef4ee589739ca42766a32Jason Sams BlendDstFunc mBlendDst; 32922534176fb5c1257130ef4ee589739ca42766a32Jason Sams boolean mDither; 33022534176fb5c1257130ef4ee589739ca42766a32Jason Sams 33132e09b5891da0174f161d99e2d3ebe67d6efa39cAlex Sakhartchouk public Builder(RenderScript rs) { 33232e09b5891da0174f161d99e2d3ebe67d6efa39cAlex Sakhartchouk mRS = rs; 33332e09b5891da0174f161d99e2d3ebe67d6efa39cAlex Sakhartchouk mDepthFunc = DepthFunc.ALWAYS; 33432e09b5891da0174f161d99e2d3ebe67d6efa39cAlex Sakhartchouk mDepthMask = false; 33532e09b5891da0174f161d99e2d3ebe67d6efa39cAlex Sakhartchouk mColorMaskR = true; 33632e09b5891da0174f161d99e2d3ebe67d6efa39cAlex Sakhartchouk mColorMaskG = true; 33732e09b5891da0174f161d99e2d3ebe67d6efa39cAlex Sakhartchouk mColorMaskB = true; 33832e09b5891da0174f161d99e2d3ebe67d6efa39cAlex Sakhartchouk mColorMaskA = true; 33932e09b5891da0174f161d99e2d3ebe67d6efa39cAlex Sakhartchouk mBlendSrc = BlendSrcFunc.ONE; 34032e09b5891da0174f161d99e2d3ebe67d6efa39cAlex Sakhartchouk mBlendDst = BlendDstFunc.ZERO; 34122534176fb5c1257130ef4ee589739ca42766a32Jason Sams } 34222534176fb5c1257130ef4ee589739ca42766a32Jason Sams 343623c54dd1605d802bb6bfdd0d266a191d4f2d88cAlex Sakhartchouk /** 344623c54dd1605d802bb6bfdd0d266a191d4f2d88cAlex Sakhartchouk * Specifies the depth testing behavior 345623c54dd1605d802bb6bfdd0d266a191d4f2d88cAlex Sakhartchouk * 346623c54dd1605d802bb6bfdd0d266a191d4f2d88cAlex Sakhartchouk * @param func function used for depth testing 347623c54dd1605d802bb6bfdd0d266a191d4f2d88cAlex Sakhartchouk * 348623c54dd1605d802bb6bfdd0d266a191d4f2d88cAlex Sakhartchouk * @return this 349623c54dd1605d802bb6bfdd0d266a191d4f2d88cAlex Sakhartchouk */ 350288c8711a64893acb3f4a31caf69153be9809d17Jim Shuma public Builder setDepthFunc(DepthFunc func) { 35122534176fb5c1257130ef4ee589739ca42766a32Jason Sams mDepthFunc = func; 352288c8711a64893acb3f4a31caf69153be9809d17Jim Shuma return this; 35322534176fb5c1257130ef4ee589739ca42766a32Jason Sams } 35422534176fb5c1257130ef4ee589739ca42766a32Jason Sams 355623c54dd1605d802bb6bfdd0d266a191d4f2d88cAlex Sakhartchouk /** 356623c54dd1605d802bb6bfdd0d266a191d4f2d88cAlex Sakhartchouk * Enables writes into the depth buffer 357623c54dd1605d802bb6bfdd0d266a191d4f2d88cAlex Sakhartchouk * 358623c54dd1605d802bb6bfdd0d266a191d4f2d88cAlex Sakhartchouk * @param enable specifies whether depth writes are 359623c54dd1605d802bb6bfdd0d266a191d4f2d88cAlex Sakhartchouk * enabled or disabled 360623c54dd1605d802bb6bfdd0d266a191d4f2d88cAlex Sakhartchouk * 361623c54dd1605d802bb6bfdd0d266a191d4f2d88cAlex Sakhartchouk * @return this 362623c54dd1605d802bb6bfdd0d266a191d4f2d88cAlex Sakhartchouk */ 363b4d7bb6872f523b4318144202e119766ed9054edAlex Sakhartchouk public Builder setDepthMaskEnabled(boolean enable) { 36422534176fb5c1257130ef4ee589739ca42766a32Jason Sams mDepthMask = enable; 365288c8711a64893acb3f4a31caf69153be9809d17Jim Shuma return this; 36622534176fb5c1257130ef4ee589739ca42766a32Jason Sams } 36722534176fb5c1257130ef4ee589739ca42766a32Jason Sams 368623c54dd1605d802bb6bfdd0d266a191d4f2d88cAlex Sakhartchouk /** 369623c54dd1605d802bb6bfdd0d266a191d4f2d88cAlex Sakhartchouk * Enables writes into the color buffer 370623c54dd1605d802bb6bfdd0d266a191d4f2d88cAlex Sakhartchouk * 371623c54dd1605d802bb6bfdd0d266a191d4f2d88cAlex Sakhartchouk * @param r specifies whether red channel is written 372623c54dd1605d802bb6bfdd0d266a191d4f2d88cAlex Sakhartchouk * @param g specifies whether green channel is written 373623c54dd1605d802bb6bfdd0d266a191d4f2d88cAlex Sakhartchouk * @param b specifies whether blue channel is written 374623c54dd1605d802bb6bfdd0d266a191d4f2d88cAlex Sakhartchouk * @param a specifies whether alpha channel is written 375623c54dd1605d802bb6bfdd0d266a191d4f2d88cAlex Sakhartchouk * 376623c54dd1605d802bb6bfdd0d266a191d4f2d88cAlex Sakhartchouk * @return this 377623c54dd1605d802bb6bfdd0d266a191d4f2d88cAlex Sakhartchouk */ 378b4d7bb6872f523b4318144202e119766ed9054edAlex Sakhartchouk public Builder setColorMaskEnabled(boolean r, boolean g, boolean b, boolean a) { 37922534176fb5c1257130ef4ee589739ca42766a32Jason Sams mColorMaskR = r; 38022534176fb5c1257130ef4ee589739ca42766a32Jason Sams mColorMaskG = g; 38122534176fb5c1257130ef4ee589739ca42766a32Jason Sams mColorMaskB = b; 38222534176fb5c1257130ef4ee589739ca42766a32Jason Sams mColorMaskA = a; 383288c8711a64893acb3f4a31caf69153be9809d17Jim Shuma return this; 38422534176fb5c1257130ef4ee589739ca42766a32Jason Sams } 38522534176fb5c1257130ef4ee589739ca42766a32Jason Sams 386623c54dd1605d802bb6bfdd0d266a191d4f2d88cAlex Sakhartchouk /** 387623c54dd1605d802bb6bfdd0d266a191d4f2d88cAlex Sakhartchouk * Specifies how incoming pixels are combined with the pixels 388623c54dd1605d802bb6bfdd0d266a191d4f2d88cAlex Sakhartchouk * stored in the framebuffer 389623c54dd1605d802bb6bfdd0d266a191d4f2d88cAlex Sakhartchouk * 390623c54dd1605d802bb6bfdd0d266a191d4f2d88cAlex Sakhartchouk * @param src specifies how the source blending factor is 391623c54dd1605d802bb6bfdd0d266a191d4f2d88cAlex Sakhartchouk * computed 392623c54dd1605d802bb6bfdd0d266a191d4f2d88cAlex Sakhartchouk * @param dst specifies how the destination blending factor is 393623c54dd1605d802bb6bfdd0d266a191d4f2d88cAlex Sakhartchouk * computed 394623c54dd1605d802bb6bfdd0d266a191d4f2d88cAlex Sakhartchouk * 395623c54dd1605d802bb6bfdd0d266a191d4f2d88cAlex Sakhartchouk * @return this 396623c54dd1605d802bb6bfdd0d266a191d4f2d88cAlex Sakhartchouk */ 397288c8711a64893acb3f4a31caf69153be9809d17Jim Shuma public Builder setBlendFunc(BlendSrcFunc src, BlendDstFunc dst) { 39822534176fb5c1257130ef4ee589739ca42766a32Jason Sams mBlendSrc = src; 39922534176fb5c1257130ef4ee589739ca42766a32Jason Sams mBlendDst = dst; 400288c8711a64893acb3f4a31caf69153be9809d17Jim Shuma return this; 40122534176fb5c1257130ef4ee589739ca42766a32Jason Sams } 40222534176fb5c1257130ef4ee589739ca42766a32Jason Sams 403623c54dd1605d802bb6bfdd0d266a191d4f2d88cAlex Sakhartchouk /** 404623c54dd1605d802bb6bfdd0d266a191d4f2d88cAlex Sakhartchouk * Enables dithering 405623c54dd1605d802bb6bfdd0d266a191d4f2d88cAlex Sakhartchouk * 406623c54dd1605d802bb6bfdd0d266a191d4f2d88cAlex Sakhartchouk * @param enable specifies whether dithering is enabled or 407623c54dd1605d802bb6bfdd0d266a191d4f2d88cAlex Sakhartchouk * disabled 408623c54dd1605d802bb6bfdd0d266a191d4f2d88cAlex Sakhartchouk * 409623c54dd1605d802bb6bfdd0d266a191d4f2d88cAlex Sakhartchouk * @return this 410623c54dd1605d802bb6bfdd0d266a191d4f2d88cAlex Sakhartchouk */ 411b4d7bb6872f523b4318144202e119766ed9054edAlex Sakhartchouk public Builder setDitherEnabled(boolean enable) { 41222534176fb5c1257130ef4ee589739ca42766a32Jason Sams mDither = enable; 413288c8711a64893acb3f4a31caf69153be9809d17Jim Shuma return this; 41422534176fb5c1257130ef4ee589739ca42766a32Jason Sams } 41522534176fb5c1257130ef4ee589739ca42766a32Jason Sams 416623c54dd1605d802bb6bfdd0d266a191d4f2d88cAlex Sakhartchouk /** 417623c54dd1605d802bb6bfdd0d266a191d4f2d88cAlex Sakhartchouk * Creates a program store from the current state of the builder 418623c54dd1605d802bb6bfdd0d266a191d4f2d88cAlex Sakhartchouk */ 41922534176fb5c1257130ef4ee589739ca42766a32Jason Sams public ProgramStore create() { 420771bebb94054d06f97284379c93a2620613513c3Jason Sams mRS.validate(); 421331bf9b14b1c5c1e88f5c4092b6e24fae887fb3bJason Sams int id = mRS.nProgramStoreCreate(mColorMaskR, mColorMaskG, mColorMaskB, mColorMaskA, 422331bf9b14b1c5c1e88f5c4092b6e24fae887fb3bJason Sams mDepthMask, mDither, 423331bf9b14b1c5c1e88f5c4092b6e24fae887fb3bJason Sams mBlendSrc.mID, mBlendDst.mID, mDepthFunc.mID); 4247d5f5e7c8943e043a422ad51c85d4e1684c37e28Alex Sakhartchouk ProgramStore programStore = new ProgramStore(id, mRS); 4257d5f5e7c8943e043a422ad51c85d4e1684c37e28Alex Sakhartchouk programStore.mDepthFunc = mDepthFunc; 4267d5f5e7c8943e043a422ad51c85d4e1684c37e28Alex Sakhartchouk programStore.mDepthMask = mDepthMask; 4277d5f5e7c8943e043a422ad51c85d4e1684c37e28Alex Sakhartchouk programStore.mColorMaskR = mColorMaskR; 4287d5f5e7c8943e043a422ad51c85d4e1684c37e28Alex Sakhartchouk programStore.mColorMaskG = mColorMaskG; 4297d5f5e7c8943e043a422ad51c85d4e1684c37e28Alex Sakhartchouk programStore.mColorMaskB = mColorMaskB; 4307d5f5e7c8943e043a422ad51c85d4e1684c37e28Alex Sakhartchouk programStore.mColorMaskA = mColorMaskA; 4317d5f5e7c8943e043a422ad51c85d4e1684c37e28Alex Sakhartchouk programStore.mBlendSrc = mBlendSrc; 4327d5f5e7c8943e043a422ad51c85d4e1684c37e28Alex Sakhartchouk programStore.mBlendDst = mBlendDst; 4337d5f5e7c8943e043a422ad51c85d4e1684c37e28Alex Sakhartchouk programStore.mDither = mDither; 4347d5f5e7c8943e043a422ad51c85d4e1684c37e28Alex Sakhartchouk return programStore; 43522534176fb5c1257130ef4ee589739ca42766a32Jason Sams } 43622534176fb5c1257130ef4ee589739ca42766a32Jason Sams } 43722534176fb5c1257130ef4ee589739ca42766a32Jason Sams 43822534176fb5c1257130ef4ee589739ca42766a32Jason Sams} 43922534176fb5c1257130ef4ee589739ca42766a32Jason Sams 44022534176fb5c1257130ef4ee589739ca42766a32Jason Sams 44122534176fb5c1257130ef4ee589739ca42766a32Jason Sams 44222534176fb5c1257130ef4ee589739ca42766a32Jason Sams 443