Use tgsi_scan_shader() to populate a tgsi_shader_info struct and use that instead.
tgsi_dump(aaline_fs.tokens, 0);
#endif
+#if 1 /* XXX remove */
aaline_fs.input_semantic_name[aaline_fs.num_inputs] = TGSI_SEMANTIC_GENERIC;
aaline_fs.input_semantic_index[aaline_fs.num_inputs] = transform.maxGeneric + 1;
aaline_fs.num_inputs++;
+#endif
aaline->fs->aaline_fs
= aaline->driver_create_fs_state(aaline->pipe, &aaline_fs);
tgsi_dump(aapoint_fs.tokens, 0);
#endif
+#if 1 /* XXX remove */
aapoint_fs.input_semantic_name[aapoint_fs.num_inputs] = TGSI_SEMANTIC_GENERIC;
aapoint_fs.input_semantic_index[aapoint_fs.num_inputs] = transform.maxGeneric + 1;
aapoint_fs.num_inputs++;
+#endif
aapoint->fs->aapoint_fs
= aapoint->driver_create_fs_state(aapoint->pipe, &aapoint_fs);
/* find PSIZ vertex output */
const struct draw_vertex_shader *vs = draw->vertex_shader;
uint i;
- for (i = 0; i < vs->state->num_outputs; i++) {
- if (vs->state->output_semantic_name[i] == TGSI_SEMANTIC_PSIZE) {
+ for (i = 0; i < vs->info.num_outputs; i++) {
+ if (vs->info.output_semantic_name[i] == TGSI_SEMANTIC_PSIZE) {
aapoint->psize_slot = i;
break;
}
clipper->flat = stage->draw->rasterizer->flatshade ? TRUE : FALSE;
if (clipper->flat) {
- const struct pipe_shader_state *vs = stage->draw->vertex_shader->state;
+ const struct draw_vertex_shader *vs = stage->draw->vertex_shader;
uint i;
clipper->num_color_attribs = 0;
- for (i = 0; i < vs->num_outputs; i++) {
- if (vs->output_semantic_name[i] == TGSI_SEMANTIC_COLOR ||
- vs->output_semantic_name[i] == TGSI_SEMANTIC_BCOLOR) {
+ for (i = 0; i < vs->info.num_outputs; i++) {
+ if (vs->info.output_semantic_name[i] == TGSI_SEMANTIC_COLOR ||
+ vs->info.output_semantic_name[i] == TGSI_SEMANTIC_BCOLOR) {
clipper->color_attribs[clipper->num_color_attribs++] = i;
}
}
draw_find_vs_output(struct draw_context *draw,
uint semantic_name, uint semantic_index)
{
- const struct pipe_shader_state *vs = draw->vertex_shader->state;
+ const struct draw_vertex_shader *vs = draw->vertex_shader;
uint i;
- for (i = 0; i < vs->num_outputs; i++) {
- if (vs->output_semantic_name[i] == semantic_name &&
- vs->output_semantic_index[i] == semantic_index)
+ for (i = 0; i < vs->info.num_outputs; i++) {
+ if (vs->info.output_semantic_name[i] == semantic_name &&
+ vs->info.output_semantic_index[i] == semantic_index)
return i;
}
static void flatshade_init_state( struct draw_stage *stage )
{
struct flat_stage *flat = flat_stage(stage);
- const struct pipe_shader_state *vs = stage->draw->vertex_shader->state;
+ const struct draw_vertex_shader *vs = stage->draw->vertex_shader;
uint i;
/* Find which vertex shader outputs are colors, make a list */
flat->num_color_attribs = 0;
- for (i = 0; i < vs->num_outputs; i++) {
- if (vs->output_semantic_name[i] == TGSI_SEMANTIC_COLOR ||
- vs->output_semantic_name[i] == TGSI_SEMANTIC_BCOLOR) {
+ for (i = 0; i < vs->info.num_outputs; i++) {
+ if (vs->info.output_semantic_name[i] == TGSI_SEMANTIC_COLOR ||
+ vs->info.output_semantic_name[i] == TGSI_SEMANTIC_BCOLOR) {
flat->color_attribs[flat->num_color_attribs++] = i;
}
}
#include "rtasm/rtasm_x86sse.h"
#include "tgsi/exec/tgsi_exec.h"
+#include "tgsi/util/tgsi_scan.h"
struct pipe_context;
*/
const struct pipe_shader_state *state;
+ struct tgsi_shader_info info;
+
void (*prepare)( struct draw_vertex_shader *shader,
struct draw_context *draw );
pstip->sampler_unit = transform.maxSampler + 1;
+#if 1 /* XXX remove */
if (transform.wincoordInput < 0) {
pstip_fs.input_semantic_name[pstip_fs.num_inputs] = TGSI_SEMANTIC_POSITION;
pstip_fs.input_semantic_index[pstip_fs.num_inputs] = (ubyte)transform.maxInput;
pstip_fs.num_inputs++;
}
+#endif
pstip->fs->pstip_fs = pstip->driver_create_fs_state(pstip->pipe, &pstip_fs);
}
struct prim_header *header )
{
struct twoside_stage *twoside = twoside_stage(stage);
- const struct pipe_shader_state *vs = stage->draw->vertex_shader->state;
+ const struct draw_vertex_shader *vs = stage->draw->vertex_shader;
uint i;
twoside->attrib_front0 = 0;
twoside->attrib_back1 = 0;
/* Find which vertex shader outputs are front/back colors */
- for (i = 0; i < vs->num_outputs; i++) {
- if (vs->output_semantic_name[i] == TGSI_SEMANTIC_COLOR) {
- if (vs->output_semantic_index[i] == 0)
+ for (i = 0; i < vs->info.num_outputs; i++) {
+ if (vs->info.output_semantic_name[i] == TGSI_SEMANTIC_COLOR) {
+ if (vs->info.output_semantic_index[i] == 0)
twoside->attrib_front0 = i;
else
twoside->attrib_front1 = i;
}
- if (vs->output_semantic_name[i] == TGSI_SEMANTIC_BCOLOR) {
- if (vs->output_semantic_index[i] == 0)
+ if (vs->info.output_semantic_name[i] == TGSI_SEMANTIC_BCOLOR) {
+ if (vs->info.output_semantic_index[i] == 0)
twoside->attrib_back0 = i;
else
twoside->attrib_back1 = i;
if (!draw->vertex_shader)
return;
- nr_attrs = draw->vertex_shader->state->num_inputs;
+ nr_attrs = draw->vertex_shader->info.num_inputs;
for (i = 0; i < nr_attrs; i++) {
unsigned buf = draw->vertex_element[i].vertex_buffer_index;
struct draw_vertex_shader *vs;
vs = draw_create_vs_llvm( draw, shader );
- if (vs)
- return vs;
+ if (!vs) {
+ vs = draw_create_vs_sse( draw, shader );
+ if (!vs) {
+ vs = draw_create_vs_exec( draw, shader );
+ }
+ }
+ assert(vs);
- vs = draw_create_vs_sse( draw, shader );
- if (vs)
- return vs;
+ tgsi_scan_shader(shader->tokens, &vs->info);
- vs = draw_create_vs_exec( draw, shader );
- assert(vs);
return vs;
}
draw_do_flush( draw, DRAW_FLUSH_STATE_CHANGE );
draw->vertex_shader = dvs;
- draw->num_vs_outputs = dvs->state->num_outputs;
+ draw->num_vs_outputs = dvs->info.num_outputs;
tgsi_exec_machine_init(&draw->machine);
const float *trans = draw->viewport.translate;
assert(count <= 4);
- assert(draw->vertex_shader->state->output_semantic_name[0]
+ assert(draw->vertex_shader->info.output_semantic_name[0]
== TGSI_SEMANTIC_POSITION);
machine->Consts = (float (*)[4]) draw->user.constants;
const float *trans = draw->viewport.translate;
assert(count <= 4);
- assert(draw->vertex_shader->state->output_semantic_name[0]
+ assert(draw->vertex_shader->info.output_semantic_name[0]
== TGSI_SEMANTIC_POSITION);
/* Consts does not require 16 byte alignment. */
/* find vertex shader texcoord outputs */
const struct draw_vertex_shader *vs = draw->vertex_shader;
uint i, j = 0;
- for (i = 0; i < vs->state->num_outputs; i++) {
- if (vs->state->output_semantic_name[i] == TGSI_SEMANTIC_GENERIC) {
+ for (i = 0; i < vs->info.num_outputs; i++) {
+ if (vs->info.output_semantic_name[i] == TGSI_SEMANTIC_GENERIC) {
wide->texcoord_slot[j] = i;
wide->texcoord_mode[j] = draw->rasterizer->sprite_coord_mode[j];
j++;
/* find PSIZ vertex output */
const struct draw_vertex_shader *vs = draw->vertex_shader;
uint i;
- for (i = 0; i < vs->state->num_outputs; i++) {
- if (vs->state->output_semantic_name[i] == TGSI_SEMANTIC_PSIZE) {
+ for (i = 0; i < vs->info.num_outputs; i++) {
+ if (vs->info.output_semantic_name[i] == TGSI_SEMANTIC_PSIZE) {
wide->psize_slot = i;
break;
}