summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/video_core/engines/maxwell_3d.h67
-rw-r--r--src/video_core/textures/texture.h15
2 files changed, 76 insertions, 6 deletions
diff --git a/src/video_core/engines/maxwell_3d.h b/src/video_core/engines/maxwell_3d.h
index d24c9f657..4637ddabd 100644
--- a/src/video_core/engines/maxwell_3d.h
+++ b/src/video_core/engines/maxwell_3d.h
@@ -312,6 +312,35 @@ public:
312 } 312 }
313 }; 313 };
314 314
315 struct MsaaSampleLocation {
316 union {
317 BitField<0, 4, u32> x0;
318 BitField<4, 4, u32> y0;
319 BitField<8, 4, u32> x1;
320 BitField<12, 4, u32> y1;
321 BitField<16, 4, u32> x2;
322 BitField<20, 4, u32> y2;
323 BitField<24, 4, u32> x3;
324 BitField<28, 4, u32> y3;
325 };
326
327 constexpr std::pair<u32, u32> Location(int index) const {
328 switch (index) {
329 case 0:
330 return {x0, y0};
331 case 1:
332 return {x1, y1};
333 case 2:
334 return {x2, y2};
335 case 3:
336 return {x3, y3};
337 default:
338 UNREACHABLE();
339 return {0, 0};
340 }
341 }
342 };
343
315 enum class DepthMode : u32 { 344 enum class DepthMode : u32 {
316 MinusOneToOne = 0, 345 MinusOneToOne = 0,
317 ZeroToOne = 1, 346 ZeroToOne = 1,
@@ -793,7 +822,13 @@ public:
793 822
794 u32 rt_separate_frag_data; 823 u32 rt_separate_frag_data;
795 824
796 INSERT_UNION_PADDING_WORDS(0xC); 825 INSERT_UNION_PADDING_WORDS(0x1);
826
827 u32 multisample_raster_enable;
828 u32 multisample_raster_samples;
829 std::array<u32, 4> multisample_sample_mask;
830
831 INSERT_UNION_PADDING_WORDS(0x5);
797 832
798 struct { 833 struct {
799 u32 address_high; 834 u32 address_high;
@@ -830,7 +865,16 @@ public:
830 865
831 std::array<VertexAttribute, NumVertexAttributes> vertex_attrib_format; 866 std::array<VertexAttribute, NumVertexAttributes> vertex_attrib_format;
832 867
833 INSERT_UNION_PADDING_WORDS(0xF); 868 std::array<MsaaSampleLocation, 4> multisample_sample_locations;
869
870 INSERT_UNION_PADDING_WORDS(0x2);
871
872 union {
873 BitField<0, 1, u32> enable;
874 BitField<4, 3, u32> target;
875 } multisample_coverage_to_color;
876
877 INSERT_UNION_PADDING_WORDS(0x8);
834 878
835 struct { 879 struct {
836 union { 880 union {
@@ -943,7 +987,7 @@ public:
943 987
944 CounterReset counter_reset; 988 CounterReset counter_reset;
945 989
946 INSERT_UNION_PADDING_WORDS(0x1); 990 u32 multisample_enable;
947 991
948 u32 zeta_enable; 992 u32 zeta_enable;
949 993
@@ -1007,7 +1051,11 @@ public:
1007 1051
1008 float polygon_offset_units; 1052 float polygon_offset_units;
1009 1053
1010 INSERT_UNION_PADDING_WORDS(0x11); 1054 INSERT_UNION_PADDING_WORDS(0x4);
1055
1056 Tegra::Texture::MsaaMode multisample_mode;
1057
1058 INSERT_UNION_PADDING_WORDS(0xC);
1011 1059
1012 union { 1060 union {
1013 BitField<2, 1, u32> coord_origin; 1061 BitField<2, 1, u32> coord_origin;
@@ -1507,12 +1555,17 @@ ASSERT_REG_POSITION(stencil_back_func_ref, 0x3D5);
1507ASSERT_REG_POSITION(stencil_back_mask, 0x3D6); 1555ASSERT_REG_POSITION(stencil_back_mask, 0x3D6);
1508ASSERT_REG_POSITION(stencil_back_func_mask, 0x3D7); 1556ASSERT_REG_POSITION(stencil_back_func_mask, 0x3D7);
1509ASSERT_REG_POSITION(color_mask_common, 0x3E4); 1557ASSERT_REG_POSITION(color_mask_common, 0x3E4);
1510ASSERT_REG_POSITION(rt_separate_frag_data, 0x3EB);
1511ASSERT_REG_POSITION(depth_bounds, 0x3E7); 1558ASSERT_REG_POSITION(depth_bounds, 0x3E7);
1559ASSERT_REG_POSITION(rt_separate_frag_data, 0x3EB);
1560ASSERT_REG_POSITION(multisample_raster_enable, 0x3ED);
1561ASSERT_REG_POSITION(multisample_raster_samples, 0x3EE);
1562ASSERT_REG_POSITION(multisample_sample_mask, 0x3EF);
1512ASSERT_REG_POSITION(zeta, 0x3F8); 1563ASSERT_REG_POSITION(zeta, 0x3F8);
1513ASSERT_REG_POSITION(clear_flags, 0x43E); 1564ASSERT_REG_POSITION(clear_flags, 0x43E);
1514ASSERT_REG_POSITION(fill_rectangle, 0x44F); 1565ASSERT_REG_POSITION(fill_rectangle, 0x44F);
1515ASSERT_REG_POSITION(vertex_attrib_format, 0x458); 1566ASSERT_REG_POSITION(vertex_attrib_format, 0x458);
1567ASSERT_REG_POSITION(multisample_sample_locations, 0x478);
1568ASSERT_REG_POSITION(multisample_coverage_to_color, 0x47E);
1516ASSERT_REG_POSITION(rt_control, 0x487); 1569ASSERT_REG_POSITION(rt_control, 0x487);
1517ASSERT_REG_POSITION(zeta_width, 0x48a); 1570ASSERT_REG_POSITION(zeta_width, 0x48a);
1518ASSERT_REG_POSITION(zeta_height, 0x48b); 1571ASSERT_REG_POSITION(zeta_height, 0x48b);
@@ -1545,11 +1598,12 @@ ASSERT_REG_POSITION(samplecnt_enable, 0x545);
1545ASSERT_REG_POSITION(point_size, 0x546); 1598ASSERT_REG_POSITION(point_size, 0x546);
1546ASSERT_REG_POSITION(point_sprite_enable, 0x548); 1599ASSERT_REG_POSITION(point_sprite_enable, 0x548);
1547ASSERT_REG_POSITION(counter_reset, 0x54C); 1600ASSERT_REG_POSITION(counter_reset, 0x54C);
1601ASSERT_REG_POSITION(multisample_enable, 0x54D);
1548ASSERT_REG_POSITION(zeta_enable, 0x54E); 1602ASSERT_REG_POSITION(zeta_enable, 0x54E);
1549ASSERT_REG_POSITION(multisample_control, 0x54F); 1603ASSERT_REG_POSITION(multisample_control, 0x54F);
1550ASSERT_REG_POSITION(condition, 0x554); 1604ASSERT_REG_POSITION(condition, 0x554);
1551ASSERT_REG_POSITION(tsc, 0x557); 1605ASSERT_REG_POSITION(tsc, 0x557);
1552ASSERT_REG_POSITION(polygon_offset_factor, 0x55b); 1606ASSERT_REG_POSITION(polygon_offset_factor, 0x55B);
1553ASSERT_REG_POSITION(tic, 0x55D); 1607ASSERT_REG_POSITION(tic, 0x55D);
1554ASSERT_REG_POSITION(stencil_two_side_enable, 0x565); 1608ASSERT_REG_POSITION(stencil_two_side_enable, 0x565);
1555ASSERT_REG_POSITION(stencil_back_op_fail, 0x566); 1609ASSERT_REG_POSITION(stencil_back_op_fail, 0x566);
@@ -1558,6 +1612,7 @@ ASSERT_REG_POSITION(stencil_back_op_zpass, 0x568);
1558ASSERT_REG_POSITION(stencil_back_func_func, 0x569); 1612ASSERT_REG_POSITION(stencil_back_func_func, 0x569);
1559ASSERT_REG_POSITION(framebuffer_srgb, 0x56E); 1613ASSERT_REG_POSITION(framebuffer_srgb, 0x56E);
1560ASSERT_REG_POSITION(polygon_offset_units, 0x56F); 1614ASSERT_REG_POSITION(polygon_offset_units, 0x56F);
1615ASSERT_REG_POSITION(multisample_mode, 0x574);
1561ASSERT_REG_POSITION(point_coord_replace, 0x581); 1616ASSERT_REG_POSITION(point_coord_replace, 0x581);
1562ASSERT_REG_POSITION(code_address, 0x582); 1617ASSERT_REG_POSITION(code_address, 0x582);
1563ASSERT_REG_POSITION(draw, 0x585); 1618ASSERT_REG_POSITION(draw, 0x585);
diff --git a/src/video_core/textures/texture.h b/src/video_core/textures/texture.h
index 59b8a5e66..eba05aced 100644
--- a/src/video_core/textures/texture.h
+++ b/src/video_core/textures/texture.h
@@ -131,6 +131,20 @@ enum class SwizzleSource : u32 {
131 OneFloat = 7, 131 OneFloat = 7,
132}; 132};
133 133
134enum class MsaaMode : u32 {
135 Msaa1x1 = 0,
136 Msaa2x1 = 1,
137 Msaa2x2 = 2,
138 Msaa4x2 = 3,
139 Msaa4x2_D3D = 4,
140 Msaa2x1_D3D = 5,
141 Msaa4x4 = 6,
142 Msaa2x2_VC4 = 8,
143 Msaa2x2_VC12 = 9,
144 Msaa4x2_VC8 = 10,
145 Msaa4x2_VC24 = 11,
146};
147
134union TextureHandle { 148union TextureHandle {
135 TextureHandle(u32 raw) : raw{raw} {} 149 TextureHandle(u32 raw) : raw{raw} {}
136 150
@@ -197,6 +211,7 @@ struct TICEntry {
197 union { 211 union {
198 BitField<0, 4, u32> res_min_mip_level; 212 BitField<0, 4, u32> res_min_mip_level;
199 BitField<4, 4, u32> res_max_mip_level; 213 BitField<4, 4, u32> res_max_mip_level;
214 BitField<8, 4, MsaaMode> msaa_mode;
200 BitField<12, 12, u32> min_lod_clamp; 215 BitField<12, 12, u32> min_lod_clamp;
201 }; 216 };
202 217