Skip to content

Commit bc9e6d9

Browse files
committed
Add Metal preview and OpenGL selection regression
Add a CPU-driven Metal preview implementation and an OpenGL selection regression test. Metal: implement RendererTextureBackendState, build RGBA float pixels via OpenImageIO, generate preview pixels with exposure/gamma/offset, color modes, orientation and heatmap, create/upload RGBA32Float Metal textures, manage texture lifecycle and expose ImGui texture refs; also set CAMetalLayer framebufferOnly and minor cleanup. Tests/docs: add imiv_opengl_selection_regression.py and wire it into CMake to run when OpenGL is enabled; update imiv_backends.md to reflect OpenGL partial feature coverage and Metal development status. This enables immediate preview/testing on macOS while GPU-native Metal preview pipeline remains planned.
1 parent 7fce7e0 commit bc9e6d9

4 files changed

Lines changed: 777 additions & 40 deletions

File tree

src/imiv/CMakeLists.txt

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1043,6 +1043,23 @@ if (TARGET imiv
10431043
imiv_selection_regression PROPERTIES
10441044
LABELS "imiv;gui"
10451045
TIMEOUT 360)
1046+
1047+
if (_imiv_renderer_is_opengl)
1048+
add_test (
1049+
NAME imiv_opengl_selection_regression
1050+
COMMAND
1051+
"${Python3_EXECUTABLE}"
1052+
"${CMAKE_CURRENT_SOURCE_DIR}/tools/imiv_opengl_selection_regression.py"
1053+
--bin "$<TARGET_FILE:imiv>"
1054+
--cwd "$<TARGET_FILE_DIR:imiv>"
1055+
--oiiotool "$<TARGET_FILE:oiiotool>"
1056+
--env-script "${CMAKE_BINARY_DIR}/imiv_env.sh"
1057+
--out-dir "${CMAKE_BINARY_DIR}/imiv_captures/opengl_selection_regression")
1058+
set_tests_properties (
1059+
imiv_opengl_selection_regression PROPERTIES
1060+
LABELS "imiv;imiv_opengl;gui"
1061+
TIMEOUT 360)
1062+
endif ()
10461063
elseif (TARGET imiv
10471064
AND OIIO_BUILD_TESTS
10481065
AND BUILD_TESTING)

src/imiv/imiv_backends.md

Lines changed: 24 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -67,14 +67,14 @@ Legend:
6767
|---|---|---|---|
6868
| App bootstrap and main window | Yes | Yes | Yes |
6969
| Dear ImGui backend | Yes | Yes | Yes |
70-
| Direct image upload | Yes | Yes | No |
71-
| Preview rendering | Yes | Yes | No |
72-
| Exposure / gamma / offset | Yes | Yes | No |
73-
| Channel / luma / heatmap modes | Yes | Yes | No |
74-
| Orientation-aware preview | Yes | Yes | No |
75-
| Linear / nearest preview sampling | Yes | Yes | No |
76-
| Pixel closeup window | Yes | Yes | No |
77-
| Area Sample / selection UI | Yes | Yes | No |
70+
| Direct image upload | Yes | Yes | Partial |
71+
| Preview rendering | Yes | Yes | Partial |
72+
| Exposure / gamma / offset | Yes | Yes | Partial |
73+
| Channel / luma / heatmap modes | Yes | Yes | Partial |
74+
| Orientation-aware preview | Yes | Yes | Partial |
75+
| Linear / nearest preview sampling | Yes | Yes | Partial |
76+
| Pixel closeup window | Yes | Yes | Partial |
77+
| Area Sample / selection UI | Yes | Yes | Partial |
7878
| Drag and drop | Yes | Yes | Yes |
7979
| Screenshot / readback | Yes | Yes | No |
8080
| OCIO display/view | Yes | Yes | No |
@@ -145,8 +145,6 @@ Current design:
145145

146146
Current gaps:
147147

148-
- no live OCIO display/view update regression equivalent to Vulkan yet
149-
- no dedicated OpenGL selection/interaction regression target yet
150148
- no Metal-equivalent backend parity to compare against
151149

152150
Current coverage:
@@ -158,19 +156,21 @@ Current coverage:
158156
- OCIO config selection and builtin/global/user fallback
159157
- OCIO GLSL preview path
160158
- OpenGL-only screenshot smoke regression
159+
- OpenGL live OCIO update regressions
160+
- OpenGL selection regression target
161161

162162
OCIO notes:
163163

164164
- startup preflight for OpenGL now validates the OCIO runtime/config path
165165
without using Vulkan SPIR-V compilation
166-
- OpenGL OCIO regressions currently rely on the shared config/fallback tests,
167-
not the Vulkan-only runtime-glslang live-update tests
166+
- OpenGL OCIO regressions now include dedicated live view/display switching
167+
coverage without relying on Vulkan runtime glslang
168168

169169
## Metal
170170

171171
Status:
172172

173-
- `Skeleton`
173+
- `Development`
174174

175175
Implementation:
176176

@@ -182,20 +182,29 @@ Current scope:
182182
- Metal device / command queue creation
183183
- CAMetalLayer setup
184184
- Dear ImGui Metal backend hookup
185+
- CPU preview generation uploaded into Metal textures
186+
- basic preview controls through the shared renderer contract
185187

186188
Current gaps:
187189

188-
- no image upload
189-
- no preview rendering
190190
- no screenshot/readback
191191
- no OCIO path
192+
- no GPU-native Metal preview pipeline yet
192193

193194
Planned direction:
194195

195196
- use backend-native Metal rendering
196197
- do not try to reuse Vulkan pipeline code directly
197198
- OCIO should later use OCIO MSL output, not the Vulkan shader path
198199

200+
Important constraints:
201+
202+
- the current Metal path is a bring-up path for immediate macOS verification,
203+
not the final performance path
204+
- Dear ImGui Metal currently samples textures linearly, so nearest/closeup
205+
behavior is only partial until Metal-specific sampler control or a dedicated
206+
closeup preview path is added
207+
199208
## Feature Mapping Rules
200209

201210
These should stay consistent across backends where the feature exists.

0 commit comments

Comments
 (0)