radv: fix wide points and lines
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Tue, 30 Jun 2020 16:45:08 +0000 (18:45 +0200)
committerSamuel Pitoiset <samuel.pitoiset@gmail.com>
Thu, 2 Jul 2020 06:26:03 +0000 (08:26 +0200)
The maximum value for both points and lines is 65536. This doesn't
fix anything known (just found this while looking in that area).

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5696>

src/amd/vulkan/radv_cmd_buffer.c
src/amd/vulkan/radv_device.c
src/amd/vulkan/si_cmd_buffer.c

index 31930d738434f39ac37662dbc9c49a75279aa79e..7b0afef9c904ff552c9306eae085f734b08347cc 100644 (file)
@@ -1266,7 +1266,7 @@ radv_emit_line_width(struct radv_cmd_buffer *cmd_buffer)
        unsigned width = cmd_buffer->state.dynamic.line_width * 8;
 
        radeon_set_context_reg(cmd_buffer->cs, R_028A08_PA_SU_LINE_CNTL,
-                              S_028A08_WIDTH(CLAMP(width, 0, 0xFFF)));
+                              S_028A08_WIDTH(CLAMP(width, 0, 0xFFFF)));
 }
 
 static void
index 4401f39e77cb3050838e10cc705d867e91ee3c2e..e83241622963bea368eacd40b9b41a5e10a10a5b 100644 (file)
@@ -1467,8 +1467,8 @@ void radv_GetPhysicalDeviceProperties(
                .maxCullDistances                         = 8,
                .maxCombinedClipAndCullDistances          = 8,
                .discreteQueuePriorities                  = 2,
-               .pointSizeRange                           = { 0.0, 8192.0 },
-               .lineWidthRange                           = { 0.0, 8192.0 },
+               .pointSizeRange                           = { 0.0, 8191.875 },
+               .lineWidthRange                           = { 0.0, 8191.875 },
                .pointSizeGranularity                     = (1.0 / 8.0),
                .lineWidthGranularity                     = (1.0 / 8.0),
                .strictLines                              = false, /* FINISHME */
index e6a3bcd45a2449230cc46da4e59c8b01f3059346..4b73bc513b5148de0b3810e338e56ee83266fca8 100644 (file)
@@ -484,7 +484,7 @@ si_emit_graphics(struct radv_device *device,
        radeon_emit(cs, S_028A00_HEIGHT(tmp) | S_028A00_WIDTH(tmp));
        radeon_set_context_reg_seq(cs, R_028A04_PA_SU_POINT_MINMAX, 1);
        radeon_emit(cs, S_028A04_MIN_SIZE(radv_pack_float_12p4(0)) |
-                   S_028A04_MAX_SIZE(radv_pack_float_12p4(8192/2)));
+                   S_028A04_MAX_SIZE(radv_pack_float_12p4(8191.875/2)));
 
        if (!has_clear_state) {
                radeon_set_context_reg(cs, R_028004_DB_COUNT_CONTROL,