Commit 9f16a163 authored by Rob Clark's avatar Rob Clark 💬
Browse files

turnip: Updates for tess_use_shared

Port of ab37109d

 freedreno/a6xx: ("Updates for tess_use_shared")
Signed-off-by: Rob Clark's avatarRob Clark <robdclark@chromium.org>
parent 071c431e
...@@ -1164,27 +1164,40 @@ tu6_emit_vpc(struct tu_cs *cs, ...@@ -1164,27 +1164,40 @@ tu6_emit_vpc(struct tu_cs *cs,
tu_cs_emit_pkt4(cs, REG_A6XX_PC_TESS_NUM_VERTEX, 1); tu_cs_emit_pkt4(cs, REG_A6XX_PC_TESS_NUM_VERTEX, 1);
tu_cs_emit(cs, hs_info->tess.tcs_vertices_out); tu_cs_emit(cs, hs_info->tess.tcs_vertices_out);
/* Total attribute slots in HS incoming patch. */ if (cs->device->physical_device->info->a6xx.tess_use_shared) {
tu_cs_emit_pkt4(cs, REG_A6XX_PC_HS_INPUT_SIZE, 1); unsigned hs_input_size = 6 + (3 * (vs->output_size - 1));
tu_cs_emit(cs, patch_control_points * vs->output_size / 4); unsigned wave_input_size =
MIN2(64, DIV_ROUND_UP(hs_input_size * 4,
hs_info->tess.tcs_vertices_out));
const uint32_t wavesize = 64; tu_cs_emit_pkt4(cs, REG_A6XX_PC_HS_INPUT_SIZE, 1);
const uint32_t max_wave_input_size = 64; tu_cs_emit(cs, hs_input_size);
/* note: if HS is really just the VS extended, then this tu_cs_emit_pkt4(cs, REG_A6XX_SP_HS_WAVE_INPUT_SIZE, 1);
* should be by MAX2(patch_control_points, hs_info->tess.tcs_vertices_out) tu_cs_emit(cs, wave_input_size);
* however that doesn't match the blob, and fails some dEQP tests. } else {
*/ /* Total attribute slots in HS incoming patch. */
uint32_t prims_per_wave = wavesize / hs_info->tess.tcs_vertices_out; tu_cs_emit_pkt4(cs, REG_A6XX_PC_HS_INPUT_SIZE, 1);
uint32_t max_prims_per_wave = tu_cs_emit(cs, patch_control_points * vs->output_size / 4);
max_wave_input_size * wavesize / (vs->output_size * patch_control_points);
prims_per_wave = MIN2(prims_per_wave, max_prims_per_wave);
uint32_t total_size = vs->output_size * patch_control_points * prims_per_wave; const uint32_t wavesize = 64;
uint32_t wave_input_size = DIV_ROUND_UP(total_size, wavesize); const uint32_t max_wave_input_size = 64;
tu_cs_emit_pkt4(cs, REG_A6XX_SP_HS_WAVE_INPUT_SIZE, 1); /* note: if HS is really just the VS extended, then this
tu_cs_emit(cs, wave_input_size); * should be by MAX2(patch_control_points, hs_info->tess.tcs_vertices_out)
* however that doesn't match the blob, and fails some dEQP tests.
*/
uint32_t prims_per_wave = wavesize / hs_info->tess.tcs_vertices_out;
uint32_t max_prims_per_wave =
max_wave_input_size * wavesize / (vs->output_size * patch_control_points);
prims_per_wave = MIN2(prims_per_wave, max_prims_per_wave);
uint32_t total_size = vs->output_size * patch_control_points * prims_per_wave;
uint32_t wave_input_size = DIV_ROUND_UP(total_size, wavesize);
tu_cs_emit_pkt4(cs, REG_A6XX_SP_HS_WAVE_INPUT_SIZE, 1);
tu_cs_emit(cs, wave_input_size);
}
/* In SPIR-V generated from GLSL, the tessellation primitive params are /* In SPIR-V generated from GLSL, the tessellation primitive params are
* are specified in the tess eval shader, but in SPIR-V generated from * are specified in the tess eval shader, but in SPIR-V generated from
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment