summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/swr/swr_screen.cpp
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/gallium/drivers/swr/swr_screen.cpp
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/gallium/drivers/swr/swr_screen.cpp')
-rw-r--r--src/gallium/drivers/swr/swr_screen.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/gallium/drivers/swr/swr_screen.cpp b/src/gallium/drivers/swr/swr_screen.cpp
index dd2d003d15d..880a177c399 100644
--- a/src/gallium/drivers/swr/swr_screen.cpp
+++ b/src/gallium/drivers/swr/swr_screen.cpp
@@ -105,7 +105,7 @@ swr_is_format_supported(struct pipe_screen *_screen,
return FALSE;
if ((sample_count > screen->msaa_max_count)
- || !util_is_power_of_two(sample_count))
+ || !util_is_power_of_two_or_zero(sample_count))
return FALSE;
if (bind & PIPE_BIND_DISPLAY_TARGET) {
@@ -1103,7 +1103,7 @@ swr_validate_env_options(struct swr_screen *screen)
int msaa_max_count = debug_get_num_option("SWR_MSAA_MAX_COUNT", 1);
if (msaa_max_count != 1) {
if ((msaa_max_count < 1) || (msaa_max_count > SWR_MAX_NUM_MULTISAMPLES)
- || !util_is_power_of_two(msaa_max_count)) {
+ || !util_is_power_of_two_or_zero(msaa_max_count)) {
fprintf(stderr, "SWR_MSAA_MAX_COUNT invalid: %d\n", msaa_max_count);
fprintf(stderr, "must be power of 2 between 1 and %d" \
" (or 1 to disable msaa)\n",