aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/state_tracker
diff options
context:
space:
mode:
authorIan Romanick <[email protected]>2017-11-13 11:17:41 -0800
committerIan Romanick <[email protected]>2018-03-29 14:09:23 -0700
commitd76c204d0564701b4b8b6a2bdda50e2939683e66 (patch)
treeedcf51df711640ffd89326079f10b1dcf65f311b /src/mesa/state_tracker
parenta3a16d4aa7e5a22816226d8e7417138164b10525 (diff)
util: Move util_is_power_of_two to bitscan.h and rename to util_is_power_of_two_or_zero
The new name make the zero-input behavior more obvious. The next patch adds a new function with different zero-input behavior. Signed-off-by: Ian Romanick <[email protected]> Suggested-by: Matt Turner <[email protected]> Reviewed-by: Alejandro PiƱeiro <[email protected]>
Diffstat (limited to 'src/mesa/state_tracker')
-rw-r--r--src/mesa/state_tracker/st_cb_readpixels.c4
-rw-r--r--src/mesa/state_tracker/st_cb_texture.c6
2 files changed, 5 insertions, 5 deletions
diff --git a/src/mesa/state_tracker/st_cb_readpixels.c b/src/mesa/state_tracker/st_cb_readpixels.c
index 84dd2d548e3..29181216071 100644
--- a/src/mesa/state_tracker/st_cb_readpixels.c
+++ b/src/mesa/state_tracker/st_cb_readpixels.c
@@ -270,8 +270,8 @@ blit_to_staging(struct st_context *st, struct st_renderbuffer *strb,
/* We are creating a texture of the size of the region being read back.
* Need to check for NPOT texture support. */
if (!screen->get_param(screen, PIPE_CAP_NPOT_TEXTURES) &&
- (!util_is_power_of_two(width) ||
- !util_is_power_of_two(height)))
+ (!util_is_power_of_two_or_zero(width) ||
+ !util_is_power_of_two_or_zero(height)))
return NULL;
/* create the destination texture */
diff --git a/src/mesa/state_tracker/st_cb_texture.c b/src/mesa/state_tracker/st_cb_texture.c
index 3a793a72654..628e4af1e67 100644
--- a/src/mesa/state_tracker/st_cb_texture.c
+++ b/src/mesa/state_tracker/st_cb_texture.c
@@ -1527,9 +1527,9 @@ st_TexSubImage(struct gl_context *ctx, GLuint dims,
/* Check for NPOT texture support. */
if (!screen->get_param(screen, PIPE_CAP_NPOT_TEXTURES) &&
- (!util_is_power_of_two(src_templ.width0) ||
- !util_is_power_of_two(src_templ.height0) ||
- !util_is_power_of_two(src_templ.depth0))) {
+ (!util_is_power_of_two_or_zero(src_templ.width0) ||
+ !util_is_power_of_two_or_zero(src_templ.height0) ||
+ !util_is_power_of_two_or_zero(src_templ.depth0))) {
goto fallback;
}