hmennen90/php-vulkan
Composer 安装命令:
pie install hmennen90/php-vulkan
包简介
PHP Vulkan API bindings for 2D/3D graphics and GPU compute — built for PHPolygon engine
README 文档
README
PHP extension providing Vulkan API bindings for use with PHPolygon — a 2D/3D engine written in PHP.
Requirements
- PHP >= 8.1
- Vulkan SDK (LunarG / MoltenVK on macOS)
- C compiler (gcc/clang)
Installation
macOS / Linux (From Source)
# Install Vulkan SDK (macOS) brew install vulkan-sdk # Build the extension phpize ./configure --with-vulkan make make install
Add to your php.ini:
extension=vulkan
Windows
On Windows, no build toolchain is needed — PHP extensions are distributed as pre-compiled DLLs. Download the matching DLL from the Releases page (match your PHP version and thread-safety mode), then:
- Copy
php_vulkan.dllinto your PHPext\directory - Add
extension=vulkanto yourphp.ini - Restart PHP / your web server
Quick Start
<?php // Create Vulkan instance $instance = new Vk\Instance(appName: 'MyApp'); // List GPUs foreach ($instance->getPhysicalDevices() as $device) { echo $device->getName() . " (" . $device->getTypeName() . ")\n"; }
API Overview
All classes live in the Vk namespace:
| Class | Vulkan Object |
|---|---|
Vk\Instance |
VkInstance |
Vk\PhysicalDevice |
VkPhysicalDevice |
Vk\Device |
VkDevice |
Vk\Queue |
VkQueue |
Vk\Buffer |
VkBuffer |
Vk\DeviceMemory |
VkDeviceMemory |
Vk\CommandPool |
VkCommandPool |
Vk\CommandBuffer |
VkCommandBuffer |
Vk\ShaderModule |
VkShaderModule |
Vk\DescriptorSetLayout |
VkDescriptorSetLayout |
Vk\DescriptorPool |
VkDescriptorPool |
Vk\DescriptorSet |
VkDescriptorSet |
Vk\PipelineLayout |
VkPipelineLayout |
Vk\Pipeline |
VkPipeline |
Vk\RenderPass |
VkRenderPass |
Vk\Framebuffer |
VkFramebuffer |
Vk\Image |
VkImage |
Vk\ImageView |
VkImageView |
Vk\Sampler |
VkSampler |
Vk\Fence |
VkFence |
Vk\Semaphore |
VkSemaphore |
Vk\Swapchain |
VkSwapchainKHR |
Vk\Surface |
VkSurfaceKHR |
Constants are available via Vk\Vk::CONSTANT_NAME.
Examples
See the examples/ directory:
01_enumerate_devices.php— List all GPUs and their properties02_compute_shader.php— Run a compute shader (multiply by 2)03_memory_info.php— Buffer creation and memory operations
License
MIT
hmennen90/php-vulkan 适用场景与选型建议
hmennen90/php-vulkan 是一款 基于 C 开发的 Composer 扩展包,目前已累计 1 次下载、GitHub Stars 达 1, 最近一次更新时间为 2026 年 03 月 22 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「graphics」 「engine」 「game」 「compute」 「3d」 「2d」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 hmennen90/php-vulkan 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 hmennen90/php-vulkan 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 hmennen90/php-vulkan 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
A SilverStripe module to optimise the Meta, crawling, indexing, and sharing of your website content (forked from Cyber-Duck/Silverstripe-SEO)
SDL FFI bindings for the PHP language
A Processor for Markup written in PHP. Allows extraction of Markup into a data structure, orchestrated nested manipulation of said structure, and output as (optimized) Markup.
Image processing for PHP 5.3
Allow KoolReport to use twig template engine to render view
Simple template engine
统计信息
- 总下载量: 1
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 27
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2026-03-22