Changeset View
Changeset View
Standalone View
Standalone View
source/blender/gpu/intern/gpu_immediate.cc
| Show First 20 Lines • Show All 159 Lines • ▼ Show 20 Lines | GPUBatch *immBeginBatch(GPUPrimType prim_type, uint vertex_len) | ||||
| imm->prim_type = prim_type; | imm->prim_type = prim_type; | ||||
| imm->vertex_len = vertex_len; | imm->vertex_len = vertex_len; | ||||
| imm->vertex_idx = 0; | imm->vertex_idx = 0; | ||||
| imm->unassigned_attr_bits = imm->enabled_attr_bits; | imm->unassigned_attr_bits = imm->enabled_attr_bits; | ||||
| GPUVertBuf *verts = GPU_vertbuf_create_with_format(&imm->vertex_format); | GPUVertBuf *verts = GPU_vertbuf_create_with_format(&imm->vertex_format); | ||||
| GPU_vertbuf_data_alloc(verts, vertex_len); | GPU_vertbuf_data_alloc(verts, vertex_len); | ||||
| imm->vertex_data = verts->data; | imm->vertex_data = (uchar *)GPU_vertbuf_get_data(verts); | ||||
| imm->batch = GPU_batch_create_ex(prim_type, verts, NULL, GPU_BATCH_OWNS_VBO); | imm->batch = GPU_batch_create_ex(prim_type, verts, NULL, GPU_BATCH_OWNS_VBO); | ||||
| imm->batch->flag |= GPU_BATCH_BUILDING; | imm->batch->flag |= GPU_BATCH_BUILDING; | ||||
| return imm->batch; | return imm->batch; | ||||
| } | } | ||||
| GPUBatch *immBeginBatchAtMost(GPUPrimType prim_type, uint vertex_len) | GPUBatch *immBeginBatchAtMost(GPUPrimType prim_type, uint vertex_len) | ||||
| ▲ Show 20 Lines • Show All 494 Lines • Show Last 20 Lines | |||||