Path: blob/21.2-virgl/src/gallium/auxiliary/driver_trace/tr_texture.h
4565 views
/**************************************************************************1*2* Copyright 2008 VMware, Inc.3* All Rights Reserved.4*5* Permission is hereby granted, free of charge, to any person obtaining a6* copy of this software and associated documentation files (the7* "Software"), to deal in the Software without restriction, including8* without limitation the rights to use, copy, modify, merge, publish,9* distribute, sub license, and/or sell copies of the Software, and to10* permit persons to whom the Software is furnished to do so, subject to11* the following conditions:12*13* The above copyright notice and this permission notice (including the14* next paragraph) shall be included in all copies or substantial portions15* of the Software.16*17* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS18* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF19* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.20* IN NO EVENT SHALL VMWARE AND/OR ITS SUPPLIERS BE LIABLE FOR21* ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,22* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE23* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.24*25**************************************************************************/2627#ifndef TR_TEXTURE_H_28#define TR_TEXTURE_H_293031#include "pipe/p_compiler.h"32#include "pipe/p_state.h"3334#include "tr_screen.h"35#include "util/u_threaded_context.h"3637struct trace_context;383940struct tr_list41{42struct tr_list *next;43struct tr_list *prev;44};4546struct trace_surface47{48struct pipe_surface base;4950struct pipe_surface *surface;5152struct tr_list list;53};545556struct trace_sampler_view57{58struct pipe_sampler_view base;5960struct pipe_sampler_view *sampler_view;61};626364struct trace_transfer65{66struct threaded_transfer base;6768struct pipe_transfer *transfer;69struct pipe_context *pipe;7071struct tr_list list;7273void *map;74};757677static inline struct trace_surface *78trace_surface(struct pipe_surface *surface)79{80if (!surface)81return NULL;82return (struct trace_surface *)surface;83}848586static inline struct trace_sampler_view *87trace_sampler_view(struct pipe_sampler_view *sampler_view)88{89if (!sampler_view)90return NULL;91return (struct trace_sampler_view *)sampler_view;92}939495static inline struct trace_transfer *96trace_transfer(struct pipe_transfer *transfer)97{98if (!transfer)99return NULL;100return (struct trace_transfer *)transfer;101}102103104struct pipe_surface *105trace_surf_create(struct trace_context *tr_ctx,106struct pipe_resource *tr_res,107struct pipe_surface *surface);108109void110trace_surf_destroy(struct trace_surface *tr_surf);111112struct pipe_transfer *113trace_transfer_create(struct trace_context *tr_ctx,114struct pipe_resource *tr_res,115struct pipe_transfer *transfer);116117void118trace_transfer_destroy(struct trace_context *tr_ctx,119struct trace_transfer *tr_trans);120121122#endif /* TR_TEXTURE_H_ */123124125