anv: fix some multisample lines_wide CTS tests
We can use a better algorithm from ICL and onward by setting a chicken bit, but prior to that we need to resort to disabling rectangular lines. Since we don't support strictLines anyway, this shouldn't be a major issue. Closes #2833 Fixes dEQP-VK.rasterization.interpolation_multisample_*_bit.*lines_wide Reviewed-by: Jason Ekstrand <jason@jlekstrand.net> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11672>
This commit is contained in:
@@ -6873,6 +6873,11 @@
|
|||||||
<field name="MFX Pipeline Command Flush" start="51" end="51" type="bool"/>
|
<field name="MFX Pipeline Command Flush" start="51" end="51" type="bool"/>
|
||||||
</instruction>
|
</instruction>
|
||||||
|
|
||||||
|
<register name="3D_CHICKEN3" length="1" num="0x2090">
|
||||||
|
<field name="AA Line Quality Fix" start="5" end="5" type="bool"/>
|
||||||
|
<field name="AA Line Quality Fix Mask" start="21" end="21" type="bool"/>
|
||||||
|
</register>
|
||||||
|
|
||||||
<register name="BCS_INSTDONE" length="1" num="0x2206c">
|
<register name="BCS_INSTDONE" length="1" num="0x2206c">
|
||||||
<field name="Ring Enable" start="0" end="0" type="bool"/>
|
<field name="Ring Enable" start="0" end="0" type="bool"/>
|
||||||
<field name="Blitter IDLE" start="1" end="1" type="bool" default="1"/>
|
<field name="Blitter IDLE" start="1" end="1" type="bool" default="1"/>
|
||||||
|
@@ -7061,6 +7061,11 @@
|
|||||||
<field name="MFX Pipeline Command Flush" start="51" end="51" type="bool"/>
|
<field name="MFX Pipeline Command Flush" start="51" end="51" type="bool"/>
|
||||||
</instruction>
|
</instruction>
|
||||||
|
|
||||||
|
<register name="3D_CHICKEN3" length="1" num="0x2090">
|
||||||
|
<field name="AA Line Quality Fix" start="5" end="5" type="bool"/>
|
||||||
|
<field name="AA Line Quality Fix Mask" start="21" end="21" type="bool"/>
|
||||||
|
</register>
|
||||||
|
|
||||||
<register name="BCS_INSTDONE" length="1" num="0x2206c">
|
<register name="BCS_INSTDONE" length="1" num="0x2206c">
|
||||||
<field name="Ring Enable" start="0" end="0" type="bool"/>
|
<field name="Ring Enable" start="0" end="0" type="bool"/>
|
||||||
<field name="Blitter IDLE" start="1" end="1" type="bool" default="1"/>
|
<field name="Blitter IDLE" start="1" end="1" type="bool" default="1"/>
|
||||||
|
@@ -7025,6 +7025,11 @@
|
|||||||
<field name="Per Sample Blend Opt Disable Mask" start="27" end="27" type="bool"/>
|
<field name="Per Sample Blend Opt Disable Mask" start="27" end="27" type="bool"/>
|
||||||
</register>
|
</register>
|
||||||
|
|
||||||
|
<register name="CHICKEN_RASTER_1" length="1" num="0x6204">
|
||||||
|
<field name="AA Line Quality Fix" start="5" end="5" type="bool"/>
|
||||||
|
<field name="AA Line Quality Fix Mask" start="21" end="21" type="bool"/>
|
||||||
|
</register>
|
||||||
|
|
||||||
<register name="CL_INVOCATION_COUNT" length="2" num="0x2338">
|
<register name="CL_INVOCATION_COUNT" length="2" num="0x2338">
|
||||||
<field name="CL Invocation Count Report" start="0" end="63" type="uint"/>
|
<field name="CL Invocation Count Report" start="0" end="63" type="uint"/>
|
||||||
</register>
|
</register>
|
||||||
|
@@ -2011,11 +2011,12 @@ void anv_GetPhysicalDeviceProperties(
|
|||||||
.maxCombinedClipAndCullDistances = 8,
|
.maxCombinedClipAndCullDistances = 8,
|
||||||
.discreteQueuePriorities = 2,
|
.discreteQueuePriorities = 2,
|
||||||
.pointSizeRange = { 0.125, 255.875 },
|
.pointSizeRange = { 0.125, 255.875 },
|
||||||
.lineWidthRange = {
|
/* While SKL and up support much wider lines than we are setting here,
|
||||||
0.0,
|
* in practice we run into conformance issues if we go past this limit.
|
||||||
(devinfo->ver >= 9 || devinfo->is_cherryview) ?
|
* Since the Windows driver does the same, it's probably fair to assume
|
||||||
2047.9921875 : 7.9921875,
|
* that no one needs more than this.
|
||||||
},
|
*/
|
||||||
|
.lineWidthRange = { 0.0, 8.0 },
|
||||||
.pointSizeGranularity = (1.0 / 8.0),
|
.pointSizeGranularity = (1.0 / 8.0),
|
||||||
.lineWidthGranularity = (1.0 / 128.0),
|
.lineWidthGranularity = (1.0 / 128.0),
|
||||||
.strictLines = false,
|
.strictLines = false,
|
||||||
|
@@ -130,6 +130,7 @@ void genX(cmd_emit_timestamp)(struct anv_batch *batch,
|
|||||||
void
|
void
|
||||||
genX(rasterization_mode)(VkPolygonMode raster_mode,
|
genX(rasterization_mode)(VkPolygonMode raster_mode,
|
||||||
VkLineRasterizationModeEXT line_mode,
|
VkLineRasterizationModeEXT line_mode,
|
||||||
|
float line_width,
|
||||||
uint32_t *api_mode,
|
uint32_t *api_mode,
|
||||||
bool *msaa_rasterization_enable);
|
bool *msaa_rasterization_enable);
|
||||||
|
|
||||||
|
@@ -580,6 +580,7 @@ vk_conservative_rasterization_mode(const VkPipelineRasterizationStateCreateInfo
|
|||||||
void
|
void
|
||||||
genX(rasterization_mode)(VkPolygonMode raster_mode,
|
genX(rasterization_mode)(VkPolygonMode raster_mode,
|
||||||
VkLineRasterizationModeEXT line_mode,
|
VkLineRasterizationModeEXT line_mode,
|
||||||
|
float line_width,
|
||||||
uint32_t *api_mode,
|
uint32_t *api_mode,
|
||||||
bool *msaa_rasterization_enable)
|
bool *msaa_rasterization_enable)
|
||||||
{
|
{
|
||||||
@@ -599,7 +600,16 @@ genX(rasterization_mode)(VkPolygonMode raster_mode,
|
|||||||
switch (line_mode) {
|
switch (line_mode) {
|
||||||
case VK_LINE_RASTERIZATION_MODE_RECTANGULAR_EXT:
|
case VK_LINE_RASTERIZATION_MODE_RECTANGULAR_EXT:
|
||||||
*api_mode = DX100;
|
*api_mode = DX100;
|
||||||
|
#if GFX_VER <= 9
|
||||||
|
/* Prior to ICL, the algorithm the HW uses to draw wide lines
|
||||||
|
* doesn't quite match what the CTS expects, at least for rectangular
|
||||||
|
* lines, so we set this to false here, making it draw parallelograms
|
||||||
|
* instead, which work well enough.
|
||||||
|
*/
|
||||||
|
*msaa_rasterization_enable = line_width < 1.0078125;
|
||||||
|
#else
|
||||||
*msaa_rasterization_enable = true;
|
*msaa_rasterization_enable = true;
|
||||||
|
#endif
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case VK_LINE_RASTERIZATION_MODE_RECTANGULAR_SMOOTH_EXT:
|
case VK_LINE_RASTERIZATION_MODE_RECTANGULAR_SMOOTH_EXT:
|
||||||
@@ -694,6 +704,7 @@ emit_rs_state(struct anv_graphics_pipeline *pipeline,
|
|||||||
#if GFX_VER >= 8
|
#if GFX_VER >= 8
|
||||||
if (!dynamic_primitive_topology)
|
if (!dynamic_primitive_topology)
|
||||||
genX(rasterization_mode)(raster_mode, pipeline->line_mode,
|
genX(rasterization_mode)(raster_mode, pipeline->line_mode,
|
||||||
|
rs_info->lineWidth,
|
||||||
&raster.APIMode,
|
&raster.APIMode,
|
||||||
&raster.DXMultisampleRasterizationEnable);
|
&raster.DXMultisampleRasterizationEnable);
|
||||||
|
|
||||||
|
@@ -256,6 +256,20 @@ init_render_queue_state(struct anv_queue *queue)
|
|||||||
cc1.ReplayMode = MidcmdbufferPreemption;
|
cc1.ReplayMode = MidcmdbufferPreemption;
|
||||||
cc1.ReplayModeMask = true;
|
cc1.ReplayModeMask = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if GFX_VERx10 < 125
|
||||||
|
#define AA_LINE_QUALITY_REG GENX(3D_CHICKEN3)
|
||||||
|
#else
|
||||||
|
#define AA_LINE_QUALITY_REG GENX(CHICKEN_RASTER_1)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Enable the new line drawing algorithm that produces higher quality
|
||||||
|
* lines.
|
||||||
|
*/
|
||||||
|
anv_batch_write_reg(&batch, AA_LINE_QUALITY_REG, c3) {
|
||||||
|
c3.AALineQualityFix = true;
|
||||||
|
c3.AALineQualityFixMask = true;
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if GFX_VER == 12
|
#if GFX_VER == 12
|
||||||
|
@@ -478,8 +478,8 @@ genX(cmd_buffer_flush_dynamic_state)(struct anv_cmd_buffer *cmd_buffer)
|
|||||||
primitive_topology);
|
primitive_topology);
|
||||||
|
|
||||||
genX(rasterization_mode)(
|
genX(rasterization_mode)(
|
||||||
dynamic_raster_mode, pipeline->line_mode, &api_mode,
|
dynamic_raster_mode, pipeline->line_mode, d->line_width,
|
||||||
&msaa_raster_enable);
|
&api_mode, &msaa_raster_enable);
|
||||||
|
|
||||||
aa_enable =
|
aa_enable =
|
||||||
anv_rasterization_aa_mode(dynamic_raster_mode,
|
anv_rasterization_aa_mode(dynamic_raster_mode,
|
||||||
|
Reference in New Issue
Block a user