1f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org/********************************************************** 2f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * Copyright 2008-2009 VMware, Inc. All rights reserved. 3f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * 4f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * Permission is hereby granted, free of charge, to any person 5f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * obtaining a copy of this software and associated documentation 6f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * files (the "Software"), to deal in the Software without 7f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * restriction, including without limitation the rights to use, copy, 8f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * modify, merge, publish, distribute, sublicense, and/or sell copies 9f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * of the Software, and to permit persons to whom the Software is 10f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * furnished to do so, subject to the following conditions: 11f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * 12f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * The above copyright notice and this permission notice shall be 13f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * included in all copies or substantial portions of the Software. 14f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * 15f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 18f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 19f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 20f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * SOFTWARE. 23f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * 24f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org **********************************************************/ 25f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org 26f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#ifndef SVGA_CONTEXT_H 27f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define SVGA_CONTEXT_H 28f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org 29f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org 30f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#include "pipe/p_context.h" 31f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#include "pipe/p_defines.h" 32f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#include "pipe/p_state.h" 33f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org 34f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#include "util/u_double_list.h" 35f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org 36f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#include "tgsi/tgsi_scan.h" 37f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org 38f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#include "svga_state.h" 39f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#include "svga_tgsi.h" 40f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#include "svga_hw_reg.h" 41f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#include "svga3d_shaderdefs.h" 42f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org 43f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org 44f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgstruct draw_vertex_shader; 45f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgstruct draw_fragment_shader; 46f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgstruct svga_shader_result; 47f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgstruct SVGACmdMemory; 48f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgstruct util_bitmask; 49f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgstruct u_upload_mgr; 50f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org 51f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org 52f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgstruct svga_shader 53f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org{ 54f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org const struct tgsi_token *tokens; 55f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org 56f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org struct tgsi_shader_info info; 57f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org 58f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org struct svga_shader_result *results; 59f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org 60f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org unsigned id; /**< for debugging only */ 61f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org}; 62f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org 63f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgstruct svga_fragment_shader 64f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org{ 65f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org struct svga_shader base; 66f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org 67f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org struct draw_fragment_shader *draw_shader; 68f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org 69f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org /** Mask of which generic varying variables are read by this shader */ 70f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org unsigned generic_inputs; 71f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org /** Table mapping original TGSI generic indexes to low integers */ 72f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org int8_t generic_remap_table[MAX_GENERIC_VARYING]; 73f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org}; 74f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org 75f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgstruct svga_vertex_shader 76f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org{ 77f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org struct svga_shader base; 78f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org 79f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org struct draw_vertex_shader *draw_shader; 80f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org}; 81f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org 82f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org 83f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgstruct svga_cache_context; 84f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgstruct svga_tracked_state; 85f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org 86f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgstruct svga_blend_state { 87f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org 88f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org boolean need_white_fragments; 89f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org 90f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org /* Should be per-render-target: 91f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org */ 92f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org struct { 93f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org uint8_t writemask; 94f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org 95f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org boolean blend_enable; 96f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org uint8_t srcblend; 97f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org uint8_t dstblend; 98f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org uint8_t blendeq; 99f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org 100f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org boolean separate_alpha_blend_enable; 101f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org uint8_t srcblend_alpha; 102f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org uint8_t dstblend_alpha; 103f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org uint8_t blendeq_alpha; 104f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org 105f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org } rt[1]; 106f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org}; 107f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org 108f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgstruct svga_depth_stencil_state { 109f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org unsigned zfunc:8; 110f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org unsigned zenable:1; 111f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org unsigned zwriteenable:1; 112f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org 113f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org unsigned alphatestenable:1; 114f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org unsigned alphafunc:8; 115f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org 116f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org struct { 117f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org unsigned enabled:1; 118f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org unsigned func:8; 119f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org unsigned fail:8; 120f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org unsigned zfail:8; 121f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org unsigned pass:8; 122f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org } stencil[2]; 123f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org 124f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org /* SVGA3D has one ref/mask/writemask triple shared between front & 125f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * back face stencil. We really need two: 126f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org */ 127f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org unsigned stencil_mask:8; 128f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org unsigned stencil_writemask:8; 129f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org 130f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org float alpharef; 131f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org}; 132f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org 133f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define SVGA_UNFILLED_DISABLE 0 134f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define SVGA_UNFILLED_LINE 1 135f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define SVGA_UNFILLED_POINT 2 136f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org 137f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define SVGA_PIPELINE_FLAG_POINTS (1<<PIPE_PRIM_POINTS) 138f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define SVGA_PIPELINE_FLAG_LINES (1<<PIPE_PRIM_LINES) 139f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define SVGA_PIPELINE_FLAG_TRIS (1<<PIPE_PRIM_TRIANGLES) 140f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org 141f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgstruct svga_rasterizer_state { 142f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org struct pipe_rasterizer_state templ; /* needed for draw module */ 143f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org 144f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org unsigned shademode:8; 145f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org unsigned cullmode:8; 146f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org unsigned scissortestenable:1; 147f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org unsigned multisampleantialias:1; 148f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org unsigned antialiasedlineenable:1; 149f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org unsigned lastpixel:1; 150f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org unsigned pointsprite:1; 151f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org 152f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org unsigned linepattern; 153f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org 154f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org float slopescaledepthbias; 155f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org float depthbias; 156f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org float pointsize; 157f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org 158f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org unsigned hw_unfilled:16; /* PIPE_POLYGON_MODE_x */ 159f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org 160f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org /** Which prims do we need help for? Bitmask of (1 << PIPE_PRIM_x) flags */ 161f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org unsigned need_pipeline:16; 162f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org 163f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org /** For debugging: */ 164f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org const char* need_pipeline_tris_str; 165f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org const char* need_pipeline_lines_str; 166f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org const char* need_pipeline_points_str; 167f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org}; 168f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org 169f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgstruct svga_sampler_state { 170f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org unsigned mipfilter; 171f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org unsigned magfilter; 172f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org unsigned minfilter; 173f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org unsigned aniso_level; 174f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org float lod_bias; 175f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org unsigned addressu; 176f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org unsigned addressv; 177f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org unsigned addressw; 178f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org unsigned bordercolor; 179f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org unsigned normalized_coords:1; 180f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org unsigned compare_mode:1; 181f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org unsigned compare_func:3; 182f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org 183f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org unsigned min_lod; 184f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org unsigned view_min_lod; 185f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org unsigned view_max_lod; 186f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org}; 187f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org 188f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgstruct svga_velems_state { 189f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org unsigned count; 190f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org struct pipe_vertex_element velem[PIPE_MAX_ATTRIBS]; 191f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org}; 192f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org 193f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org/* Use to calculate differences between state emitted to hardware and 194f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * current driver-calculated state. 195f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org */ 196f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgstruct svga_state 197f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org{ 198f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org const struct svga_blend_state *blend; 199f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org const struct svga_depth_stencil_state *depth; 200f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org const struct svga_rasterizer_state *rast; 201f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org const struct svga_sampler_state *sampler[PIPE_MAX_SAMPLERS]; 202f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org const struct svga_velems_state *velems; 203f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org 204f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org struct pipe_sampler_view *sampler_views[PIPE_MAX_SAMPLERS]; /* or texture ID's? */ 205f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org struct svga_fragment_shader *fs; 206f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org struct svga_vertex_shader *vs; 207f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org 208f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org struct pipe_vertex_buffer vb[PIPE_MAX_ATTRIBS]; 209f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org struct pipe_index_buffer ib; 210f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org struct pipe_resource *cb[PIPE_SHADER_TYPES]; 211f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org 212f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org struct pipe_framebuffer_state framebuffer; 213f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org float depthscale; 214f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org 215f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org /* Hack to limit the number of different render targets between 216f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * flushes. Helps avoid blowing out our surface cache in EXA. 217f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org */ 218f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org int nr_fbs; 219f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org 220f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org struct pipe_poly_stipple poly_stipple; 221f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org struct pipe_scissor_state scissor; 222f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org struct pipe_blend_color blend_color; 223f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org struct pipe_stencil_ref stencil_ref; 224f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org struct pipe_clip_state clip; 225f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org struct pipe_viewport_state viewport; 226f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org 227f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org unsigned num_samplers; 228f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org unsigned num_sampler_views; 229f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org unsigned num_vertex_buffers; 230f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org unsigned reduced_prim; 231f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org 232f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org struct { 233f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org unsigned flag_1d; 234f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org unsigned flag_srgb; 235f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org } tex_flags; 236f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org 237f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org boolean any_user_vertex_buffers; 238f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org}; 239f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org 240f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgstruct svga_prescale { 241f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org float translate[4]; 242f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org float scale[4]; 243f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org boolean enabled; 244f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org}; 245f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org 246f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org 247f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org/* Updated by calling svga_update_state( SVGA_STATE_HW_CLEAR ) 248f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org */ 249f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgstruct svga_hw_clear_state 250f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org{ 251f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org struct { 252f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org unsigned x,y,w,h; 253f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org } viewport; 254f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org 255f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org struct { 256f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org float zmin, zmax; 257f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org } depthrange; 258f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org 259f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org struct pipe_framebuffer_state framebuffer; 260f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org struct svga_prescale prescale; 261f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org}; 262f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org 263f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgstruct svga_hw_view_state 264f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org{ 265f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org struct pipe_resource *texture; 266f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org struct svga_sampler_view *v; 267f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org unsigned min_lod; 268f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org unsigned max_lod; 269f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org int dirty; 270f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org}; 271f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org 272f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org/* Updated by calling svga_update_state( SVGA_STATE_HW_DRAW ) 273f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org */ 274f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgstruct svga_hw_draw_state 275f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org{ 276f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org unsigned rs[SVGA3D_RS_MAX]; 277f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org unsigned ts[SVGA3D_PIXEL_SAMPLERREG_MAX][SVGA3D_TS_MAX]; 278f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org float cb[PIPE_SHADER_TYPES][SVGA3D_CONSTREG_MAX][4]; 279f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org 280f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org struct svga_shader_result *fs; 281f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org struct svga_shader_result *vs; 282f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org struct svga_hw_view_state views[PIPE_MAX_SAMPLERS]; 283f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org 284f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org unsigned num_views; 285f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org}; 286f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org 287f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org 288f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org/* Updated by calling svga_update_state( SVGA_STATE_NEED_SWTNL ) 289f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org */ 290f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgstruct svga_sw_state 291f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org{ 292f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org unsigned ve_format[PIPE_MAX_ATTRIBS]; /* NEW_VELEMENT */ 293f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org 294f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org /* which parts we need */ 295f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org boolean need_swvfetch; 296f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org boolean need_pipeline; 297f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org boolean need_swtnl; 298f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org 299f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org /* Flag to make sure that need sw is on while 300f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * updating state within a swtnl call. 301f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org */ 302f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org boolean in_swtnl_draw; 303f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org}; 304f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org 305f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org 306f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org/* Queue some state updates (like rss) and submit them to hardware in 307f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * a single packet. 308f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org */ 309f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgstruct svga_hw_queue; 310f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org 311f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgstruct svga_query; 312f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org 313f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgstruct svga_context 314f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org{ 315f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org struct pipe_context pipe; 316f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org struct svga_winsys_context *swc; 317f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org 318f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org struct { 319f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org boolean no_swtnl; 320f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org boolean force_swtnl; 321f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org boolean use_min_mipmap; 322f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org 323f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org /* incremented for each shader */ 324f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org unsigned shader_id; 325f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org 326f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org unsigned disable_shader; 327f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org 328f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org boolean no_line_width; 329f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org boolean force_hw_line_stipple; 330f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org } debug; 331f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org 332f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org struct { 333f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org struct draw_context *draw; 334f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org struct vbuf_render *backend; 335f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org unsigned hw_prim; 336f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org boolean new_vbuf; 337f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org boolean new_vdecl; 338f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org } swtnl; 339f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org 340f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org /* Bitmask of used shader IDs */ 341f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org struct util_bitmask *fs_bm; 342f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org struct util_bitmask *vs_bm; 343f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org 344f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org struct { 345f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org unsigned dirty[SVGA_STATE_MAX]; 346f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org 347f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org unsigned texture_timestamp; 348f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org 349f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org /* 350f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org */ 351f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org struct svga_sw_state sw; 352f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org struct svga_hw_draw_state hw_draw; 353f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org struct svga_hw_clear_state hw_clear; 354f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org } state; 355f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org 356f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org struct svga_state curr; /* state from the state tracker */ 357f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org unsigned dirty; /* statechanges since last update_state() */ 358f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org 359f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org struct { 360f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org unsigned rendertargets:1; 361f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org unsigned texture_samplers:1; 362f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org } rebind; 363f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org 364f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org struct u_upload_mgr *upload_ib; 365f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org struct u_upload_mgr *upload_vb; 366f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org struct svga_hwtnl *hwtnl; 367f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org 368f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org /** The occlusion query currently in progress */ 369f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org struct svga_query *sq; 370f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org 371f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org /** List of buffers with queued transfers */ 372f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org struct list_head dirty_buffers; 373f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org}; 374f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org 375f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org/* A flag for each state_tracker state object: 376f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org */ 377f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define SVGA_NEW_BLEND 0x1 378f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define SVGA_NEW_DEPTH_STENCIL 0x2 379f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define SVGA_NEW_RAST 0x4 380f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define SVGA_NEW_SAMPLER 0x8 381f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define SVGA_NEW_TEXTURE 0x10 382f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define SVGA_NEW_VBUFFER 0x20 383f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define SVGA_NEW_VELEMENT 0x40 384f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define SVGA_NEW_FS 0x80 385f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define SVGA_NEW_VS 0x100 386f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define SVGA_NEW_FS_CONST_BUFFER 0x200 387f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define SVGA_NEW_VS_CONST_BUFFER 0x400 388f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define SVGA_NEW_FRAME_BUFFER 0x800 389f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define SVGA_NEW_STIPPLE 0x1000 390f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define SVGA_NEW_SCISSOR 0x2000 391f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define SVGA_NEW_BLEND_COLOR 0x4000 392f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define SVGA_NEW_CLIP 0x8000 393f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define SVGA_NEW_VIEWPORT 0x10000 394f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define SVGA_NEW_PRESCALE 0x20000 395f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define SVGA_NEW_REDUCED_PRIMITIVE 0x40000 396f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define SVGA_NEW_TEXTURE_BINDING 0x80000 397f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define SVGA_NEW_NEED_PIPELINE 0x100000 398f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define SVGA_NEW_NEED_SWVFETCH 0x200000 399f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define SVGA_NEW_NEED_SWTNL 0x400000 400f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define SVGA_NEW_FS_RESULT 0x800000 401f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define SVGA_NEW_VS_RESULT 0x1000000 402f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define SVGA_NEW_TEXTURE_FLAGS 0x4000000 403f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define SVGA_NEW_STENCIL_REF 0x8000000 404f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org 405f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org 406f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org 407f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org 408f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org 409f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org/*********************************************************************** 410f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * svga_clear.c: 411f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org */ 412f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgvoid svga_clear(struct pipe_context *pipe, 413f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org unsigned buffers, 414f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org const union pipe_color_union *color, 415f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org double depth, 416f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org unsigned stencil); 417f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org 418f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org 419f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org/*********************************************************************** 420f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * svga_screen_texture.c: 421f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org */ 422f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgvoid svga_mark_surfaces_dirty(struct svga_context *svga); 423f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org 424f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org 425f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org 426f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org 427f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgvoid svga_init_state_functions( struct svga_context *svga ); 428f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgvoid svga_init_flush_functions( struct svga_context *svga ); 429f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgvoid svga_init_string_functions( struct svga_context *svga ); 430f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgvoid svga_init_blit_functions(struct svga_context *svga); 431f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org 432f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgvoid svga_init_blend_functions( struct svga_context *svga ); 433f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgvoid svga_init_depth_stencil_functions( struct svga_context *svga ); 434f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgvoid svga_init_misc_functions( struct svga_context *svga ); 435f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgvoid svga_init_rasterizer_functions( struct svga_context *svga ); 436f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgvoid svga_init_sampler_functions( struct svga_context *svga ); 437f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgvoid svga_init_fs_functions( struct svga_context *svga ); 438f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgvoid svga_init_vs_functions( struct svga_context *svga ); 439f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgvoid svga_init_vertex_functions( struct svga_context *svga ); 440f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgvoid svga_init_constbuffer_functions( struct svga_context *svga ); 441f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgvoid svga_init_draw_functions( struct svga_context *svga ); 442f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgvoid svga_init_query_functions( struct svga_context *svga ); 443f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgvoid svga_init_surface_functions(struct svga_context *svga); 444f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org 445f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgvoid svga_cleanup_vertex_state( struct svga_context *svga ); 446f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgvoid svga_cleanup_tss_binding( struct svga_context *svga ); 447f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgvoid svga_cleanup_framebuffer( struct svga_context *svga ); 448f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org 449f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgvoid svga_context_flush( struct svga_context *svga, 450f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org struct pipe_fence_handle **pfence ); 451f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org 452f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgvoid svga_hwtnl_flush_retry( struct svga_context *svga ); 453f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgvoid svga_hwtnl_flush_buffer( struct svga_context *svga, 454f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org struct pipe_resource *buffer ); 455f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org 456f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgvoid svga_surfaces_flush(struct svga_context *svga); 457f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org 458f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgstruct pipe_context * 459f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgsvga_context_create(struct pipe_screen *screen, 460f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org void *priv); 461f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org 462f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org 463f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org/*********************************************************************** 464f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * Inline conversion functions. These are better-typed than the 465f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * macros used previously: 466f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org */ 467f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgstatic INLINE struct svga_context * 468f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgsvga_context( struct pipe_context *pipe ) 469f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org{ 470f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org return (struct svga_context *)pipe; 471f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org} 472f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org 473f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org 474f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org 475f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#endif 476