tr_context.h revision 3b4da4e9dac00f181380a9896ef3329964432c43
135355f7610b69dcd2fdba451db4554478fe0acaaJosé Fonseca/**************************************************************************
235355f7610b69dcd2fdba451db4554478fe0acaaJosé Fonseca *
335355f7610b69dcd2fdba451db4554478fe0acaaJosé Fonseca * Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas.
435355f7610b69dcd2fdba451db4554478fe0acaaJosé Fonseca * All Rights Reserved.
535355f7610b69dcd2fdba451db4554478fe0acaaJosé Fonseca *
635355f7610b69dcd2fdba451db4554478fe0acaaJosé Fonseca * Permission is hereby granted, free of charge, to any person obtaining a
735355f7610b69dcd2fdba451db4554478fe0acaaJosé Fonseca * copy of this software and associated documentation files (the
835355f7610b69dcd2fdba451db4554478fe0acaaJosé Fonseca * "Software"), to deal in the Software without restriction, including
935355f7610b69dcd2fdba451db4554478fe0acaaJosé Fonseca * without limitation the rights to use, copy, modify, merge, publish,
1035355f7610b69dcd2fdba451db4554478fe0acaaJosé Fonseca * distribute, sub license, and/or sell copies of the Software, and to
1135355f7610b69dcd2fdba451db4554478fe0acaaJosé Fonseca * permit persons to whom the Software is furnished to do so, subject to
1235355f7610b69dcd2fdba451db4554478fe0acaaJosé Fonseca * the following conditions:
1335355f7610b69dcd2fdba451db4554478fe0acaaJosé Fonseca *
1435355f7610b69dcd2fdba451db4554478fe0acaaJosé Fonseca * The above copyright notice and this permission notice (including the
1535355f7610b69dcd2fdba451db4554478fe0acaaJosé Fonseca * next paragraph) shall be included in all copies or substantial portions
1635355f7610b69dcd2fdba451db4554478fe0acaaJosé Fonseca * of the Software.
1735355f7610b69dcd2fdba451db4554478fe0acaaJosé Fonseca *
1835355f7610b69dcd2fdba451db4554478fe0acaaJosé Fonseca * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
1935355f7610b69dcd2fdba451db4554478fe0acaaJosé Fonseca * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
2035355f7610b69dcd2fdba451db4554478fe0acaaJosé Fonseca * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
2135355f7610b69dcd2fdba451db4554478fe0acaaJosé Fonseca * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
2235355f7610b69dcd2fdba451db4554478fe0acaaJosé Fonseca * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
2335355f7610b69dcd2fdba451db4554478fe0acaaJosé Fonseca * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
2435355f7610b69dcd2fdba451db4554478fe0acaaJosé Fonseca * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
2535355f7610b69dcd2fdba451db4554478fe0acaaJosé Fonseca *
2635355f7610b69dcd2fdba451db4554478fe0acaaJosé Fonseca **************************************************************************/
2735355f7610b69dcd2fdba451db4554478fe0acaaJosé Fonseca
2835355f7610b69dcd2fdba451db4554478fe0acaaJosé Fonseca#ifndef TR_CONTEXT_H_
2935355f7610b69dcd2fdba451db4554478fe0acaaJosé Fonseca#define TR_CONTEXT_H_
3035355f7610b69dcd2fdba451db4554478fe0acaaJosé Fonseca
3135355f7610b69dcd2fdba451db4554478fe0acaaJosé Fonseca
3235355f7610b69dcd2fdba451db4554478fe0acaaJosé Fonseca#include "pipe/p_compiler.h"
33ea4bf267e4b023b08043f91ac44592fed1736e7fJosé Fonseca#include "util/u_debug.h"
3435355f7610b69dcd2fdba451db4554478fe0acaaJosé Fonseca#include "pipe/p_context.h"
3535355f7610b69dcd2fdba451db4554478fe0acaaJosé Fonseca
363b4da4e9dac00f181380a9896ef3329964432c43Jakob Bornecrantz#include "tr_screen.h"
3735355f7610b69dcd2fdba451db4554478fe0acaaJosé Fonseca
38200d6dcc83ea9ac0bf6f1506214e0bd9b65714f2José Fonseca#ifdef __cplusplus
39200d6dcc83ea9ac0bf6f1506214e0bd9b65714f2José Fonsecaextern "C" {
40200d6dcc83ea9ac0bf6f1506214e0bd9b65714f2José Fonseca#endif
41200d6dcc83ea9ac0bf6f1506214e0bd9b65714f2José Fonseca
42422512050312a880439ed4e8eb99b8e362d5071fJakob Bornecrantz
4335355f7610b69dcd2fdba451db4554478fe0acaaJosé Fonsecastruct trace_context
4435355f7610b69dcd2fdba451db4554478fe0acaaJosé Fonseca{
4535355f7610b69dcd2fdba451db4554478fe0acaaJosé Fonseca   struct pipe_context base;
46422512050312a880439ed4e8eb99b8e362d5071fJakob Bornecrantz
47f2e19c34e06dfc33557a481f764fc75a5aef15ffJosé Fonseca   struct pipe_context *pipe;
4844d0e0caf4ad3b01dc08d8432867c449dc3f2a23Jakob Bornecrantz
493b4da4e9dac00f181380a9896ef3329964432c43Jakob Bornecrantz   /* for list on screen */
5044d0e0caf4ad3b01dc08d8432867c449dc3f2a23Jakob Bornecrantz   struct tr_list list;
513b4da4e9dac00f181380a9896ef3329964432c43Jakob Bornecrantz
523b4da4e9dac00f181380a9896ef3329964432c43Jakob Bornecrantz   /* list of state objects */
533b4da4e9dac00f181380a9896ef3329964432c43Jakob Bornecrantz   pipe_mutex list_mutex;
543b4da4e9dac00f181380a9896ef3329964432c43Jakob Bornecrantz   unsigned num_shaders;
553b4da4e9dac00f181380a9896ef3329964432c43Jakob Bornecrantz   struct tr_list shaders;
5635355f7610b69dcd2fdba451db4554478fe0acaaJosé Fonseca};
5735355f7610b69dcd2fdba451db4554478fe0acaaJosé Fonseca
5835355f7610b69dcd2fdba451db4554478fe0acaaJosé Fonseca
5935355f7610b69dcd2fdba451db4554478fe0acaaJosé Fonsecastatic INLINE struct trace_context *
60f2e19c34e06dfc33557a481f764fc75a5aef15ffJosé Fonsecatrace_context(struct pipe_context *pipe)
6135355f7610b69dcd2fdba451db4554478fe0acaaJosé Fonseca{
62f2e19c34e06dfc33557a481f764fc75a5aef15ffJosé Fonseca   assert(pipe);
63f2e19c34e06dfc33557a481f764fc75a5aef15ffJosé Fonseca   return (struct trace_context *)pipe;
6435355f7610b69dcd2fdba451db4554478fe0acaaJosé Fonseca}
6535355f7610b69dcd2fdba451db4554478fe0acaaJosé Fonseca
6635355f7610b69dcd2fdba451db4554478fe0acaaJosé Fonseca
6735355f7610b69dcd2fdba451db4554478fe0acaaJosé Fonseca
6835355f7610b69dcd2fdba451db4554478fe0acaaJosé Fonsecastruct pipe_context *
693c90678ea69ee8be832e16d42a1b8049a49535e3José Fonsecatrace_context_create(struct pipe_screen *screen,
703c90678ea69ee8be832e16d42a1b8049a49535e3José Fonseca                     struct pipe_context *pipe);
7135355f7610b69dcd2fdba451db4554478fe0acaaJosé Fonseca
7235355f7610b69dcd2fdba451db4554478fe0acaaJosé Fonseca
73200d6dcc83ea9ac0bf6f1506214e0bd9b65714f2José Fonseca#ifdef __cplusplus
74200d6dcc83ea9ac0bf6f1506214e0bd9b65714f2José Fonseca}
75200d6dcc83ea9ac0bf6f1506214e0bd9b65714f2José Fonseca#endif
76200d6dcc83ea9ac0bf6f1506214e0bd9b65714f2José Fonseca
7735355f7610b69dcd2fdba451db4554478fe0acaaJosé Fonseca#endif /* TR_CONTEXT_H_ */
78