| 854 | } |
| 855 | |
| 856 | void CommandBufferAccessContext::RecordDrawVertex(uint32_t vertexCount, uint32_t firstVertex, const ResourceUsageTag tag) { |
| 857 | const auto* pipe = cb_state_->GetLastBoundGraphics().pipeline_state; |
| 858 | if (!pipe) { |
| 859 | return; |
| 860 | } |
| 861 | const auto& binding_buffers = cb_state_->current_vertex_buffer_binding_info; |
| 862 | const auto& vertex_bindings = pipe->IsDynamic(CB_DYNAMIC_STATE_VERTEX_INPUT_EXT) |
| 863 | ? cb_state_->dynamic_state_value.vertex_bindings |
| 864 | : pipe->vertex_input_state->bindings; |
| 865 | |
| 866 | for (const auto& [_, binding_state] : vertex_bindings) { |
| 867 | const auto& binding_desc = binding_state.desc; |
| 868 | if (binding_desc.inputRate != VK_VERTEX_INPUT_RATE_VERTEX) { |
| 869 | // TODO: add support to determine range of instance level attributes |
| 870 | continue; |
| 871 | } |
| 872 | if (const auto* vertex_buffer = vvl::Find(binding_buffers, binding_desc.binding)) { |
| 873 | // TODO - Handle https://gitlab.khronos.org/vulkan/Vulkan-ValidationLayers/-/issues/45 |
| 874 | const auto buf_state = sync_state_.Get<vvl::Buffer>(vertex_buffer->Buffer()); |
| 875 | if (!buf_state) continue; // also skips if using nullDescriptor |
| 876 | |
| 877 | const AccessRange range = |
| 878 | MakeRangeForVertexData(vertex_buffer->BufferOffset(), firstVertex, vertexCount, binding_state); |
| 879 | const ResourceUsageTagEx tag_ex = AddCommandHandle(tag, buf_state->Handle()); |
| 880 | current_context_->UpdateAccessState(*buf_state, SYNC_VERTEX_ATTRIBUTE_INPUT_VERTEX_ATTRIBUTE_READ, range, tag_ex); |
| 881 | } |
| 882 | } |
| 883 | } |
| 884 | |
| 885 | bool CommandBufferAccessContext::ValidateDrawVertexIndex(uint32_t index_count, uint32_t firstIndex, const Location& loc) const { |
| 886 | bool skip = false; |
no test coverage detected