简体   繁体   English

OpenGL 3.3 中是否有 AMD GPU 可以绘制的最大顶点数?

[英]Is there a maximum number of vertices that can be drawn by an AMD GPU in OpenGL 3.3?

I have written a small application to display large pointclouds of vertices of usual size ~ 20m points consisting of position values xyz and colour values RGB.我编写了一个小应用程序来显示通常大小的顶点的大型点云 ~ 20m 点,由位置值 xyz 和颜色值 RGB 组成。

I experianced no issues on a workstation with a Nvidia GTX 670 GPU but have now changed to another workstation with a AMD HD6950 and now large pointclouds are not being displayed.我在配备 Nvidia GTX 670 GPU 的工作站上没有遇到任何问题,但现在已更换为另一台配备 AMD HD6950 的工作站,现在没有显示大型点云。

I originally thought that there might be a limit to the number of vertices that the AMD GPU can draw in a single call but after additional testing think that this is not the case.我最初认为 AMD GPU 可以在一次调用中绘制的顶点数量可能有限制,但经过额外测试后认为情况并非如此。

I generated a test pointcloud (done with simple 'for' loops) larger then the other point clouds and with the same format [vc3(xyz) & vec3(rgb)] and this cloud still displays but not the other large pointcloud from the laser scanner.我生成了一个测试点云(用简单的“for”循环完成)比其他点云大,格式相同 [vc3(xyz) & vec3(rgb)],这个云仍然显示,但不是来自激光的另一个大点云扫描器。 Looking at the VBO states in CodeXL these are all present and of the correct size (233MB for 20m vec3's) so i cannot see where the error might be unless the non-debug pointcloud is obtaining incorrect values from somewhere.查看 CodeXL 中的 VBO 状态,这些状态都存在且大小正确(20m vec3 为 233MB),因此除非非调试点云从某处获取不正确的值,否则我无法看到错误可能在哪里。

It's also worth noting that I have used small pointclouds (30k vertices) and they load fine but not the large ones on the AMD computer.还值得注意的是,我使用了小点云(30k 顶点),它们在 AMD 计算机上加载得很好,但不是大点云。

As a sanity check this is the code for generating the debug pointcloud:作为完整性检查,这是生成调试点云的代码:

// Holders for position and colour
std::vector<glm::vec3> t_position;
std::vector<glm::vec3> t_colour;

// Reserve memory
t_position.reserve(point_cloud_size);
t_colour.reserve(point_cloud_size);

// Generate Data
for (int x=0; x < cube_root; x++) {
    for (int y=0; y < cube_root; y++) {
        for (int z=0; z < cube_root; z++) {
            t_position.push_back(glm::vec3(x/10.0 - 0.5, y/10.0 -0.5, z/10.0 -0.5));
            t_colour.push_back(glm::vec3((float)x/10.0,(float)y/10.0,(float)z/10.0));
        }
    }
}

and this is the method for generating the laserscanner pointcloud:这是生成激光扫描仪点云的方法:

pcl::PointCloud<pcl::PointXYZRGBNormal>::Ptr pointcloud (new pcl::PointCloud<pcl::PointXYZRGBNormal>);

if (pcl::io::loadPCDFile(point_cloud_path, *pointcloud) == -1) // Loading pointcloud from file path.
{
// Error Catch
    PCL_ERROR("Could not load pointcloud\n");
}

// Number of points in cloud
point_cloud_size = pointcloud->size();

// Sanity Check
std::cout << "Loaded Pointcloud of size: " << point_cloud_size << std::endl;

// Create data vectors
std::vector<glm::vec3> t_position;
std::vector<glm::vec3> t_colour;

// Reserve space in vectors for data
t_position.reserve(point_cloud_size);
t_colour.reserve(point_cloud_size);

// pointer for pcl data
pcl::PointXYZRGBNormal point_ptr;

std::cout << "Converting Pointcloud into vectors" << std::endl;
// Convert pointcloud to individual components (NEEDS OPTIMIZING)
for (int i = 0; i<point_cloud_size; i++) {

// Loading Bar for point cloud conversion
    loadbar(i, point_cloud_size);

    point_ptr = pointcloud->at(i);

    t_position.push_back(glm::vec3(point_ptr.x, point_ptr.y, point_ptr.z));
    t_colour.push_back(glm::vec3(point_ptr.r/255.0, point_ptr.g/255.0, point_ptr.b/255.0));
}

Both pointclouds are loaded to VBO's and VAO's with the same method:两个点云都使用相同的方法加载到 VBO 和 VAO:

BindPointCloud(t_position,t_colour);

So I cannot see the binding being the issue.所以我看不出绑定是问题所在。

So I am pretty lost as to what the problem could be as it works fine on a workstation with a NVidia GPU but not an AMD one.所以我很不知道问题可能是什么,因为它在带有 NVidia GPU 但不是 AMD GPU 的工作站上运行良好。

Any advice?有什么建议吗?

除了 AMD 自己的工具, gDEBugger是一个很好的工具。

Problem was with the pointclouds coordinates.问题在于点云坐标。

There was a strange transformation being applied to the pointclouds so that they were not being rendered.对点云应用了一个奇怪的转换,因此它们没有被渲染。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM