Skip to content

Commit 692fbdc

Browse files
committed
Merge branch 'main' into walker/cycle_fix
2 parents 6bb8778 + 57a94a8 commit 692fbdc

27 files changed

Lines changed: 2514 additions & 353 deletions

.github/workflows/ci_workflow.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,9 @@ jobs:
5757
container:
5858
# DockerHub: https://hub.docker.com/u/aswf
5959
# Source: https://github.com/AcademySoftwareFoundation/aswf-docker
60-
image: aswf/ci-ocio:${{ matrix.vfx-cy }}
60+
image: aswf/ci-ocio:${{ matrix.container-tag || matrix.vfx-cy }}
6161
strategy:
62-
fail-fast: true
62+
fail-fast: false
6363
matrix:
6464
build: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]
6565
include:
@@ -204,6 +204,7 @@ jobs:
204204
cc-compiler: clang
205205
compiler-desc: Clang
206206
vfx-cy: 2023
207+
container-tag: 2023.2
207208
install-ext-packages: MISSING
208209
- build: 2
209210
build-type: Release
@@ -217,6 +218,7 @@ jobs:
217218
cc-compiler: gcc
218219
compiler-desc: GCC
219220
vfx-cy: 2023
221+
container-tag: 2023.2
220222
install-ext-packages: ALL
221223
- build: 1
222224
build-type: Release
@@ -230,6 +232,7 @@ jobs:
230232
cc-compiler: gcc
231233
compiler-desc: GCC
232234
vfx-cy: 2023
235+
container-tag: 2023.2
233236
install-ext-packages: ALL
234237
env:
235238
CXX: ${{ matrix.cxx-compiler }}

CMakeLists.txt

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -287,6 +287,19 @@ message(STATUS "")
287287
message(STATUS "Checking for GPU configuration...")
288288
include(CheckSupportGL)
289289

290+
# DirectX 12 is only available on Windows.
291+
if(WIN32)
292+
option(OCIO_DIRECTX_ENABLED "Enable DirectX 12 GPU rendering support" ON)
293+
else()
294+
set(OCIO_DIRECTX_ENABLED OFF CACHE BOOL "Enable DirectX 12 GPU rendering support" FORCE)
295+
endif()
296+
mark_as_advanced(OCIO_DIRECTX_ENABLED)
297+
298+
# Vulkan is cross-platform but requires an external SDK, so it is off by
299+
# default; enable explicitly with -DOCIO_VULKAN_ENABLED=ON.
300+
option(OCIO_VULKAN_ENABLED "Enable Vulkan GPU rendering support" OFF)
301+
mark_as_advanced(OCIO_VULKAN_ENABLED)
302+
290303

291304
###############################################################################
292305
# Check for ARM neon here because we need to know if ARM NEON is supported

