Path: blob/21.2-virgl/src/amd/llvm/ac_nir_to_llvm.h
7237 views
/*1* Copyright © 2016 Bas Nieuwenhuizen2*3* Permission is hereby granted, free of charge, to any person obtaining a4* copy of this software and associated documentation files (the "Software"),5* to deal in the Software without restriction, including without limitation6* the rights to use, copy, modify, merge, publish, distribute, sublicense,7* and/or sell copies of the Software, and to permit persons to whom the8* Software is furnished to do so, subject to the following conditions:9*10* The above copyright notice and this permission notice (including the next11* paragraph) shall be included in all copies or substantial portions of the12* Software.13*14* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR15* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,16* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL17* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER18* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING19* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS20* IN THE SOFTWARE.21*/2223#ifndef AC_NIR_TO_LLVM_H24#define AC_NIR_TO_LLVM_H2526#include "amd_family.h"27#include "compiler/shader_enums.h"28#include "llvm-c/Core.h"29#include "llvm-c/TargetMachine.h"3031#include <stdbool.h>3233struct nir_shader;34struct nir_variable;35struct ac_llvm_context;36struct ac_shader_abi;37struct ac_shader_args;3839/* Interpolation locations */40#define INTERP_CENTER 041#define INTERP_CENTROID 142#define INTERP_SAMPLE 24344static inline unsigned ac_llvm_reg_index_soa(unsigned index, unsigned chan)45{46return (index * 4) + chan;47}4849bool ac_are_tessfactors_def_in_all_invocs(const struct nir_shader *nir);5051void ac_nir_translate(struct ac_llvm_context *ac, struct ac_shader_abi *abi,52const struct ac_shader_args *args, struct nir_shader *nir);5354void ac_handle_shader_output_decl(struct ac_llvm_context *ctx, struct ac_shader_abi *abi,55struct nir_shader *nir, struct nir_variable *variable,56gl_shader_stage stage);5758void ac_emit_barrier(struct ac_llvm_context *ac, gl_shader_stage stage);5960#endif /* AC_NIR_TO_LLVM_H */616263