struct svga_shader_variant *
svga_tgsi_vgpu9_translate(struct svga_context *svga,
const struct svga_shader *shader,
- const struct svga_compile_key *key, unsigned unit)
+ const struct svga_compile_key *key,
+ enum pipe_shader_type unit)
{
struct svga_shader_variant *variant = NULL;
struct svga_shader_emitter emit;
+ SVGA_STATS_TIME_PUSH(svga_sws(svga), SVGA_STATS_TIME_TGSIVGPU9TRANSLATE);
+
memset(&emit, 0, sizeof(emit));
emit.size = 1024;
goto fail;
}
+ if (emit.info.indirect_files & (1 << TGSI_FILE_TEMPORARY)) {
+ debug_printf(
+ "svga: indirect indexing of temporary registers is not supported.\n");
+ goto fail;
+ }
+
emit.in_main_func = TRUE;
if (!svga_shader_emit_header(&emit)) {
goto fail;
}
- variant = svga_new_shader_variant(svga);
+ variant = svga_new_shader_variant(svga, unit);
if (!variant)
goto fail;
}
#endif
- return variant;
+ goto done;
- fail:
+fail:
FREE(variant);
if (emit.buf != err_buf)
FREE(emit.buf);
- return NULL;
+ variant = NULL;
+
+done:
+ SVGA_STATS_TIME_POP(svga_sws(svga));
+ return variant;
}