Home | History | Annotate | Download | only in runtime
      1 #include "rs_core.rsh"
      2 #include "rs_graphics.rsh"
      3 #include "rs_structs.h"
      4 
      5 /**
      6 * Program Store
      7 */
      8 extern rs_depth_func __attribute__((overloadable))
      9         rsgProgramStoreGetDepthFunc(rs_program_store ps) {
     10     ProgramStore_t *prog = (ProgramStore_t *)ps.p;
     11     if (prog == NULL) {
     12         return RS_DEPTH_FUNC_INVALID;
     13     }
     14     return prog->mHal.state.depthFunc;
     15 }
     16 
     17 extern bool __attribute__((overloadable))
     18         rsgProgramStoreIsDepthMaskEnabled(rs_program_store ps) {
     19     ProgramStore_t *prog = (ProgramStore_t *)ps.p;
     20     if (prog == NULL) {
     21         return false;
     22     }
     23     return prog->mHal.state.depthWriteEnable;
     24 }
     25 
     26 extern bool __attribute__((overloadable))
     27         rsgProgramStoreIsColorMaskRedEnabled(rs_program_store ps) {
     28     ProgramStore_t *prog = (ProgramStore_t *)ps.p;
     29     if (prog == NULL) {
     30         return false;
     31     }
     32     return prog->mHal.state.colorRWriteEnable;
     33 }
     34 
     35 extern bool __attribute__((overloadable))
     36         rsgProgramStoreIsColorMaskGreenEnabled(rs_program_store ps) {
     37     ProgramStore_t *prog = (ProgramStore_t *)ps.p;
     38     if (prog == NULL) {
     39         return false;
     40     }
     41     return prog->mHal.state.colorGWriteEnable;
     42 }
     43 
     44 extern bool __attribute__((overloadable))
     45         rsgProgramStoreIsColorMaskBlueEnabled(rs_program_store ps) {
     46     ProgramStore_t *prog = (ProgramStore_t *)ps.p;
     47     if (prog == NULL) {
     48         return false;
     49     }
     50     return prog->mHal.state.colorBWriteEnable;
     51 }
     52 
     53 extern bool __attribute__((overloadable))
     54         rsgProgramStoreIsColorMaskAlphaEnabled(rs_program_store ps) {
     55     ProgramStore_t *prog = (ProgramStore_t *)ps.p;
     56     if (prog == NULL) {
     57         return false;
     58     }
     59     return prog->mHal.state.colorAWriteEnable;
     60 }
     61 
     62 extern rs_blend_src_func __attribute__((overloadable))
     63         rsgProgramStoreGetBlendSrcFunc(rs_program_store ps) {
     64     ProgramStore_t *prog = (ProgramStore_t *)ps.p;
     65     if (prog == NULL) {
     66         return RS_BLEND_SRC_INVALID;
     67     }
     68     return prog->mHal.state.blendSrc;
     69 }
     70 
     71 extern rs_blend_dst_func __attribute__((overloadable))
     72         rsgProgramStoreGetBlendDstFunc(rs_program_store ps) {
     73     ProgramStore_t *prog = (ProgramStore_t *)ps.p;
     74     if (prog == NULL) {
     75         return RS_BLEND_DST_INVALID;
     76     }
     77     return prog->mHal.state.blendDst;
     78 }
     79 
     80 extern bool __attribute__((overloadable))
     81         rsgProgramStoreIsDitherEnabled(rs_program_store ps) {
     82     ProgramStore_t *prog = (ProgramStore_t *)ps.p;
     83     if (prog == NULL) {
     84         return false;
     85     }
     86     return prog->mHal.state.ditherEnable;
     87 }
     88 
     89 /**
     90 * Program Raster
     91 */
     92 extern bool __attribute__((overloadable))
     93         rsgProgramRasterIsPointSpriteEnabled(rs_program_raster pr) {
     94     ProgramRaster_t *prog = (ProgramRaster_t *)pr.p;
     95     if (prog == NULL) {
     96         return false;
     97     }
     98     return prog->mHal.state.pointSprite;
     99 }
    100 
    101 extern rs_cull_mode __attribute__((overloadable))
    102         rsgProgramRasterGetCullMode(rs_program_raster pr) {
    103     ProgramRaster_t *prog = (ProgramRaster_t *)pr.p;
    104     if (prog == NULL) {
    105         return RS_CULL_INVALID;
    106     }
    107     return prog->mHal.state.cull;
    108 }
    109