Skip to content

Commit

Permalink
javadoc, comments, and whitespace
Browse files Browse the repository at this point in the history
  • Loading branch information
stephengold committed Jul 13, 2023
1 parent f1f9778 commit 96b1d53
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 9 deletions.
2 changes: 1 addition & 1 deletion common.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ dependencies {
implementation 'org.joml:joml:1.10.5'
implementation 'org.lwjgl:lwjgl'
implementation 'org.lwjgl:lwjgl-glfw'
implementation 'org.lwjgl:lwjgl-shaderc'
implementation 'org.lwjgl:lwjgl-shaderc' // to compile GLSL into SPIR-V
implementation 'org.lwjgl:lwjgl-vulkan'
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -485,8 +485,8 @@ static void copyBuffer(long sourceHandle, long destHandle, long size) {
* @param bufferBytes the desired size in bytes
* @param usage a bitmask
* @param requiredProperties a bitmask
* @param pBuffer to store the handle of the buffer object (not null,
* modified)
* @param pBuffer to store the handle of the resulting buffer object (not
* null, modified)
* @param pMemory to store the handle of the buffer's memory (not null,
* modified)
*/
Expand Down Expand Up @@ -531,8 +531,8 @@ static void createBuffer(long bufferBytes, int usage,

// Bind the newly allocated memory to the buffer object:
int offset = 0;
retCode = VK10.vkBindBufferMemory(logicalDevice, bufferHandle,
memoryHandle, offset);
retCode = VK10.vkBindBufferMemory(
logicalDevice, bufferHandle, memoryHandle, offset);
Utils.checkForError(retCode, "bind memory to a buffer object");
}
}
Expand Down Expand Up @@ -1802,7 +1802,8 @@ private static void initializeGlfw(String initialTitle) {
}

// Request callback when the frame buffer of the main window is resized:
GLFW.glfwSetFramebufferSizeCallback(windowHandle, BaseApplication::frameBufferResizeCallback);
GLFW.glfwSetFramebufferSizeCallback(
windowHandle, BaseApplication::frameBufferResizeCallback);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,13 +106,15 @@ class BufferResource {
stagingMemoryHandle, offset, numBytes, flags, pPointer);
Utils.checkForError(retCode, "map staging buffer's memory");

int index = 0;
int index = 0; // the index within pPointer
this.data = pPointer.getByteBuffer(index, numBytes);
fill(data);
this.data = null;
VK10.vkUnmapMemory(logicalDevice, stagingMemoryHandle);

// Create the buffer:
/*
* Create a device-local buffer that's optimized for being a
* copy destination:
*/
createUsage = usage | VK10.VK_BUFFER_USAGE_TRANSFER_DST_BIT;
properties = VK10.VK_MEMORY_HEAP_DEVICE_LOCAL_BIT;
BaseApplication.createBuffer(numBytes, createUsage,
Expand Down

0 comments on commit 96b1d53

Please sign in to comment.