Skip to content

Commit

Permalink
Updated Vulkan and Validation Layers
Browse files Browse the repository at this point in the history
  • Loading branch information
MarconZet committed Sep 26, 2019
1 parent 60087a3 commit c9bb3b0
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
4 changes: 2 additions & 2 deletions graphics/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ repositories {
}

project.ext.lwjglNatives = "natives-${platform}"
project.ext.lwjglVersion = "3.2.1"
project.ext.jomlVersion = "1.9.13"
project.ext.lwjglVersion = "3.2.3"
project.ext.jomlVersion = "1.9.17"

dependencies {
implementation project(':core')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
public class GraphicsConfig {
//TODO this staff should come form config, and not be hardcoded
public static final boolean ENABLE_VALIDATION_LAYERS = true;
public static final String[] VALIDATION_LAYERS = {"VK_LAYER_LUNARG_standard_validation", "VK_LAYER_RENDERDOC_Capture"};
public static final String[] VALIDATION_LAYERS = {"VK_LAYER_KHRONOS_validation"};
public static final String[] VALIDATION_LAYERS_INSTANCE_EXTENSIONS = {VK_EXT_DEBUG_REPORT_EXTENSION_NAME};
public static final String[] INSTANCE_EXTENSIONS = {VK_KHR_SURFACE_EXTENSION_NAME};
public static final String[] DEVICE_EXTENSIONS = {VK_KHR_SWAPCHAIN_EXTENSION_NAME, VK_KHR_GET_MEMORY_REQUIREMENTS_2_EXTENSION_NAME};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import org.slf4j.LoggerFactory;

import static org.lwjgl.glfw.GLFW.glfwPollEvents;
import static org.lwjgl.vulkan.VK10.vkDeviceWaitIdle;

/**
* @author MarconZet
Expand Down Expand Up @@ -52,6 +53,7 @@ public void update(int delta) {

@Override
protected void onClose() {
vkDeviceWaitIdle(instanceManager.getDevice().get());
logger.info("Destroying Vulkan instance and static resources");
graphicsPipeline.destroy();
renderPass.destroy();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,9 @@ public void create(){
.pApplicationInfo(appInfo)
.ppEnabledExtensionNames(ppEnabledExtensionNames)
.ppEnabledLayerNames(ppEnabledLayerNames);
PointerBuffer pInstance = memAllocPointer(1);
PointerBuffer pInstance = BufferUtils.createPointerBuffer(1);
int err = vkCreateInstance(pCreateInfo, null, pInstance);
long instance = pInstance.get(0);
memFree(pInstance);
if (err != VK_SUCCESS) {
throw new VulkanAssertionError("Failed to create VkInstance", err);
}
Expand Down

0 comments on commit c9bb3b0

Please sign in to comment.