Path: blob/21.2-virgl/src/gallium/drivers/r300/r300_texture.h
4570 views
/*1* Copyright 2008 Corbin Simpson <[email protected]>2*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* on the rights to use, copy, modify, merge, publish, distribute, sub7* license, and/or sell copies of the Software, and to permit persons to whom8* the 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 NON-INFRINGEMENT. IN NO EVENT SHALL17* THE AUTHOR(S) AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM,18* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR19* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE20* USE OR OTHER DEALINGS IN THE SOFTWARE. */2122#ifndef R300_TEXTURE_H23#define R300_TEXTURE_H2425#include "pipe/p_compiler.h"26#include "pipe/p_format.h"27#include "pipe/p_screen.h"2829struct pipe_screen;30struct pipe_context;31struct pipe_resource;32struct winsys_handle;33struct r300_texture_format_state;34struct r300_texture_desc;35struct r300_resource;36struct r300_screen;3738unsigned r300_get_swizzle_combined(const unsigned char *swizzle_format,39const unsigned char *swizzle_view,40boolean dxtc_swizzle);4142uint32_t r300_translate_texformat(enum pipe_format format,43const unsigned char *swizzle_view,44boolean is_r500,45boolean dxtc_swizzle);4647uint32_t r500_tx_format_msb_bit(enum pipe_format format);4849boolean r300_is_colorbuffer_format_supported(enum pipe_format format);5051boolean r300_is_zs_format_supported(enum pipe_format format);5253boolean r300_is_sampler_format_supported(enum pipe_format format);5455void r300_texture_setup_format_state(struct r300_screen *screen,56struct r300_resource *tex,57enum pipe_format format,58unsigned level,59unsigned width0_override,60unsigned height0_override,61struct r300_texture_format_state *out);6263bool r300_resource_get_handle(struct pipe_screen* screen,64struct pipe_context *ctx,65struct pipe_resource *texture,66struct winsys_handle *whandle,67unsigned usage);6869struct pipe_resource*70r300_texture_from_handle(struct pipe_screen* screen,71const struct pipe_resource* base,72struct winsys_handle *whandle,73unsigned usage);7475struct pipe_resource*76r300_texture_create(struct pipe_screen* screen,77const struct pipe_resource* templ);7879struct pipe_surface* r300_create_surface_custom(struct pipe_context * ctx,80struct pipe_resource* texture,81const struct pipe_surface *surf_tmpl,82unsigned width0_override,83unsigned height0_override);8485struct pipe_surface* r300_create_surface(struct pipe_context *ctx,86struct pipe_resource* texture,87const struct pipe_surface *surf_tmpl);8889void r300_surface_destroy(struct pipe_context *ctx, struct pipe_surface* s);9091#endif /* R300_TEXTURE_H */929394