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