@@ -253,6 +253,13 @@ struct Liverpool {
253
253
}
254
254
};
255
255
256
+ struct ModeControl {
257
+ s32 msaa_enable : 1 ;
258
+ s32 vport_scissor_enable : 1 ;
259
+ s32 line_stripple_enable : 1 ;
260
+ s32 send_unlit_stiles_to_pkr : 1 ;
261
+ };
262
+
256
263
enum class ZOrder : u32 {
257
264
LateZ = 0 ,
258
265
EarlyZLateZ = 1 ,
@@ -559,29 +566,39 @@ struct Liverpool {
559
566
s16 top_left_x;
560
567
s16 top_left_y;
561
568
};
562
- union {
563
- BitField< 0 , 15 , u32 > bottom_right_x;
564
- BitField< 16 , 15 , u32 > bottom_right_y;
569
+ struct {
570
+ s16 bottom_right_x;
571
+ s16 bottom_right_y;
565
572
};
566
573
574
+ // From AMD spec: 'Negative numbers clamped to 0'
575
+ static s16 Clamp (s16 value) {
576
+ return std::max (s16 (0 ), value);
577
+ }
578
+
567
579
u32 GetWidth () const {
568
- return static_cast <u32 >(bottom_right_x - top_left_x);
580
+ return static_cast <u32 >(Clamp ( bottom_right_x) - Clamp ( top_left_x) );
569
581
}
570
582
571
583
u32 GetHeight () const {
572
- return static_cast <u32 >(bottom_right_y - top_left_y);
584
+ return static_cast <u32 >(Clamp ( bottom_right_y) - Clamp ( top_left_y) );
573
585
}
574
586
};
575
587
588
+ struct WindowOffset {
589
+ s32 window_x_offset : 16 ;
590
+ s32 window_y_offset : 16 ;
591
+ };
592
+
576
593
struct ViewportScissor {
577
594
union {
578
595
BitField<0 , 15 , s32> top_left_x;
579
- BitField<15 , 15 , s32> top_left_y;
580
- BitField<30 , 1 , s32> window_offset_disable;
596
+ BitField<16 , 15 , s32> top_left_y;
597
+ BitField<31 , 1 , s32> window_offset_disable;
581
598
};
582
- union {
583
- BitField< 0 , 15 , s32> bottom_right_x;
584
- BitField< 15 , 15 , s32> bottom_right_y;
599
+ struct {
600
+ s16 bottom_right_x;
601
+ s16 bottom_right_y;
585
602
};
586
603
587
604
u32 GetWidth () const {
@@ -953,10 +970,14 @@ struct Liverpool {
953
970
Scissor screen_scissor;
954
971
INSERT_PADDING_WORDS (0xA010 - 0xA00C - 2 );
955
972
DepthBuffer depth_buffer;
956
- INSERT_PADDING_WORDS (0xA08E - 0xA018 );
973
+ INSERT_PADDING_WORDS (0xA080 - 0xA018 );
974
+ WindowOffset window_offset;
975
+ ViewportScissor window_scissor;
976
+ INSERT_PADDING_WORDS (0xA08E - 0xA081 - 2 );
957
977
ColorBufferMask color_target_mask;
958
978
ColorBufferMask color_shader_mask;
959
- INSERT_PADDING_WORDS (0xA094 - 0xA08E - 2 );
979
+ ViewportScissor generic_scissor;
980
+ INSERT_PADDING_WORDS (2 );
960
981
std::array<ViewportScissor, NumViewports> viewport_scissors;
961
982
std::array<ViewportDepth, NumViewports> viewport_depths;
962
983
INSERT_PADDING_WORDS (0xA103 - 0xA0D4 );
@@ -994,7 +1015,9 @@ struct Liverpool {
994
1015
PolygonControl polygon_control;
995
1016
ViewportControl viewport_control;
996
1017
VsOutputControl vs_output_control;
997
- INSERT_PADDING_WORDS (0xA29E - 0xA207 - 2 );
1018
+ INSERT_PADDING_WORDS (0xA292 - 0xA207 - 1 );
1019
+ ModeControl mode_control;
1020
+ INSERT_PADDING_WORDS (0xA29D - 0xA292 - 1 );
998
1021
u32 index_size;
999
1022
u32 max_index_size;
1000
1023
IndexBufferType index_buffer_type;
@@ -1206,8 +1229,11 @@ static_assert(GFX6_3D_REG_INDEX(depth_htile_data_base) == 0xA005);
1206
1229
static_assert (GFX6_3D_REG_INDEX(screen_scissor) == 0xA00C );
1207
1230
static_assert (GFX6_3D_REG_INDEX(depth_buffer.z_info) == 0xA010 );
1208
1231
static_assert (GFX6_3D_REG_INDEX(depth_buffer.depth_slice) == 0xA017 );
1232
+ static_assert (GFX6_3D_REG_INDEX(window_offset) == 0xA080 );
1233
+ static_assert (GFX6_3D_REG_INDEX(window_scissor) == 0xA081 );
1209
1234
static_assert (GFX6_3D_REG_INDEX(color_target_mask) == 0xA08E );
1210
1235
static_assert (GFX6_3D_REG_INDEX(color_shader_mask) == 0xA08F );
1236
+ static_assert (GFX6_3D_REG_INDEX(generic_scissor) == 0xA090 );
1211
1237
static_assert (GFX6_3D_REG_INDEX(viewport_scissors) == 0xA094 );
1212
1238
static_assert (GFX6_3D_REG_INDEX(primitive_restart_index) == 0xA103 );
1213
1239
static_assert (GFX6_3D_REG_INDEX(stencil_control) == 0xA10B );
@@ -1227,6 +1253,7 @@ static_assert(GFX6_3D_REG_INDEX(color_control) == 0xA202);
1227
1253
static_assert (GFX6_3D_REG_INDEX(clipper_control) == 0xA204 );
1228
1254
static_assert (GFX6_3D_REG_INDEX(viewport_control) == 0xA206 );
1229
1255
static_assert (GFX6_3D_REG_INDEX(vs_output_control) == 0xA207 );
1256
+ static_assert (GFX6_3D_REG_INDEX(mode_control) == 0xA292 );
1230
1257
static_assert (GFX6_3D_REG_INDEX(index_size) == 0xA29D );
1231
1258
static_assert (GFX6_3D_REG_INDEX(index_buffer_type) == 0xA29F );
1232
1259
static_assert (GFX6_3D_REG_INDEX(enable_primitive_id) == 0xA2A1 );
0 commit comments