163529c731a090c5e41c1224ca79b544243a1e570Corbin Simpson/* 263529c731a090c5e41c1224ca79b544243a1e570Corbin Simpson * Copyright 2009 Corbin Simpson <MostAwesomeDude@gmail.com> 3cb90235135ef7c657053657f3bdfbda7ca70d708Marek Olšák * Copyright 2009 Marek Olšák <maraeo@gmail.com> 463529c731a090c5e41c1224ca79b544243a1e570Corbin Simpson * 563529c731a090c5e41c1224ca79b544243a1e570Corbin Simpson * Permission is hereby granted, free of charge, to any person obtaining a 663529c731a090c5e41c1224ca79b544243a1e570Corbin Simpson * copy of this software and associated documentation files (the "Software"), 763529c731a090c5e41c1224ca79b544243a1e570Corbin Simpson * to deal in the Software without restriction, including without limitation 863529c731a090c5e41c1224ca79b544243a1e570Corbin Simpson * on the rights to use, copy, modify, merge, publish, distribute, sub 963529c731a090c5e41c1224ca79b544243a1e570Corbin Simpson * license, and/or sell copies of the Software, and to permit persons to whom 1063529c731a090c5e41c1224ca79b544243a1e570Corbin Simpson * the Software is furnished to do so, subject to the following conditions: 1163529c731a090c5e41c1224ca79b544243a1e570Corbin Simpson * 1263529c731a090c5e41c1224ca79b544243a1e570Corbin Simpson * The above copyright notice and this permission notice (including the next 1363529c731a090c5e41c1224ca79b544243a1e570Corbin Simpson * paragraph) shall be included in all copies or substantial portions of the 1463529c731a090c5e41c1224ca79b544243a1e570Corbin Simpson * Software. 1563529c731a090c5e41c1224ca79b544243a1e570Corbin Simpson * 1663529c731a090c5e41c1224ca79b544243a1e570Corbin Simpson * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 1763529c731a090c5e41c1224ca79b544243a1e570Corbin Simpson * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 1863529c731a090c5e41c1224ca79b544243a1e570Corbin Simpson * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL 1963529c731a090c5e41c1224ca79b544243a1e570Corbin Simpson * THE AUTHOR(S) AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM, 2063529c731a090c5e41c1224ca79b544243a1e570Corbin Simpson * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 2163529c731a090c5e41c1224ca79b544243a1e570Corbin Simpson * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE 2263529c731a090c5e41c1224ca79b544243a1e570Corbin Simpson * USE OR OTHER DEALINGS IN THE SOFTWARE. */ 2363529c731a090c5e41c1224ca79b544243a1e570Corbin Simpson 24622858884fc5923c9e7a0c1bb0e80b53f0acb5a7Joakim Sindholt#ifndef R300_VS_H 25622858884fc5923c9e7a0c1bb0e80b53f0acb5a7Joakim Sindholt#define R300_VS_H 2663529c731a090c5e41c1224ca79b544243a1e570Corbin Simpson 27188f8c679254f193cdcfcd4ef338f3c8c5e1146dNicolai Hähnle#include "pipe/p_state.h" 28188f8c679254f193cdcfcd4ef338f3c8c5e1146dNicolai Hähnle#include "tgsi/tgsi_scan.h" 291c2c4ddbd1e97bfd13430521e5c09cb5ce8e36e6Marek Olšák#include "compiler/radeon_code.h" 3063529c731a090c5e41c1224ca79b544243a1e570Corbin Simpson 314f541db80c5ffff8932679a389a6043105f0b1beMarek Olšák#include "r300_context.h" 32cb90235135ef7c657053657f3bdfbda7ca70d708Marek Olšák#include "r300_shader_semantics.h" 33cb90235135ef7c657053657f3bdfbda7ca70d708Marek Olšák 34188f8c679254f193cdcfcd4ef338f3c8c5e1146dNicolai Hähnlestruct r300_context; 35935e6b19245542d177ab26ced416dd665a79048dCorbin Simpson 36188f8c679254f193cdcfcd4ef338f3c8c5e1146dNicolai Hähnlestruct r300_vertex_shader { 37188f8c679254f193cdcfcd4ef338f3c8c5e1146dNicolai Hähnle /* Parent class */ 38188f8c679254f193cdcfcd4ef338f3c8c5e1146dNicolai Hähnle struct pipe_shader_state state; 39cb90235135ef7c657053657f3bdfbda7ca70d708Marek Olšák 40188f8c679254f193cdcfcd4ef338f3c8c5e1146dNicolai Hähnle struct tgsi_shader_info info; 41cb90235135ef7c657053657f3bdfbda7ca70d708Marek Olšák struct r300_shader_semantics outputs; 4263529c731a090c5e41c1224ca79b544243a1e570Corbin Simpson 436eae8e4482b6d5e3d46e10473b05f16381736a5aMarek Olšák /* Whether the shader was replaced by a dummy one due to a shader 446eae8e4482b6d5e3d46e10473b05f16381736a5aMarek Olšák * compilation failure. */ 456eae8e4482b6d5e3d46e10473b05f16381736a5aMarek Olšák boolean dummy; 466eae8e4482b6d5e3d46e10473b05f16381736a5aMarek Olšák 47abc2f29dd2baa9c8aa672f07a1500e579364ab29Marek Olšák /* Numbers of constants for each type. */ 48abc2f29dd2baa9c8aa672f07a1500e579364ab29Marek Olšák unsigned externals_count; 49abc2f29dd2baa9c8aa672f07a1500e579364ab29Marek Olšák unsigned immediates_count; 50abc2f29dd2baa9c8aa672f07a1500e579364ab29Marek Olšák 514f541db80c5ffff8932679a389a6043105f0b1beMarek Olšák /* HWTCL-specific. */ 52188f8c679254f193cdcfcd4ef338f3c8c5e1146dNicolai Hähnle /* Machine code (if translated) */ 53188f8c679254f193cdcfcd4ef338f3c8c5e1146dNicolai Hähnle struct r300_vertex_program_code code; 544f541db80c5ffff8932679a389a6043105f0b1beMarek Olšák 554f541db80c5ffff8932679a389a6043105f0b1beMarek Olšák /* SWTCL-specific. */ 564f541db80c5ffff8932679a389a6043105f0b1beMarek Olšák void *draw_vs; 57c4fb791909e687d5af5b95d88ebd6332c82c3095Corbin Simpson}; 58c4fb791909e687d5af5b95d88ebd6332c82c3095Corbin Simpson 595ce0598a034179eaacff96f39eaebf0ba0f30d4cMarek Olšákvoid r300_init_vs_outputs(struct r300_context *r300, 605ce0598a034179eaacff96f39eaebf0ba0f30d4cMarek Olšák struct r300_vertex_shader *vs); 6163529c731a090c5e41c1224ca79b544243a1e570Corbin Simpson 62f86ac27bf9203fdd9b7110dc843263307f475a99Marek Olšákvoid r300_translate_vertex_shader(struct r300_context *r300, 63f86ac27bf9203fdd9b7110dc843263307f475a99Marek Olšák struct r300_vertex_shader *vs); 6490e5a37d128efaca9e89434ab103826ee82cb911Marek Olšák 655ce0598a034179eaacff96f39eaebf0ba0f30d4cMarek Olšákvoid r300_draw_init_vertex_shader(struct r300_context *r300, 6690e5a37d128efaca9e89434ab103826ee82cb911Marek Olšák struct r300_vertex_shader *vs); 6790e5a37d128efaca9e89434ab103826ee82cb911Marek Olšák 68622858884fc5923c9e7a0c1bb0e80b53f0acb5a7Joakim Sindholt#endif /* R300_VS_H */ 69