tgsi: add tgsi_full_src_register_from_dst helper function
authorNicolai Hähnle <nicolai.haehnle@amd.com>
Tue, 9 Feb 2016 17:54:10 +0000 (12:54 -0500)
committerNicolai Hähnle <nicolai.haehnle@amd.com>
Mon, 14 Mar 2016 22:24:49 +0000 (17:24 -0500)
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
src/gallium/auxiliary/tgsi/tgsi_build.c
src/gallium/auxiliary/tgsi/tgsi_build.h

index cfe9b92ee1bf34b6dbe35d513f12814e254ba11f..e5355f573bbe5b43d23790cb248c525714b51582 100644 (file)
@@ -1425,3 +1425,18 @@ tgsi_build_full_property(
 
    return size;
 }
+
+struct tgsi_full_src_register
+tgsi_full_src_register_from_dst(const struct tgsi_full_dst_register *dst)
+{
+   struct tgsi_full_src_register src;
+   src.Register = tgsi_default_src_register();
+   src.Register.File = dst->Register.File;
+   src.Register.Indirect = dst->Register.Indirect;
+   src.Register.Dimension = dst->Register.Dimension;
+   src.Register.Index = dst->Register.Index;
+   src.Indirect = dst->Indirect;
+   src.Dimension = dst->Dimension;
+   src.DimIndirect = dst->DimIndirect;
+   return src;
+}
index c5127e1855c83ee13126930b7223277a69a01270..34d181ab247ff604d7d27421fbbf0d02ddcff424 100644 (file)
@@ -30,6 +30,8 @@
 
 
 struct tgsi_token;
+struct tgsi_full_dst_register;
+struct tgsi_full_src_register;
 
 
 #if defined __cplusplus
@@ -111,6 +113,9 @@ tgsi_build_full_instruction(
 struct tgsi_instruction_predicate
 tgsi_default_instruction_predicate(void);
 
+struct tgsi_full_src_register
+tgsi_full_src_register_from_dst(const struct tgsi_full_dst_register *dst);
+
 #if defined __cplusplus
 }
 #endif