15a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines#include "rs_core.rsh"
25a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines#include "rs_graphics.rsh"
35a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines#include "rs_structs.h"
45a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines
55a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines/**
65a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines* Sampler
75a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines*/
85a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hinesextern rs_sampler_value __attribute__((overloadable))
95a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines        rsSamplerGetMinification(rs_sampler s) {
105a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines    Sampler_t *prog = (Sampler_t *)s.p;
115a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines    if (prog == NULL) {
125a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines        return RS_SAMPLER_INVALID;
135a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines    }
145a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines    return prog->mHal.state.minFilter;
155a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines}
165a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines
175a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hinesextern rs_sampler_value __attribute__((overloadable))
185a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines        rsSamplerGetMagnification(rs_sampler s) {
195a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines    Sampler_t *prog = (Sampler_t *)s.p;
205a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines    if (prog == NULL) {
215a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines        return RS_SAMPLER_INVALID;
225a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines    }
235a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines    return prog->mHal.state.magFilter;
245a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines}
255a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines
265a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hinesextern rs_sampler_value __attribute__((overloadable))
275a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines        rsSamplerGetWrapS(rs_sampler s) {
285a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines    Sampler_t *prog = (Sampler_t *)s.p;
295a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines    if (prog == NULL) {
305a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines        return RS_SAMPLER_INVALID;
315a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines    }
325a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines    return prog->mHal.state.wrapS;
335a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines}
345a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines
355a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hinesextern rs_sampler_value __attribute__((overloadable))
365a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines        rsSamplerGetWrapT(rs_sampler s) {
375a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines    Sampler_t *prog = (Sampler_t *)s.p;
385a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines    if (prog == NULL) {
395a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines        return RS_SAMPLER_INVALID;
405a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines    }
415a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines    return prog->mHal.state.wrapT;
425a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines}
435a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines
445a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hinesextern float __attribute__((overloadable))
455a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines        rsSamplerGetAnisotropy(rs_sampler s) {
465a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines    Sampler_t *prog = (Sampler_t *)s.p;
475a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines    if (prog == NULL) {
485a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines        return 0.0f;
495a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines    }
505a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines    return prog->mHal.state.aniso;
515a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines}
52