Path: blob/21.2-virgl/src/panfrost/midgard/midgard_compile.h
4564 views
/*1* Copyright (C) 2018-2019 Alyssa Rosenzweig <[email protected]>2* Copyright (C) 2019-2020 Collabora, Ltd.3*4* Permission is hereby granted, free of charge, to any person obtaining a5* copy of this software and associated documentation files (the "Software"),6* to deal in the Software without restriction, including without limitation7* the rights to use, copy, modify, merge, publish, distribute, sublicense,8* and/or sell copies of the Software, and to permit persons to whom the9* Software is furnished to do so, subject to the following conditions:10*11* The above copyright notice and this permission notice (including the next12* paragraph) shall be included in all copies or substantial portions of the13* Software.14*15* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR16* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,17* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL18* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER19* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,20* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE21* SOFTWARE.22*/2324#ifndef __MIDGARD_H_25#define __MIDGARD_H_2627#include "compiler/nir/nir.h"28#include "util/u_dynarray.h"29#include "panfrost/util/pan_ir.h"3031void32midgard_compile_shader_nir(nir_shader *nir,33const struct panfrost_compile_inputs *inputs,34struct util_dynarray *binary,35struct pan_shader_info *info);3637/* NIR options are shared between the standalone compiler and the online38* compiler. Defining it here is the simplest, though maybe not the Right39* solution. */4041static const nir_shader_compiler_options midgard_nir_options = {42.lower_ffma16 = true,43.lower_ffma32 = true,44.lower_ffma64 = true,45.lower_scmp = true,46.lower_flrp16 = true,47.lower_flrp32 = true,48.lower_flrp64 = true,49.lower_ffract = true,50.lower_fmod = true,51.lower_fdiv = true,52.lower_isign = true,53.lower_fpow = true,54.lower_find_lsb = true,55.lower_ifind_msb = true,56.lower_fdph = true,5758.lower_wpos_pntc = true,5960/* TODO: We have native ops to help here, which we'll want to look into61* eventually */62.lower_fsign = true,6364.lower_bit_count = true,65.lower_bitfield_reverse = true,66.lower_bitfield_insert_to_shifts = true,67.lower_bitfield_extract_to_shifts = true,68.lower_extract_byte = true,69.lower_extract_word = true,70.lower_insert_byte = true,71.lower_insert_word = true,72.lower_rotate = true,7374.lower_pack_half_2x16 = true,75.lower_pack_unorm_2x16 = true,76.lower_pack_snorm_2x16 = true,77.lower_pack_unorm_4x8 = true,78.lower_pack_snorm_4x8 = true,79.lower_unpack_half_2x16 = true,80.lower_unpack_unorm_2x16 = true,81.lower_unpack_snorm_2x16 = true,82.lower_unpack_unorm_4x8 = true,83.lower_unpack_snorm_4x8 = true,84.lower_pack_split = true,8586.lower_doubles_options = nir_lower_dmod,8788.lower_bitfield_extract_to_shifts = true,89.lower_uniforms_to_ubo = true,90.has_fsub = true,91.has_isub = true,92.vectorize_io = true,93.use_interpolated_input_intrinsics = true,9495.vertex_id_zero_based = true,96.has_cs_global_id = true,97.lower_cs_local_index_from_id = true,98.max_unroll_iterations = 32,99};100101#endif102103104