41 return &
imm->vertex_format;
49 imm->builtin_shader_bound = std::nullopt;
51 if (!
imm->vertex_format.packed) {
53 imm->enabled_attr_bits = 0xFFFFu & ~(0xFFFFu <<
imm->vertex_format.attr_len);
65 imm->builtin_shader_bound = shader_id;
73 imm->shader =
nullptr;
85 if (vertex_len == 0) {
93 return vertex_len % 2 == 0;
96 return vertex_len >= 2;
98 return vertex_len >= 4;
100 return vertex_len % 3 == 0;
103 return vertex_len >= 3;
125 if (line_width == 1.0f) {
129 if (!
imm->builtin_shader_bound) {
134 switch (*
imm->builtin_shader_bound) {
152 imm->prev_builtin_shader =
imm->builtin_shader_bound;
171 if (
ELEM(polyline_sh,
181 if (
imm->prev_builtin_shader) {
189 imm->prev_builtin_shader = std::nullopt;
202 imm->prim_type = prim_type;
203 imm->vertex_len = vertex_len;
205 imm->unassigned_attr_bits =
imm->enabled_attr_bits;
207 imm->vertex_data =
imm->begin();
213 imm->strict_vertex_len =
false;
222 imm->prim_type = prim_type;
223 imm->vertex_len = vertex_len;
225 imm->unassigned_attr_bits =
imm->enabled_attr_bits;
241 imm->strict_vertex_len =
false;
250 if (
imm->strict_vertex_len) {
260 if (
imm->vertex_idx <
imm->vertex_len) {
266 imm->batch =
nullptr;
274 imm->strict_vertex_len =
true;
275 imm->vertex_data =
nullptr;
483 if (
imm->unassigned_attr_bits) {
485 for (
uint a_idx = 0; a_idx <
imm->vertex_format.attr_len; a_idx++) {
486 if ((
imm->unassigned_attr_bits >> a_idx) & 1) {
490 printf(
"copying %s from vertex %u to %u\n", a->name,
imm->vertex_idx - 1,
imm->vertex_idx);
501 imm->vertex_data +=
imm->vertex_format.stride;
502 imm->unassigned_attr_bits =
imm->enabled_attr_bits;
629 float data[4] = {r, g,
b, a};
657 const float scale = 1.0f / 255.0f;
663 const float scale = 1.0f / 255.0f;
682#ifndef GPU_STANDALONE
MINLINE void copy_v4_v4(float r[4], const float a[4])
blender::gpu::Batch * GPU_batch_create_ex(GPUPrimType primitive_type, blender::gpu::VertBuf *vertex_buf, blender::gpu::IndexBuf *index_buf, eGPUBatchFlag owns_flag)
void GPU_batch_set_shader(blender::gpu::Batch *batch, GPUShader *shader)
void GPU_matrix_bind(GPUShader *shader)
@ GPU_PRIM_LINE_STRIP_ADJ
int GPU_shader_get_sampler_binding(GPUShader *shader, const char *name)
void GPU_shader_uniform_2fv(GPUShader *sh, const char *name, const float data[2])
void GPU_shader_uniform_1i(GPUShader *sh, const char *name, int value)
int GPU_shader_get_ubo_binding(GPUShader *shader, const char *name)
void GPU_shader_uniform_3f(GPUShader *sh, const char *name, float x, float y, float z)
void GPU_shader_uniform_2f(GPUShader *sh, const char *name, float x, float y)
void GPU_shader_uniform_1f(GPUShader *sh, const char *name, float value)
void GPU_shader_uniform_3fv(GPUShader *sh, const char *name, const float data[3])
void GPU_shader_uniform_4fv_array(GPUShader *sh, const char *name, int len, const float(*val)[4])
void GPU_shader_uniform_float_ex(GPUShader *shader, int location, int length, int array_size, const float *value)
void GPU_shader_bind(GPUShader *shader)
void GPU_shader_uniform_4fv(GPUShader *sh, const char *name, const float data[4])
void GPU_shader_uniform_4f(GPUShader *sh, const char *name, float x, float y, float z, float w)
void GPU_shader_uniform_mat4(GPUShader *sh, const char *name, const float data[4][4])
int GPU_shader_get_builtin_uniform(GPUShader *shader, int builtin)
GPUShader * GPU_shader_get_builtin_shader(eGPUBuiltinShader shader)
@ GPU_SHADER_3D_SMOOTH_COLOR
@ GPU_SHADER_3D_POLYLINE_SMOOTH_COLOR
@ GPU_SHADER_3D_POLYLINE_UNIFORM_COLOR
@ GPU_SHADER_3D_CLIPPED_UNIFORM_COLOR
@ GPU_SHADER_3D_UNIFORM_COLOR
@ GPU_SHADER_3D_FLAT_COLOR
@ GPU_SHADER_3D_POLYLINE_FLAT_COLOR
@ GPU_SHADER_3D_POLYLINE_CLIPPED_UNIFORM_COLOR
eGPUBlend GPU_blend_get()
float GPU_line_width_get()
void GPU_viewport_size_get_f(float coords[4])
void GPU_texture_bind(GPUTexture *texture, int unit)
void GPU_texture_bind_ex(GPUTexture *texture, GPUSamplerState state, int unit)
#define GPU_vertbuf_create_with_format(format)
void GPU_vertbuf_data_resize(blender::gpu::VertBuf &verts, uint v_len)
void GPU_vertbuf_data_alloc(blender::gpu::VertBuf &verts, uint v_len)
Group Output data from inside of a node group A color picker Mix two input colors RGB to Convert a color s luminance to a grayscale value Generate a normal vector and a dot product Brightness Control the brightness and contrast of the input color Vector Map input vector components with curves Camera Retrieve information about the camera and how it relates to the current shading point s position Clamp a value between a minimum and a maximum Vector Perform vector math operation Invert Invert a color
void UI_GetThemeColorShadeAlpha4ubv(int colorid, int coloffset, int alphaoffset, unsigned char col[4])
void UI_GetThemeColor3fv(int colorid, float col[3])
void UI_GetThemeColorBlend3ubv(int colorid1, int colorid2, float fac, unsigned char col[3])
void UI_GetThemeColorBlendShade4fv(int colorid1, int colorid2, float fac, int offset, float col[4])
void UI_GetThemeColorShadeAlpha4fv(int colorid, int coloffset, int alphaoffset, float col[4])
void UI_GetThemeColor4fv(int colorid, float col[4])
void UI_GetThemeColorShade4fv(int colorid, int offset, float col[4])
struct GPUShader GPUShader
SIMD_FORCE_INLINE const btScalar & z() const
Return the z value.
SIMD_FORCE_INLINE const btScalar & w() const
Return the w value.
static void set_srgb_uniform(GPUShader *shader)
local_group_size(16, 16) .push_constant(Type b
struct @157336070235062372277311340362362342103123126032::@132215023242101136103363133227133264017254024241 attr_id
ccl_device_inline float4 mask(const int4 mask, const float4 a)