diff options
author | Chia-I Wu <[email protected]> | 2014-09-12 10:55:58 +0800 |
---|---|---|
committer | Chia-I Wu <[email protected]> | 2014-09-12 16:58:30 +0800 |
commit | 56d2ebb019f38d727a41f8f4a8ebd4f1aeee19e0 (patch) | |
tree | 44e84ab2aa0481e9f75a924ed2803bd7326f8064 /src/gallium/drivers/ilo/ilo_format.c | |
parent | ea5de3e0bd82c52130633b1f01b5e0ed226b3b76 (diff) |
ilo: use an accessor for dev->gen
It should enable us to do specialized builds by making the accessor return a
constant.
Diffstat (limited to 'src/gallium/drivers/ilo/ilo_format.c')
-rw-r--r-- | src/gallium/drivers/ilo/ilo_format.c | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/src/gallium/drivers/ilo/ilo_format.c b/src/gallium/drivers/ilo/ilo_format.c index ab23f6b005b..d0d3be02213 100644 --- a/src/gallium/drivers/ilo/ilo_format.c +++ b/src/gallium/drivers/ilo/ilo_format.c @@ -705,8 +705,12 @@ ilo_format_supports_rt(const struct ilo_dev_info *dev, assert(!cap->rt_write_blending || cap->rt_write_blending >= cap->rt_write); - return util_format_is_pure_integer(format) ? (dev->gen >= cap->rt_write) : - (cap->rt_write_blending) ? (dev->gen >= cap->rt_write_blending) : false; + if (util_format_is_pure_integer(format)) + return (ilo_dev_gen(dev) >= cap->rt_write); + else if (cap->rt_write_blending) + return (ilo_dev_gen(dev) >= cap->rt_write_blending); + else + return false; } static bool @@ -722,8 +726,12 @@ ilo_format_supports_sampler(const struct ilo_dev_info *dev, assert(!cap->filtering || cap->filtering >= cap->sampling); - return util_format_is_pure_integer(format) ? (dev->gen >= cap->sampling) : - (cap->filtering) ? (dev->gen >= cap->filtering) : false; + if (util_format_is_pure_integer(format)) + return (ilo_dev_gen(dev) >= cap->sampling); + else if (cap->filtering) + return (ilo_dev_gen(dev) >= cap->filtering); + else + return false; } static bool @@ -734,7 +742,8 @@ ilo_format_supports_vb(const struct ilo_dev_info *dev, const struct ilo_vf_cap *cap = (idx >= 0 && idx < Elements(ilo_vf_caps)) ? &ilo_vf_caps[idx] : NULL; - return (cap && cap->vertex_element && dev->gen >= cap->vertex_element); + return (cap && cap->vertex_element && + ilo_dev_gen(dev) >= cap->vertex_element); } static boolean |