Cleanup: use 'uint' in draw manager
This commit is contained in:
parent
df10a2e030
commit
33f3298e28
|
@ -135,5 +135,5 @@ void DRW_opengl_context_disable(void);
|
|||
|
||||
void DRW_deferred_shader_remove(struct GPUMaterial *mat);
|
||||
|
||||
unsigned int *WORKBENCH_generate_studiolight_preview(int studiolight_id, int icon_size);
|
||||
uint *WORKBENCH_generate_studiolight_preview(int studiolight_id, int icon_size);
|
||||
#endif /* __DRW_ENGINE_H__ */
|
||||
|
|
|
@ -314,7 +314,7 @@ void EEVEE_effects_cache_init(EEVEE_ViewLayerData *sldata, EEVEE_Data *vedata)
|
|||
|
||||
{
|
||||
static int zero = 0;
|
||||
static unsigned int six = 6;
|
||||
static uint six = 6;
|
||||
psl->color_downsample_cube_ps = DRW_pass_create("Downsample Cube", DRW_STATE_WRITE_COLOR);
|
||||
DRWShadingGroup *grp = DRW_shgroup_create(e_data.downsample_cube_sh, psl->color_downsample_cube_ps);
|
||||
DRW_shgroup_uniform_texture_ref(grp, "source", &e_data.color_src);
|
||||
|
|
|
@ -199,8 +199,8 @@ static void eevee_draw_background(void *vedata)
|
|||
while (loop_ct--) {
|
||||
float clear_col[4] = {0.0f, 0.0f, 0.0f, 0.0f};
|
||||
float clear_depth = 1.0f;
|
||||
unsigned int clear_stencil = 0xFF;
|
||||
unsigned int primes[3] = {2, 3, 7};
|
||||
uint clear_stencil = 0xFF;
|
||||
uint primes[3] = {2, 3, 7};
|
||||
double offset[3] = {0.0, 0.0, 0.0};
|
||||
double r[3];
|
||||
|
||||
|
|
|
@ -571,7 +571,7 @@ void EEVEE_lightprobes_cache_init(EEVEE_ViewLayerData *sldata, EEVEE_Data *vedat
|
|||
DRWShadingGroup *grp = DRW_shgroup_create(e_data.probe_planar_downsample_sh, psl->probe_planar_downsample_ps);
|
||||
DRW_shgroup_uniform_texture_ref(grp, "source", &txl->planar_pool);
|
||||
DRW_shgroup_uniform_float(grp, "fireflyFactor", &sldata->common_data.ssr_firefly_fac, 1);
|
||||
DRW_shgroup_call_instances_add(grp, DRW_cache_fullscreen_quad_get(), NULL, (unsigned int *)&pinfo->num_planar);
|
||||
DRW_shgroup_call_instances_add(grp, DRW_cache_fullscreen_quad_get(), NULL, (uint *)&pinfo->num_planar);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -930,7 +930,7 @@ static void EEVEE_lightprobes_updates(EEVEE_ViewLayerData *sldata, EEVEE_PassLis
|
|||
DRW_shgroup_uniform_vec3(grp, "increment_z", egrid->increment_z, 1);
|
||||
DRW_shgroup_uniform_texture_ref(grp, "irradianceGrid", &sldata->irradiance_pool);
|
||||
DRW_shgroup_uniform_float(grp, "sphere_size", &probe->data_draw_size, 1);
|
||||
DRW_shgroup_call_instances_add(grp, DRW_cache_sphere_get(), NULL, (unsigned int *)&ped->num_cell);
|
||||
DRW_shgroup_call_instances_add(grp, DRW_cache_sphere_get(), NULL, (uint *)&ped->num_cell);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -53,7 +53,7 @@ extern char datatoc_concentric_samples_lib_glsl[];
|
|||
static void eevee_light_setup(Object *ob, EEVEE_Light *evli);
|
||||
|
||||
/* *********** LIGHT BITS *********** */
|
||||
static void lightbits_set_single(EEVEE_LightBits *bitf, unsigned int idx, bool val)
|
||||
static void lightbits_set_single(EEVEE_LightBits *bitf, uint idx, bool val)
|
||||
{
|
||||
if (val) {
|
||||
bitf->fields[idx / 8] |= (1 << (idx % 8));
|
||||
|
@ -75,12 +75,12 @@ static void lightbits_or(EEVEE_LightBits *r, const EEVEE_LightBits *v)
|
|||
}
|
||||
}
|
||||
|
||||
static bool lightbits_get(const EEVEE_LightBits *r, unsigned int idx)
|
||||
static bool lightbits_get(const EEVEE_LightBits *r, uint idx)
|
||||
{
|
||||
return r->fields[idx / 8] & (1 << (idx % 8));
|
||||
}
|
||||
|
||||
static void lightbits_convert(EEVEE_LightBits *r, const EEVEE_LightBits *bitf, const int *light_bit_conv_table, unsigned int table_length)
|
||||
static void lightbits_convert(EEVEE_LightBits *r, const EEVEE_LightBits *bitf, const int *light_bit_conv_table, uint table_length)
|
||||
{
|
||||
for (int i = 0; i < table_length; ++i) {
|
||||
if (lightbits_get(bitf, i) != 0) {
|
||||
|
@ -95,7 +95,7 @@ static void lightbits_convert(EEVEE_LightBits *r, const EEVEE_LightBits *bitf, c
|
|||
|
||||
void EEVEE_lights_init(EEVEE_ViewLayerData *sldata)
|
||||
{
|
||||
const unsigned int shadow_ubo_size = sizeof(EEVEE_Shadow) * MAX_SHADOW +
|
||||
const uint shadow_ubo_size = sizeof(EEVEE_Shadow) * MAX_SHADOW +
|
||||
sizeof(EEVEE_ShadowCube) * MAX_SHADOW_CUBE +
|
||||
sizeof(EEVEE_ShadowCascade) * MAX_SHADOW_CASCADE;
|
||||
|
||||
|
|
|
@ -61,7 +61,7 @@ static struct {
|
|||
struct GPUTexture *util_tex;
|
||||
struct GPUTexture *noise_tex;
|
||||
|
||||
unsigned int sss_count;
|
||||
uint sss_count;
|
||||
|
||||
float alpha_hash_offset;
|
||||
float noise_offsets[3];
|
||||
|
|
|
@ -337,8 +337,8 @@ typedef struct EEVEE_ShadowCaster {
|
|||
typedef struct EEVEE_ShadowCasterBuffer {
|
||||
struct EEVEE_ShadowCaster *shadow_casters;
|
||||
char *flags;
|
||||
unsigned int alloc_count;
|
||||
unsigned int count;
|
||||
uint alloc_count;
|
||||
uint count;
|
||||
} EEVEE_ShadowCasterBuffer;
|
||||
|
||||
/* ************ LIGHT DATA ************* */
|
||||
|
@ -354,7 +354,7 @@ typedef struct EEVEE_LampsInfo {
|
|||
int shadow_cube_store_size;
|
||||
int current_shadow_cascade;
|
||||
int current_shadow_face;
|
||||
unsigned int shadow_instance_count;
|
||||
uint shadow_instance_count;
|
||||
float filter_size;
|
||||
/* List of lights in the scene. */
|
||||
/* XXX This is fragile, can get out of sync quickly. */
|
||||
|
@ -752,7 +752,7 @@ typedef struct EEVEE_ObjectEngineData {
|
|||
bool ob_vis, ob_vis_dirty;
|
||||
|
||||
bool need_update;
|
||||
unsigned int shadow_caster_id;
|
||||
uint shadow_caster_id;
|
||||
} EEVEE_ObjectEngineData;
|
||||
|
||||
/* *********************************** */
|
||||
|
@ -882,7 +882,7 @@ int EEVEE_subsurface_init(EEVEE_ViewLayerData *sldata, EEVEE_Data *vedata);
|
|||
void EEVEE_subsurface_cache_init(EEVEE_ViewLayerData *sldata, EEVEE_Data *vedata);
|
||||
void EEVEE_subsurface_output_init(EEVEE_ViewLayerData *sldata, EEVEE_Data *vedata);
|
||||
void EEVEE_subsurface_add_pass(
|
||||
EEVEE_ViewLayerData *sldata, EEVEE_Data *vedata, unsigned int sss_id, struct GPUUniformBuffer *sss_profile);
|
||||
EEVEE_ViewLayerData *sldata, EEVEE_Data *vedata, uint sss_id, struct GPUUniformBuffer *sss_profile);
|
||||
void EEVEE_subsurface_data_render(EEVEE_ViewLayerData *sldata, EEVEE_Data *vedata);
|
||||
void EEVEE_subsurface_compute(EEVEE_ViewLayerData *sldata, EEVEE_Data *vedata);
|
||||
void EEVEE_subsurface_output_accumulate(EEVEE_ViewLayerData *sldata, EEVEE_Data *vedata);
|
||||
|
@ -909,7 +909,7 @@ void EEVEE_temporal_sampling_free(void);
|
|||
|
||||
/* eevee_volumes.c */
|
||||
int EEVEE_volumes_init(EEVEE_ViewLayerData *sldata, EEVEE_Data *vedata);
|
||||
void EEVEE_volumes_set_jitter(EEVEE_ViewLayerData *sldata, unsigned int current_sample);
|
||||
void EEVEE_volumes_set_jitter(EEVEE_ViewLayerData *sldata, uint current_sample);
|
||||
void EEVEE_volumes_cache_init(EEVEE_ViewLayerData *sldata, EEVEE_Data *vedata);
|
||||
void EEVEE_volumes_cache_object_add(EEVEE_ViewLayerData *sldata, EEVEE_Data *vedata, struct Scene *scene, Object *ob);
|
||||
void EEVEE_volumes_compute(EEVEE_ViewLayerData *sldata, EEVEE_Data *vedata);
|
||||
|
|
|
@ -436,8 +436,8 @@ void EEVEE_render_draw(EEVEE_Data *vedata, RenderEngine *engine, RenderLayer *rl
|
|||
}
|
||||
|
||||
IDProperty *props = BKE_view_layer_engine_evaluated_get(view_layer, RE_engine_id_BLENDER_EEVEE);
|
||||
unsigned int tot_sample = BKE_collection_engine_property_value_get_int(props, "taa_render_samples");
|
||||
unsigned int render_samples = 0;
|
||||
uint tot_sample = BKE_collection_engine_property_value_get_int(props, "taa_render_samples");
|
||||
uint render_samples = 0;
|
||||
|
||||
if (RE_engine_test_break(engine)) {
|
||||
return;
|
||||
|
@ -446,8 +446,8 @@ void EEVEE_render_draw(EEVEE_Data *vedata, RenderEngine *engine, RenderLayer *rl
|
|||
while (render_samples < tot_sample && !RE_engine_test_break(engine)) {
|
||||
float clear_col[4] = {0.0f, 0.0f, 0.0f, 0.0f};
|
||||
float clear_depth = 1.0f;
|
||||
unsigned int clear_stencil = 0xFF;
|
||||
unsigned int primes[3] = {2, 3, 7};
|
||||
uint clear_stencil = 0xFF;
|
||||
uint primes[3] = {2, 3, 7};
|
||||
double offset[3] = {0.0, 0.0, 0.0};
|
||||
double r[3];
|
||||
|
||||
|
|
|
@ -198,7 +198,7 @@ void EEVEE_subsurface_cache_init(EEVEE_ViewLayerData *UNUSED(sldata), EEVEE_Data
|
|||
}
|
||||
|
||||
void EEVEE_subsurface_add_pass(
|
||||
EEVEE_ViewLayerData *sldata, EEVEE_Data *vedata, unsigned int sss_id, struct GPUUniformBuffer *sss_profile)
|
||||
EEVEE_ViewLayerData *sldata, EEVEE_Data *vedata, uint sss_id, struct GPUUniformBuffer *sss_profile)
|
||||
{
|
||||
DefaultTextureList *dtxl = DRW_viewport_texture_list_get();
|
||||
EEVEE_PassList *psl = vedata->psl;
|
||||
|
|
|
@ -248,7 +248,7 @@ int EEVEE_temporal_sampling_init(EEVEE_ViewLayerData *UNUSED(sldata), EEVEE_Data
|
|||
|
||||
double ht_point[2];
|
||||
double ht_offset[2] = {0.0, 0.0};
|
||||
unsigned int ht_primes[2] = {2, 3};
|
||||
uint ht_primes[2] = {2, 3};
|
||||
|
||||
BLI_halton_2D(ht_primes, ht_offset, effects->taa_current_sample - 1, ht_point);
|
||||
|
||||
|
|
|
@ -131,13 +131,13 @@ static void eevee_create_shader_volumes(void)
|
|||
e_data.volumetric_common_lib, NULL);
|
||||
}
|
||||
|
||||
void EEVEE_volumes_set_jitter(EEVEE_ViewLayerData *sldata, unsigned int current_sample)
|
||||
void EEVEE_volumes_set_jitter(EEVEE_ViewLayerData *sldata, uint current_sample)
|
||||
{
|
||||
EEVEE_CommonUniformBuffer *common_data = &sldata->common_data;
|
||||
|
||||
double ht_point[3];
|
||||
double ht_offset[3] = {0.0, 0.0};
|
||||
unsigned int ht_primes[3] = {3, 7, 2};
|
||||
uint ht_primes[3] = {3, 7, 2};
|
||||
|
||||
BLI_halton_3D(ht_primes, ht_offset, current_sample, ht_point);
|
||||
|
||||
|
@ -241,8 +241,8 @@ int EEVEE_volumes_init(EEVEE_ViewLayerData *sldata, EEVEE_Data *vedata)
|
|||
}
|
||||
|
||||
/* Temporal Super sampling jitter */
|
||||
unsigned int ht_primes[3] = {3, 7, 2};
|
||||
unsigned int current_sample = 0;
|
||||
uint ht_primes[3] = {3, 7, 2};
|
||||
uint current_sample = 0;
|
||||
|
||||
/* If TAA is in use do not use the history buffer. */
|
||||
bool do_taa = ((effects->enabled_effects & EFFECT_TAA) != 0);
|
||||
|
@ -258,7 +258,7 @@ int EEVEE_volumes_init(EEVEE_ViewLayerData *sldata, EEVEE_Data *vedata)
|
|||
effects->volume_current_sample = -1;
|
||||
}
|
||||
else {
|
||||
const unsigned int max_sample = (ht_primes[0] * ht_primes[1] * ht_primes[2]);
|
||||
const uint max_sample = (ht_primes[0] * ht_primes[1] * ht_primes[2]);
|
||||
current_sample = effects->volume_current_sample = (effects->volume_current_sample + 1) % max_sample;
|
||||
if (current_sample != max_sample - 1) {
|
||||
DRW_viewport_request_redraw();
|
||||
|
|
|
@ -423,7 +423,7 @@ static WORKBENCH_MaterialData *get_or_create_material_data(WORKBENCH_Data *vedat
|
|||
material_template.object_id = engine_object_data->object_id;
|
||||
material_template.drawtype = drawtype;
|
||||
material_template.ima = ima;
|
||||
unsigned int hash = get_material_hash(&material_template);
|
||||
uint hash = get_material_hash(&material_template);
|
||||
|
||||
material = BLI_ghash_lookup(wpd->material_hash, SET_UINT_IN_POINTER(hash));
|
||||
if (material == NULL) {
|
||||
|
@ -575,7 +575,7 @@ void workbench_materials_draw_background(WORKBENCH_Data *vedata)
|
|||
WORKBENCH_PrivateData *wpd = stl->g_data;
|
||||
const float clear_depth = 1.0f;
|
||||
const float clear_color[4] = {0.0f, 0.0f, 0.0f, 0.0f};
|
||||
unsigned int clear_stencil = 0xFF;
|
||||
uint clear_stencil = 0xFF;
|
||||
|
||||
GPU_framebuffer_bind(fbl->prepass_fb);
|
||||
int clear_bits = GPU_DEPTH_BIT | GPU_COLOR_BIT;
|
||||
|
|
|
@ -90,7 +90,7 @@ void studiolight_update_world(int studio_light, WORKBENCH_UBO_World *wd)
|
|||
|
||||
uint *WORKBENCH_generate_studiolight_preview(int studiolight_id, int icon_size)
|
||||
{
|
||||
unsigned int *rect = MEM_mallocN(icon_size * icon_size * sizeof(unsigned int), __func__);
|
||||
uint *rect = MEM_mallocN(icon_size * icon_size * sizeof(uint), __func__);
|
||||
int icon_center = icon_size / 2;
|
||||
float sphere_radius = icon_center * 0.9;
|
||||
|
||||
|
@ -109,11 +109,11 @@ uint *WORKBENCH_generate_studiolight_preview(int studiolight_id, int icon_size)
|
|||
}
|
||||
}
|
||||
}
|
||||
unsigned int pixelresult = 0x0;
|
||||
unsigned int alias_i = clamp_i(alias * 256, 0, 255);
|
||||
uint pixelresult = 0x0;
|
||||
uint alias_i = clamp_i(alias * 256, 0, 255);
|
||||
if (alias_i != 0) {
|
||||
/* calculate normal */
|
||||
unsigned int alias_mask = alias_i << 24;
|
||||
uint alias_mask = alias_i << 24;
|
||||
float normal[3];
|
||||
normal[0] = dx / sphere_radius;
|
||||
normal[1] = dy / sphere_radius;
|
||||
|
|
|
@ -332,23 +332,23 @@ void DRW_shgroup_call_object_add_with_callback(
|
|||
DRWCallVisibilityFn *callback, void *user_data);
|
||||
/* Used for drawing a batch with instancing without instance attribs. */
|
||||
void DRW_shgroup_call_instances_add(
|
||||
DRWShadingGroup *shgroup, struct Gwn_Batch *geom, float (*obmat)[4], unsigned int *count);
|
||||
DRWShadingGroup *shgroup, struct Gwn_Batch *geom, float (*obmat)[4], uint *count);
|
||||
void DRW_shgroup_call_object_instances_add(
|
||||
DRWShadingGroup *shgroup, struct Gwn_Batch *geom, struct Object *ob, unsigned int *count);
|
||||
DRWShadingGroup *shgroup, struct Gwn_Batch *geom, struct Object *ob, uint *count);
|
||||
void DRW_shgroup_call_sculpt_add(DRWShadingGroup *shgroup, struct Object *ob, float (*obmat)[4]);
|
||||
void DRW_shgroup_call_generate_add(
|
||||
DRWShadingGroup *shgroup, DRWCallGenerateFn *geometry_fn, void *user_data, float (*obmat)[4]);
|
||||
void DRW_shgroup_call_dynamic_add_array(DRWShadingGroup *shgroup, const void *attr[], unsigned int attr_len);
|
||||
void DRW_shgroup_call_dynamic_add_array(DRWShadingGroup *shgroup, const void *attr[], uint attr_len);
|
||||
#define DRW_shgroup_call_dynamic_add(shgroup, ...) do { \
|
||||
const void *array[] = {__VA_ARGS__}; \
|
||||
DRW_shgroup_call_dynamic_add_array(shgroup, array, (sizeof(array) / sizeof(*array))); \
|
||||
} while (0)
|
||||
|
||||
unsigned int DRW_shgroup_get_instance_count(const DRWShadingGroup *shgroup);
|
||||
uint DRW_shgroup_get_instance_count(const DRWShadingGroup *shgroup);
|
||||
|
||||
void DRW_shgroup_state_enable(DRWShadingGroup *shgroup, DRWState state);
|
||||
void DRW_shgroup_state_disable(DRWShadingGroup *shgroup, DRWState state);
|
||||
void DRW_shgroup_stencil_mask(DRWShadingGroup *shgroup, unsigned int mask);
|
||||
void DRW_shgroup_stencil_mask(DRWShadingGroup *shgroup, uint mask);
|
||||
|
||||
void DRW_shgroup_uniform_texture(DRWShadingGroup *shgroup, const char *name, const struct GPUTexture *tex);
|
||||
void DRW_shgroup_uniform_texture_persistent(DRWShadingGroup *shgroup, const char *name, const struct GPUTexture *tex);
|
||||
|
@ -465,7 +465,7 @@ void DRW_state_lock(DRWState state);
|
|||
|
||||
void DRW_state_invert_facing(void);
|
||||
|
||||
void DRW_state_clip_planes_count_set(unsigned int plane_ct);
|
||||
void DRW_state_clip_planes_count_set(uint plane_ct);
|
||||
void DRW_state_clip_planes_reset(void);
|
||||
|
||||
/* Culling, return true if object is inside view frustum. */
|
||||
|
@ -474,7 +474,7 @@ bool DRW_culling_box_test(BoundBox *bbox);
|
|||
bool DRW_culling_plane_test(float plane[4]);
|
||||
|
||||
/* Selection */
|
||||
void DRW_select_load_id(unsigned int id);
|
||||
void DRW_select_load_id(uint id);
|
||||
|
||||
/* Draw State */
|
||||
void DRW_state_dfdy_factors_get(float dfdyfac[2]);
|
||||
|
|
|
@ -1482,7 +1482,7 @@ static void draw_armature_edit(Object *ob)
|
|||
for (eBone = arm->edbo->first, index = ob->select_color; eBone; eBone = eBone->next, index += 0x10000) {
|
||||
if (eBone->layer & arm->layer) {
|
||||
if ((eBone->flag & BONE_HIDDEN_A) == 0) {
|
||||
const int select_id = is_select ? index : (unsigned int)-1;
|
||||
const int select_id = is_select ? index : (uint)-1;
|
||||
|
||||
const short constflag = 0;
|
||||
|
||||
|
@ -1586,7 +1586,7 @@ static void draw_armature_pose(Object *ob, const float const_color[4])
|
|||
/* bone must be visible */
|
||||
if ((bone->flag & (BONE_HIDDEN_P | BONE_HIDDEN_PG)) == 0) {
|
||||
if (bone->layer & arm->layer) {
|
||||
const int select_id = is_pose_select ? index : (unsigned int)-1;
|
||||
const int select_id = is_pose_select ? index : (uint)-1;
|
||||
|
||||
const short constflag = pchan->constflag;
|
||||
|
||||
|
|
|
@ -117,8 +117,8 @@ void DRW_shape_cache_free(void)
|
|||
* \{ */
|
||||
|
||||
static void add_fancy_edge(
|
||||
Gwn_VertBuf *vbo, unsigned int pos_id, unsigned int n1_id, unsigned int n2_id,
|
||||
unsigned int *v_idx, const float co1[3], const float co2[3],
|
||||
Gwn_VertBuf *vbo, uint pos_id, uint n1_id, uint n2_id,
|
||||
uint *v_idx, const float co1[3], const float co2[3],
|
||||
const float n1[3], const float n2[3])
|
||||
{
|
||||
GWN_vertbuf_attr_set(vbo, n1_id, *v_idx, n1);
|
||||
|
@ -132,8 +132,8 @@ const float n1[3], const float n2[3])
|
|||
|
||||
#if 0 /* UNUSED */
|
||||
static void add_lat_lon_vert(
|
||||
Gwn_VertBuf *vbo, unsigned int pos_id, unsigned int nor_id,
|
||||
unsigned int *v_idx, const float rad, const float lat, const float lon)
|
||||
Gwn_VertBuf *vbo, uint pos_id, uint nor_id,
|
||||
uint *v_idx, const float rad, const float lat, const float lon)
|
||||
{
|
||||
float pos[3], nor[3];
|
||||
nor[0] = sinf(lat) * cosf(lon);
|
||||
|
@ -873,7 +873,7 @@ Gwn_Batch *DRW_cache_field_vortex_get(void)
|
|||
#define SPIRAL_RESOL 32
|
||||
if (!SHC.drw_field_vortex) {
|
||||
float v[3] = {0.0f, 0.0f, 0.0f};
|
||||
unsigned int v_idx = 0;
|
||||
uint v_idx = 0;
|
||||
|
||||
/* Position Only 3D format */
|
||||
static Gwn_VertFormat format = { 0 };
|
||||
|
@ -910,7 +910,7 @@ Gwn_Batch *DRW_cache_field_tube_limit_get(void)
|
|||
#define CIRCLE_RESOL 32
|
||||
if (!SHC.drw_field_tube_limit) {
|
||||
float v[3] = {0.0f, 0.0f, 0.0f};
|
||||
unsigned int v_idx = 0;
|
||||
uint v_idx = 0;
|
||||
|
||||
/* Position Only 3D format */
|
||||
static Gwn_VertFormat format = { 0 };
|
||||
|
@ -959,7 +959,7 @@ Gwn_Batch *DRW_cache_field_cone_limit_get(void)
|
|||
#define CIRCLE_RESOL 32
|
||||
if (!SHC.drw_field_cone_limit) {
|
||||
float v[3] = {0.0f, 0.0f, 0.0f};
|
||||
unsigned int v_idx = 0;
|
||||
uint v_idx = 0;
|
||||
|
||||
/* Position Only 3D format */
|
||||
static Gwn_VertFormat format = { 0 };
|
||||
|
@ -1285,7 +1285,7 @@ Gwn_Batch *DRW_cache_lamp_spot_square_get(void)
|
|||
{-1.0f, -1.0f, -1.0f},
|
||||
{-1.0f, 1.0f, -1.0f}};
|
||||
|
||||
unsigned int v_idx = 0;
|
||||
uint v_idx = 0;
|
||||
|
||||
/* Position Only 3D format */
|
||||
static Gwn_VertFormat format = { 0 };
|
||||
|
@ -1548,7 +1548,7 @@ static const float bone_octahedral_smooth_normals[6][3] = {
|
|||
{ 0.0f, 1.0f, 0.0f}
|
||||
};
|
||||
|
||||
static const unsigned int bone_octahedral_wire[24] = {
|
||||
static const uint bone_octahedral_wire[24] = {
|
||||
0, 1, 1, 5, 5, 3, 3, 0,
|
||||
0, 4, 4, 5, 5, 2, 2, 0,
|
||||
1, 2, 2, 3, 3, 4, 4, 1,
|
||||
|
@ -1556,13 +1556,13 @@ static const unsigned int bone_octahedral_wire[24] = {
|
|||
|
||||
/* aligned with bone_octahedral_wire
|
||||
* Contains adjacent normal index */
|
||||
static const unsigned int bone_octahedral_wire_adjacent_face[24] = {
|
||||
static const uint bone_octahedral_wire_adjacent_face[24] = {
|
||||
0, 3, 4, 7, 5, 6, 1, 2,
|
||||
2, 3, 6, 7, 4, 5, 0, 1,
|
||||
0, 4, 1, 5, 2, 6, 3, 7,
|
||||
};
|
||||
|
||||
static const unsigned int bone_octahedral_solid_tris[8][3] = {
|
||||
static const uint bone_octahedral_solid_tris[8][3] = {
|
||||
{2, 1, 0}, /* bottom */
|
||||
{3, 2, 0},
|
||||
{4, 3, 0},
|
||||
|
@ -1585,7 +1585,7 @@ static const unsigned int bone_octahedral_solid_tris[8][3] = {
|
|||
* the first vertex of the first face aka. vertex 2):
|
||||
* {0, 12, 1, 10, 2, 3}
|
||||
**/
|
||||
static const unsigned int bone_octahedral_solid_tris_adjacency[8][6] = {
|
||||
static const uint bone_octahedral_solid_tris_adjacency[8][6] = {
|
||||
{ 0, 12, 1, 10, 2, 3},
|
||||
{ 3, 15, 4, 1, 5, 6},
|
||||
{ 6, 18, 7, 4, 8, 9},
|
||||
|
@ -1612,7 +1612,7 @@ static const float bone_octahedral_solid_normals[8][3] = {
|
|||
Gwn_Batch *DRW_cache_bone_octahedral_get(void)
|
||||
{
|
||||
if (!SHC.drw_bone_octahedral) {
|
||||
unsigned int v_idx = 0;
|
||||
uint v_idx = 0;
|
||||
|
||||
static Gwn_VertFormat format = { 0 };
|
||||
static struct { uint pos, nor, snor; } attr_id;
|
||||
|
@ -1653,7 +1653,7 @@ Gwn_Batch *DRW_cache_bone_octahedral_get(void)
|
|||
Gwn_Batch *DRW_cache_bone_octahedral_wire_outline_get(void)
|
||||
{
|
||||
if (!SHC.drw_bone_octahedral_wire) {
|
||||
unsigned int v_idx = 0;
|
||||
uint v_idx = 0;
|
||||
|
||||
static Gwn_VertFormat format = { 0 };
|
||||
static struct { uint pos, n1, n2; } attr_id;
|
||||
|
@ -1704,7 +1704,7 @@ static const float bone_box_smooth_normals[8][3] = {
|
|||
{-M_SQRT3, M_SQRT3, M_SQRT3},
|
||||
};
|
||||
|
||||
static const unsigned int bone_box_wire[24] = {
|
||||
static const uint bone_box_wire[24] = {
|
||||
0, 1, 1, 2, 2, 3, 3, 0,
|
||||
4, 5, 5, 6, 6, 7, 7, 4,
|
||||
0, 4, 1, 5, 2, 6, 3, 7,
|
||||
|
@ -1712,13 +1712,13 @@ static const unsigned int bone_box_wire[24] = {
|
|||
|
||||
/* aligned with bone_octahedral_wire
|
||||
* Contains adjacent normal index */
|
||||
static const unsigned int bone_box_wire_adjacent_face[24] = {
|
||||
static const uint bone_box_wire_adjacent_face[24] = {
|
||||
0, 2, 0, 4, 1, 6, 1, 8,
|
||||
3, 10, 5, 10, 7, 11, 9, 11,
|
||||
3, 8, 2, 5, 4, 7, 6, 9,
|
||||
};
|
||||
|
||||
static const unsigned int bone_box_solid_tris[12][3] = {
|
||||
static const uint bone_box_solid_tris[12][3] = {
|
||||
{0, 2, 1}, /* bottom */
|
||||
{0, 3, 2},
|
||||
|
||||
|
@ -1742,7 +1742,7 @@ static const unsigned int bone_box_solid_tris[12][3] = {
|
|||
* Store indices of generated verts from bone_box_solid_tris to define adjacency infos.
|
||||
* See bone_octahedral_solid_tris for more infos.
|
||||
**/
|
||||
static const unsigned int bone_box_solid_tris_adjacency[12][6] = {
|
||||
static const uint bone_box_solid_tris_adjacency[12][6] = {
|
||||
{ 0, 5, 1, 14, 2, 8},
|
||||
{ 3, 26, 4, 20, 5, 1},
|
||||
|
||||
|
@ -1786,7 +1786,7 @@ static const float bone_box_solid_normals[12][3] = {
|
|||
Gwn_Batch *DRW_cache_bone_box_get(void)
|
||||
{
|
||||
if (!SHC.drw_bone_box) {
|
||||
unsigned int v_idx = 0;
|
||||
uint v_idx = 0;
|
||||
|
||||
static Gwn_VertFormat format = { 0 };
|
||||
static struct { uint pos, nor, snor; } attr_id;
|
||||
|
@ -1823,7 +1823,7 @@ Gwn_Batch *DRW_cache_bone_box_get(void)
|
|||
Gwn_Batch *DRW_cache_bone_box_wire_outline_get(void)
|
||||
{
|
||||
if (!SHC.drw_bone_box_wire) {
|
||||
unsigned int v_idx = 0;
|
||||
uint v_idx = 0;
|
||||
|
||||
static Gwn_VertFormat format = { 0 };
|
||||
static struct { uint pos, n1, n2; } attr_id;
|
||||
|
@ -1854,7 +1854,7 @@ Gwn_Batch *DRW_cache_bone_box_wire_outline_get(void)
|
|||
Gwn_Batch *DRW_cache_bone_wire_wire_outline_get(void)
|
||||
{
|
||||
if (!SHC.drw_bone_wire_wire) {
|
||||
unsigned int v_idx = 0;
|
||||
uint v_idx = 0;
|
||||
|
||||
static Gwn_VertFormat format = { 0 };
|
||||
static struct { uint pos, n1, n2; } attr_id;
|
||||
|
@ -1894,7 +1894,7 @@ Gwn_Batch *DRW_cache_bone_envelope_solid_get(void)
|
|||
const int lat_res = 24;
|
||||
const float lon_inc = 2.0f * M_PI / lon_res;
|
||||
const float lat_inc = M_PI / lat_res;
|
||||
unsigned int v_idx = 0;
|
||||
uint v_idx = 0;
|
||||
|
||||
static Gwn_VertFormat format = { 0 };
|
||||
static struct { uint pos; } attr_id;
|
||||
|
@ -1960,7 +1960,7 @@ Gwn_Batch *DRW_cache_bone_envelope_outline_get(void)
|
|||
v1[1] = radius * cosf((2.0f * M_PI * -1) / ((float)CIRCLE_RESOL));
|
||||
|
||||
/* Output 4 verts for each position. See shader for explanation. */
|
||||
unsigned int v = 0;
|
||||
uint v = 0;
|
||||
for (int a = 0; a < CIRCLE_RESOL; a++) {
|
||||
v2[0] = radius * sinf((2.0f * M_PI * a) / ((float)CIRCLE_RESOL));
|
||||
v2[1] = radius * cosf((2.0f * M_PI * a) / ((float)CIRCLE_RESOL));
|
||||
|
@ -1997,7 +1997,7 @@ Gwn_Batch *DRW_cache_bone_point_get(void)
|
|||
const float rad = 0.05f;
|
||||
const float lon_inc = 2 * M_PI / lon_res;
|
||||
const float lat_inc = M_PI / lat_res;
|
||||
unsigned int v_idx = 0;
|
||||
uint v_idx = 0;
|
||||
|
||||
static Gwn_VertFormat format = { 0 };
|
||||
static struct { uint pos, nor; } attr_id;
|
||||
|
@ -2082,7 +2082,7 @@ Gwn_Batch *DRW_cache_bone_point_wire_outline_get(void)
|
|||
v0[0] = radius * sinf((2.0f * M_PI * -1) / ((float)CIRCLE_RESOL));
|
||||
v0[1] = radius * cosf((2.0f * M_PI * -1) / ((float)CIRCLE_RESOL));
|
||||
|
||||
unsigned int v = 0;
|
||||
uint v = 0;
|
||||
for (int a = 0; a < CIRCLE_RESOL; a++) {
|
||||
v1[0] = radius * sinf((2.0f * M_PI * a) / ((float)CIRCLE_RESOL));
|
||||
v1[1] = radius * cosf((2.0f * M_PI * a) / ((float)CIRCLE_RESOL));
|
||||
|
@ -2120,8 +2120,8 @@ Gwn_Batch *DRW_cache_bone_stick_get(void)
|
|||
{
|
||||
if (!SHC.drw_bone_stick) {
|
||||
#define CIRCLE_RESOL 12
|
||||
unsigned int v = 0;
|
||||
unsigned int flag;
|
||||
uint v = 0;
|
||||
uint flag;
|
||||
const float radius = 2.0f; /* head/tail radius */
|
||||
float pos[2];
|
||||
|
||||
|
@ -2133,7 +2133,7 @@ Gwn_Batch *DRW_cache_bone_stick_get(void)
|
|||
attr_id.flag = GWN_vertformat_attr_add(&format, "flag", GWN_COMP_U32, 1, GWN_FETCH_INT);
|
||||
}
|
||||
|
||||
const unsigned int vcount = (CIRCLE_RESOL + 1) * 2 + 6;
|
||||
const uint vcount = (CIRCLE_RESOL + 1) * 2 + 6;
|
||||
|
||||
Gwn_VertBuf *vbo = GWN_vertbuf_create_with_format(&format);
|
||||
GWN_vertbuf_data_alloc(vbo, vcount);
|
||||
|
@ -2184,7 +2184,7 @@ Gwn_Batch *DRW_cache_bone_stick_get(void)
|
|||
|
||||
static void set_bone_axis_vert(
|
||||
Gwn_VertBuf *vbo, uint axis, uint pos, uint col,
|
||||
unsigned int *v, const float *a, const float *p, const float *c)
|
||||
uint *v, const float *a, const float *p, const float *c)
|
||||
{
|
||||
GWN_vertbuf_attr_set(vbo, axis, *v, a);
|
||||
GWN_vertbuf_attr_set(vbo, pos, *v, p);
|
||||
|
@ -2280,7 +2280,7 @@ Gwn_Batch *DRW_cache_bone_arrows_get(void)
|
|||
GWN_vertbuf_data_alloc(vbo, (2 + MARKER_LEN * MARKER_FILL_LAYER) * 3 +
|
||||
(X_LEN + Y_LEN + Z_LEN) * (1 + SHADOW_RES));
|
||||
|
||||
unsigned int v = 0;
|
||||
uint v = 0;
|
||||
|
||||
for (int axis = 0; axis < 3; axis++) {
|
||||
float pos[2] = {0.0f, 0.0f};
|
||||
|
|
|
@ -629,7 +629,7 @@ static MeshRenderData *mesh_render_data_create_ex(
|
|||
}
|
||||
else {
|
||||
const char *name = CustomData_get_layer_name(cd_ldata, CD_MLOOPCOL, i_src);
|
||||
unsigned int hash = BLI_ghashutil_strhash_p(name);
|
||||
uint hash = BLI_ghashutil_strhash_p(name);
|
||||
BLI_snprintf(rdata->cd.uuid.vcol[i_dst], sizeof(*rdata->cd.uuid.vcol), "c%u", hash);
|
||||
rdata->cd.layers.vcol[i_dst] = CustomData_get_layer_n(cd_ldata, CD_MLOOPCOL, i_src);
|
||||
if (rdata->edit_bmesh) {
|
||||
|
@ -663,7 +663,7 @@ static MeshRenderData *mesh_render_data_create_ex(
|
|||
}
|
||||
else {
|
||||
const char *name = CustomData_get_layer_name(cd_ldata, CD_MLOOPUV, i_src);
|
||||
unsigned int hash = BLI_ghashutil_strhash_p(name);
|
||||
uint hash = BLI_ghashutil_strhash_p(name);
|
||||
|
||||
BLI_snprintf(rdata->cd.uuid.uv[i_dst], sizeof(*rdata->cd.uuid.uv), "u%u", hash);
|
||||
rdata->cd.layers.uv[i_dst] = CustomData_get_layer_n(cd_ldata, CD_MLOOPUV, i_src);
|
||||
|
@ -768,7 +768,7 @@ static MeshRenderData *mesh_render_data_create_ex(
|
|||
}
|
||||
else {
|
||||
const char *name = CustomData_get_layer_name(cd_ldata, CD_MLOOPUV, i_src);
|
||||
unsigned int hash = BLI_ghashutil_strhash_p(name);
|
||||
uint hash = BLI_ghashutil_strhash_p(name);
|
||||
|
||||
BLI_snprintf(rdata->cd.uuid.tangent[i_dst], sizeof(*rdata->cd.uuid.tangent), "t%u", hash);
|
||||
|
||||
|
@ -786,7 +786,7 @@ static MeshRenderData *mesh_render_data_create_ex(
|
|||
}
|
||||
if (cd_lused[CD_TANGENT] & DM_TANGENT_MASK_ORCO) {
|
||||
const char *name = CustomData_get_layer_name(&rdata->cd.output.ldata, CD_TANGENT, i_dst);
|
||||
unsigned int hash = BLI_ghashutil_strhash_p(name);
|
||||
uint hash = BLI_ghashutil_strhash_p(name);
|
||||
BLI_snprintf(rdata->cd.uuid.tangent[i_dst], sizeof(*rdata->cd.uuid.tangent), "t%u", hash);
|
||||
|
||||
rdata->cd.layers.tangent[i_dst] = CustomData_get_layer_n(&rdata->cd.output.ldata, CD_TANGENT, i_dst);
|
||||
|
@ -1358,7 +1358,7 @@ static unsigned char mesh_render_data_vertex_flag(MeshRenderData *rdata, const B
|
|||
|
||||
static void add_overlay_tri(
|
||||
MeshRenderData *rdata, Gwn_VertBuf *vbo_pos, Gwn_VertBuf *vbo_nor, Gwn_VertBuf *vbo_data,
|
||||
const unsigned int pos_id, const unsigned int vnor_id, const unsigned int lnor_id, const unsigned int data_id,
|
||||
const uint pos_id, const uint vnor_id, const uint lnor_id, const uint data_id,
|
||||
const BMLoop **bm_looptri, const int base_vert_idx)
|
||||
{
|
||||
unsigned char fflag;
|
||||
|
@ -1411,7 +1411,7 @@ static void add_overlay_tri(
|
|||
|
||||
static void add_overlay_loose_edge(
|
||||
MeshRenderData *rdata, Gwn_VertBuf *vbo_pos, Gwn_VertBuf *vbo_nor, Gwn_VertBuf *vbo_data,
|
||||
const unsigned int pos_id, const unsigned int vnor_id, const unsigned int data_id,
|
||||
const uint pos_id, const uint vnor_id, const uint data_id,
|
||||
const BMEdge *eed, const int base_vert_idx)
|
||||
{
|
||||
if (vbo_pos) {
|
||||
|
@ -1450,7 +1450,7 @@ static void add_overlay_loose_edge(
|
|||
|
||||
static void add_overlay_loose_vert(
|
||||
MeshRenderData *rdata, Gwn_VertBuf *vbo_pos, Gwn_VertBuf *vbo_nor, Gwn_VertBuf *vbo_data,
|
||||
const unsigned int pos_id, const unsigned int vnor_id, const unsigned int data_id,
|
||||
const uint pos_id, const uint vnor_id, const uint data_id,
|
||||
const BMVert *eve, const int base_vert_idx)
|
||||
{
|
||||
if (vbo_pos) {
|
||||
|
@ -2069,7 +2069,7 @@ static Gwn_VertBuf *mesh_batch_cache_get_tri_uv_active(
|
|||
BLI_assert(rdata->edit_bmesh == NULL);
|
||||
|
||||
if (cache->tri_aligned_uv == NULL) {
|
||||
unsigned int vidx = 0;
|
||||
uint vidx = 0;
|
||||
|
||||
static Gwn_VertFormat format = { 0 };
|
||||
static struct { uint uv; } attr_id;
|
||||
|
@ -2556,7 +2556,7 @@ static Gwn_VertBuf *mesh_create_tri_weights(
|
|||
|
||||
Gwn_VertBuf *vbo;
|
||||
{
|
||||
unsigned int cidx = 0;
|
||||
uint cidx = 0;
|
||||
|
||||
static Gwn_VertFormat format = { 0 };
|
||||
static struct { uint col; } attr_id;
|
||||
|
@ -2616,7 +2616,7 @@ static Gwn_VertBuf *mesh_create_tri_vert_colors(
|
|||
|
||||
Gwn_VertBuf *vbo;
|
||||
{
|
||||
unsigned int cidx = 0;
|
||||
uint cidx = 0;
|
||||
|
||||
static Gwn_VertFormat format = { 0 };
|
||||
static struct { uint col; } attr_id;
|
||||
|
@ -2676,7 +2676,7 @@ static Gwn_VertBuf *mesh_create_tri_select_id(
|
|||
|
||||
Gwn_VertBuf *vbo;
|
||||
{
|
||||
unsigned int cidx = 0;
|
||||
uint cidx = 0;
|
||||
|
||||
static Gwn_VertFormat format = { 0 };
|
||||
static struct { uint col; } attr_id;
|
||||
|
@ -2771,7 +2771,7 @@ static Gwn_VertBuf *mesh_batch_cache_get_vert_pos_and_nor_in_order(
|
|||
return cache->pos_in_order;
|
||||
}
|
||||
|
||||
static Gwn_VertFormat *edit_mesh_overlay_pos_format(unsigned int *r_pos_id)
|
||||
static Gwn_VertFormat *edit_mesh_overlay_pos_format(uint *r_pos_id)
|
||||
{
|
||||
static Gwn_VertFormat format_pos = { 0 };
|
||||
static unsigned pos_id;
|
||||
|
@ -2782,7 +2782,7 @@ static Gwn_VertFormat *edit_mesh_overlay_pos_format(unsigned int *r_pos_id)
|
|||
return &format_pos;
|
||||
}
|
||||
|
||||
static Gwn_VertFormat *edit_mesh_overlay_nor_format(unsigned int *r_vnor_id, unsigned int *r_lnor_id)
|
||||
static Gwn_VertFormat *edit_mesh_overlay_nor_format(uint *r_vnor_id, uint *r_lnor_id)
|
||||
{
|
||||
static Gwn_VertFormat format_nor = { 0 };
|
||||
static Gwn_VertFormat format_nor_loop = { 0 };
|
||||
|
@ -2803,7 +2803,7 @@ static Gwn_VertFormat *edit_mesh_overlay_nor_format(unsigned int *r_vnor_id, uns
|
|||
}
|
||||
}
|
||||
|
||||
static Gwn_VertFormat *edit_mesh_overlay_data_format(unsigned int *r_data_id)
|
||||
static Gwn_VertFormat *edit_mesh_overlay_data_format(uint *r_data_id)
|
||||
{
|
||||
static Gwn_VertFormat format_flag = { 0 };
|
||||
static unsigned data_id;
|
||||
|
@ -3268,7 +3268,7 @@ static Gwn_VertBuf *mesh_create_edge_pos_with_sel(
|
|||
|
||||
Gwn_VertBuf *vbo;
|
||||
{
|
||||
unsigned int vidx = 0, cidx = 0;
|
||||
uint vidx = 0, cidx = 0;
|
||||
|
||||
static Gwn_VertFormat format = { 0 };
|
||||
static struct { uint pos, sel; } attr_id;
|
||||
|
@ -3355,7 +3355,7 @@ static Gwn_VertBuf *mesh_create_vert_pos_with_overlay_data(
|
|||
|
||||
Gwn_VertBuf *vbo;
|
||||
{
|
||||
unsigned int cidx = 0;
|
||||
uint cidx = 0;
|
||||
|
||||
static Gwn_VertFormat format = { 0 };
|
||||
static struct { uint data; } attr_id;
|
||||
|
|
|
@ -316,7 +316,7 @@ static int particle_batch_cache_fill_segments(
|
|||
const int num_path_keys,
|
||||
const int num_uv_layers,
|
||||
/*const*/ MTFace **mtfaces,
|
||||
unsigned int *uv_id,
|
||||
uint *uv_id,
|
||||
float (***r_parent_uvs)[2],
|
||||
Gwn_IndexBufBuilder *elb,
|
||||
HairAttributeID *attr_id,
|
||||
|
@ -408,7 +408,7 @@ static void particle_batch_cache_ensure_pos_and_seg(ParticleSystem *psys,
|
|||
|
||||
static Gwn_VertFormat format = { 0 };
|
||||
static HairAttributeID attr_id;
|
||||
unsigned int *uv_id = NULL;
|
||||
uint *uv_id = NULL;
|
||||
int num_uv_layers = 0;
|
||||
MTFace **mtfaces = NULL;
|
||||
float (**parent_uvs)[2] = NULL;
|
||||
|
|
|
@ -217,10 +217,10 @@ void DRW_instance_buffer_finish(DRWInstanceDataList *idatalist)
|
|||
for (int i = 0; i < batching->alloc_size; i++, bbuf++) {
|
||||
if (bbuf->shgroup != NULL) {
|
||||
realloc_size = i + 1;
|
||||
unsigned int vert_ct = DRW_shgroup_get_instance_count(bbuf->shgroup);
|
||||
uint vert_ct = DRW_shgroup_get_instance_count(bbuf->shgroup);
|
||||
vert_ct += (vert_ct == 0) ? 1 : 0; /* Do not realloc to 0 size buffer */
|
||||
if (vert_ct + BUFFER_VERTS_CHUNK <= bbuf->vert->vertex_ct) {
|
||||
unsigned int size = vert_ct + BUFFER_VERTS_CHUNK - 1;
|
||||
uint size = vert_ct + BUFFER_VERTS_CHUNK - 1;
|
||||
size = size - size % BUFFER_VERTS_CHUNK;
|
||||
GWN_vertbuf_data_resize(bbuf->vert, size);
|
||||
}
|
||||
|
@ -249,10 +249,10 @@ void DRW_instance_buffer_finish(DRWInstanceDataList *idatalist)
|
|||
for (int i = 0; i < instancing->alloc_size; i++, ibuf++) {
|
||||
if (ibuf->shgroup != NULL) {
|
||||
realloc_size = i + 1;
|
||||
unsigned int vert_ct = DRW_shgroup_get_instance_count(ibuf->shgroup);
|
||||
uint vert_ct = DRW_shgroup_get_instance_count(ibuf->shgroup);
|
||||
vert_ct += (vert_ct == 0) ? 1 : 0; /* Do not realloc to 0 size buffer */
|
||||
if (vert_ct + BUFFER_VERTS_CHUNK <= ibuf->vert->vertex_ct) {
|
||||
unsigned int size = vert_ct + BUFFER_VERTS_CHUNK - 1;
|
||||
uint size = vert_ct + BUFFER_VERTS_CHUNK - 1;
|
||||
size = size - size % BUFFER_VERTS_CHUNK;
|
||||
GWN_vertbuf_data_resize(ibuf->vert, size);
|
||||
}
|
||||
|
@ -283,7 +283,7 @@ void DRW_instance_buffer_finish(DRWInstanceDataList *idatalist)
|
|||
* \{ */
|
||||
|
||||
static DRWInstanceData *drw_instance_data_create(
|
||||
DRWInstanceDataList *idatalist, unsigned int attrib_size, unsigned int instance_group)
|
||||
DRWInstanceDataList *idatalist, uint attrib_size, uint instance_group)
|
||||
{
|
||||
DRWInstanceData *idata = MEM_callocN(sizeof(DRWInstanceData), "DRWInstanceData");
|
||||
idata->next = NULL;
|
||||
|
@ -338,7 +338,7 @@ void *DRW_instance_data_get(DRWInstanceData *idata)
|
|||
}
|
||||
|
||||
DRWInstanceData *DRW_instance_data_request(
|
||||
DRWInstanceDataList *idatalist, unsigned int attrib_size, unsigned int instance_group)
|
||||
DRWInstanceDataList *idatalist, uint attrib_size, uint instance_group)
|
||||
{
|
||||
BLI_assert(attrib_size > 0 && attrib_size <= MAX_INSTANCE_DATA_SIZE);
|
||||
|
||||
|
|
|
@ -41,7 +41,7 @@ struct DRWShadingGroup;
|
|||
void *DRW_instance_data_next(DRWInstanceData *idata);
|
||||
void *DRW_instance_data_get(DRWInstanceData *idata);
|
||||
DRWInstanceData *DRW_instance_data_request(
|
||||
DRWInstanceDataList *idatalist, unsigned int attrib_size, unsigned int instance_group);
|
||||
DRWInstanceDataList *idatalist, uint attrib_size, uint instance_group);
|
||||
|
||||
void DRW_batching_buffer_request(
|
||||
DRWInstanceDataList *idatalist, Gwn_VertFormat *format, Gwn_PrimType type, struct DRWShadingGroup *shgroup,
|
||||
|
|
|
@ -232,8 +232,8 @@ void DRW_transform_to_display(GPUTexture *tex)
|
|||
drw_state_set(DRW_STATE_WRITE_COLOR);
|
||||
|
||||
Gwn_VertFormat *vert_format = immVertexFormat();
|
||||
unsigned int pos = GWN_vertformat_attr_add(vert_format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT);
|
||||
unsigned int texco = GWN_vertformat_attr_add(vert_format, "texCoord", GWN_COMP_F32, 2, GWN_FETCH_FLOAT);
|
||||
uint pos = GWN_vertformat_attr_add(vert_format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT);
|
||||
uint texco = GWN_vertformat_attr_add(vert_format, "texCoord", GWN_COMP_F32, 2, GWN_FETCH_FLOAT);
|
||||
|
||||
const float dither = 1.0f;
|
||||
|
||||
|
@ -1097,9 +1097,9 @@ static void drw_engines_disable(void)
|
|||
BLI_freelistN(&DST.enabled_engines);
|
||||
}
|
||||
|
||||
static unsigned int DRW_engines_get_hash(void)
|
||||
static uint DRW_engines_get_hash(void)
|
||||
{
|
||||
unsigned int hash = 0;
|
||||
uint hash = 0;
|
||||
/* The cache depends on enabled engines */
|
||||
/* FIXME : if collision occurs ... segfault */
|
||||
for (LinkData *link = DST.enabled_engines.first; link; link = link->next) {
|
||||
|
@ -1693,8 +1693,8 @@ static void draw_depth_texture_to_screen(GPUTexture *texture)
|
|||
const float h = (float)GPU_texture_height(texture);
|
||||
|
||||
Gwn_VertFormat *format = immVertexFormat();
|
||||
unsigned int texcoord = GWN_vertformat_attr_add(format, "texCoord", GWN_COMP_F32, 2, GWN_FETCH_FLOAT);
|
||||
unsigned int pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT);
|
||||
uint texcoord = GWN_vertformat_attr_add(format, "texCoord", GWN_COMP_F32, 2, GWN_FETCH_FLOAT);
|
||||
uint pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT);
|
||||
|
||||
immBindBuiltinProgram(GPU_SHADER_3D_IMAGE_DEPTH_COPY);
|
||||
|
||||
|
|
|
@ -140,7 +140,7 @@ typedef struct DRWCall {
|
|||
struct { /* type == DRW_CALL_INSTANCES */
|
||||
Gwn_Batch *geometry;
|
||||
/* Count can be adjusted between redraw. If needed, we can add fixed count. */
|
||||
unsigned int *count;
|
||||
uint *count;
|
||||
} instances;
|
||||
struct { /* type == DRW_CALL_GENERATE */
|
||||
DRWCallGenerateFn *geometry_fn;
|
||||
|
@ -201,19 +201,19 @@ struct DRWShadingGroup {
|
|||
struct { /* DRW_SHG_***_BATCH */
|
||||
struct Gwn_Batch *batch_geom; /* Result of call batching */
|
||||
struct Gwn_VertBuf *batch_vbo;
|
||||
unsigned int primitive_count;
|
||||
uint primitive_count;
|
||||
};
|
||||
struct { /* DRW_SHG_INSTANCE[_EXTERNAL] */
|
||||
struct Gwn_Batch *instance_geom;
|
||||
struct Gwn_VertBuf *instance_vbo;
|
||||
unsigned int instance_count;
|
||||
uint instance_count;
|
||||
float instance_orcofac[2][3]; /* TODO find a better place. */
|
||||
};
|
||||
};
|
||||
|
||||
DRWState state_extra; /* State changes for this batch only (or'd with the pass's state) */
|
||||
DRWState state_extra_disable; /* State changes for this batch only (and'd with the pass's state) */
|
||||
unsigned int stencil_mask; /* Stencil mask to use for stencil test / write operations */
|
||||
uint stencil_mask; /* Stencil mask to use for stencil test / write operations */
|
||||
DRWShadingGroupType type;
|
||||
|
||||
/* Builtin matrices locations */
|
||||
|
@ -279,7 +279,7 @@ typedef struct DRWManager {
|
|||
/* Managed by `DRW_state_set`, `DRW_state_reset` */
|
||||
DRWState state;
|
||||
DRWState state_lock;
|
||||
unsigned int stencil_mask;
|
||||
uint stencil_mask;
|
||||
|
||||
/* Per viewport */
|
||||
GPUViewport *viewport;
|
||||
|
@ -292,11 +292,11 @@ typedef struct DRWManager {
|
|||
GLenum backface, frontface;
|
||||
|
||||
struct {
|
||||
unsigned int is_select : 1;
|
||||
unsigned int is_depth : 1;
|
||||
unsigned int is_image_render : 1;
|
||||
unsigned int is_scene_render : 1;
|
||||
unsigned int draw_background : 1;
|
||||
uint is_select : 1;
|
||||
uint is_depth : 1;
|
||||
uint is_image_render : 1;
|
||||
uint is_scene_render : 1;
|
||||
uint draw_background : 1;
|
||||
} options;
|
||||
|
||||
/* Current rendering context */
|
||||
|
@ -326,7 +326,7 @@ typedef struct DRWManager {
|
|||
} clipping;
|
||||
|
||||
#ifdef USE_GPU_SELECT
|
||||
unsigned int select_id;
|
||||
uint select_id;
|
||||
#endif
|
||||
|
||||
/* ---------- Nothing after this point is cleared after use ----------- */
|
||||
|
|
|
@ -378,7 +378,7 @@ void DRW_shgroup_call_object_add_with_callback(
|
|||
BLI_LINKS_APPEND(&shgroup->calls, call);
|
||||
}
|
||||
|
||||
void DRW_shgroup_call_instances_add(DRWShadingGroup *shgroup, Gwn_Batch *geom, float (*obmat)[4], unsigned int *count)
|
||||
void DRW_shgroup_call_instances_add(DRWShadingGroup *shgroup, Gwn_Batch *geom, float (*obmat)[4], uint *count)
|
||||
{
|
||||
BLI_assert(geom != NULL);
|
||||
BLI_assert(shgroup->type == DRW_SHG_NORMAL);
|
||||
|
@ -396,7 +396,7 @@ void DRW_shgroup_call_instances_add(DRWShadingGroup *shgroup, Gwn_Batch *geom, f
|
|||
}
|
||||
|
||||
/* These calls can be culled and are optimized for redraw */
|
||||
void DRW_shgroup_call_object_instances_add(DRWShadingGroup *shgroup, Gwn_Batch *geom, Object *ob, unsigned int *count)
|
||||
void DRW_shgroup_call_object_instances_add(DRWShadingGroup *shgroup, Gwn_Batch *geom, Object *ob, uint *count)
|
||||
{
|
||||
BLI_assert(geom != NULL);
|
||||
BLI_assert(shgroup->type == DRW_SHG_NORMAL);
|
||||
|
@ -453,7 +453,7 @@ void DRW_shgroup_call_sculpt_add(DRWShadingGroup *shgroup, Object *ob, float (*o
|
|||
DRW_shgroup_call_generate_add(shgroup, sculpt_draw_cb, ob, obmat);
|
||||
}
|
||||
|
||||
void DRW_shgroup_call_dynamic_add_array(DRWShadingGroup *shgroup, const void *attr[], unsigned int attr_len)
|
||||
void DRW_shgroup_call_dynamic_add_array(DRWShadingGroup *shgroup, const void *attr[], uint attr_len)
|
||||
{
|
||||
#ifdef USE_GPU_SELECT
|
||||
if (G.f & G_PICKSEL) {
|
||||
|
@ -824,7 +824,7 @@ void DRW_shgroup_instance_batch(DRWShadingGroup *shgroup, struct Gwn_Batch *batc
|
|||
#endif
|
||||
}
|
||||
|
||||
unsigned int DRW_shgroup_get_instance_count(const DRWShadingGroup *shgroup)
|
||||
uint DRW_shgroup_get_instance_count(const DRWShadingGroup *shgroup)
|
||||
{
|
||||
return shgroup->instance_count;
|
||||
}
|
||||
|
@ -843,7 +843,7 @@ void DRW_shgroup_state_disable(DRWShadingGroup *shgroup, DRWState state)
|
|||
shgroup->state_extra_disable &= ~state;
|
||||
}
|
||||
|
||||
void DRW_shgroup_stencil_mask(DRWShadingGroup *shgroup, unsigned int mask)
|
||||
void DRW_shgroup_stencil_mask(DRWShadingGroup *shgroup, uint mask)
|
||||
{
|
||||
BLI_assert(mask <= 255);
|
||||
shgroup->stencil_mask = mask;
|
||||
|
|
|
@ -42,7 +42,7 @@
|
|||
#endif
|
||||
|
||||
#ifdef USE_GPU_SELECT
|
||||
void DRW_select_load_id(unsigned int id)
|
||||
void DRW_select_load_id(uint id)
|
||||
{
|
||||
BLI_assert(G.f & G_PICKSEL);
|
||||
DST.select_id = id;
|
||||
|
@ -326,7 +326,7 @@ void drw_state_set(DRWState state)
|
|||
DST.state = state;
|
||||
}
|
||||
|
||||
static void drw_stencil_set(unsigned int mask)
|
||||
static void drw_stencil_set(uint mask)
|
||||
{
|
||||
if (DST.stencil_mask != mask) {
|
||||
DST.stencil_mask = mask;
|
||||
|
@ -382,7 +382,7 @@ void DRW_state_invert_facing(void)
|
|||
* and if the shaders have support for it (see usage of gl_ClipDistance).
|
||||
* Be sure to call DRW_state_clip_planes_reset() after you finish drawing.
|
||||
**/
|
||||
void DRW_state_clip_planes_count_set(unsigned int plane_ct)
|
||||
void DRW_state_clip_planes_count_set(uint plane_ct)
|
||||
{
|
||||
BLI_assert(plane_ct <= MAX_CLIP_PLANES);
|
||||
DST.num_clip_planes = plane_ct;
|
||||
|
@ -775,7 +775,7 @@ static void draw_geometry_prepare(DRWShadingGroup *shgroup, DRWCallState *state)
|
|||
}
|
||||
|
||||
static void draw_geometry_execute_ex(
|
||||
DRWShadingGroup *shgroup, Gwn_Batch *geom, unsigned int start, unsigned int count, bool draw_instance)
|
||||
DRWShadingGroup *shgroup, Gwn_Batch *geom, uint start, uint count, bool draw_instance)
|
||||
{
|
||||
/* Special case: empty drawcall, placement is done via shader, don't bind anything. */
|
||||
if (geom == NULL) {
|
||||
|
@ -1032,7 +1032,7 @@ static void draw_shgroup(DRWShadingGroup *shgroup, DRWState pass_state)
|
|||
}
|
||||
else {
|
||||
if (shgroup->instance_count > 0) {
|
||||
unsigned int count, start;
|
||||
uint count, start;
|
||||
draw_geometry_prepare(shgroup, NULL);
|
||||
GPU_SELECT_LOAD_IF_PICKSEL_LIST(shgroup, start, count)
|
||||
{
|
||||
|
@ -1045,7 +1045,7 @@ static void draw_shgroup(DRWShadingGroup *shgroup, DRWState pass_state)
|
|||
else { /* DRW_SHG_***_BATCH */
|
||||
/* Some dynamic batch can have no geom (no call to aggregate) */
|
||||
if (shgroup->instance_count > 0) {
|
||||
unsigned int count, start;
|
||||
uint count, start;
|
||||
draw_geometry_prepare(shgroup, NULL);
|
||||
GPU_SELECT_LOAD_IF_PICKSEL_LIST(shgroup, start, count)
|
||||
{
|
||||
|
|
|
@ -304,8 +304,8 @@ void DRW_stats_draw(rcti *rect)
|
|||
/* ------------------------------------------ */
|
||||
|
||||
/* Memory Stats */
|
||||
unsigned int tex_mem = GPU_texture_memory_usage_get();
|
||||
unsigned int vbo_mem = GWN_vertbuf_get_memory_usage();
|
||||
uint tex_mem = GPU_texture_memory_usage_get();
|
||||
uint vbo_mem = GWN_vertbuf_get_memory_usage();
|
||||
|
||||
sprintf(stat_string, "GPU Memory");
|
||||
draw_stat(rect, 0, v, stat_string, sizeof(stat_string));
|
||||
|
|
|
@ -212,8 +212,8 @@ static void drawgrid(UnitSettings *unit, ARegion *ar, View3D *v3d, const char **
|
|||
#endif
|
||||
|
||||
Gwn_VertFormat *format = immVertexFormat();
|
||||
unsigned int pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT);
|
||||
unsigned int color = GWN_vertformat_attr_add(format, "color", GWN_COMP_U8, 3, GWN_FETCH_INT_TO_FLOAT_UNIT);
|
||||
uint pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT);
|
||||
uint color = GWN_vertformat_attr_add(format, "color", GWN_COMP_U8, 3, GWN_FETCH_INT_TO_FLOAT_UNIT);
|
||||
|
||||
immBindBuiltinProgram(GPU_SHADER_2D_FLAT_COLOR);
|
||||
|
||||
|
@ -379,8 +379,8 @@ static void drawfloor(Scene *scene, View3D *v3d, const char **grid_unit)
|
|||
unsigned char col_bg[3], col_grid_emphasise[3], col_grid_light[3];
|
||||
|
||||
Gwn_VertFormat *format = immVertexFormat();
|
||||
unsigned int pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT);
|
||||
unsigned int color = GWN_vertformat_attr_add(format, "color", GWN_COMP_U8, 3, GWN_FETCH_INT_TO_FLOAT_UNIT);
|
||||
uint pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT);
|
||||
uint color = GWN_vertformat_attr_add(format, "color", GWN_COMP_U8, 3, GWN_FETCH_INT_TO_FLOAT_UNIT);
|
||||
|
||||
immBindBuiltinProgram(GPU_SHADER_3D_FLAT_COLOR);
|
||||
|
||||
|
@ -467,8 +467,8 @@ static void drawfloor(Scene *scene, View3D *v3d, const char **grid_unit)
|
|||
/* draw axis lines -- sometimes grid floor is off, other times we still need to draw the Z axis */
|
||||
|
||||
Gwn_VertFormat *format = immVertexFormat();
|
||||
unsigned int pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT);
|
||||
unsigned int color = GWN_vertformat_attr_add(format, "color", GWN_COMP_U8, 3, GWN_FETCH_INT_TO_FLOAT_UNIT);
|
||||
uint pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT);
|
||||
uint color = GWN_vertformat_attr_add(format, "color", GWN_COMP_U8, 3, GWN_FETCH_INT_TO_FLOAT_UNIT);
|
||||
|
||||
immBindBuiltinProgram(GPU_SHADER_3D_FLAT_COLOR);
|
||||
immBegin(GWN_PRIM_LINES, (show_axis_x + show_axis_y + show_axis_z) * 2);
|
||||
|
|
|
@ -1664,7 +1664,7 @@ typedef struct OBJECT_LightProbeEngineData {
|
|||
float increment_y[3];
|
||||
float increment_z[3];
|
||||
float corner[3];
|
||||
unsigned int cell_count;
|
||||
uint cell_count;
|
||||
} OBJECT_LightProbeEngineData;
|
||||
|
||||
static void DRW_shgroup_lightprobe(OBJECT_StorageList *stl, OBJECT_PassList *psl, Object *ob, ViewLayer *view_layer)
|
||||
|
|
Loading…
Reference in New Issue