|
Blender V4.3
|
#include <vk_data_conversion.hh>
Vertex Attributes | |
| bool | is_initialized () const |
| void | init (const GPUVertFormat *vertex_format, const VKWorkarounds &workarounds) |
| const GPUVertFormat & | device_format_get () const |
| bool | needs_conversion () const |
| void | convert (void *device_data, const void *src_data, const uint vertex_len) const |
| void | reset () |
Utility to make vertex buffers device compatible.
Some vertex formats used by vertex buffers cannot be handled by vulkan. This could be that vulkan doesn't support it, or that the device itself doesn't support it.
In this case the vertex buffer needs to be converted before it can be uploaded. The approach is to do this during upload so we reduce the read/write actions during transform/upload.
Definition at line 100 of file vk_data_conversion.hh.
| void blender::gpu::VertexFormatConverter::convert | ( | void * | device_data, |
| const void * | src_data, | ||
| const uint | vertex_len ) const |
Convert src_data to device data.
Only call this after init and when needs_conversion returns true. Will assert if this isn't the case. src_data and device_data can point to the same memory address and perform an inline conversion.
After this method completes the src_data is converted to device compatible data.
Definition at line 1196 of file vk_data_conversion.cc.
References BLI_assert, source_data, GPUVertFormat::stride, and UNUSED_VARS.
Referenced by blender::gpu::VKImmediate::end(), blender::gpu::tests::TEST(), blender::gpu::tests::TEST(), blender::gpu::tests::TEST(), and blender::gpu::tests::TEST().
| const GPUVertFormat & blender::gpu::VertexFormatConverter::device_format_get | ( | ) | const |
Get the GPUVertFormat that is compatible with the Vulkan and the active workarounds passed by the init function.
Will assert when this isn't initialized.
Definition at line 1122 of file vk_data_conversion.cc.
References BLI_assert, and is_initialized().
Referenced by blender::gpu::VKImmediate::begin(), blender::gpu::VKVertexBuffer::device_format_get(), and blender::gpu::VKVertexAttributeObject::update_bindings().
| void blender::gpu::VertexFormatConverter::init | ( | const GPUVertFormat * | vertex_format, |
| const VKWorkarounds & | workarounds ) |
Initialize the vertex format converter instance.
Can be run on both initialized and uninitialized instances. After calling this method:
Definition at line 1110 of file vk_data_conversion.cc.
Referenced by blender::gpu::VKImmediate::begin(), blender::gpu::VKVertexBuffer::device_format_ensure(), blender::gpu::tests::TEST(), blender::gpu::tests::TEST(), blender::gpu::tests::TEST(), and blender::gpu::tests::TEST().
| bool blender::gpu::VertexFormatConverter::is_initialized | ( | ) | const |
Has this instance already been initialized?
Call init to initialize the instance.
Definition at line 1105 of file vk_data_conversion.cc.
Referenced by blender::gpu::VKVertexBuffer::device_format_ensure(), device_format_get(), and needs_conversion().
| bool blender::gpu::VertexFormatConverter::needs_conversion | ( | ) | const |
Can be called after init to check if conversion is needed.
Definition at line 1128 of file vk_data_conversion.cc.
References BLI_assert, and is_initialized().
Referenced by blender::gpu::VKImmediate::end(), blender::gpu::tests::TEST(), blender::gpu::tests::TEST(), blender::gpu::tests::TEST(), and blender::gpu::tests::TEST().
| void blender::gpu::VertexFormatConverter::reset | ( | ) |
Reset this instance by clearing internal data.
After calling this is_initialized() will be false.
Definition at line 1096 of file vk_data_conversion.cc.
References GPU_vertformat_clear().
Referenced by blender::gpu::VKImmediate::end().