MCPcopy Create free account
hub / github.com/KhronosGroup/Vulkan-ValidationLayers / RecordDrawVertex

Method RecordDrawVertex

layers/sync/sync_command_buffer.cpp:856–883  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

854}
855
856void 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
885bool CommandBufferAccessContext::ValidateDrawVertexIndex(uint32_t index_count, uint32_t firstIndex, const Location& loc) const {
886 bool skip = false;

Callers 1

PostCallRecordCmdDrawMethod · 0.80

Calls 7

MakeRangeForVertexDataFunction · 0.85
UpdateAccessStateMethod · 0.80
FindFunction · 0.50
IsDynamicMethod · 0.45
BufferMethod · 0.45
BufferOffsetMethod · 0.45
HandleMethod · 0.45

Tested by

no test coverage detected