Commit 6410e94b authored by José Fonseca's avatar José Fonseca

python: New state tracker which exposes the pipe driver to python scripts.

Still under development. Just barely works.
parent 36dd89c8
......@@ -29,23 +29,22 @@ import common
#######################################################################
# Configuration options
default_statetrackers = 'mesa'
if common.default_platform in ('linux', 'freebsd', 'darwin'):
default_statetrackers = 'all'
default_drivers = 'softpipe,failover,i915simple,i965simple'
default_winsys = 'xlib'
elif common.default_platform in ('winddk',):
default_statetrackers = 'all'
default_drivers = 'softpipe,i915simple'
default_winsys = 'all'
else:
default_statetrackers = 'all'
default_drivers = 'all'
default_winsys = 'all'
opts = Options('config.py')
common.AddOptions(opts)
opts.Add(ListOption('statetrackers', 'state trackers to build', default_statetrackers,
['mesa']))
['mesa', 'python']))
opts.Add(ListOption('drivers', 'pipe drivers to build', default_drivers,
['softpipe', 'failover', 'i915simple', 'i965simple', 'cell']))
opts.Add(ListOption('winsys', 'winsys drivers to build', default_winsys,
......
......@@ -25,3 +25,5 @@ SConscript([
for driver in env['drivers']:
SConscript(os.path.join('drivers', driver, 'SConscript'))
SConscript('state_trackers/python/SConscript')
This directory contains Python bindings to Gallium3D. It looks like a state
tracker from the pipe driver perspective, and it looks like a pipe driver from
the python script perspective.
To build you'll need:
* Python (with development packages)
* SCons
* SWIG
* Python Imaging Library (for the samples)
Invoke scons on the top dir as
scons statetrackers=python
To use do
export PYTHONPATH=build/XXXX-XXXX-XXXX/gallium/state_trackers/python
and then try running
python src/gallium/state_trackers/python/samples/simple.py
which should create a simple.png
This is still in experimental phase, and there many limitations to what you can
do with from Python.
--
Jose Fonseca <jrfonseca@tungstengraphics.com>
Import('*')
if 'python' in env['statetrackers']:
env = env.Clone()
env.Append(CPPPATH = '.')
env.Tool('swig')
env.Append(SWIGPATH = ['#src/gallium/include', '#src/gallium/include/pipe'])
env.Append(SWIGFLAGS = ['-python', '-keyword'])
env.ParseConfig('python-config --cflags --ldflags --libs')
env.SharedLibrary(
target = '_gallium',
source = [
'gallium.i',
'st_device.c',
'st_softpipe_winsys.c',
],
SHLIBPREFIX = '',
LIBS = softpipe + auxiliaries + env['LIBS'],
)
This diff is collapsed.
/**************************************************************************
*
* Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas.
* All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sub license, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice (including the
* next paragraph) shall be included in all copies or substantial portions
* of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
* IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
* ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
**************************************************************************/
/*
* XXX: SWIG can't parse p_format.h, so we need to duplicate the relevant
* declarations here
*/
%{
#include "pipe/p_format.h"
%}
enum pipe_format {
PIPE_FORMAT_NONE,
PIPE_FORMAT_A8R8G8B8_UNORM,
PIPE_FORMAT_X8R8G8B8_UNORM,
PIPE_FORMAT_B8G8R8A8_UNORM,
PIPE_FORMAT_B8G8R8X8_UNORM,
PIPE_FORMAT_A1R5G5B5_UNORM,
PIPE_FORMAT_A4R4G4B4_UNORM,
PIPE_FORMAT_R5G6B5_UNORM,
PIPE_FORMAT_A2B10G10R10_UNORM,
PIPE_FORMAT_L8_UNORM,
PIPE_FORMAT_A8_UNORM,
PIPE_FORMAT_I8_UNORM,
PIPE_FORMAT_A8L8_UNORM,
PIPE_FORMAT_L16_UNORM,
PIPE_FORMAT_YCBCR,
PIPE_FORMAT_YCBCR_REV,
PIPE_FORMAT_Z16_UNORM,
PIPE_FORMAT_Z32_UNORM,
PIPE_FORMAT_Z32_FLOAT,
PIPE_FORMAT_S8Z24_UNORM,
PIPE_FORMAT_Z24S8_UNORM,
PIPE_FORMAT_X8Z24_UNORM,
PIPE_FORMAT_Z24X8_UNORM,
PIPE_FORMAT_S8_UNORM,
PIPE_FORMAT_R64_FLOAT,
PIPE_FORMAT_R64G64_FLOAT,
PIPE_FORMAT_R64G64B64_FLOAT,
PIPE_FORMAT_R64G64B64A64_FLOAT,
PIPE_FORMAT_R32_FLOAT,
PIPE_FORMAT_R32G32_FLOAT,
PIPE_FORMAT_R32G32B32_FLOAT,
PIPE_FORMAT_R32G32B32A32_FLOAT,
PIPE_FORMAT_R32_UNORM,
PIPE_FORMAT_R32G32_UNORM,
PIPE_FORMAT_R32G32B32_UNORM,
PIPE_FORMAT_R32G32B32A32_UNORM,
PIPE_FORMAT_R32_USCALED,
PIPE_FORMAT_R32G32_USCALED,
PIPE_FORMAT_R32G32B32_USCALED,
PIPE_FORMAT_R32G32B32A32_USCALED,
PIPE_FORMAT_R32_SNORM,
PIPE_FORMAT_R32G32_SNORM,
PIPE_FORMAT_R32G32B32_SNORM,
PIPE_FORMAT_R32G32B32A32_SNORM,
PIPE_FORMAT_R32_SSCALED,
PIPE_FORMAT_R32G32_SSCALED,
PIPE_FORMAT_R32G32B32_SSCALED,
PIPE_FORMAT_R32G32B32A32_SSCALED,
PIPE_FORMAT_R16_UNORM,
PIPE_FORMAT_R16G16_UNORM,
PIPE_FORMAT_R16G16B16_UNORM,
PIPE_FORMAT_R16G16B16A16_UNORM,
PIPE_FORMAT_R16_USCALED,
PIPE_FORMAT_R16G16_USCALED,
PIPE_FORMAT_R16G16B16_USCALED,
PIPE_FORMAT_R16G16B16A16_USCALED,
PIPE_FORMAT_R16_SNORM,
PIPE_FORMAT_R16G16_SNORM,
PIPE_FORMAT_R16G16B16_SNORM,
PIPE_FORMAT_R16G16B16A16_SNORM,
PIPE_FORMAT_R16_SSCALED,
PIPE_FORMAT_R16G16_SSCALED,
PIPE_FORMAT_R16G16B16_SSCALED,
PIPE_FORMAT_R16G16B16A16_SSCALED,
PIPE_FORMAT_R8_UNORM,
PIPE_FORMAT_R8G8_UNORM,
PIPE_FORMAT_R8G8B8_UNORM,
PIPE_FORMAT_R8G8B8A8_UNORM,
PIPE_FORMAT_R8G8B8X8_UNORM,
PIPE_FORMAT_R8_USCALED,
PIPE_FORMAT_R8G8_USCALED,
PIPE_FORMAT_R8G8B8_USCALED,
PIPE_FORMAT_R8G8B8A8_USCALED,
PIPE_FORMAT_R8G8B8X8_USCALED,
PIPE_FORMAT_R8_SNORM,
PIPE_FORMAT_R8G8_SNORM,
PIPE_FORMAT_R8G8B8_SNORM,
PIPE_FORMAT_R8G8B8A8_SNORM,
PIPE_FORMAT_R8G8B8X8_SNORM,
PIPE_FORMAT_B6G5R5_SNORM,
PIPE_FORMAT_A8B8G8R8_SNORM,
PIPE_FORMAT_X8B8G8R8_SNORM,
PIPE_FORMAT_R8_SSCALED,
PIPE_FORMAT_R8G8_SSCALED,
PIPE_FORMAT_R8G8B8_SSCALED,
PIPE_FORMAT_R8G8B8A8_SSCALED,
PIPE_FORMAT_R8G8B8X8_SSCALED,
PIPE_FORMAT_R32_FIXED,
PIPE_FORMAT_R32G32_FIXED,
PIPE_FORMAT_R32G32B32_FIXED,
PIPE_FORMAT_R32G32B32A32_FIXED,
PIPE_FORMAT_L8_SRGB,
PIPE_FORMAT_A8_L8_SRGB,
PIPE_FORMAT_R8G8B8_SRGB,
PIPE_FORMAT_R8G8B8A8_SRGB,
PIPE_FORMAT_R8G8B8X8_SRGB,
PIPE_FORMAT_X8UB8UG8SR8S_NORM,
PIPE_FORMAT_B6UG5SR5S_NORM,
PIPE_FORMAT_DXT1_RGB,
PIPE_FORMAT_DXT1_RGBA,
PIPE_FORMAT_DXT3_RGBA,
PIPE_FORMAT_DXT5_RGBA,
};
struct pipe_format_block
{
unsigned size;
unsigned width;
unsigned height;
};
#!/usr/bin/env python
##########################################################################
#
# Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas.
# All Rights Reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# distribute, sub license, and/or sell copies of the Software, and to
# permit persons to whom the Software is furnished to do so, subject to
# the following conditions:
#
# The above copyright notice and this permission notice (including the
# next paragraph) shall be included in all copies or substantial portions
# of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
# IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
# ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
##########################################################################
from gallium import *
def save_image(filename, surface):
pixels = FloatArray(surface.height*surface.width*4)
surface.get_tile_rgba(0, 0, surface.width, surface.height, pixels)
import Image
outimage = Image.new(
mode='RGB',
size=(surface.width, surface.height),
color=(0,0,0))
outpixels = outimage.load()
for y in range(0, surface.height):
for x in range(0, surface.width):
offset = (y*surface.width + x)*4
r, g, b, a = [int(pixels[offset + ch]*255) for ch in range(4)]
outpixels[x, y] = r, g, b
outimage.save(filename, "PNG")
def test(dev):
ctx = dev.context_create()
width = 256
height = 256
# disabled blending/masking
blend = Blend()
blend.rgb_src_factor = PIPE_BLENDFACTOR_ONE
blend.alpha_src_factor = PIPE_BLENDFACTOR_ONE
blend.rgb_dst_factor = PIPE_BLENDFACTOR_ZERO
blend.alpha_dst_factor = PIPE_BLENDFACTOR_ZERO
blend.colormask = PIPE_MASK_RGBA
ctx.set_blend(blend)
# no-op depth/stencil/alpha
depth_stencil_alpha = DepthStencilAlpha()
ctx.set_depth_stencil_alpha(depth_stencil_alpha)
# rasterizer
rasterizer = Rasterizer()
rasterizer.front_winding = PIPE_WINDING_CW
rasterizer.cull_mode = PIPE_WINDING_NONE
rasterizer.bypass_clipping = 1
#rasterizer.bypass_vs = 1
ctx.set_rasterizer(rasterizer)
# viewport (identity, we setup vertices in wincoords)
viewport = Viewport()
scale = FloatArray(4)
scale[0] = 1.0
scale[1] = 1.0
scale[2] = 1.0
scale[3] = 1.0
viewport.scale = scale
translate = FloatArray(4)
translate[0] = 0.0
translate[1] = 0.0
translate[2] = 0.0
translate[3] = 0.0
viewport.translate = translate
ctx.set_viewport(viewport)
# samplers
sampler = Sampler()
sampler.wrap_s = PIPE_TEX_WRAP_CLAMP_TO_EDGE
sampler.wrap_t = PIPE_TEX_WRAP_CLAMP_TO_EDGE
sampler.wrap_r = PIPE_TEX_WRAP_CLAMP_TO_EDGE
sampler.min_mip_filter = PIPE_TEX_MIPFILTER_NONE
sampler.min_img_filter = PIPE_TEX_MIPFILTER_NEAREST
sampler.mag_img_filter = PIPE_TEX_MIPFILTER_NEAREST
sampler.normalized_coords = 1
ctx.set_sampler(0, sampler)
# texture
texture = dev.texture_create(PIPE_FORMAT_A8R8G8B8_UNORM, width, height, usage=PIPE_TEXTURE_USAGE_RENDER_TARGET)
ctx.set_sampler_texture(0, texture)
# drawing dest
surface = texture.get_surface(usage = PIPE_BUFFER_USAGE_GPU_WRITE)
fb = Framebuffer()
fb.width = surface.width
fb.height = surface.height
fb.num_cbufs = 1
fb.set_cbuf(0, surface)
ctx.set_framebuffer(fb)
# vertex shader
# vs = Shader()
#ctx.set_vertex_shader(vs)
# fragment shader
#fs = Shader()
#ctx.set_fragment_shader(fs)
if 0:
nverts = 4
nattrs = 1
vertices = FloatArray(n_verts * nattrs * 4)
# init vertex data that doesn't change
for i in range(nverts):
for j in range(nattrs):
vertices[(i*nattrs +j)*4 + 0] = 0.0
vertices[(i*nattrs +j)*4 + 1] = 0.0
vertices[(i*nattrs +j)*4 + 2] = 0.0
vertices[(i*nattrs +j)*4 + 3] = 0.0
ctx.draw_vertices(PIPE_PRIM_TRIANGLE_FAN,
4, # verts
2, # attribs/vert
vertices)
else:
ctx.draw_quad(32.0, 32.0, 224.0, 224.0)
ctx.flush()
save_image("simple.png", surface)
def main():
dev = Device(0)
test(dev)
if __name__ == '__main__':
main()
/**************************************************************************
*
* Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas.
* All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sub license, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice (including the
* next paragraph) shall be included in all copies or substantial portions
* of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
* IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
* ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
**************************************************************************/
#include "pipe/p_util.h"
#include "pipe/p_winsys.h"
#include "pipe/p_context.h"
#include "pipe/p_shader_tokens.h"
#include "pipe/p_inlines.h"
#include "cso_cache/cso_context.h"
#include "util/u_simple_shaders.h"
#include "st_device.h"
#include "st_winsys.h"
static void
st_device_really_destroy(struct st_device *st_dev)
{
if(st_dev->screen)
st_dev->st_ws->screen_destroy(st_dev->screen);
FREE(st_dev);
}
void
st_device_destroy(struct st_device *st_dev)
{
if(!--st_dev->refcount)
st_device_really_destroy(st_dev);
}
static struct st_device *
st_device_create_from_st_winsys(const struct st_winsys *st_ws)
{
struct st_device *st_dev;
if(!st_ws->screen_create ||
!st_ws->screen_destroy ||
!st_ws->context_create ||
!st_ws->context_destroy)
return NULL;
st_dev = CALLOC_STRUCT(st_device);
if(!st_dev)
return NULL;
st_dev->st_ws = st_ws;
st_dev->screen = st_ws->screen_create();
if(!st_dev->screen)
st_device_destroy(st_dev);
return st_dev;
}
struct st_device *
st_device_create(boolean hardware) {
#if 0
if(hardware)
return st_device_create_from_st_winsys(&st_hardware_winsys);
else
#endif
return st_device_create_from_st_winsys(&st_software_winsys);
}
void
st_context_destroy(struct st_context *st_ctx)
{
unsigned i;
if(st_ctx) {
struct st_device *st_dev = st_ctx->st_dev;
if(st_ctx->vs) {
st_ctx->pipe->bind_vs_state(st_ctx->pipe, NULL);
st_ctx->pipe->delete_vs_state(st_ctx->pipe, st_ctx->vs);
}
if(st_ctx->fs) {
st_ctx->pipe->bind_fs_state(st_ctx->pipe, NULL);
st_ctx->pipe->delete_fs_state(st_ctx->pipe, st_ctx->fs);
}
if(st_ctx->cso)
cso_destroy_context(st_ctx->cso);
if(st_ctx->pipe)
st_ctx->st_dev->st_ws->context_destroy(st_ctx->pipe);
for(i = 0; i < PIPE_MAX_SAMPLERS; ++i)
pipe_texture_reference(&st_ctx->sampler_textures[i], NULL);
FREE(st_ctx);
if(!--st_dev->refcount)
st_device_really_destroy(st_dev);
}
}
struct st_context *
st_context_create(struct st_device *st_dev)
{
struct st_context *st_ctx;
st_ctx = CALLOC_STRUCT(st_context);
if(!st_ctx)
return NULL;
st_ctx->st_dev = st_dev;
++st_dev->refcount;
st_ctx->pipe = st_dev->st_ws->context_create(st_dev->screen);
if(!st_ctx->pipe)
st_context_destroy(st_ctx);
st_ctx->cso = cso_create_context(st_ctx->pipe);
if(!st_ctx->cso)
st_context_destroy(st_ctx);
/* vertex shader */
{
const uint semantic_names[] = { TGSI_SEMANTIC_POSITION,
TGSI_SEMANTIC_GENERIC };
const uint semantic_indexes[] = { 0, 0 };
st_ctx->vs = util_make_vertex_passthrough_shader(st_ctx->pipe,
2,
semantic_names,
semantic_indexes,
&st_ctx->vert_shader);
}
/* fragment shader */
st_ctx->fs = util_make_fragment_passthrough_shader(st_ctx->pipe,
&st_ctx->frag_shader);
st_ctx->pipe->bind_fs_state(st_ctx->pipe, st_ctx->fs);
st_ctx->pipe->bind_vs_state(st_ctx->pipe, st_ctx->vs);
return st_ctx;
}
/**************************************************************************
*
* Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas.
* All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sub license, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice (including the
* next paragraph) shall be included in all copies or substantial portions
* of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
* IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
* ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
**************************************************************************/
#ifndef ST_DEVICE_H_
#define ST_DEVICE_H_
#include "pipe/p_state.h"
struct cso_context;
struct pipe_screen;
struct pipe_context;
struct st_winsys;
struct st_context {
struct st_device *st_dev;
struct pipe_context *pipe;
struct cso_context *cso;
struct pipe_shader_state vert_shader;
struct pipe_shader_state frag_shader;
void *vs;
void *fs;
struct pipe_texture *sampler_textures[PIPE_MAX_SAMPLERS];
struct pipe_vertex_buffer vertex_buffers[PIPE_MAX_ATTRIBS];
struct pipe_vertex_element vertex_elements[PIPE_MAX_ATTRIBS];
};
struct st_device {
const struct st_winsys *st_ws;
struct pipe_screen *screen;
/* FIXME: we also need to refcount for textures and surfaces... */
unsigned refcount;
};
struct st_context *
st_context_create(struct st_device *st_dev);
void
st_context_destroy(struct st_context *st_ctx);
struct st_device *
st_device_create(boolean hardware);
void
st_device_destroy(struct st_device *st_dev);
#endif /* ST_DEVICE_H_ */
/**************************************************************************
*
* Copyright 2007 Tungsten Graphics, Inc., Bismarck, ND., USA
* All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sub license, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
* THE COPYRIGHT HOLDERS, AUTHORS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM,
* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
* USE OR OTHER DEALINGS IN THE SOFTWARE.
*
* The above copyright notice and this permission notice (including the
* next paragraph) shall be included in all copies or substantial portions
* of the Software.
*
*
**************************************************************************/
/**
* @file
* Softpipe support.
*
* @author Keith Whitwell
* @author Brian Paul
* @author Jose Fonseca
*/
#include "pipe/p_winsys.h"
#include "pipe/p_format.h"
#include "pipe/p_context.h"
#include "pipe/p_util.h"
#include "pipe/p_inlines.h"
#include "softpipe/sp_winsys.h"
#include "st_winsys.h"
struct st_softpipe_buffer
{
struct pipe_buffer base;
boolean userBuffer; /** Is this a user-space buffer? */
void *data;
void *mapped;
};