docs/quick_start/installation.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -287,6 +287,8 @@ Here are the most common OCIO-specific CMake options (the default values are sho
287287
- ``-DOCIO_BUILD_TESTS=ON`` (Set to OFF to not build the unit tests)
288288
- ``-DOCIO_BUILD_GPU_TESTS=ON`` (Set to OFF to not build the GPU unit tests)
289289
- ``-DOCIO_USE_HEADLESS=OFF`` (Set to ON to do headless GPU rendering)
290+
- ``-DOCIO_DIRECTX_ENABLED=ON`` (Windows only; set to OFF to disable the DirectX 12 GPU rendering backend used by ``test_dx``. Forced OFF on non-Windows platforms.)
291+
- ``-DOCIO_VULKAN_ENABLED=OFF`` (Set to ON to enable the Vulkan GPU rendering backend used by ``test_vulkan``. Requires the Vulkan SDK to be installed and findable by CMake.)
290292
- ``-DOCIO_WARNING_AS_ERROR=ON`` (Set to OFF to turn off warnings as errors)
291293
- ``-DOCIO_BUILD_DOCS=OFF`` (Set to ON to build the documentation)
292294

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
# SPDX-License-Identifier: BSD-3-Clause
2+
# Copyright Contributors to the OpenColorIO Project.
3+
#
4+
# Locate DirectX-Headers (header-only, Windows only)
5+
#
6+
# Variables defined by this module:
7+
# DirectX-Headers_FOUND - Indicate whether the package was found or not
8+
# DirectX-Headers_INCLUDE_DIR - Location of the header files
9+
# DirectX-Headers_VERSION - Package version
10+
#
11+
# Global targets defined by this module:
12+
# Microsoft::DirectX-Headers
13+
#
14+
# DirectX-Headers can be supplied by the caller through any of the standard
15+
# CMake mechanisms:
16+
# -- Set -DDirectX-Headers_DIR to the directory containing directx-headers-config.cmake
17+
# -- Set -DDirectX-Headers_ROOT to the install prefix (with include/directx/ underneath)
18+
# -- Set -DDirectX-Headers_INCLUDE_DIR to the directory containing directx/d3d12.h
19+
#
20+
# When OCIO_INSTALL_EXT_PACKAGES is not ALL, this module first tries to locate
21+
# an existing install via the upstream CMake config, then falls back to a
22+
# manual header search. If still not found and OCIO_INSTALL_EXT_PACKAGES is
23+
# MISSING (the default), OCIO's ocio_install_dependency() pathway will invoke
24+
# InstallDirectX-Headers.cmake to build it via FetchContent.
25+
#
26+
27+
if(NOT OCIO_INSTALL_EXT_PACKAGES STREQUAL ALL)
28+
# Prefer the upstream CMake config (installed as lower-case).
29+
find_package(directx-headers ${DirectX-Headers_FIND_VERSION} CONFIG QUIET)
30+
31+
if(directx-headers_FOUND)
32+
set(DirectX-Headers_FOUND TRUE)
33+
if(directx-headers_VERSION)
34+
set(DirectX-Headers_VERSION ${directx-headers_VERSION})
35+
endif()
36+
else()
37+
# Fall back to locating the public header directly (e.g. when the
38+
# headers were installed without the CMake config, or are provided
39+
# by a vendored copy).
40+
find_path(DirectX-Headers_INCLUDE_DIR
41+
NAMES
42+
directx/d3d12.h
43+
HINTS
44+
${DirectX-Headers_ROOT}
45+
PATH_SUFFIXES
46+
include
47+
)
48+
endif()
49+
50+
# If OCIO can install the package itself, demote REQUIRED so a missing
51+
# dependency here does not abort configuration before the install step.
52+
if(OCIO_INSTALL_EXT_PACKAGES STREQUAL MISSING)
53+
set(DirectX-Headers_FIND_REQUIRED FALSE)
54+
endif()
55+
56+
include(FindPackageHandleStandardArgs)
57+
find_package_handle_standard_args(DirectX-Headers
58+
REQUIRED_VARS
59+
DirectX-Headers_INCLUDE_DIR
60+
VERSION_VAR
61+
DirectX-Headers_VERSION
62+
)
63+
endif()
64+
65+
###############################################################################
66+
### Create target (only needed for the manual-header-search fallback; the
67+
### upstream CMake config already defines Microsoft::DirectX-Headers).
68+
69+
if(DirectX-Headers_FOUND AND NOT TARGET Microsoft::DirectX-Headers AND DirectX-Headers_INCLUDE_DIR)
70+
add_library(Microsoft::DirectX-Headers INTERFACE IMPORTED GLOBAL)
71+
set_target_properties(Microsoft::DirectX-Headers PROPERTIES
72+
INTERFACE_INCLUDE_DIRECTORIES "${DirectX-Headers_INCLUDE_DIR}"
73+
)
74+
75+
mark_as_advanced(DirectX-Headers_INCLUDE_DIR DirectX-Headers_VERSION)
76+
endif()
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# SPDX-License-Identifier: BSD-3-Clause
2+
# Copyright Contributors to the OpenColorIO Project.
3+
#
4+
# Install DirectX-Headers (header-only, Windows only)
5+
# https://github.com/microsoft/DirectX-Headers
6+
#
7+
###############################################################################
8+
9+
include(FetchContent)
10+
11+
if(OCIO_DirectX-Headers_RECOMMENDED_VERSION)
12+
set(DirectX-Headers_VERSION ${OCIO_DirectX-Headers_RECOMMENDED_VERSION})
13+
else()
14+
set(DirectX-Headers_VERSION ${DirectX-Headers_FIND_VERSION})
15+
endif()
16+
17+
set(FETCHCONTENT_BASE_DIR "${CMAKE_BINARY_DIR}/ext/build/DirectX-Headers")
18+
set(DIRECTX_HEADERS_BUILD_TEST OFF CACHE BOOL "" FORCE)
19+
20+
FetchContent_Declare(DirectX-Headers
21+
GIT_REPOSITORY https://github.com/microsoft/DirectX-Headers.git
22+
GIT_TAG v${DirectX-Headers_VERSION}
23+
)
24+
25+
FetchContent_MakeAvailable(DirectX-Headers)
26+
27+
# Signal success to ocio_install_dependency so ocio_handle_dependency does not
28+
# abort at the next required-check. FetchContent_MakeAvailable has just created
29+
# the Microsoft::DirectX-Headers target via the upstream CMakeLists.
30+
if(TARGET Microsoft::DirectX-Headers)
31+
set(DirectX-Headers_FOUND TRUE)
32+
endif()
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
# SPDX-License-Identifier: BSD-3-Clause
2+
# Copyright Contributors to the OpenColorIO Project.
3+
#
4+
# Locate the dxcompiler.dll + dxil.dll runtime pair needed to run D3D12 shader
5+
# compilation at test time, and surface their file version.
6+
#
7+
# Inputs:
8+
# OCIO_DXCOMPILER_DLL - Optional user-supplied path to dxcompiler.dll.
9+
# When set, overrides the Windows SDK Redist/D3D
10+
# search. Useful when the SDK-bundled DLL is too old.
11+
#
12+
# Outputs:
13+
# DXCOMPILER_DLL - Path to dxcompiler.dll (cache variable).
14+
# DXIL_DLL - Path to the adjacent dxil.dll (cache variable, may
15+
# be left unset if not found next to dxcompiler.dll).
16+
17+
set(OCIO_DXCOMPILER_DLL "" CACHE FILEPATH
18+
"Optional explicit path to dxcompiler.dll (e.g. from a newer DirectX Shader Compiler release). \
19+
Overrides the automatic Windows SDK Redist/D3D search."
20+
)
21+
22+
if(OCIO_DXCOMPILER_DLL)
23+
if(NOT EXISTS "${OCIO_DXCOMPILER_DLL}")
24+
message(FATAL_ERROR "OCIO_DXCOMPILER_DLL=${OCIO_DXCOMPILER_DLL} does not exist.")
25+
endif()
26+
set(DXCOMPILER_DLL "${OCIO_DXCOMPILER_DLL}" CACHE FILEPATH
27+
"Path to dxcompiler.dll (user-supplied via OCIO_DXCOMPILER_DLL)" FORCE)
28+
else()
29+
find_file(DXCOMPILER_DLL
30+
NAMES dxcompiler.dll
31+
PATHS
32+
# Note: x64 hardcoded; update if ARM64 Windows support is needed.
33+
"$ENV{WindowsSdkDir}Redist/D3D/x64"
34+
"C:/Program Files (x86)/Windows Kits/10/Redist/D3D/x64"
35+
NO_DEFAULT_PATH
36+
DOC "Path to dxcompiler.dll from Windows SDK"
37+
)
38+
endif()
39+
40+
if(DXCOMPILER_DLL)
41+
get_filename_component(_dxc_dll_dir "${DXCOMPILER_DLL}" DIRECTORY)
42+
find_file(DXIL_DLL
43+
NAMES dxil.dll
44+
HINTS "${_dxc_dll_dir}"
45+
NO_DEFAULT_PATH
46+
)
47+
48+
# Report the found dxcompiler.dll version so crash reports can identify
49+
# mismatched or outdated DXC builds without re-running diagnostics.
50+
string(REPLACE "'" "''" _dxc_dll_ps "${DXCOMPILER_DLL}")
51+
execute_process(
52+
COMMAND powershell -NoProfile -Command
53+
"(Get-Item -LiteralPath '${_dxc_dll_ps}').VersionInfo.FileVersion"
54+
OUTPUT_VARIABLE _dxc_version
55+
OUTPUT_STRIP_TRAILING_WHITESPACE
56+
ERROR_QUIET
57+
)
58+
if(_dxc_version)
59+
message(STATUS "Found dxcompiler.dll (version ${_dxc_version}): ${DXCOMPILER_DLL}")
60+
else()
61+
message(STATUS "Found dxcompiler.dll (version unknown): ${DXCOMPILER_DLL}")
62+
endif()
63+
message(STATUS
64+
"If test_dx crashes during shader compilation, the Windows SDK's dxcompiler.dll "
65+
"may be too old to produce signed DXIL on this system. Replace it with a newer "
66+
"build from https://github.com/microsoft/DirectXShaderCompiler/releases, or set "
67+
"-DOCIO_DXCOMPILER_DLL=<path> to point at a specific dxcompiler.dll."
68+
)
69+
else()
70+
message(WARNING
71+
"OCIO_DIRECTX_ENABLED is ON but dxcompiler.dll was not found in the "
72+
"Windows SDK Redist/D3D path. test_dx will fail at runtime unless "
73+
"dxcompiler.dll and dxil.dll are on PATH. Install the Windows SDK "
74+
"redistributable components, set -DOCIO_DXCOMPILER_DLL=<path> to supply "
75+
"a specific dxcompiler.dll, or set -DOCIO_DIRECTX_ENABLED=OFF to "
76+
"disable the DirectX 12 backend."
77+
)
78+
endif()

src/apps/ociochecklut/main.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -52,18 +52,18 @@ class ProcessorWrapper
5252
m_gpu = gpu;
5353
if (!m_oglApp)
5454
{
55-
m_oglApp = OCIO::OglApp::CreateOglApp("ociochecklut", 256, 20);
55+
m_oglApp = OCIO::GraphicalApp::CreateApp("ociochecklut", 256, 20);
5656

5757
if (m_verbose)
5858
{
59-
m_oglApp->printGLInfo();
59+
m_oglApp->printGraphicsInfo();
6060
}
6161
}
6262

63-
m_oglApp->setPrintShader(m_verbose);
63+
m_oglApp->setShaderVerbose(m_verbose);
6464
float image[4]{ 0.f, 0.f, 0.f, 0.f };
65-
m_oglApp->initImage(1, 1, OCIO::OglApp::COMPONENTS_RGBA, image);
66-
m_oglApp->createGLBuffers();
65+
m_oglApp->initImage(1, 1, OCIO::GraphicalApp::COMPONENTS_RGBA, image);
66+
m_oglApp->createBuffers();
6767
OCIO::GpuShaderDescRcPtr shaderDesc = OCIO::GpuShaderDesc::CreateShaderDesc();
6868
shaderDesc->setLanguage(OCIO::GPU_LANGUAGE_GLSL_1_2);
6969
m_gpu->extractGpuShaderInfo(shaderDesc);
@@ -98,7 +98,7 @@ class ProcessorWrapper
9898
m_oglApp->redisplay();
9999
m_oglApp->readImage(pixel.data());
100100
}
101-
OCIO::OglAppRcPtr m_oglApp;
101+
OCIO::GraphicalAppRcPtr m_oglApp;
102102
#else
103103
void applyGPU(std::vector<float> &)
104104
{

src/apps/ocioconvert/main.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -361,18 +361,18 @@ int main(int argc, const char **argv)
361361

362362
#ifdef OCIO_GPU_ENABLED
363363
// Initialize GPU.
364-
OCIO::OglAppRcPtr oglApp;
364+
OCIO::GraphicalAppRcPtr oglApp;
365365

366366
if (usegpu || usegpuLegacy)
367367
{
368-
OCIO::OglApp::Components comp = OCIO::OglApp::COMPONENTS_RGBA;
368+
OCIO::GraphicalApp::Components comp = OCIO::GraphicalApp::COMPONENTS_RGBA;
369369
if (imgInput.getNumChannels() == 4)
370370
{
371-
comp = OCIO::OglApp::COMPONENTS_RGBA;
371+
comp = OCIO::GraphicalApp::COMPONENTS_RGBA;
372372
}
373373
else if (imgInput.getNumChannels() == 3)
374374
{
375-
comp = OCIO::OglApp::COMPONENTS_RGB;
375+
comp = OCIO::GraphicalApp::COMPONENTS_RGB;
376376
}
377377
else
378378
{
@@ -383,7 +383,7 @@ int main(int argc, const char **argv)
383383

384384
try
385385
{
386-
oglApp = OCIO::OglApp::CreateOglApp("ocioconvert", 256, 20);
386+
oglApp = OCIO::GraphicalApp::CreateApp("ocioconvert", 256, 20);
387387
}
388388
catch (const OCIO::Exception & e)
389389
{
@@ -393,14 +393,14 @@ int main(int argc, const char **argv)
393393

394394
if (verbose)
395395
{
396-
oglApp->printGLInfo();
396+
oglApp->printGraphicsInfo();
397397
}
398398

399-
oglApp->setPrintShader(outputgpuInfo);
399+
oglApp->setShaderVerbose(outputgpuInfo);
400400

401401
oglApp->initImage(imgInput.getWidth(), imgInput.getHeight(), comp, (float *)imgInput.getData());
402402

403-
oglApp->createGLBuffers();
403+
oglApp->createBuffers();
404404
}
405405
#endif // OCIO_GPU_ENABLED
406406

src/apps/ociodisplay/main.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ float g_display_gamma{1.0f};
6464
int g_channelHot[4]{1, 1, 1, 1}; // show rgb
6565
int g_viewsMenuID;
6666

67-
OCIO::OglAppRcPtr g_oglApp;
67+
OCIO::GraphicalAppRcPtr g_oglApp;
6868

6969
void UpdateOCIOGLState();
7070

@@ -115,14 +115,14 @@ static void InitImageTexture(const char * filename)
115115
}
116116
}
117117

118-
OCIO::OglApp::Components comp = OCIO::OglApp::COMPONENTS_RGBA;
118+
OCIO::GraphicalApp::Components comp = OCIO::GraphicalApp::COMPONENTS_RGBA;
119119
if (img.getNumChannels() == 4)
120120
{
121-
comp = OCIO::OglApp::COMPONENTS_RGBA;
121+
comp = OCIO::GraphicalApp::COMPONENTS_RGBA;
122122
}
123123
else if (img.getNumChannels() == 3)
124124
{
125-
comp = OCIO::OglApp::COMPONENTS_RGB;
125+
comp = OCIO::GraphicalApp::COMPONENTS_RGB;
126126
}
127127
else
128128
{
@@ -658,7 +658,7 @@ int main(int argc, char **argv)
658658
else
659659
#endif
660660
{
661-
g_oglApp = std::make_shared<OCIO::ScreenApp>("ociodisplay", 512, 512);
661+
g_oglApp = std::make_shared<OCIO::ScreenOglApp>("ociodisplay", 512, 512);
662662
}
663663
}
664664
catch (const OCIO::Exception &e)
@@ -669,11 +669,11 @@ int main(int argc, char **argv)
669669

670670
if (g_verbose)
671671
{
672-
g_oglApp->printGLInfo();
672+
g_oglApp->printGraphicsInfo();
673673
}
674674

675675
g_oglApp->setYMirror();
676-
g_oglApp->setPrintShader(g_gpuinfo);
676+
g_oglApp->setShaderVerbose(g_gpuinfo);
677677

678678
glutReshapeFunc(Reshape);
679679
glutKeyboardFunc(Key);

0 commit comments

Comments
 (0)