/********************************************************** * Copyright 2008-2009 VMware, Inc. 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, sublicense, 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 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 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS * 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 SVGA_CONTEXT_H #define SVGA_CONTEXT_H #include "pipe/p_context.h" #include "pipe/p_defines.h" #include "pipe/p_state.h" #include "util/u_double_list.h" #include "tgsi/tgsi_scan.h" #include "svga_state.h" #define SVGA_TEX_UNITS 8 #define SVGA_MAX_POINTSIZE 80.0 struct draw_vertex_shader; struct svga_shader_result; struct SVGACmdMemory; struct util_bitmask; struct u_upload_mgr; struct svga_shader { const struct tgsi_token *tokens; struct tgsi_shader_info info; struct svga_shader_result *results; unsigned id; boolean use_sm30; }; struct svga_fragment_shader { struct svga_shader base; }; struct svga_vertex_shader { struct svga_shader base; struct draw_vertex_shader *draw_shader; }; struct svga_cache_context; struct svga_tracked_state; struct svga_blend_state { boolean need_white_fragments; /* Should be per-render-target: */ struct { uint8_t writemask; boolean blend_enable; uint8_t srcblend; uint8_t dstblend; uint8_t blendeq; boolean separate_alpha_blend_enable; uint8_t srcblend_alpha; uint8_t dstblend_alpha; uint8_t blendeq_alpha; } rt[1]; }; struct svga_depth_stencil_state { unsigned zfunc:8; unsigned zenable:1; unsigned zwriteenable:1; unsigned alphatestenable:1; unsigned alphafunc:8; struct { unsigned enabled:1; unsigned func:8; unsigned fail:8; unsigned zfail:8; unsigned pass:8; } stencil[2]; /* SVGA3D has one ref/mask/writemask triple shared between front & * back face stencil. We really need two: */ unsigned stencil_mask:8; unsigned stencil_writemask:8; float alpharef; }; #define SVGA_UNFILLED_DISABLE 0 #define SVGA_UNFILLED_LINE 1 #define SVGA_UNFILLED_POINT 2 #define SVGA_PIPELINE_FLAG_POINTS (1<