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