Commit c7612d1
gpu: Add Vulkan unit test framework (#2243)
* Add release signing workflow using Sigstore (#2229)
This adds a GitHub Actions workflow that signs release artifacts
using Sigstore, following the OpenSSF Best Practices Badge
recommendations. The workflow is triggered on release publication
and:
1. Creates a .tar.gz archive of the source tree
2. Signs the archive using sigstore/gh-action-sigstore-python
3. Uploads both the tarball and .sigstore.json credential bundle
Based on the OpenEXR release-sign.yml workflow template.
Closes #2034
Signed-off-by: pmady <pavan4devops@gmail.com>
Co-authored-by: Doug Walker <doug.walker@autodesk.com>
Signed-off-by: pmady <pavan4devops@gmail.com>
* gpu: Add Vulkan unit test framework
Add initial Vulkan support for GPU unit testing in OpenColorIO.
This commit introduces:
- vulkanapp.h/cpp: Headless Vulkan rendering framework for GPU tests
- CMakeLists.txt updates: Conditional Vulkan build support with OCIO_VULKAN_ENABLED
- GPUUnitTest.cpp: --vulkan flag to run tests with Vulkan renderer
The Vulkan implementation uses compute shaders for color processing,
similar to the existing OpenGL and Metal implementations. It supports
headless rendering suitable for CI environments.
Note: GLSL to SPIR-V compilation requires linking against glslang or
shaderc library (marked as TODO in the implementation).
Issue Number: close #2209
Signed-off-by: pmady <pavan4devops@gmail.com>
* gpu: Implement GLSL to SPIR-V compilation using glslang
Add glslang library dependency for runtime GLSL to SPIR-V compilation
in the Vulkan unit test framework. This enables the Vulkan GPU tests
to actually run by compiling OCIO-generated GLSL shaders to SPIR-V.
Changes:
- CMakeLists.txt: Add find_package(glslang) and link glslang libraries
- vulkanapp.cpp: Implement compileGLSLToSPIRV() using glslang API
The implementation:
- Initializes glslang process (thread-safe, one-time init)
- Configures Vulkan 1.2 / SPIR-V 1.5 target environment
- Parses GLSL compute shader source
- Links shader program
- Generates optimized SPIR-V bytecode
Signed-off-by: pmady <pavan4devops@gmail.com>
* docs: Add comprehensive Vulkan testing guides for PR #2243
Add detailed testing documentation to help reviewers and contributors
test the Vulkan unit test framework locally.
Files added:
- VULKAN_TESTING_GUIDE.md: Comprehensive guide with installation
instructions for macOS, Linux, and Windows, build configuration,
troubleshooting, and platform-specific notes
- QUICK_TEST_STEPS.md: Quick reference guide with fast-track
installation and testing steps for each platform
These guides address the request from @doug-walker to provide
instructions for installing Vulkan SDK and glslang dependencies
needed to test the Vulkan branch locally.
Signed-off-by: pmady <pavan4devops@gmail.com>
* Remove testing guide files - will provide as PR comment instead
Signed-off-by: pmady <pavan4devops@gmail.com>
* fix: Change Vulkan CMake definitions from PRIVATE to PUBLIC
Address feedback from @doug-walker regarding build issues:
- Change target_include_directories from PRIVATE to PUBLIC
- Change target_link_libraries from PRIVATE to PUBLIC
- Change target_compile_definitions from PRIVATE to PUBLIC
This allows dependent targets (like test_gpu_exec) to properly
access the OCIO_VULKAN_ENABLED definition and Vulkan libraries.
Signed-off-by: pmady <pavan4devops@gmail.com>
* fix: Add MoltenVK portability extension for macOS
Add VK_KHR_PORTABILITY_ENUMERATION extension and flag for macOS
to enable Vulkan instance creation with MoltenVK.
Signed-off-by: pmady <pavan4devops@gmail.com>
* feat: Integrate Vulkan test framework into GPU unit tests
Complete Vulkan test integration for OpenColorIO GPU unit tests:
- Add Vulkan-specific helper functions in GPUUnitTest.cpp:
- AllocateImageTexture for VulkanApp
- UpdateImageTexture for VulkanApp
- UpdateOCIOVulkanState for VulkanApp
- ValidateImageTexture for VulkanApp
- Wire VulkanApp into test execution loop with proper branching
- Fix VulkanApp initialization:
- Add MoltenVK portability extension for macOS
- Add bounds checking in compute shader
- Fix cleanup order to destroy VulkanBuilder before device
- Fix CMake: Change PRIVATE to PUBLIC for Vulkan definitions
Test Results (macOS with MoltenVK):
- 155 tests PASSED (all non-LUT operations)
- 108 tests FAILED (LUT1D/LUT3D - require texture sampler support)
The LUT tests fail because 3D texture sampler support is not yet
implemented in VulkanBuilder. This is a known limitation that
requires additional work to implement texture allocation and
descriptor set updates for LUT textures.
Signed-off-by: pmady <pavan4devops@gmail.com>
* Add Vulkan uniform buffer and LUT texture support
- Implement VulkanBuilder uniform buffer creation and update for dynamic parameters
- Add 3D LUT texture allocation with RGBA format (RGB32F not supported on MoltenVK)
- Add 1D/2D LUT texture allocation with proper format handling
- Fix shader generation to use correct descriptor bindings for textures and uniforms
- Add std140 layout qualifier to OCIO uniform blocks
- Update descriptor set layout and pool sizes to include uniforms and textures
- Call updateUniforms() before each dispatch for dynamic parameter updates
Test results: 216/263 tests pass (82%)
Remaining failures are complex uniform blocks with vec3 types that need
additional std140 alignment handling.
Signed-off-by: pmady <pavan4devops@gmail.com>
* Fix Vulkan uniform buffer layout and 1D texture handling
- Use OCIO's getUniformBufferSize() and m_bufferOffset for correct std140 layout
- Write array data with 16-byte stride per element (std140 requirement)
- Add std140 layout qualifier to uniform blocks in shader generation
- Disable 1D textures for Vulkan (use 2D instead) for MoltenVK compatibility
- Add better exception handling in GPU unit tests for debugging
This fixes 108 additional Vulkan GPU tests, bringing the pass rate from
155/263 (59%) to 260/263 (98.9%). The 3 remaining failures are ACES2
precision-sensitive edge cases that may need Vulkan-specific tolerance
adjustments.
Signed-off-by: pmady <pavan4devops@gmail.com>
* Use OCIO's getTextureShaderBindingIndex API for Vulkan texture bindings
- Remove manual sampler declarations in buildShader(), use OCIO-generated ones
- Configure shader descriptor with setDescriptorSetIndex(0, 2) for Vulkan
to start texture bindings at 2 (after input/output storage buffers)
- Use get3DTextureShaderBindingIndex() and getTextureShaderBindingIndex()
for correct texture binding indices
- Add GPU diagnostic output to verify MoltenVK uses actual GPU hardware
This addresses review feedback from PR #2243 to use the new texture binding
API added in OCIO 2.5.1 (PR #2226) instead of manually declaring samplers.
Test results: 260/263 tests pass (98.9%)
Remaining 3 failures are ACES2 precision-sensitive edge cases.
GPU confirmed: Apple M2 Pro (Integrated GPU), not CPU emulation.
Signed-off-by: pmady <pavan4devops@gmail.com>
* Address PR review comments for Vulkan unit test framework
- Fix switch warning by explicitly handling VK_PHYSICAL_DEVICE_TYPE_OTHER
and VK_PHYSICAL_DEVICE_TYPE_MAX_ENUM cases
- Fix unused format parameter warning in transitionImageLayout
- Move input/output buffers to high bindings (100, 101) to avoid conflicts
with OCIO's uniform binding at 0, eliminating need to edit shader text
- Refactor GPUUnitTest.cpp to share code between GL and Vulkan:
- Extract PrepareInputValues helper for UpdateImageTexture
- Extract ValidateResults and ValidateImageTextureImpl template for
ValidateImageTexture
- Preserve Mac ARM ifdef for NaN/Infinity test disabling in Vulkan path
- Update texture binding start to 1 (was 2) since binding 0 is now used
for OCIO uniforms
Signed-off-by: pmady <pavan4devops@gmail.com>
* Address PR review: use consecutive bindings and increase tolerances
- Change input/output buffer bindings from 100/101 to 1/2
- Update setDescriptorSetIndex(0, 3) so textures start at binding 3
- Increase test tolerances as requested:
- Test 39 (line 306): 3e-6f -> 3e-5f
- Test 49 (line 659): 0.018f -> 0.019f
- Test 51 (line 696): 0.03f -> 0.032f
- Update comments to reflect the new binding strategy
Signed-off-by: pmady <pavan4devops@gmail.com>
---------
Signed-off-by: pmady <pavan4devops@gmail.com>
Co-authored-by: Doug Walker <doug.walker@autodesk.com>1 parent d9eb50c commit c7612d1
File tree
5 files changed
+2113
-86
lines changed- src/libutils/oglapphelpers
- tests/gpu
5 files changed
+2113
-86
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
34 | 49 | | |
35 | 50 | | |
36 | 51 | | |
| |||
111 | 126 | | |
112 | 127 | | |
113 | 128 | | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
114 | 147 | | |
115 | 148 | | |
116 | 149 | | |
| |||
0 commit comments