This prevents the use of unaligned data types in vertex formats. These formats are not supported on many platform. This simplify the `GPUVertexFormat` class a lot as we do not need packing shenanigans anymore and just compute the vertex stride. The old enums are kept for progressive porting of the backends and user code. This will break compatibility with python addons. TODO: - [x] Deprecation warning for PyGPU (4.5) - [x] Deprecate matrix attributes - [x] Error handling for PyGPU (5.0) - [x] Backends - [x] Metal - [x] OpenGL - [x] Vulkan Pull Request: https://projects.blender.org/blender/blender/pulls/138846
27 lines
558 B
C++
27 lines
558 B
C++
/* SPDX-FileCopyrightText: 2016 by Mike Erwin. All rights reserved.
|
|
*
|
|
* SPDX-License-Identifier: GPL-2.0-or-later */
|
|
|
|
/** \file
|
|
* \ingroup gpu
|
|
*
|
|
* GPU vertex format
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include "GPU_vertex_buffer.hh"
|
|
|
|
struct GPUVertFormat;
|
|
|
|
void VertexFormat_pack(GPUVertFormat *format);
|
|
uint padding(uint offset, uint alignment);
|
|
uint vertex_buffer_size(const GPUVertFormat *format, uint vertex_len);
|
|
|
|
namespace blender::gpu {
|
|
|
|
bool is_fetch_normalized(VertAttrType attr_type);
|
|
bool is_fetch_float(VertAttrType attr_type);
|
|
|
|
} // namespace blender::gpu
|