Nicolas Cannasse 3 năm trước cách đây
mục cha
commit
f1cfc4f181
2 tập tin đã thay đổi với 22 bổ sung0 xóa
  1. 12 0
      libs/sdl/sdl/Vulkan.hx
  2. 10 0
      libs/sdl/vulkan.c

+ 12 - 0
libs/sdl/sdl/Vulkan.hx

@@ -1218,6 +1218,12 @@ enum abstract VkSharingMode(Int) {
 	}
 }
 
+@:struct class VkDeviceSize {
+	public var low : Int;
+	public var high : Int;
+	public function new(v=0) { low = v; }
+}
+
 enum VkMemoryPropertyFlag {
     DEVICE_LOCAL;
     HOST_VISIBLE;
@@ -1338,9 +1344,15 @@ abstract VkCommandBuffer(hl.Abstract<"vk_command_buffer">) {
 	public function bindIndexBuffer( buffer : VkBuffer, offset : Int, indexType : Int ) {
 	}
 
+	public function bindVertexBuffers( first : Int, count : Int, buffers : ArrayStruct<VkBuffer>, offsets : ArrayStruct<VkDeviceSize> ) {
+	}
+
 	public function beginRenderPass( begin : VkRenderPassBeginInfo, contents : VkSubpassContents ) {
 	}
 
+	public function endRenderPass() {
+	}
+
 }
 
 @:hlNative("?sdl","vk_")

+ 10 - 0
libs/sdl/vulkan.c

@@ -507,12 +507,22 @@ HL_PRIM void HL_NAME(vk_bind_index_buffer)( VkCommandBuffer out, VkBuffer buf, i
 	vkCmdBindIndexBuffer(out, buf, offset, type);
 }
 
+HL_PRIM void HL_NAME(vk_bind_vertex_buffers)( VkCommandBuffer out, int first, int count, VkBuffer *buffers, VkDeviceSize *sizes ) {
+	vkCmdBindVertexBuffers(out, first, count, buffers, sizes);
+}
+
+HL_PRIM void HL_NAME(vk_end_render_pass)( VkCommandBuffer out ) {
+	vkCmdEndRenderPass(out);
+}
+
 DEFINE_PRIM(_VOID, vk_clear_color_image, _CMD _IMAGE _F64 _F64 _F64 _F64);
 DEFINE_PRIM(_VOID, vk_clear_depth_stencil_image, _CMD _IMAGE _F64 _I32);
 DEFINE_PRIM(_VOID, vk_draw_indexed, _CMD _I32 _I32 _I32 _I32 _I32);
 DEFINE_PRIM(_VOID, vk_bind_pipeline, _CMD _I32 _GPIPELINE);
 DEFINE_PRIM(_VOID, vk_begin_render_pass, _CMD _STRUCT _I32);
 DEFINE_PRIM(_VOID, vk_bind_index_buffer, _CMD _BUFFER _I32 _I32);
+DEFINE_PRIM(_VOID, vk_bind_vertex_buffers, _CMD _I32 _I32 _BYTES _BYTES);
+DEFINE_PRIM(_VOID, vk_end_render_pass, _CMD);
 
 // ------ SHADER COMPILATION ------------------------------