Path: blob/21.2-virgl/src/gallium/drivers/lima/ir/lima_ir.h
4574 views
/*1* Copyright (c) 2017 Lima Project2*3* Permission is hereby granted, free of charge, to any person obtaining a copy4* of this software and associated documentation files (the "Software"), to deal5* in the Software without restriction, including without limitation the rights6* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell7* copies of the Software, and to permit persons to whom the Software is8* furnished to do so, subject to the following conditions:9*10* The above copyright notice and this permission notice shall be included in11* all copies or substantial portions of the Software.12*13* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR14* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,15* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE16* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER17* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,18* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN19* THE SOFTWARE.20*21*/2223#ifndef LIMA_IR_H24#define LIMA_IR_H2526#include <stdio.h>27#include <lima_screen.h>2829#include "nir.h"3031#define gpir_debug(...) \32do { \33if (lima_debug & LIMA_DEBUG_GP) \34printf("gpir: " __VA_ARGS__); \35} while (0)3637#define gpir_error(...) \38fprintf(stderr, "gpir: " __VA_ARGS__)3940#define ppir_debug(...) \41do { \42if (lima_debug & LIMA_DEBUG_PP) \43printf("ppir: " __VA_ARGS__); \44} while (0)4546#define ppir_error(...) \47fprintf(stderr, "ppir: " __VA_ARGS__)484950struct ra_regs;51struct lima_vs_compiled_shader;52struct lima_fs_compiled_shader;5354/* gpir interface */55bool gpir_compile_nir(struct lima_vs_compiled_shader *prog, struct nir_shader *nir,56struct pipe_debug_callback *debug);575859/* ppir interface */60bool ppir_compile_nir(struct lima_fs_compiled_shader *prog, struct nir_shader *nir,61struct ra_regs *ra,62struct pipe_debug_callback *debug);63struct ra_regs *ppir_regalloc_init(void *mem_ctx);6465void lima_nir_lower_uniform_to_scalar(nir_shader *shader);66bool lima_nir_scale_trig(nir_shader *shader);67bool lima_nir_lower_ftrunc(nir_shader *shader);68bool lima_nir_split_load_input(nir_shader *shader);6970void lima_nir_duplicate_load_consts(nir_shader *shader);71void lima_nir_duplicate_load_inputs(nir_shader *shader);72void lima_nir_duplicate_load_uniforms(nir_shader *shader);7374#endif757677