com.jme3.renderer.Renderer.startProfiling()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(1.6k)|赞(0)|评价(0)|浏览(92)

本文整理了Java中com.jme3.renderer.Renderer.startProfiling方法的一些代码示例,展示了Renderer.startProfiling的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Renderer.startProfiling方法的具体详情如下:
包路径:com.jme3.renderer.Renderer
类名称:Renderer
方法名:startProfiling

Renderer.startProfiling介绍

[英]Starts a time profiling task on the GPU. This will profile all operations called between startProfiling and stopProfiling
[中]在GPU上启动时间分析任务。这将分析startProfiling和StopperProfiling之间调用的所有操作

代码示例

代码示例来源:origin: jMonkeyEngine/jmonkeyengine

private void addStep(String path, long value) {
  if (ongoingGpuProfiling && renderer != null) {
    renderer.stopProfiling();
    ongoingGpuProfiling = false;
  }
  if (prevPath != null) {
    StatLine prevLine = data.get(prevPath);
    if (prevLine != null) {
      prevLine.setValueCpu(value - prevLine.getValueCpu());
    }
  }
  StatLine line = pool.get(path);
  if (line == null) {
    line = new StatLine(currentFrame);
    pool.put(path, line);
  }
  data.put(path, line);
  line.setNewFrameValueCpu(value);
  if (renderer != null) {
    int id = getUnusedTaskId();
    line.taskIds.add(id);
    renderer.startProfiling(id);
  }
  ongoingGpuProfiling = true;
  prevPath = path;
}

代码示例来源:origin: org.jmonkeyengine/jme3-core

private void addStep(String path, long value) {
  if (ongoingGpuProfiling && renderer != null) {
    renderer.stopProfiling();
    ongoingGpuProfiling = false;
  }
  if (prevPath != null) {
    StatLine prevLine = data.get(prevPath);
    if (prevLine != null) {
      prevLine.setValueCpu(value - prevLine.getValueCpu());
    }
  }
  StatLine line = pool.get(path);
  if (line == null) {
    line = new StatLine(currentFrame);
    pool.put(path, line);
  }
  data.put(path, line);
  line.setNewFrameValueCpu(value);
  if (renderer != null) {
    int id = getUnusedTaskId();
    line.taskIds.add(id);
    renderer.startProfiling(id);
  }
  ongoingGpuProfiling = true;
  prevPath = path;
}

相关文章