Jakob Bornecrantz | 3192633 | 2009-11-16 19:56:18 +0100 | [diff] [blame] | 1 | /********************************************************** |
| 2 | * Copyright 2008-2009 VMware, Inc. All rights reserved. |
| 3 | * |
| 4 | * Permission is hereby granted, free of charge, to any person |
| 5 | * obtaining a copy of this software and associated documentation |
| 6 | * files (the "Software"), to deal in the Software without |
| 7 | * restriction, including without limitation the rights to use, copy, |
| 8 | * modify, merge, publish, distribute, sublicense, and/or sell copies |
| 9 | * of the Software, and to permit persons to whom the Software is |
| 10 | * furnished to do so, subject to the following conditions: |
| 11 | * |
| 12 | * The above copyright notice and this permission notice shall be |
| 13 | * included in all copies or substantial portions of the Software. |
| 14 | * |
| 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, |
| 16 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF |
| 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND |
| 18 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS |
| 19 | * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN |
| 20 | * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN |
| 21 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE |
| 22 | * SOFTWARE. |
| 23 | * |
| 24 | **********************************************************/ |
| 25 | |
| 26 | #ifndef SVGA_STATE_H |
| 27 | #define SVGA_STATE_H |
| 28 | |
| 29 | |
| 30 | #include "pipe/p_compiler.h" |
| 31 | #include "pipe/p_defines.h" |
| 32 | |
| 33 | struct svga_context; |
| 34 | |
| 35 | |
| 36 | void svga_init_state( struct svga_context *svga ); |
| 37 | void svga_destroy_state( struct svga_context *svga ); |
| 38 | |
| 39 | |
| 40 | struct svga_tracked_state { |
| 41 | const char *name; |
| 42 | unsigned dirty; |
Brian Paul | 5f053bf | 2011-09-22 17:02:59 -0600 | [diff] [blame] | 43 | enum pipe_error (*update)( struct svga_context *svga, unsigned dirty ); |
Jakob Bornecrantz | 3192633 | 2009-11-16 19:56:18 +0100 | [diff] [blame] | 44 | }; |
| 45 | |
| 46 | /* NEED_SWTNL |
| 47 | */ |
| 48 | extern struct svga_tracked_state svga_update_need_swvfetch; |
| 49 | extern struct svga_tracked_state svga_update_need_pipeline; |
| 50 | extern struct svga_tracked_state svga_update_need_swtnl; |
| 51 | |
| 52 | /* HW_CLEAR |
| 53 | */ |
| 54 | extern struct svga_tracked_state svga_hw_viewport; |
| 55 | extern struct svga_tracked_state svga_hw_scissor; |
| 56 | extern struct svga_tracked_state svga_hw_framebuffer; |
| 57 | |
| 58 | /* HW_DRAW |
| 59 | */ |
Brian Paul | e054251 | 2015-08-13 11:00:58 -0700 | [diff] [blame] | 60 | extern struct svga_tracked_state svga_need_tgsi_transform; |
Jakob Bornecrantz | 3192633 | 2009-11-16 19:56:18 +0100 | [diff] [blame] | 61 | extern struct svga_tracked_state svga_hw_vs; |
| 62 | extern struct svga_tracked_state svga_hw_fs; |
Brian Paul | e054251 | 2015-08-13 11:00:58 -0700 | [diff] [blame] | 63 | extern struct svga_tracked_state svga_hw_gs; |
Jakob Bornecrantz | 3192633 | 2009-11-16 19:56:18 +0100 | [diff] [blame] | 64 | extern struct svga_tracked_state svga_hw_rss; |
Brian Paul | e054251 | 2015-08-13 11:00:58 -0700 | [diff] [blame] | 65 | extern struct svga_tracked_state svga_hw_pstipple; |
| 66 | extern struct svga_tracked_state svga_hw_sampler; |
| 67 | extern struct svga_tracked_state svga_hw_sampler_bindings; |
Jakob Bornecrantz | 3192633 | 2009-11-16 19:56:18 +0100 | [diff] [blame] | 68 | extern struct svga_tracked_state svga_hw_tss; |
| 69 | extern struct svga_tracked_state svga_hw_tss_binding; |
| 70 | extern struct svga_tracked_state svga_hw_clip_planes; |
| 71 | extern struct svga_tracked_state svga_hw_vdecl; |
Brian Paul | 2a5eeea | 2012-08-09 10:14:51 -0600 | [diff] [blame] | 72 | extern struct svga_tracked_state svga_hw_fs_constants; |
Brian Paul | e054251 | 2015-08-13 11:00:58 -0700 | [diff] [blame] | 73 | extern struct svga_tracked_state svga_hw_gs_constants; |
Brian Paul | 2a5eeea | 2012-08-09 10:14:51 -0600 | [diff] [blame] | 74 | extern struct svga_tracked_state svga_hw_vs_constants; |
Jakob Bornecrantz | 3192633 | 2009-11-16 19:56:18 +0100 | [diff] [blame] | 75 | |
| 76 | /* SWTNL_DRAW |
| 77 | */ |
| 78 | extern struct svga_tracked_state svga_update_swtnl_draw; |
| 79 | extern struct svga_tracked_state svga_update_swtnl_vdecl; |
| 80 | |
| 81 | /* Bring the hardware fully up-to-date so that we can emit draw |
| 82 | * commands. |
| 83 | */ |
| 84 | #define SVGA_STATE_NEED_SWTNL 0 |
| 85 | #define SVGA_STATE_HW_CLEAR 1 |
| 86 | #define SVGA_STATE_HW_DRAW 2 |
| 87 | #define SVGA_STATE_SWTNL_DRAW 3 |
| 88 | #define SVGA_STATE_MAX 4 |
| 89 | |
| 90 | |
| 91 | enum pipe_error svga_update_state( struct svga_context *svga, |
| 92 | unsigned level ); |
| 93 | |
| 94 | void svga_update_state_retry( struct svga_context *svga, |
| 95 | unsigned level ); |
| 96 | |
| 97 | |
| 98 | enum pipe_error svga_emit_initial_state( struct svga_context *svga ); |
| 99 | |
José Fonseca | 369ece1 | 2011-02-23 13:32:37 +0000 | [diff] [blame] | 100 | enum pipe_error svga_reemit_framebuffer_bindings( struct svga_context *svga ); |
| 101 | |
Brian Paul | e054251 | 2015-08-13 11:00:58 -0700 | [diff] [blame] | 102 | enum pipe_error svga_rebind_framebuffer_bindings( struct svga_context *svga ); |
| 103 | |
José Fonseca | 369ece1 | 2011-02-23 13:32:37 +0000 | [diff] [blame] | 104 | enum pipe_error svga_reemit_tss_bindings( struct svga_context *svga ); |
| 105 | |
Brian Paul | f84c830 | 2014-02-08 09:51:14 -0800 | [diff] [blame] | 106 | enum pipe_error svga_reemit_vs_bindings(struct svga_context *svga); |
| 107 | |
| 108 | enum pipe_error svga_reemit_fs_bindings(struct svga_context *svga); |
| 109 | |
Brian Paul | e054251 | 2015-08-13 11:00:58 -0700 | [diff] [blame] | 110 | enum pipe_error svga_reemit_gs_bindings(struct svga_context *svga); |
| 111 | |
Jakob Bornecrantz | 3192633 | 2009-11-16 19:56:18 +0100 | [diff] [blame] | 112 | #endif |