Re: [PATCH 1/2] wined3d: Remove leftover texture accesses in GLSL shader generation
On 21 April 2013 16:51, Stefan Dösinger <stefan(a)codeweavers.com> wrote:
- if (texture && texture->target == GL_TEXTURE_RECTANGLE_ARB) - sample_flags |= WINED3D_GLSL_SAMPLE_RECT; + if (priv->cur_ps_args->np2_fixup & (1 << sampler_idx)) + { + sample_flags |= WINED3D_GLSL_SAMPLE_NPOT; + } I don't think the added braces are an improvement, but otherwise this looks ok.
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Am 2013-04-22 14:42, schrieb Henri Verbeet:> On 21 April 2013 16:51, Stefan Dösinger <stefan(a)codeweavers.com> wrote:
- if (texture && texture->target == GL_TEXTURE_RECTANGLE_ARB) - sample_flags |= WINED3D_GLSL_SAMPLE_RECT; + if (priv->cur_ps_args->np2_fixup & (1 << sampler_idx)) + { + sample_flags |= WINED3D_GLSL_SAMPLE_NPOT; + } I don't think the added braces are an improvement, but otherwise this looks ok. Personally I don't like ifs without braces if either the condition or the instruction is spread over more than one line.
Afaics the code isn't quite consistent in either direction. I can resend the patch without the braces if you disagree. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (GNU/Linux) Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQIcBAEBAgAGBQJRdTGfAAoJEN0/YqbEcdMwKIcP/ieIu1iHckCe1hSoG+Xx5YAm 4DBCjak4xlf1NfmVSik0RduCCG4mR1w2ZWkYXzrHuHUsQlh3ILsNe3nsHIOj/M4K R82tmWfCS0iV5xThnGiIdVs4/7lkwcs8ZJGZDWhN8bvDZ3CtJCVSCepulPt1LJ8Q +G2S18OKGIXgtQTYNPgvGK5V3QSpuSkAWkmfL45II9vD1/Qs4/SIEF/6jQrJ9cya 7DRnYhMRdZaz0zfrvjrq6rUQOWwtLPj50zDCINLS1w6prMZugyB9zdB5xmnAjzu2 eR9Dvh/7USzoFkbv2KwFwBQhxj5202+iUoDJEcKZ765GveeN5d3+GghLN8M1B8jR 9alSRqsirWvxiu/HT5W3e4Hm83TMp1XOrAgfrCQHjg9PGfQ/vWVjpf+uVh5xprzC gRLW6ko5I9QKsFDuoeg5revedX2BP2z+iUH1zRIZhLnegdnEwVaIuuhPVZ4bW1WB QqxfaMBuKJ8B86g8OEcE8BMHDF9qXCnd9ewS0qHpPwshvkBP3GJdJt1w5tVmvp/1 s/OTV4gBYIF6ZzWX89Boi0dWyUnUGFGl9n4FJbN3473SeJor0HkZHAgqXLbDgP/D AbpmEgdiRhPTRGIfO42mwSqdOZjyXOvh5E2HoUlfxoM5xCqKkzrC2HqGHowUaxUy FWJtBflkY/oslt8BQsLS =qysk -----END PGP SIGNATURE-----
On 22 April 2013 14:48, Stefan Dösinger <stefan(a)codeweavers.com> wrote:
Personally I don't like ifs without braces if either the condition or the instruction is spread over more than one line.
Well, I do disagree, but note that that reasoning doesn't actually apply here, both are single-line.
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Am 2013-04-22 14:54, schrieb Henri Verbeet:
On 22 April 2013 14:48, Stefan Dösinger <stefan(a)codeweavers.com> wrote:
Personally I don't like ifs without braces if either the condition or the instruction is spread over more than one line.
Well, I do disagree, but note that that reasoning doesn't actually apply here, both are single-line. Oh right, I changed that from a first version of the patch before sending.
/me bangs head against wall and will resend. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (GNU/Linux) Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQIcBAEBAgAGBQJRdTPPAAoJEN0/YqbEcdMw/5kP/2N5YFuzEKsjVLR29ArqBEha qsYuQUOLq6OhguUK/cksTidnVIMQ9V99aFVTz1RXdgAfWqVhIZ9UhE8M1cSKTq2m +VJEtCmDzsuocUg7ZWNq+WOPivE65D/HpS+j1g6B3VTfeRXUAWNAICHz3B7jB1lO wmFLXOuWPha2G6n89o+nN3lFBhNSU3ViFMxwjPWXKqrrAxRKGRIKR6aHyKqajpsP dIeppHO6UXcj9Pxb44GpXdlwgKYa17eIM95i7pzTV0m4mmyMRGGr4L4HCVcZhXuk PUULZE5lKJM6Ada8g3xTtsfOc+SazSWyhZpFgczqBAGQy4y4gn24xcMREz0xtEwI v27xFuKFXP2XHi6sSbAkTg1FF+S+hL+S2Kn5J7SAHa2jPD8YHf1zZlevCvHW6Gpi S2ivTys+wNnHEOjfv+dnR7fOBHkCJhMs6f6loGvaeGKx5i5q/HsopcrxeZJXfIuc oFRZJgw6HbzPWltb3jvA6XTmDQFUH49QvqY3DoZRO+Q5aTw29Zt6MC1hhEVdZMWf it2RVlKfdd+t9Ou9hDkzI4Qn0hxx7cwsbQXignghwQfeiMKjrZQDhn2GPqKv1wEM Krl/ZHoagBnodiFr7HGdhewrHntGxTEphR5ygZc/mgJtV7A6wqDPmzbPCX6OJxkK SJDm3wSw3f+t11u6AyXC =M+Ry -----END PGP SIGNATURE-----
participants (2)
-
Henri Verbeet -
Stefan Dösinger