v3dv: prepack VCM_CACHE_SIZE

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6766>
This commit is contained in:
Alejandro Piñeiro 2020-01-09 14:34:13 +01:00 committed by Marge Bot
parent 5226928557
commit 4279145124
3 changed files with 15 additions and 4 deletions

View file

@ -1597,10 +1597,7 @@ cmd_buffer_emit_graphics_pipeline(struct v3dv_cmd_buffer *cmd_buffer)
}
}
cl_emit(&job->bcl, VCM_CACHE_SIZE, vcm) {
vcm.number_of_16_vertex_batches_for_binning = pipeline->vpm_cfg_bin.Vc;
vcm.number_of_16_vertex_batches_for_rendering = pipeline->vpm_cfg.Vc;
}
cl_emit_prepacked(&job->bcl, &pipeline->vcm_cache_size);
cl_emit(&job->bcl, GL_SHADER_STATE, state) {
state.address = v3dv_cl_address(job->indirect.bo,

View file

@ -941,6 +941,18 @@ pack_shader_state_record(struct v3dv_pipeline *pipeline)
}
}
static void
pack_vcm_cache_size(struct v3dv_pipeline *pipeline)
{
assert(sizeof(pipeline->vcm_cache_size) ==
cl_packet_length(VCM_CACHE_SIZE));
v3dv_pack(pipeline->vcm_cache_size, VCM_CACHE_SIZE, vcm) {
vcm.number_of_16_vertex_batches_for_binning = pipeline->vpm_cfg_bin.Vc;
vcm.number_of_16_vertex_batches_for_rendering = pipeline->vpm_cfg.Vc;
}
}
static VkResult
pipeline_init(struct v3dv_pipeline *pipeline,
struct v3dv_device *device,
@ -984,6 +996,7 @@ pipeline_init(struct v3dv_pipeline *pipeline,
}
pack_shader_state_record(pipeline);
pack_vcm_cache_size(pipeline);
return result;
}

View file

@ -619,6 +619,7 @@ struct v3dv_pipeline {
*/
uint8_t cfg_bits[cl_packet_length(CFG_BITS)];
uint8_t shader_state_record[cl_packet_length(GL_SHADER_STATE_RECORD)];
uint8_t vcm_cache_size[cl_packet_length(VCM_CACHE_SIZE)];
};
uint32_t v3dv_physical_device_api_version(struct v3dv_physical_device *dev);