Skip to content

Commit 286c146

Browse files
committed
Vulkan, bugfix for loading spv
1 parent 19b7689 commit 286c146

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

graphics-by-opengl-j2se/src/main/java/com/nucleus/io/StreamUtils.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ public static byte[] readFromStream(InputStream in, int buffersize) throws IOExc
140140
public static int readFromName(String name, ByteBuffer buffer) throws IOException, URISyntaxException {
141141
ClassLoader loader = StreamUtils.class.getClassLoader();
142142
InputStream is = loader.getResourceAsStream(name);
143-
int loaded = readFromStream(is, buffer, -1);
143+
int loaded = readFromStream(is, buffer, buffer.limit() - buffer.position());
144144
is.close();
145145
return loaded;
146146
}

graphics-by-opengl-j2se/src/main/java/com/nucleus/vulkan/GLSLCompiler.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ public void compileStage(String path, ArrayList<String> folders, ByteBuffer buff
6969
String output = null;
7070
for (String filename : filenames) {
7171
String filePath = FileUtils.getInstance().getFilePath(path + filename, folder);
72-
name = filename.substring(0, filename.length() - (type.fileName.length() + 1));
72+
name = filename.substring(0, filename.length() - (stageSuffix.length()));
7373
output = name + type.fileName;
7474
String cmd = "glslc " + filename + " -o -";
7575
buffer.clear();

0 commit comments

Comments
 (0)