1331bf9b14b1c5c1e88f5c4092b6e24fae887fb3bJason Sams/* 2331bf9b14b1c5c1e88f5c4092b6e24fae887fb3bJason Sams * Copyright (C) 2011 The Android Open Source Project 3331bf9b14b1c5c1e88f5c4092b6e24fae887fb3bJason Sams * 4331bf9b14b1c5c1e88f5c4092b6e24fae887fb3bJason Sams * Licensed under the Apache License, Version 2.0 (the "License"); 5331bf9b14b1c5c1e88f5c4092b6e24fae887fb3bJason Sams * you may not use this file except in compliance with the License. 6331bf9b14b1c5c1e88f5c4092b6e24fae887fb3bJason Sams * You may obtain a copy of the License at 7331bf9b14b1c5c1e88f5c4092b6e24fae887fb3bJason Sams * 8331bf9b14b1c5c1e88f5c4092b6e24fae887fb3bJason Sams * http://www.apache.org/licenses/LICENSE-2.0 9331bf9b14b1c5c1e88f5c4092b6e24fae887fb3bJason Sams * 10331bf9b14b1c5c1e88f5c4092b6e24fae887fb3bJason Sams * Unless required by applicable law or agreed to in writing, software 11331bf9b14b1c5c1e88f5c4092b6e24fae887fb3bJason Sams * distributed under the License is distributed on an "AS IS" BASIS, 12331bf9b14b1c5c1e88f5c4092b6e24fae887fb3bJason Sams * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13331bf9b14b1c5c1e88f5c4092b6e24fae887fb3bJason Sams * See the License for the specific language governing permissions and 14331bf9b14b1c5c1e88f5c4092b6e24fae887fb3bJason Sams * limitations under the License. 15331bf9b14b1c5c1e88f5c4092b6e24fae887fb3bJason Sams */ 16331bf9b14b1c5c1e88f5c4092b6e24fae887fb3bJason Sams 17331bf9b14b1c5c1e88f5c4092b6e24fae887fb3bJason Sams 18331bf9b14b1c5c1e88f5c4092b6e24fae887fb3bJason Sams#include "rsdCore.h" 19331bf9b14b1c5c1e88f5c4092b6e24fae887fb3bJason Sams#include "rsdProgramStore.h" 20331bf9b14b1c5c1e88f5c4092b6e24fae887fb3bJason Sams 21331bf9b14b1c5c1e88f5c4092b6e24fae887fb3bJason Sams#include "rsContext.h" 22331bf9b14b1c5c1e88f5c4092b6e24fae887fb3bJason Sams#include "rsProgramStore.h" 23331bf9b14b1c5c1e88f5c4092b6e24fae887fb3bJason Sams 24331bf9b14b1c5c1e88f5c4092b6e24fae887fb3bJason Sams#include <GLES/gl.h> 25331bf9b14b1c5c1e88f5c4092b6e24fae887fb3bJason Sams#include <GLES/glext.h> 26331bf9b14b1c5c1e88f5c4092b6e24fae887fb3bJason Sams 27331bf9b14b1c5c1e88f5c4092b6e24fae887fb3bJason Sams 28331bf9b14b1c5c1e88f5c4092b6e24fae887fb3bJason Samsusing namespace android; 29331bf9b14b1c5c1e88f5c4092b6e24fae887fb3bJason Samsusing namespace android::renderscript; 30331bf9b14b1c5c1e88f5c4092b6e24fae887fb3bJason Sams 31331bf9b14b1c5c1e88f5c4092b6e24fae887fb3bJason Samsbool rsdProgramRasterInit(const Context *, const ProgramRaster *) { 32331bf9b14b1c5c1e88f5c4092b6e24fae887fb3bJason Sams return true; 33331bf9b14b1c5c1e88f5c4092b6e24fae887fb3bJason Sams} 34331bf9b14b1c5c1e88f5c4092b6e24fae887fb3bJason Sams 355316b9eead0c29df36f46d29c17914bc3c61ed9fJason Samsvoid rsdProgramRasterSetActive(const Context *rsc, const ProgramRaster *pr) { 36331bf9b14b1c5c1e88f5c4092b6e24fae887fb3bJason Sams switch (pr->mHal.state.cull) { 37331bf9b14b1c5c1e88f5c4092b6e24fae887fb3bJason Sams case RS_CULL_BACK: 385316b9eead0c29df36f46d29c17914bc3c61ed9fJason Sams RSD_CALL_GL(glEnable, GL_CULL_FACE); 395316b9eead0c29df36f46d29c17914bc3c61ed9fJason Sams RSD_CALL_GL(glCullFace, GL_BACK); 40331bf9b14b1c5c1e88f5c4092b6e24fae887fb3bJason Sams break; 41331bf9b14b1c5c1e88f5c4092b6e24fae887fb3bJason Sams case RS_CULL_FRONT: 425316b9eead0c29df36f46d29c17914bc3c61ed9fJason Sams RSD_CALL_GL(glEnable, GL_CULL_FACE); 435316b9eead0c29df36f46d29c17914bc3c61ed9fJason Sams RSD_CALL_GL(glCullFace, GL_FRONT); 44331bf9b14b1c5c1e88f5c4092b6e24fae887fb3bJason Sams break; 45331bf9b14b1c5c1e88f5c4092b6e24fae887fb3bJason Sams case RS_CULL_NONE: 465316b9eead0c29df36f46d29c17914bc3c61ed9fJason Sams RSD_CALL_GL(glDisable, GL_CULL_FACE); 47331bf9b14b1c5c1e88f5c4092b6e24fae887fb3bJason Sams break; 48331bf9b14b1c5c1e88f5c4092b6e24fae887fb3bJason Sams } 49331bf9b14b1c5c1e88f5c4092b6e24fae887fb3bJason Sams 50331bf9b14b1c5c1e88f5c4092b6e24fae887fb3bJason Sams} 51331bf9b14b1c5c1e88f5c4092b6e24fae887fb3bJason Sams 52331bf9b14b1c5c1e88f5c4092b6e24fae887fb3bJason Samsvoid rsdProgramRasterDestroy(const Context *, const ProgramRaster *) { 53331bf9b14b1c5c1e88f5c4092b6e24fae887fb3bJason Sams} 54331bf9b14b1c5c1e88f5c4092b6e24fae887fb3bJason Sams 55331bf9b14b1c5c1e88f5c4092b6e24fae887fb3bJason Sams 56