WIP: Draw: Sub Handles #105175

Closed
Miguel Pozo wants to merge 5 commits from pragma37/blender:pull-thin-handles-2 into main

When changing the target branch, be careful to rebase the branch in your fork to match. See documentation.
4 changed files with 7 additions and 7 deletions
Showing only changes of commit a11a15e45d - Show all commits

View File

@ -29,8 +29,8 @@ struct ResourceHandle {
union {
uint raw;
struct {
uint index : 25;
uint sub_index : 6;
uint index : 26;
uint sub_index : 5;
uint inverted_handedness : 1;
};
};

View File

@ -110,7 +110,7 @@ class Manager {
uint attribute_len_ = 0;
Vector<uint8_t> sub_handle_indices_;
int max_sub_handles_ = 64;
int max_sub_handles_ = 32;
Object *object_active = nullptr;

View File

@ -161,8 +161,8 @@ flat in int resourceIDFrag;
# endif
#endif
#define resource_id int(_resource_id_ & 0x01ffffffu)
#define sub_resource_id int((_resource_id_ >> 25) & 0x3fu)
#define resource_id int(_resource_id_ & 0x03FFFFFFu)
#define sub_resource_id int((_resource_id_ >> 26) & 0x1Fu)
/* Breaking this across multiple lines causes issues for some older GLSL compilers. */
/* clang-format off */

View File

@ -53,7 +53,7 @@ void main()
DrawPrototype proto = prototype_buf[proto_id];
uint group_id = proto.group_id;
bool is_inverted = (proto.resource_handle & 0x80000000u) != 0;
uint resource_index = (proto.resource_handle & 0x01ffffffu);
uint resource_index = (proto.resource_handle & 0x03FFFFFFu);
/* Visibility test result. */
uint visible_instance_len = 0;
@ -117,7 +117,7 @@ void main()
}
else {
for (uint i = dst_index; i < dst_index + visible_instance_len; i++) {
resource_id_buf[i] = proto.resource_handle & 0x07ffffffu;
resource_id_buf[i] = proto.resource_handle & 0x7FFFFFFFu;
}
}
}