radv: Don't include radv_private.h from radv_shader.h
This patch decouples radv_shader.h from any LLVM dependency. Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
This commit is contained in:

committed by
Samuel Pitoiset

parent
f27908152b
commit
45638e14fb
@@ -80,6 +80,50 @@ static const struct nir_shader_compiler_options nir_options = {
|
||||
.use_interpolated_input_intrinsics = true,
|
||||
};
|
||||
|
||||
bool
|
||||
radv_can_dump_shader(struct radv_device *device,
|
||||
struct radv_shader_module *module,
|
||||
bool is_gs_copy_shader)
|
||||
{
|
||||
if (!(device->instance->debug_flags & RADV_DEBUG_DUMP_SHADERS))
|
||||
return false;
|
||||
|
||||
/* Only dump non-meta shaders, useful for debugging purposes. */
|
||||
return (module && !module->nir) || is_gs_copy_shader;
|
||||
}
|
||||
|
||||
bool
|
||||
radv_can_dump_shader_stats(struct radv_device *device,
|
||||
struct radv_shader_module *module)
|
||||
{
|
||||
/* Only dump non-meta shader stats. */
|
||||
return device->instance->debug_flags & RADV_DEBUG_DUMP_SHADER_STATS &&
|
||||
module && !module->nir;
|
||||
}
|
||||
|
||||
unsigned shader_io_get_unique_index(gl_varying_slot slot)
|
||||
{
|
||||
/* handle patch indices separate */
|
||||
if (slot == VARYING_SLOT_TESS_LEVEL_OUTER)
|
||||
return 0;
|
||||
if (slot == VARYING_SLOT_TESS_LEVEL_INNER)
|
||||
return 1;
|
||||
if (slot >= VARYING_SLOT_PATCH0 && slot <= VARYING_SLOT_TESS_MAX)
|
||||
return 2 + (slot - VARYING_SLOT_PATCH0);
|
||||
if (slot == VARYING_SLOT_POS)
|
||||
return 0;
|
||||
if (slot == VARYING_SLOT_PSIZ)
|
||||
return 1;
|
||||
if (slot == VARYING_SLOT_CLIP_DIST0)
|
||||
return 2;
|
||||
if (slot == VARYING_SLOT_CLIP_DIST1)
|
||||
return 3;
|
||||
/* 3 is reserved for clip dist as well */
|
||||
if (slot >= VARYING_SLOT_VAR0 && slot <= VARYING_SLOT_VAR31)
|
||||
return 4 + (slot - VARYING_SLOT_VAR0);
|
||||
unreachable("illegal slot in get unique index\n");
|
||||
}
|
||||
|
||||
VkResult radv_CreateShaderModule(
|
||||
VkDevice _device,
|
||||
const VkShaderModuleCreateInfo* pCreateInfo,
|
||||
|
Reference in New Issue
Block a user