2.80's tile size recomandation is 32x32

This commit is contained in:
Laurent Clouet
2019-09-04 21:01:29 +02:00
parent 96a1b28bc0
commit 9065a1aef6
5 changed files with 5 additions and 112 deletions

View File

@@ -63,7 +63,6 @@ public class Configuration {
private String extras; private String extras;
private boolean autoSignIn; private boolean autoSignIn;
private String UIType; private String UIType;
private int tileSize;
private String hostname; private String hostname;
public Configuration(File cache_dir_, String login_, String password_) { public Configuration(File cache_dir_, String login_, String password_) {
@@ -90,7 +89,6 @@ public class Configuration {
this.extras = ""; this.extras = "";
this.autoSignIn = false; this.autoSignIn = false;
this.UIType = null; this.UIType = null;
this.tileSize = -1; // ie not set
} }

View File

@@ -168,7 +168,7 @@ public class Job {
} }
core_script += ignore_signal_script; core_script += ignore_signal_script;
core_script += String.format("bpy.context.scene.render.tile_x = %1$d\nbpy.context.scene.render.tile_y = %1$d\n", getTileSize()); core_script += String.format("bpy.context.scene.render.tile_x = %1$d\nbpy.context.scene.render.tile_y = %1$d\n", 32);
File script_file = null; File script_file = null;
String command1[] = getRendererCommand().split(" "); String command1[] = getRendererCommand().split(" ");
int size_command = command1.length + 2; // + 2 for script int size_command = command1.length + 2; // + 2 for script
@@ -762,20 +762,6 @@ public class Job {
return Type.OK; return Type.OK;
} }
public int getTileSize() {
if (configuration.getTileSize() == -1) { // not set
int size = 32; // CPU
GPUDevice gpu = this.configuration.getGPUDevice();
if (isUseGPU() && gpu != null) {
return gpu.getRecommandedTileSize();
}
return size;
}
else {
return configuration.getTileSize();
}
}
public static class renderStartedObservable extends Observable { public static class renderStartedObservable extends Observable {
@Getter @Getter

View File

@@ -56,7 +56,6 @@ public class SettingsLoader {
private String cacheDir; private String cacheDir;
private String autoSignIn; private String autoSignIn;
private String ui; private String ui;
private String tileSize;
private int priority; private int priority;
public SettingsLoader(String path_) { public SettingsLoader(String path_) {
@@ -68,7 +67,7 @@ public class SettingsLoader {
} }
} }
public SettingsLoader(String path_, String login_, String password_, String proxy_, String hostname_, ComputeType computeMethod_, GPUDevice gpu_, int cores_, long maxRam_, int maxRenderTime_, String cacheDir_, boolean autoSignIn_, String ui_, String tileSize_, int priority_) { public SettingsLoader(String path_, String login_, String password_, String proxy_, String hostname_, ComputeType computeMethod_, GPUDevice gpu_, int cores_, long maxRam_, int maxRenderTime_, String cacheDir_, boolean autoSignIn_, String ui_, int priority_) {
if (path_ == null) { if (path_ == null) {
path = getDefaultFilePath(); path = getDefaultFilePath();
} }
@@ -82,7 +81,6 @@ public class SettingsLoader {
cacheDir = cacheDir_; cacheDir = cacheDir_;
autoSignIn = String.valueOf(autoSignIn_); autoSignIn = String.valueOf(autoSignIn_);
ui = ui_; ui = ui_;
tileSize = tileSize_;
priority = priority_; priority = priority_;
if (cores_ > 0) { if (cores_ > 0) {
cores = String.valueOf(cores_); cores = String.valueOf(cores_);
@@ -169,10 +167,6 @@ public class SettingsLoader {
prop.setProperty("ui", ui); prop.setProperty("ui", ui);
} }
if (tileSize != null) {
prop.setProperty("tile-size", tileSize);
}
prop.store(output, null); prop.store(output, null);
} }
catch (IOException io) { catch (IOException io) {
@@ -215,7 +209,6 @@ public class SettingsLoader {
this.cacheDir = null; this.cacheDir = null;
this.autoSignIn = null; this.autoSignIn = null;
this.ui = null; this.ui = null;
this.tileSize = null;
this.priority = 19; // must be the same default as Configuration this.priority = 19; // must be the same default as Configuration
this.ram = null; this.ram = null;
this.renderTime = null; this.renderTime = null;
@@ -282,10 +275,6 @@ public class SettingsLoader {
this.ui = prop.getProperty("ui"); this.ui = prop.getProperty("ui");
} }
if (prop.containsKey("tile-size")) {
this.tileSize = prop.getProperty("tile-size");
}
if (prop.containsKey("priority")) { if (prop.containsKey("priority")) {
this.priority = Integer.parseInt(prop.getProperty("priority")); this.priority = Integer.parseInt(prop.getProperty("priority"));
} }
@@ -369,10 +358,6 @@ public class SettingsLoader {
config.setUIType(ui); config.setUIType(ui);
} }
if (config.getTileSize() == -1 && tileSize != null) {
config.setTileSize(Integer.valueOf(tileSize));
}
config.setAutoSignIn(Boolean.valueOf(autoSignIn)); config.setAutoSignIn(Boolean.valueOf(autoSignIn));
} }

View File

@@ -79,11 +79,4 @@ public class GPUDevice {
public String toString() { public String toString() {
return "GPUDevice [type=" + type + ", model='" + model + "', memory=" + memory + ", id=" + id + "]"; return "GPUDevice [type=" + type + ", model='" + model + "', memory=" + memory + ", id=" + id + "]";
} }
public int getRecommandedTileSize() {
// GPU
// if the vram is lower than 1G reduce the size of tile to avoid black output
return (getMemory() > 1073741824L) ? 256 : 128;
}
} }

View File

@@ -84,10 +84,6 @@ public class Settings implements Activity {
private boolean haveAutoStarted; private boolean haveAutoStarted;
private JTextField tileSizeValue;
private JLabel tileSizeLabel;
private JCheckBox customTileSize;
public Settings(GuiSwing parent_) { public Settings(GuiSwing parent_) {
parent = parent_; parent = parent_;
cacheDir = null; cacheDir = null;
@@ -321,7 +317,7 @@ public class Settings implements Activity {
parent.getContentPane().add(compute_devices_panel, constraints); parent.getContentPane().add(compute_devices_panel, constraints);
// other // other
CollapsibleJPanel advanced_panel = new CollapsibleJPanel(new GridLayout(5, 2)); CollapsibleJPanel advanced_panel = new CollapsibleJPanel(new GridLayout(3, 2));
advanced_panel.setBorder(BorderFactory.createTitledBorder("Advanced options")); advanced_panel.setBorder(BorderFactory.createTitledBorder("Advanced options"));
JLabel proxyLabel = new JLabel("Proxy:"); JLabel proxyLabel = new JLabel("Proxy:");
@@ -351,30 +347,6 @@ public class Settings implements Activity {
advanced_panel.add(renderTimeLabel); advanced_panel.add(renderTimeLabel);
advanced_panel.add(renderTime); advanced_panel.add(renderTime);
JLabel customTileSizeLabel = new JLabel("Custom render tile size:");
customTileSize = new JCheckBox("", config.getTileSize() != -1);
advanced_panel.add(customTileSizeLabel);
advanced_panel.add(customTileSize);
customTileSize.addActionListener(new TileSizeChange());
tileSizeLabel = new JLabel("Tile Size:");
tileSizeValue = new JTextField();
int fromConfig = parent.getConfiguration().getTileSize();
if (fromConfig == -1) {
if (parent.getConfiguration().getGPUDevice() != null) {
fromConfig = parent.getConfiguration().getGPUDevice().getRecommandedTileSize();
}
else {
fromConfig = 32;
}
}
tileSizeValue.setText(Integer.toString(fromConfig));
hideCustomTileSize(config.getTileSize() != -1, false);
advanced_panel.add(tileSizeLabel);
advanced_panel.add(tileSizeValue);
currentRow++; currentRow++;
constraints.gridx = 0; constraints.gridx = 0;
constraints.gridy = currentRow; constraints.gridy = currentRow;
@@ -420,14 +392,6 @@ public class Settings implements Activity {
} }
} }
public void hideCustomTileSize(boolean hidden, boolean displayWarning) {
tileSizeValue.setVisible(hidden);
tileSizeLabel.setVisible(hidden);
if (customTileSize.isSelected() == true && displayWarning) {
JOptionPane.showMessageDialog(parent.getContentPane(), "<html>These settings should only be changed if you are an advanced user.<br /> Improper settings may lead to invalid and slower renders!</html>", "Warning: Advanced Users Only!", JOptionPane.WARNING_MESSAGE);
}
}
public boolean checkDisplaySaveButton() { public boolean checkDisplaySaveButton() {
boolean selected = useCPU.isSelected(); boolean selected = useCPU.isSelected();
for (JCheckBoxGPU box : useGPUs) { for (JCheckBoxGPU box : useGPUs) {
@@ -439,14 +403,6 @@ public class Settings implements Activity {
selected = false; selected = false;
} }
if (customTileSize.isSelected()) {
try {
Integer.parseInt(tileSizeValue.getText().replaceAll(",", ""));
}
catch (NumberFormatException e) {
selected = false;
}
}
saveButton.setEnabled(selected); saveButton.setEnabled(selected);
return selected; return selected;
} }
@@ -496,15 +452,6 @@ public class Settings implements Activity {
} }
} }
class TileSizeChange implements ActionListener {
@Override
public void actionPerformed(ActionEvent e) {
boolean custom = customTileSize.isSelected();
hideCustomTileSize(custom, true);
}
}
class SaveAction implements ActionListener { class SaveAction implements ActionListener {
@Override @Override
@@ -590,22 +537,6 @@ public class Settings implements Activity {
} }
} }
String tile = null;
if (customTileSize.isSelected() && tileSizeValue != null) {
try {
tile = tileSizeValue.getText().replaceAll(",", "");
config.setTileSize(Integer.parseInt(tile));
}
catch (NumberFormatException e1) {
System.err.println("Error: wrong tile format");
System.err.println(e1);
System.exit(2);
}
}
else {
config.setTileSize(-1); // no tile
}
parent.setCredentials(login.getText(), new String(password.getPassword())); parent.setCredentials(login.getText(), new String(password.getPassword()));
String cachePath = null; String cachePath = null;
@@ -619,7 +550,7 @@ public class Settings implements Activity {
} }
if (saveFile.isSelected()) { if (saveFile.isSelected()) {
parent.setSettingsLoader(new SettingsLoader(config.getConfigFilePath(), login.getText(), new String(password.getPassword()), proxyText, hostnameText, method, selected_gpu, cpu_cores, max_ram, max_rendertime, cachePath, autoSignIn.isSelected(), GuiSwing.type, tile, priority.getValue())); parent.setSettingsLoader(new SettingsLoader(config.getConfigFilePath(), login.getText(), new String(password.getPassword()), proxyText, hostnameText, method, selected_gpu, cpu_cores, max_ram, max_rendertime, cachePath, autoSignIn.isSelected(), GuiSwing.type, priority.getValue()));
} }
} }
} }