From: Jonathan Marek Date: Sun, 23 Feb 2020 22:29:37 +0000 (-0500) Subject: turnip: enable sampleRateShading feature X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=708c3a5ffd1a69dc14dbc0e022a4c3848f9138fd;p=mesa.git turnip: enable sampleRateShading feature There's still a TODO related to key->sample_shading, but it doesn't look like it changes anything in ir3, so it works without that. Signed-off-by: Jonathan Marek Part-of: --- diff --git a/src/freedreno/vulkan/tu_cmd_buffer.c b/src/freedreno/vulkan/tu_cmd_buffer.c index 2cf59d1e4cc..9bda41d4d06 100644 --- a/src/freedreno/vulkan/tu_cmd_buffer.c +++ b/src/freedreno/vulkan/tu_cmd_buffer.c @@ -1060,14 +1060,11 @@ tu6_init_hw(struct tu_cmd_buffer *cmd, struct tu_cs *cs) tu_cs_emit_write_reg(cs, REG_A6XX_RB_SRGB_CNTL, 0); - tu_cs_emit_write_reg(cs, REG_A6XX_GRAS_UNKNOWN_8101, 0); - tu_cs_emit_write_reg(cs, REG_A6XX_GRAS_SAMPLE_CNTL, 0); tu_cs_emit_write_reg(cs, REG_A6XX_GRAS_UNKNOWN_8110, 0); tu_cs_emit_write_reg(cs, REG_A6XX_RB_RENDER_CONTROL0, 0x401); tu_cs_emit_write_reg(cs, REG_A6XX_RB_RENDER_CONTROL1, 0); tu_cs_emit_write_reg(cs, REG_A6XX_RB_FS_OUTPUT_CNTL0, 0); - tu_cs_emit_write_reg(cs, REG_A6XX_RB_SAMPLE_CNTL, 0); tu_cs_emit_write_reg(cs, REG_A6XX_RB_UNKNOWN_8818, 0); tu_cs_emit_write_reg(cs, REG_A6XX_RB_UNKNOWN_8819, 0); tu_cs_emit_write_reg(cs, REG_A6XX_RB_UNKNOWN_881A, 0); diff --git a/src/freedreno/vulkan/tu_device.c b/src/freedreno/vulkan/tu_device.c index 9a8288934ca..82c1cb686be 100644 --- a/src/freedreno/vulkan/tu_device.c +++ b/src/freedreno/vulkan/tu_device.c @@ -582,7 +582,7 @@ tu_GetPhysicalDeviceFeatures(VkPhysicalDevice physicalDevice, .independentBlend = false, .geometryShader = false, .tessellationShader = false, - .sampleRateShading = false, + .sampleRateShading = true, .dualSrcBlend = false, .logicOp = false, .multiDrawIndirect = false, diff --git a/src/freedreno/vulkan/tu_pipeline.c b/src/freedreno/vulkan/tu_pipeline.c index 75ce56dc673..ba13e7b4008 100644 --- a/src/freedreno/vulkan/tu_pipeline.c +++ b/src/freedreno/vulkan/tu_pipeline.c @@ -851,6 +851,15 @@ tu6_emit_fs_inputs(struct tu_cs *cs, const struct ir3_shader_variant *fs) CONDREG(samp_id_regid, A6XX_RB_RENDER_CONTROL1_SAMPLEID) | CONDREG(ij_size_regid, A6XX_RB_RENDER_CONTROL1_SIZE) | COND(fs->frag_face, A6XX_RB_RENDER_CONTROL1_FACENESS)); + + tu_cs_emit_pkt4(cs, REG_A6XX_RB_SAMPLE_CNTL, 1); + tu_cs_emit(cs, COND(sample_shading, A6XX_RB_SAMPLE_CNTL_PER_SAMP_MODE)); + + tu_cs_emit_pkt4(cs, REG_A6XX_GRAS_UNKNOWN_8101, 1); + tu_cs_emit(cs, COND(sample_shading, 0x6)); // XXX + + tu_cs_emit_pkt4(cs, REG_A6XX_GRAS_SAMPLE_CNTL, 1); + tu_cs_emit(cs, COND(sample_shading, A6XX_GRAS_SAMPLE_CNTL_PER_SAMP_MODE)); } static void @@ -1478,7 +1487,6 @@ tu6_emit_blend_control(struct tu_cs *cs, uint32_t blend_enable_mask, const VkPipelineMultisampleStateCreateInfo *msaa_info) { - assert(!msaa_info->sampleShadingEnable); assert(!msaa_info->alphaToOneEnable); uint32_t sp_blend_cntl = A6XX_SP_BLEND_CNTL_UNK8;