summaryrefslogtreecommitdiffstats
path: root/src/amd/vulkan
diff options
context:
space:
mode:
authorDave Airlie <[email protected]>2016-10-14 13:11:20 +1000
committerDave Airlie <[email protected]>2016-10-19 09:05:25 +1000
commitc6f1077e0d96400c89ad577e841b1851ab9e3349 (patch)
tree50bac83ae182fc1983d492e02e3d2f9caa40aef7 /src/amd/vulkan
parent78bce52f9a57ea020ef7b9386216efe151be9542 (diff)
radv: drop local MIN/MAX macros.
Use the ones in macros.h instead. Acked-by: Jason Ekstrand <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
Diffstat (limited to 'src/amd/vulkan')
-rw-r--r--src/amd/vulkan/radv_descriptor_set.c2
-rw-r--r--src/amd/vulkan/radv_private.h5
-rw-r--r--src/amd/vulkan/radv_wsi_x11.c2
-rw-r--r--src/amd/vulkan/winsys/amdgpu/radv_amdgpu_surface.c2
4 files changed, 4 insertions, 7 deletions
diff --git a/src/amd/vulkan/radv_descriptor_set.c b/src/amd/vulkan/radv_descriptor_set.c
index ba8a002929a..3dea0750995 100644
--- a/src/amd/vulkan/radv_descriptor_set.c
+++ b/src/amd/vulkan/radv_descriptor_set.c
@@ -45,7 +45,7 @@ VkResult radv_CreateDescriptorSetLayout(
uint32_t max_binding = 0;
uint32_t immutable_sampler_count = 0;
for (uint32_t j = 0; j < pCreateInfo->bindingCount; j++) {
- max_binding = MAX(max_binding, pCreateInfo->pBindings[j].binding);
+ max_binding = MAX2(max_binding, pCreateInfo->pBindings[j].binding);
if (pCreateInfo->pBindings[j].pImmutableSamplers)
immutable_sampler_count += pCreateInfo->pBindings[j].descriptorCount;
}
diff --git a/src/amd/vulkan/radv_private.h b/src/amd/vulkan/radv_private.h
index 1f5af622e1d..8dddf70b294 100644
--- a/src/amd/vulkan/radv_private.h
+++ b/src/amd/vulkan/radv_private.h
@@ -85,9 +85,6 @@ typedef uint32_t xcb_window_t;
#define radv_noreturn __attribute__((__noreturn__))
#define radv_printflike(a, b) __attribute__((__format__(__printf__, a, b)))
-#define MIN(a, b) ((a) < (b) ? (a) : (b))
-#define MAX(a, b) ((a) > (b) ? (a) : (b))
-
static inline uint32_t
align_u32(uint32_t v, uint32_t a)
{
@@ -141,7 +138,7 @@ radv_minify(uint32_t n, uint32_t levels)
if (unlikely(n == 0))
return 0;
else
- return MAX(n >> levels, 1);
+ return MAX2(n >> levels, 1);
}
static inline float
radv_clamp_f(float f, float min, float max)
diff --git a/src/amd/vulkan/radv_wsi_x11.c b/src/amd/vulkan/radv_wsi_x11.c
index 9cd0db0a685..8e0040ffd46 100644
--- a/src/amd/vulkan/radv_wsi_x11.c
+++ b/src/amd/vulkan/radv_wsi_x11.c
@@ -823,7 +823,7 @@ x11_surface_create_swapchain(VkIcdSurfaceBase *icd_surface,
* 4) One to render to
*/
if (pCreateInfo->presentMode == VK_PRESENT_MODE_MAILBOX_KHR)
- num_images = MAX(num_images, 4);
+ num_images = MAX2(num_images, 4);
size_t size = sizeof(*chain) + num_images * sizeof(chain->images[0]);
chain = radv_alloc2(&device->alloc, pAllocator, size, 8,
diff --git a/src/amd/vulkan/winsys/amdgpu/radv_amdgpu_surface.c b/src/amd/vulkan/winsys/amdgpu/radv_amdgpu_surface.c
index 31927ecd91b..02aad3c81d2 100644
--- a/src/amd/vulkan/winsys/amdgpu/radv_amdgpu_surface.c
+++ b/src/amd/vulkan/winsys/amdgpu/radv_amdgpu_surface.c
@@ -256,7 +256,7 @@ static int radv_compute_level(ADDR_HANDLE addrlib,
surf_level->dcc_fast_clear_size = AddrDccOut->dccFastClearSize;
surf_level->dcc_enabled = true;
surf->dcc_size = surf_level->dcc_offset + AddrDccOut->dccRamSize;
- surf->dcc_alignment = MAX(surf->dcc_alignment, AddrDccOut->dccRamBaseAlign);
+ surf->dcc_alignment = MAX2(surf->dcc_alignment, AddrDccOut->dccRamBaseAlign);
}
}