mesa/src/amd/vulkan/radv_sampler.h
Samuel Pitoiset 371316e989 radv: use radv_compiler_info everywhere during compilation
This prevents the compiler to access the logical/physical devices and
the instance during compilation.

The main goal is to make it more robust against cache related issues
when something isn't hashed correctly (this used to happen a lot in the
past). Also it would be much more robust for sharing binaries between
two GPUs in the same generation (eg. Vangogh/Rembrandt) because
everything needed for compilation is in radv_compiler_info. There is
still some work to do to achieve that but it's making good progress.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40992>
2026-04-23 07:56:48 +00:00

35 lines
994 B
C

/*
* Copyright © 2016 Red Hat.
* Copyright © 2016 Bas Nieuwenhuizen
*
* based in part on anv driver which is:
* Copyright © 2015 Intel Corporation
*
* SPDX-License-Identifier: MIT
*/
#ifndef RADV_SAMPLER_H
#define RADV_SAMPLER_H
#include "vk_sampler.h"
struct radv_device;
struct radv_compiler_info;
struct radv_sampler {
struct vk_sampler vk;
uint32_t state[4];
uint32_t border_color_index;
bool border_color_index_from_user;
};
VK_DEFINE_NONDISP_HANDLE_CASTS(radv_sampler, vk.base, VkSampler, VK_OBJECT_TYPE_SAMPLER)
VkResult radv_sampler_init(struct radv_device *device, struct radv_sampler *sampler,
const VkSamplerCreateInfo *pCreateInfo);
void radv_sampler_finish(struct radv_device *device, struct radv_sampler *sampler);
void radv_make_sampler_descriptor(const struct radv_compiler_info *compiler_info,
const struct vk_sampler_state *sampler_state, uint32_t *desc);
#endif /* RADV_SAMPLER_H */