static void * svga_create_vs_state(struct pipe_context *pipe, const struct pipe_shader_state *templ) { struct svga_context *svga = svga_context(pipe); struct svga_vertex_shader *vs = CALLOC_STRUCT(svga_vertex_shader); if (!vs) return NULL; SVGA_STATS_TIME_PUSH(svga_sws(svga), SVGA_STATS_TIME_CREATEVS); /* substitute a debug shader? */ vs->base.tokens = tgsi_dup_tokens(substitute_vs(svga->debug.shader_id, templ->tokens)); /* Collect basic info that we'll need later: */ tgsi_scan_shader(vs->base.tokens, &vs->base.info); { /* Need to do construct a new template in case we substitued a * debug shader. */ struct pipe_shader_state tmp2 = *templ; tmp2.tokens = vs->base.tokens; vs->draw_shader = draw_create_vertex_shader(svga->swtnl.draw, &tmp2); } vs->base.id = svga->debug.shader_id++; vs->generic_outputs = svga_get_generic_outputs_mask(&vs->base.info); /* check for any stream output declarations */ if (templ->stream_output.num_outputs) { vs->base.stream_output = svga_create_stream_output(svga, &vs->base, &templ->stream_output); } SVGA_STATS_TIME_POP(svga_sws(svga)); return vs; }
static void * svga_create_vs_state(struct pipe_context *pipe, const struct pipe_shader_state *templ) { struct svga_context *svga = svga_context(pipe); struct svga_screen *svgascreen = svga_screen(pipe->screen); struct svga_vertex_shader *vs = CALLOC_STRUCT(svga_vertex_shader); if (!vs) return NULL; /* substitute a debug shader? */ vs->base.tokens = tgsi_dup_tokens(substitute_vs(svga->debug.shader_id, templ->tokens)); /* Collect basic info that we'll need later: */ tgsi_scan_shader(vs->base.tokens, &vs->base.info); { /* Need to do construct a new template in case we substitued a * debug shader. */ struct pipe_shader_state tmp2 = *templ; tmp2.tokens = vs->base.tokens; vs->draw_shader = draw_create_vertex_shader(svga->swtnl.draw, &tmp2); } vs->base.id = svga->debug.shader_id++; vs->base.use_sm30 = svgascreen->use_vs30; if (SVGA_DEBUG & DEBUG_TGSI || 0) { debug_printf("%s id: %u, inputs: %u, outputs: %u\n", __FUNCTION__, vs->base.id, vs->base.info.num_inputs, vs->base.info.num_outputs); } return vs; }