[Mesa-dev] [PATCH] st/mesa: don't set the border color if it's unused
Marek Olšák
maraeo at gmail.com
Fri Jun 16 10:26:24 UTC 2017
On Jun 16, 2017 6:08 AM, "Michel Dänzer" <michel at daenzer.net> wrote:
On 15/06/17 08:56 PM, Marek Olšák wrote:
> From: Marek Olšák <marek.olsak at amd.com>
[...]
> /* For non-black borders... */
> - if (msamp->BorderColor.ui[0] ||
> - msamp->BorderColor.ui[1] ||
> - msamp->BorderColor.ui[2] ||
> - msamp->BorderColor.ui[3]) {
> + if ((msamp->BorderColor.ui[0] ||
> + msamp->BorderColor.ui[1] ||
> + msamp->BorderColor.ui[2] ||
> + msamp->BorderColor.ui[3]) &&
> + /* This is true if wrap modes are using the border color. */
> + (sampler->wrap_s | sampler->wrap_t | sampler->wrap_r) & 0x1) {
I'd make this
if (/* This is true if wrap modes are using the border color. */
(sampler->wrap_s | sampler->wrap_t | sampler->wrap_r) & 0x1 &&
(msamp->BorderColor.ui[0] ||
msamp->BorderColor.ui[1] ||
msamp->BorderColor.ui[2] ||
msamp->BorderColor.ui[3])) {
No need to test the BorderColor.ui array when the border colour isn't used.
Done locally.
Marek
--
Earthling Michel Dänzer | http://www.amd.com
Libre software enthusiast | Mesa and X developer
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20170616/96ba12cb/attachment-0001.html>
More information about the mesa-dev
mailing list