added a constructor that disables the program cache: used during development

define_list_fix
shamanDevel 9 years ago
parent a2df82b9e0
commit e35bb7dcbc
  1. 4
      jme3-core/src/main/java/com/jme3/opencl/OpenCLObjectManager.java
  2. 15
      jme3-core/src/main/java/com/jme3/opencl/ProgramCache.java

@ -43,8 +43,8 @@ import java.util.logging.Logger;
*/
public class OpenCLObjectManager {
private static final Logger LOG = Logger.getLogger(OpenCLObjectManager.class.getName());
private static final Level LOG_LEVEL1 = Level.INFO;
private static final Level LOG_LEVEL2 = Level.INFO;
private static final Level LOG_LEVEL1 = Level.FINER;
private static final Level LOG_LEVEL2 = Level.FINE;
/**
* Call Runtime.getRuntime().gc() every these frames
*/

@ -59,6 +59,21 @@ public class ProgramCache {
private final Device device;
private final File tmpFolder;
/**
* Creates a "disabled" program cache, no caching is done.
* {@link #loadFromCache(java.lang.String) } will always return {@code null}
* and {@link #saveToCache(java.lang.String, com.jme3.opencl.Program) } does
* nothing.<br>
* Use this during development if you still modify your kernel code.
* (Otherwise, you don't see the changes because you are still use the
* cached version of your program)
*/
public ProgramCache() {
this.context = null;
this.device = null;
this.tmpFolder = null;
}
/**
* Creates a new program cache associated with the specified context and
* devices.

Loading…
Cancel
Save