rs_program.c 3.0 KB

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