rs_sampler.c 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. #include "rs_core.rsh"
  2. #include "rs_structs.h"
  3. /**
  4. * Sampler
  5. */
  6. extern rs_sampler_value __attribute__((overloadable))
  7. rsSamplerGetMinification(rs_sampler s) {
  8. Sampler_t *prog = (Sampler_t *)s.p;
  9. if (prog == NULL) {
  10. return RS_SAMPLER_INVALID;
  11. }
  12. return prog->mHal.state.minFilter;
  13. }
  14. extern rs_sampler_value __attribute__((overloadable))
  15. rsSamplerGetMagnification(rs_sampler s) {
  16. Sampler_t *prog = (Sampler_t *)s.p;
  17. if (prog == NULL) {
  18. return RS_SAMPLER_INVALID;
  19. }
  20. return prog->mHal.state.magFilter;
  21. }
  22. extern rs_sampler_value __attribute__((overloadable))
  23. rsSamplerGetWrapS(rs_sampler s) {
  24. Sampler_t *prog = (Sampler_t *)s.p;
  25. if (prog == NULL) {
  26. return RS_SAMPLER_INVALID;
  27. }
  28. return prog->mHal.state.wrapS;
  29. }
  30. extern rs_sampler_value __attribute__((overloadable))
  31. rsSamplerGetWrapT(rs_sampler s) {
  32. Sampler_t *prog = (Sampler_t *)s.p;
  33. if (prog == NULL) {
  34. return RS_SAMPLER_INVALID;
  35. }
  36. return prog->mHal.state.wrapT;
  37. }
  38. extern float __attribute__((overloadable))
  39. rsSamplerGetAnisotropy(rs_sampler s) {
  40. Sampler_t *prog = (Sampler_t *)s.p;
  41. if (prog == NULL) {
  42. return 0.0f;
  43. }
  44. return prog->mHal.state.aniso;
  45. }