From 6c26ec72a5b299a5ceb3e4ca7ed0712d312da548 Mon Sep 17 00:00:00 2001 From: Tony Wasserka Date: Fri, 2 Jan 2015 20:59:23 +0100 Subject: Pica/CommandProcessor: Properly implement shader load destination offset registers. --- src/video_core/pica.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/video_core/pica.h') diff --git a/src/video_core/pica.h b/src/video_core/pica.h index 9c1a12dc8..cf9dc4853 100644 --- a/src/video_core/pica.h +++ b/src/video_core/pica.h @@ -678,7 +678,9 @@ struct Regs { INSERT_PADDING_WORDS(0x2); struct { - u32 begin_load; + // Offset of the next instruction to write code to. + // Incremented with each instruction write. + u32 offset; // Writing to these registers sets the "current" word in the shader program. // TODO: It's not clear how the hardware stores what the "current" word is. @@ -690,7 +692,9 @@ struct Regs { // This register group is used to load an internal table of swizzling patterns, // which are indexed by each shader instruction to specify vector component swizzling. struct { - u32 begin_load; + // Offset of the next swizzle pattern to write code to. + // Incremented with each instruction write. + u32 offset; // Writing to these registers sets the "current" swizzle pattern in the table. // TODO: It's not clear how the hardware stores what the "current" swizzle pattern is. -- cgit v1.2.3 From aaf30ca4ee7cb539722a2928a578a579641987a1 Mon Sep 17 00:00:00 2001 From: Tony Wasserka Date: Fri, 2 Jan 2015 15:26:50 +0100 Subject: Pica/OutputMerger: Implement color format checking. --- src/video_core/pica.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/video_core/pica.h') diff --git a/src/video_core/pica.h b/src/video_core/pica.h index cf9dc4853..effa61571 100644 --- a/src/video_core/pica.h +++ b/src/video_core/pica.h @@ -421,7 +421,7 @@ struct Regs { INSERT_PADDING_WORDS(0x6); u32 depth_format; - u32 color_format; + BitField<16, 3, u32> color_format; INSERT_PADDING_WORDS(0x4); -- cgit v1.2.3 From 8bd7a896ea82b5b2f4ff7f2ec50624ff6ec45431 Mon Sep 17 00:00:00 2001 From: Tony Wasserka Date: Thu, 1 Jan 2015 19:59:11 +0100 Subject: Pica: Fix a bug in the register definitions, relating to texture wrapping. --- src/video_core/pica.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/video_core/pica.h') diff --git a/src/video_core/pica.h b/src/video_core/pica.h index effa61571..ef9809d57 100644 --- a/src/video_core/pica.h +++ b/src/video_core/pica.h @@ -131,7 +131,7 @@ struct Regs { union { BitField< 8, 2, WrapMode> wrap_s; - BitField<11, 2, WrapMode> wrap_t; + BitField<12, 2, WrapMode> wrap_t; }; INSERT_PADDING_WORDS(0x1); -- cgit v1.2.3 From 6ca752ccbc7c59dab66f476ca02d3b53527c57da Mon Sep 17 00:00:00 2001 From: Tony Wasserka Date: Sat, 3 Jan 2015 13:33:57 +0100 Subject: Pica/TextureUnit: Implement mirrored repeating texture wrapping. --- src/video_core/pica.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/video_core/pica.h') diff --git a/src/video_core/pica.h b/src/video_core/pica.h index ef9809d57..c20bf99d4 100644 --- a/src/video_core/pica.h +++ b/src/video_core/pica.h @@ -118,8 +118,9 @@ struct Regs { struct TextureConfig { enum WrapMode : u32 { - ClampToEdge = 0, - Repeat = 2, + ClampToEdge = 0, + Repeat = 2, + MirroredRepeat = 3, }; INSERT_PADDING_WORDS(0x1); -- cgit v1.2.3 From 04cd06d5c285848c29278083891474ee78797c8a Mon Sep 17 00:00:00 2001 From: Tony Wasserka Date: Sat, 3 Jan 2015 13:45:10 +0100 Subject: Pica/TextureEnvironment: Add support for the MAD-like texture combiners and clean up texture environment logic. --- src/video_core/pica.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/video_core/pica.h') diff --git a/src/video_core/pica.h b/src/video_core/pica.h index c20bf99d4..23fc6b9ba 100644 --- a/src/video_core/pica.h +++ b/src/video_core/pica.h @@ -266,6 +266,9 @@ struct Regs { AddSigned = 3, Lerp = 4, Subtract = 5, + + MultiplyThenAdd = 8, + AddThenMultiply = 9, }; union { -- cgit v1.2.3 From e11fb96408b27e2aa76e29a380fe3a2d15d37d32 Mon Sep 17 00:00:00 2001 From: Tony Wasserka Date: Sat, 3 Jan 2015 13:49:53 +0100 Subject: Pica/TextureEnvironment: Treat texture combiner source 1 as the PrimaryColor. Not really sure where the difference is, but some applications seem to use this 1:1 the same way... --- src/video_core/pica.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/video_core/pica.h') diff --git a/src/video_core/pica.h b/src/video_core/pica.h index 23fc6b9ba..24f2c2382 100644 --- a/src/video_core/pica.h +++ b/src/video_core/pica.h @@ -224,6 +224,8 @@ struct Regs { struct TevStageConfig { enum class Source : u32 { PrimaryColor = 0x0, + PrimaryFragmentColor = 0x1, + Texture0 = 0x3, Texture1 = 0x4, Texture2 = 0x5, -- cgit v1.2.3 From 156120434251d0ae726442206f8b5b41338d700d Mon Sep 17 00:00:00 2001 From: Tony Wasserka Date: Wed, 11 Feb 2015 21:39:43 +0100 Subject: Pica/BlendUnit: Implement separate color/alpha blend equations. --- src/video_core/pica.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/video_core/pica.h') diff --git a/src/video_core/pica.h b/src/video_core/pica.h index 24f2c2382..e4a5ef78e 100644 --- a/src/video_core/pica.h +++ b/src/video_core/pica.h @@ -343,7 +343,7 @@ struct Regs { }; union { - enum BlendEquation : u32 { + enum class BlendEquation : u32 { Add = 0, Subtract = 1, ReverseSubtract = 2, -- cgit v1.2.3