Path: blob/21.2-virgl/src/gallium/auxiliary/driver_trace/tr_context.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_CONTEXT_H_28#define TR_CONTEXT_H_293031#include "pipe/p_compiler.h"32#include "util/u_debug.h"33#include "util/hash_table.h"34#include "pipe/p_context.h"35#include "util/u_threaded_context.h"3637#include "tr_screen.h"3839#ifdef __cplusplus40extern "C" {41#endif424344struct trace_screen;4546struct trace_context47{48struct pipe_context base;4950struct hash_table blend_states;51struct hash_table rasterizer_states;52struct hash_table depth_stencil_alpha_states;5354struct pipe_context *pipe;55tc_replace_buffer_storage_func replace_buffer_storage;56tc_create_fence_func create_fence;5758struct pipe_framebuffer_state unwrapped_state;59bool seen_fb_state;6061bool threaded;62};636465void66trace_context_check(const struct pipe_context *pipe);67struct pipe_context *68trace_get_possibly_threaded_context(struct pipe_context *pipe);6970static inline struct trace_context *71trace_context(struct pipe_context *pipe)72{73assert(pipe);74#ifdef DEBUG75trace_context_check(pipe);76#endif77return (struct trace_context *)pipe;78}798081struct pipe_context *82trace_context_create(struct trace_screen *tr_scr,83struct pipe_context *pipe);8485struct pipe_context *86trace_context_create_threaded(struct pipe_screen *screen, struct pipe_context *pipe,87tc_replace_buffer_storage_func *replace_buffer,88tc_create_fence_func *create_fence,89tc_is_resource_busy *is_resource_busy);90#ifdef __cplusplus91}92#endif9394#endif /* TR_CONTEXT_H_ */959697