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