• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 #include "rs_core.rsh"
2 #include "rs_graphics.rsh"
3 #include "rs_structs.h"
4 
5 /**
6 * Sampler
7 */
8 extern rs_sampler_value __attribute__((overloadable))
rsSamplerGetMinification(rs_sampler s)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 
17 extern rs_sampler_value __attribute__((overloadable))
rsSamplerGetMagnification(rs_sampler s)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 
26 extern rs_sampler_value __attribute__((overloadable))
rsSamplerGetWrapS(rs_sampler s)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 
35 extern rs_sampler_value __attribute__((overloadable))
rsSamplerGetWrapT(rs_sampler s)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 
44 extern float __attribute__((overloadable))
rsSamplerGetAnisotropy(rs_sampler s)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