17e102996Smaya/* 27e102996Smaya * Copyright (C) 2017-2018 Rob Clark <robclark@freedesktop.org> 37e102996Smaya * 47e102996Smaya * Permission is hereby granted, free of charge, to any person obtaining a 57e102996Smaya * copy of this software and associated documentation files (the "Software"), 67e102996Smaya * to deal in the Software without restriction, including without limitation 77e102996Smaya * the rights to use, copy, modify, merge, publish, distribute, sublicense, 87e102996Smaya * and/or sell copies of the Software, and to permit persons to whom the 97e102996Smaya * Software is furnished to do so, subject to the following conditions: 107e102996Smaya * 117e102996Smaya * The above copyright notice and this permission notice (including the next 127e102996Smaya * paragraph) shall be included in all copies or substantial portions of the 137e102996Smaya * Software. 147e102996Smaya * 157e102996Smaya * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 167e102996Smaya * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 177e102996Smaya * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 187e102996Smaya * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 197e102996Smaya * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 207e102996Smaya * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 217e102996Smaya * SOFTWARE. 227e102996Smaya * 237e102996Smaya * Authors: 247e102996Smaya * Rob Clark <robclark@freedesktop.org> 257e102996Smaya */ 267e102996Smaya 277e102996Smaya#ifndef IR3_IMAGE_H_ 287e102996Smaya#define IR3_IMAGE_H_ 297e102996Smaya 307e102996Smaya#include "ir3_context.h" 317e102996Smaya 327ec681f3Smrgvoid ir3_ibo_mapping_init(struct ir3_ibo_mapping *mapping, 337ec681f3Smrg unsigned num_textures); 347ec681f3Smrgstruct ir3_instruction *ir3_ssbo_to_ibo(struct ir3_context *ctx, nir_src src); 357e102996Smayaunsigned ir3_ssbo_to_tex(struct ir3_ibo_mapping *mapping, unsigned ssbo); 367ec681f3Smrgstruct ir3_instruction *ir3_image_to_ibo(struct ir3_context *ctx, nir_src src); 377e102996Smayaunsigned ir3_image_to_tex(struct ir3_ibo_mapping *mapping, unsigned image); 387e102996Smaya 397ec681f3Smrgunsigned ir3_get_image_coords(const nir_intrinsic_instr *instr, 407ec681f3Smrg unsigned *flagsp); 417ec681f3Smrgtype_t ir3_get_type_for_image_intrinsic(const nir_intrinsic_instr *instr); 427ec681f3Smrgunsigned ir3_get_num_components_for_image_format(enum pipe_format); 437e102996Smaya 447e102996Smaya#endif /* IR3_IMAGE_H_ */ 45