Fix #104730: Suppress using anonymous UV layers for rendering #105192
|
@ -475,6 +475,8 @@ const char *CustomData_get_active_layer_name(const struct CustomData *data, int
|
|||
*/
|
||||
const char *CustomData_get_render_layer_name(const struct CustomData *data, int type);
|
||||
|
||||
bool CustomData_layer_is_anonymous(const struct CustomData *data, int type, int n);
|
||||
|
||||
void CustomData_bmesh_set(const struct CustomData *data,
|
||||
void *block,
|
||||
int type,
|
||||
|
@ -506,6 +508,8 @@ void CustomData_set_layer_stencil_index(struct CustomData *data, int type, int n
|
|||
void CustomData_set_layer_flag(struct CustomData *data, int type, int flag);
|
||||
void CustomData_clear_layer_flag(struct CustomData *data, int type, int flag);
|
||||
|
||||
|
||||
|
||||
|
||||
void CustomData_bmesh_set_default(struct CustomData *data, void **block);
|
||||
void CustomData_bmesh_free_block(struct CustomData *data, void **block);
|
||||
void CustomData_bmesh_alloc_block(struct CustomData *data, void **block);
|
||||
|
|
|
@ -2686,6 +2686,15 @@ void CustomData_clear_layer_flag(CustomData *data, const int type, const int fla
|
|||
}
|
||||
}
|
||||
|
||||
bool CustomData_layer_is_anonymous(const struct CustomData *data, int type, int n)
|
||||
{
|
||||
const int layer_index = data->typemap[type];
|
||||
BLI_assert(customdata_typemap_is_valid(data));
|
||||
BLI_assert(data->layers[layer_index + n].type == type);
|
||||
Baardaap marked this conversation as resolved
Outdated
Hans Goudey
commented
Can this be implemented with Can this be implemented with `CustomData_get_layer_index_n`?
|
||||
|
||||
return data->layers[layer_index + n].anonymous_id != nullptr;
|
||||
}
|
||||
|
||||
static bool customData_resize(CustomData *data, const int amount)
|
||||
{
|
||||
CustomDataLayer *tmp = static_cast<CustomDataLayer *>(
|
||||
|
|
|
@ -358,7 +358,7 @@ static DRW_MeshCDMask mesh_cd_calc_used_gpu_layers(const Object *object,
|
|||
CustomData_get_named_layer(cd_ldata, CD_PROP_FLOAT2, name) :
|
||||
CustomData_get_render_layer(cd_ldata, CD_PROP_FLOAT2);
|
||||
}
|
||||
if (layer != -1) {
|
||||
if (layer != -1 && !CustomData_layer_is_anonymous(cd_ldata, CD_PROP_FLOAT2, layer)) {
|
||||
cd_used.uv |= (1 << layer);
|
||||
}
|
||||
break;
|
||||
|
|
|
@ -248,7 +248,7 @@ static void extract_edituv_stretch_angle_init_subdiv(const DRWSubdivCache *subdi
|
|||
/* HACK to fix #68857 */
|
||||
if (mr->extract_type == MR_EXTRACT_BMESH && cache->cd_used.edit_uv == 1) {
|
||||
int layer = CustomData_get_active_layer(cd_ldata, CD_PROP_FLOAT2);
|
||||
if (layer != -1) {
|
||||
if (layer != -1 && !CustomData_layer_is_anonymous(cd_ldata, CD_PROP_FLOAT2, layer)) {
|
||||
uv_layers |= (1 << layer);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -31,7 +31,7 @@ static bool mesh_extract_uv_format_init(GPUVertFormat *format,
|
|||
/* HACK to fix #68857 */
|
||||
if (extract_type == MR_EXTRACT_BMESH && cache->cd_used.edit_uv == 1) {
|
||||
int layer = CustomData_get_active_layer(cd_ldata, CD_PROP_FLOAT2);
|
||||
if (layer != -1) {
|
||||
if (layer != -1 && !CustomData_layer_is_anonymous(cd_ldata, CD_PROP_FLOAT2, layer)) {
|
||||
uv_layers |= (1 << layer);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Looks like clang format is missing here