Skip to content

Commit

Permalink
up
Browse files Browse the repository at this point in the history
  • Loading branch information
elect86 committed May 4, 2018
1 parent 8350899 commit 061edcc
Show file tree
Hide file tree
Showing 4 changed files with 378 additions and 4 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ dependencies {

compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlinVersion"

compile 'com.github.kotlin-graphics:uno-sdk:fc409fb08a40a21a30296459c00e9b3507206136'
compile 'com.github.kotlin-graphics:uno-sdk:fc67ccf36c7da5baffa41efab4c5911be41c9c77'
compile 'com.github.kotlin-graphics:assimp:2ba2dbbd3782c51a1349ac1a050b20e5b992b1dc'

ext.spirvCrossVersion = "0.4.0"
Expand Down
1 change: 1 addition & 0 deletions src/main/kotlin/vkn/vk.kt
Original file line number Diff line number Diff line change
Expand Up @@ -474,6 +474,7 @@ object vk {

inline fun SpecializationInfo(): VkSpecializationInfo = VkSpecializationInfo.create(ptr.advance(VkSpecializationInfo.SIZEOF))
inline fun SpecializationInfo(capacity: Int): VkSpecializationInfo.Buffer = VkSpecializationInfo.create(ptr.advance(VkSpecializationInfo.SIZEOF * capacity), capacity)
inline fun SpecializationInfo(block: VkSpecializationInfo.() -> Unit): VkSpecializationInfo = VkSpecializationInfo.create(ptr.advance(VkSpecializationInfo.SIZEOF)).also(block)

inline fun SubpassDependency(capacity: Int): VkSubpassDependency.Buffer = VkSubpassDependency.create(ptr.advance(VkSubpassDependency.SIZEOF * capacity), capacity)

Expand Down
6 changes: 3 additions & 3 deletions src/main/kotlin/vulkan/base/VulkanModel.kt
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,8 @@ class Model {
}
if(::vertexBuffer.isInitialized)
vertexBuffer.destroy()
if(::vertexBuffer.isInitialized)
vertexBuffer.destroy()
if(::indexBuffer.isInitialized)
indexBuffer.destroy()
}

/**
Expand Down Expand Up @@ -242,7 +242,7 @@ class Model {
val memoryProps = VkMemoryProperty.HOST_VISIBLE_BIT or VkMemoryProperty.HOST_COHERENT_BIT

vertexBuffer = floatBufferOf(vertices)
// indexBuffer = intBufferOf(indices)
indexBuffer = intBufferOf(indices)
// Vertex buffer
device.createBuffer(VkBufferUsage.TRANSFER_SRC_BIT.i, memoryProps, vertexStaging, vertexBuffer)
// Index buffer
Expand Down
Loading

0 comments on commit 061edcc

Please sign in to comment.