Sorting packed vertices with thrust
So I have an device array of PackedVertex structs: struct PackedVertex { glm::vec3 Vertex; glm::vec2 UV; glm::vec3 Normal; } I'm trying to sort them so that duplicates are clustered together in the array; I don't care about overall order at all. I've tried sorting them by comparing the lengths of the vectors which ran but didn't sort them correctly so now I'm trying per variable using 3 stable_sorts with the binary_operators: __thrust_hd_warning_disable__ struct sort_packed_verts_by_vertex : public thrust::binary_function < PackedVertex, PackedVertex, bool > { __host__ __device__ bool operator