25 const uchar(*polys)[2] = (
const void *)polys_flat;
26 const uint polys_len = polys_flat_len / 2;
33 uint(*tris_step)[3] = tris;
35 const float range_uchar[2] = {
36 (rect ? (rect->
xmax - rect->
xmin) : 2.0f) / 255.0f,
37 (rect ? (rect->
ymax - rect->
ymin) : 2.0f) / 255.0f,
39 const float min_uchar[2] = {
40 (rect ? rect->
xmin : -1.0f),
41 (rect ? rect->
ymin : -1.0f),
46 while (i_poly != polys_len) {
47 for (
uint j = 0; j < 2; j++) {
48 verts[i_vert][j] = min_uchar[j] + ((
float)polys[i_poly][j] * range_uchar[j]);
52 if (polys[i_poly - 1][0] == polys[i_poly][0] && polys[i_poly - 1][1] == polys[i_poly][1]) {
53 const uint verts_step_len = (&
verts[i_vert]) - verts_step;
55 const uint tris_len = (verts_step_len - 2);
58 if (verts_step !=
verts) {
59 uint *
t = tris_step[0];
61 uint tot = tris_len * 3;
68 verts_step += verts_step_len;
69 tris_step += tris_len;
80 if (
format.attr_len == 0) {
84 const uint verts_len = (verts_step -
verts);
85 const uint tris_len = (tris_step - tris);
92 for (
uint i = 0; i < verts_len; i++) {
98 for (
uint i = 0; i < tris_len; i++) {
114 const uchar(*polys)[2] = (
const void *)polys_flat;
115 const uint polys_len = polys_flat_len / 2;
123 const float range_uchar[2] = {
124 (rect ? (rect->
xmax - rect->
xmin) : 2.0f) / 255.0f,
125 (rect ? (rect->
ymax - rect->
ymin) : 2.0f) / 255.0f,
127 const float min_uchar[2] = {
128 (rect ? rect->
xmin : -1.0f),
129 (rect ? rect->
ymin : -1.0f),
132 uint i_poly_prev = 0;
134 while (i_poly != polys_len) {
136 if (polys[i_poly - 1][0] == polys[i_poly][0] && polys[i_poly - 1][1] == polys[i_poly][1]) {
137 const uchar(*polys_step)[2] = polys + i_poly_prev;
138 const uint polys_step_len = i_poly - i_poly_prev;
140 for (
uint i_prev = polys_step_len - 1, i = 0; i < polys_step_len; i_prev = i++) {
145 data.as_u16[0] = *((
const uint16_t *)polys_step[i_prev]);
147 if (
data.as_u16[0] >
data.as_u16[1]) {
150 *lines_step =
data.as_u32;
154 i_poly_prev = i_poly;
159 uint lines_len = lines_step - lines;
165 for (
uint i_prev = 0, i = 1; i < lines_len; i_prev = i++) {
166 if (lines[i] != lines[i_prev]) {
167 *lines_step++ = lines[i_prev];
173 *lines_step++ = lines[lines_len - 1];
174 lines_len = lines_step - lines;
182 if (
format.attr_len == 0) {
187 const uint vbo_len_capacity = lines_len * 2;
193 for (
uint i = 0; i < lines_len; i++) {
198 data.as_u32 = lines[i];
199 for (
uint k = 0; k < 2; k++) {
201 for (
uint j = 0; j < 2; j++) {
202 pos_v2[j] = min_uchar[j] + ((
float)
data.as_u8_pair[k][j] * range_uchar[j]);
typedef float(TangentPoint)[2]
MINLINE void copy_v2_v2(float r[2], const float a[2])
void BLI_polyfill_calc(const float(*coords)[2], unsigned int coords_num, int coords_sign, unsigned int(*r_tris)[3])
int BLI_sortutil_cmp_int(const void *a_, const void *b_)
GPUBatch * GPU_batch_create_ex(GPUPrimType prim, GPUVertBuf *vert, GPUIndexBuf *elem, eGPUBatchFlag owns_flag)
struct GPUIndexBuf GPUIndexBuf
void GPU_indexbuf_init(GPUIndexBufBuilder *, GPUPrimType, uint prim_len, uint vertex_len)
GPUIndexBuf * GPU_indexbuf_build(GPUIndexBufBuilder *)
void GPU_indexbuf_add_tri_verts(GPUIndexBufBuilder *, uint v1, uint v2, uint v3)
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint GLsizei GLsizei GLenum type _GL_VOID_RET _GL_VOID GLsizei GLenum GLenum const void *pixels _GL_VOID_RET _GL_VOID const void *pointer _GL_VOID_RET _GL_VOID GLdouble v _GL_VOID_RET _GL_VOID GLfloat v _GL_VOID_RET _GL_VOID GLint GLint i2 _GL_VOID_RET _GL_VOID GLint j _GL_VOID_RET _GL_VOID GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble GLdouble GLdouble zFar _GL_VOID_RET _GL_UINT GLdouble *equation _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLenum GLfloat *v _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLfloat *values _GL_VOID_RET _GL_VOID GLushort *values _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLenum GLdouble *params _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_BOOL GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLushort pattern _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble u2 _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLdouble GLdouble v2 _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLdouble GLdouble nz _GL_VOID_RET _GL_VOID GLfloat GLfloat nz _GL_VOID_RET _GL_VOID GLint GLint nz _GL_VOID_RET _GL_VOID GLshort GLshort nz _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const GLfloat *values _GL_VOID_RET _GL_VOID GLsizei const GLushort *values _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID const GLuint const GLclampf *priorities _GL_VOID_RET _GL_VOID GLdouble y _GL_VOID_RET _GL_VOID GLfloat y _GL_VOID_RET _GL_VOID GLint y _GL_VOID_RET _GL_VOID GLshort y _GL_VOID_RET _GL_VOID GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLfloat GLfloat z _GL_VOID_RET _GL_VOID GLint GLint z _GL_VOID_RET _GL_VOID GLshort GLshort z _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble w _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat w _GL_VOID_RET _GL_VOID GLint GLint GLint w _GL_VOID_RET _GL_VOID GLshort GLshort GLshort w _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble y2 _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat y2 _GL_VOID_RET _GL_VOID GLint GLint GLint y2 _GL_VOID_RET _GL_VOID GLshort GLshort GLshort y2 _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLuint *buffer _GL_VOID_RET _GL_VOID GLdouble t _GL_VOID_RET _GL_VOID GLfloat t _GL_VOID_RET _GL_VOID GLint t _GL_VOID_RET _GL_VOID GLshort t _GL_VOID_RET _GL_VOID GLdouble t
#define GPU_vertbuf_create_with_format(format)
struct GPUVertBuf GPUVertBuf
GPU_INLINE uint GPU_vertbuf_raw_used(GPUVertBufRaw *a)
void GPU_vertbuf_data_alloc(GPUVertBuf *, uint v_len)
GPU_INLINE void * GPU_vertbuf_raw_step(GPUVertBufRaw *a)
void GPU_vertbuf_attr_get_raw_data(GPUVertBuf *, uint a_idx, GPUVertBufRaw *access)
Read Guarded memory(de)allocation.
struct @653::@656 attr_id
GPUBatch * GPU_batch_tris_from_poly_2d_encoded(const uchar *polys_flat, uint polys_flat_len, const rctf *rect)
GPUBatch * GPU_batch_wire_from_poly_2d_encoded(const uchar *polys_flat, uint polys_flat_len, const rctf *rect)
ccl_gpu_kernel_postfix ccl_global float int int int int float bool int offset
void(* MEM_freeN)(void *vmemh)
void *(* MEM_mallocN)(size_t len, const char *str)