Path: blob/21.2-virgl/src/gallium/drivers/etnaviv/etnaviv_format.h
4570 views
/*1* Copyright (c) 2016 Etnaviv Project2*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, sub license,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 the11* next paragraph) shall be included in all copies or substantial portions12* of the 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 NON-INFRINGEMENT. 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 OTHER20* DEALINGS IN THE SOFTWARE.21*22* Authors:23* Christian Gmeiner <[email protected]>24*/2526#ifndef ETNAVIV_FORMAT_H_27#define ETNAVIV_FORMAT_H_2829#include "util/format/u_format.h"30#include "pipe/p_state.h"31#include <stdint.h>3233#define ETNA_NO_MATCH (~0)34#define EXT_FORMAT (1 << 31)35#define ASTC_FORMAT (1 << 30)3637uint32_t38translate_texture_format(enum pipe_format fmt);3940bool41texture_use_int_filter(const struct pipe_sampler_view *sv,42const struct pipe_sampler_state *ss,43bool tex_desc);4445bool46texture_format_needs_swiz(enum pipe_format fmt);4748uint32_t49get_texture_swiz(enum pipe_format fmt, unsigned swizzle_r,50unsigned swizzle_g, unsigned swizzle_b, unsigned swizzle_a);5152uint32_t53translate_pe_format(enum pipe_format fmt);5455int56translate_pe_format_rb_swap(enum pipe_format fmt);5758uint32_t59translate_vertex_format_type(enum pipe_format fmt);6061#endif /* ETNAVIV_FORMAT_H_ */626364