diff options
author | Samuel Pitoiset <[email protected]> | 2017-09-06 17:21:47 +0200 |
---|---|---|
committer | Samuel Pitoiset <[email protected]> | 2017-09-08 16:04:51 +0200 |
commit | fefbcb090d2cd0048d961a355e313601ff8d68c3 (patch) | |
tree | 958a376d4306c9d2f66a43fb605891dc9dd9ed4d /src/amd/vulkan/radv_pipeline.c | |
parent | f77d06fb28fb23b8acaf6a70ff236b040f81a8a2 (diff) |
radv: add radv_vertex_elements_info data structure
In my opinion, this improves code readability.
Signed-off-by: Samuel Pitoiset <[email protected]>
Reviewed-by: Bas Nieuwenhuizen <[email protected]>
Diffstat (limited to 'src/amd/vulkan/radv_pipeline.c')
-rw-r--r-- | src/amd/vulkan/radv_pipeline.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/amd/vulkan/radv_pipeline.c b/src/amd/vulkan/radv_pipeline.c index c090b8e2f0e..b2e449bcc51 100644 --- a/src/amd/vulkan/radv_pipeline.c +++ b/src/amd/vulkan/radv_pipeline.c @@ -2408,6 +2408,8 @@ radv_pipeline_init(struct radv_pipeline *pipeline, const VkPipelineVertexInputStateCreateInfo *vi_info = pCreateInfo->pVertexInputState; + struct radv_vertex_elements_info *velems = &pipeline->vertex_elements; + for (uint32_t i = 0; i < vi_info->vertexAttributeDescriptionCount; i++) { const VkVertexInputAttributeDescription *desc = &vi_info->pVertexAttributeDescriptions[i]; @@ -2421,16 +2423,16 @@ radv_pipeline_init(struct radv_pipeline *pipeline, num_format = radv_translate_buffer_numformat(format_desc, first_non_void); data_format = radv_translate_buffer_dataformat(format_desc, first_non_void); - pipeline->va_rsrc_word3[loc] = S_008F0C_DST_SEL_X(si_map_swizzle(format_desc->swizzle[0])) | + velems->rsrc_word3[loc] = S_008F0C_DST_SEL_X(si_map_swizzle(format_desc->swizzle[0])) | S_008F0C_DST_SEL_Y(si_map_swizzle(format_desc->swizzle[1])) | S_008F0C_DST_SEL_Z(si_map_swizzle(format_desc->swizzle[2])) | S_008F0C_DST_SEL_W(si_map_swizzle(format_desc->swizzle[3])) | S_008F0C_NUM_FORMAT(num_format) | S_008F0C_DATA_FORMAT(data_format); - pipeline->va_format_size[loc] = format_desc->block.bits / 8; - pipeline->va_offset[loc] = desc->offset; - pipeline->va_binding[loc] = desc->binding; - pipeline->num_vertex_attribs = MAX2(pipeline->num_vertex_attribs, loc + 1); + velems->format_size[loc] = format_desc->block.bits / 8; + velems->offset[loc] = desc->offset; + velems->binding[loc] = desc->binding; + velems->count = MAX2(velems->count, loc + 1); } for (uint32_t i = 0; i < vi_info->vertexBindingDescriptionCount; i++) { |