Path: blob/21.2-virgl/src/gallium/auxiliary/driver_rbug/rbug_context.h
4561 views
/**************************************************************************1*2* Copyright 2010 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 RBUG_CONTEXT_H28#define RBUG_CONTEXT_H2930#include "pipe/p_state.h"31#include "pipe/p_context.h"3233#include "rbug_screen.h"343536struct rbug_context {37struct pipe_context base; /**< base class */3839struct pipe_context *pipe;4041struct rbug_list list;4243/* call locking */44mtx_t call_mutex;4546/* current state */47struct {48struct rbug_shader *shader[PIPE_SHADER_TYPES];4950struct rbug_sampler_view *views[PIPE_SHADER_TYPES][PIPE_MAX_SHADER_SAMPLER_VIEWS];51struct rbug_resource *texs[PIPE_SHADER_TYPES][PIPE_MAX_SHADER_SAMPLER_VIEWS];52unsigned num_views[PIPE_SHADER_TYPES];5354unsigned nr_cbufs;55struct rbug_resource *cbufs[PIPE_MAX_COLOR_BUFS];56struct rbug_resource *zsbuf;57} curr;5859/* draw locking */60mtx_t draw_mutex;61cnd_t draw_cond;62unsigned draw_num_rules;63int draw_blocker;64int draw_blocked;6566struct {67struct rbug_shader *shader[PIPE_SHADER_TYPES];6869struct rbug_resource *texture;70struct rbug_resource *surf;7172int blocker;73} draw_rule;7475/* list of state objects */76mtx_t list_mutex;77unsigned num_shaders;78struct rbug_list shaders;79};8081static inline struct rbug_context *82rbug_context(struct pipe_context *pipe)83{84return (struct rbug_context *)pipe;85}868788/**********************************************************89* rbug_context.c90*/9192struct pipe_context *93rbug_context_create(struct pipe_screen *screen, struct pipe_context *pipe);949596/**********************************************************97* rbug_core.c98*/99100void rbug_notify_draw_blocked(struct rbug_context *rb_context);101102103#endif /* RBUG_CONTEXT_H */104105106