Skip to content

Commit 11dbebe

Browse files
num3ricdoug-walker
authored andcommitted
Add DirectX 12 GPU backend for automated unit testing on Windows (#2271)
* Add DirectX 12 GPU backend for automated unit testing on Windows Introduce a DirectX 12 / HLSL rendering backend alongside the existing OpenGL / GLSL and Metal / MSL backends, enabling the GPU unit test suite to run natively on Windows without requiring an OpenGL context. Key changes: GraphicalApp abstract interface (graphicalapp.h/cpp) Backend-agnostic base class extracted from OglApp. OglApp and MetalApp now inherit from it. DxApp (dxapp.h/cpp) -- DirectX 12 backend Off-screen RGBA32F render target, full-screen triangle via SV_VertexID, staging readback, SM 6.0 DXC shader compilation. HLSLBuilder (hlsl.h/cpp) -- HLSL shader generation Translates GpuShaderDesc into HLSL pixel shaders with 1D and 3D LUT texture uploads in RGBA32F format. CMake integration OCIO_DIRECTX_ENABLED option, FetchContent for DirectX-Headers, auto-copy of DXC runtime DLLs to the test output directory. Test tolerance adjustments Minor epsilon increases for 4 tests due to DX12/SM6.0 FMA and pow() precision differences. All 263 GPU tests pass on the DirectX 12 backend. Build and run: # Configure (OCIO_DIRECTX_ENABLED defaults to ON on Windows) cmake -S . -B build -DCMAKE_BUILD_TYPE=Release # Build the GPU test binary cmake --build build --target test_gpu_exec --config Release # Run GPU tests with the DX12 backend ctest --test-dir build -C Release -R test_dx Signed-off-by: Eric Renaud-Houde <eric.renaud.houde@gmail.com> * Fix post-rebase issues found in code review - HeadlessOglApp::printGraphicsInfo() was calling pure virtual base (crash on headless EGL) - graphicalapp.cpp included oglapp.h unconditionally; guard under OCIO_GL_ENABLED - tests/gpu/CMakeLists.txt early-return guard excluded Vulkan-only builds - Add missing test_vulkan ctest entry Signed-off-by: Eric Renaud-Houde <eric.renaud.houde@gmail.com> * Minor additional comments, formatting and fixes. Signed-off-by: Eric Renaud-Houde <eric.renaud.houde@gmail.com> * Speed up DX12 GPU test backend (~19%) The DX12 test suite was noticeably slower than the OpenGL and Vulkan backends. Profiling the run showed the gap was almost entirely in DXC shader compilation, not in Present, fence waits, or DxcCreateInstance as initially suspected. Three low-risk changes: - Cache IDxcUtils and IDxcCompiler3 as DxApp members instead of recreating them on every setShader() call. The COM instances are thread-safe and perfectly reusable; recreating them per test added no value. - Compile the full-screen-triangle vertex shader exactly once and reuse the bytecode across all tests. The VSMain HLSL is a hard-coded SV_VertexID-driven triangle with no test-specific state — the bytecode is identical every time. Extracted into a new ensureVertexShaderCompiled() helper. This alone eliminated the biggest redundancy (263 duplicate VS compiles). - Present(1, 0) → Present(0, 0). VSync is meaningless for an off-screen test harness that reads back from a float render target. Locally the win shows up mostly in waitForPreviousFrame, which was being throttled by the swap-chain pipeline even on an invisible window. All 263/263 tests still pass; no tolerance changes, no DXIL codegen changes (except for a UTF8 fix), no precision risk. Signed-off-by: Eric Renaud-Houde <eric.renaud.houde@gmail.com> * Several small fixes tidying up the recently-added GPU test infrastructure. - Fix unused-variable warnings (fatal on macOS with warnings-as-errors): guard useDxRenderer and useVulkanRenderer declarations with the same ifdefs as their usage sites. useMetalRenderer stays unconditional because it's referenced on all platforms. - Propagate the MSVC+shared-libs PATH workaround to test_vulkan so it can find OpenColorIO_*.dll at runtime, matching what's already done for test_dx. - Upgrade the dxcompiler.dll detection message from STATUS to WARNING and rewrite it to name OCIO_DIRECTX_ENABLED and offer concrete recovery paths. The previous STATUS message was easy to miss, leaving users with a silent degradation until test_dx failed at runtime. - Rename the OpenGL ctest from test_gpu to test_opengl now that sibling backend-specific tests (test_dx, test_vulkan, test_metal) exist. The test_gpu_exec binary keeps its name since it's backend-agnostic and selects via CLI flags. - Declare OCIO_VULKAN_ENABLED as a first-class CMake option with mark_as_advanced, matching the existing OCIO_DIRECTX_ENABLED. It was previously used in conditionals without ever being declared, so it never appeared as a toggle in ccmake/cmake-gui. - Document both OCIO_DIRECTX_ENABLED and OCIO_VULKAN_ENABLED in docs/quick_start/installation.rst, noting that Vulkan requires an external SDK. Signed-off-by: Eric Renaud-Houde <eric.renaud.houde@gmail.com> * Integrate DirectX-Headers with OCIO's external-package pattern Previously InstallDirectXHeaders.cmake was included unconditionally from oglapphelpers/CMakeLists.txt, so DirectX-Headers was always fetched from GitHub regardless of whether the user had a local copy installed. There was no way to use a system install, a vendored copy, or an air-gapped build, and the dep didn't respect OCIO_INSTALL_EXT_PACKAGES. DirectX-Headers is now a first-class OCIO dependency, handled the same way as Imath, ZLIB, yaml-cpp, etc.: try find_package first, fall back to FetchContent only if not found and OCIO_INSTALL_EXT_PACKAGES allows it. Changes: - New share/cmake/modules/FindDirectX-Headers.cmake, modeled on FindImath.cmake. - InstallDirectXHeaders.cmake → InstallDirectX-Headers.cmake (the hyphen matches OCIO's Install convention). - oglapphelpers/CMakeLists.txt now calls ocio_handle_dependency(DirectX-Headers ...) with MIN_VERSION 1.606.0 (Windows SDK 22H2 era — old enough to cover most installed copies) and RECOMMENDED_VERSION 1.619.1 (the version OCIO pins and validates). For users: a local DirectX-Headers install can now be supplied via any of the standard CMake mechanisms — -DDirectX-Headers_DIR, -DDirectX-Headers_ROOT, -DDirectX-Headers_INCLUDE_DIR, or globally with -DOCIO_INSTALL_EXT_PACKAGES=NONE to forbid any network fetch. Signed-off-by: Eric Renaud-Houde <eric.renaud.houde@gmail.com> * Improve dxcompiler.dll diagnostics and allow overriding its path Addresses test crashes seen on stuck Windows 10 hosts caused by an old dxcompiler.dll shipped in that host's Windows SDK Redist. - Print the version of the found dxcompiler.dll at configure time so crash reports identify the exact DXC build without follow-up diagnostics. - Emit a standing hint pointing at the DirectX Shader Compiler releases page, which is the documented workaround. - New -DOCIO_DXCOMPILER_DLL=<path> overrides the Windows SDK Redist search, letting users supply a newer DLL pre-build instead of copying it by hand after. - Extracted the DXC-runtime logic into share/cmake/utils/LocateDXCompilerRuntime.cmake so tests/gpu/CMakeLists.txt stays focused on the test target. Signed-off-by: Eric Renaud-Houde <eric.renaud.houde@gmail.com> * Minor comment tweaks in LocateDXCompilerRuntime.cmake. Signed-off-by: Eric Renaud-Houde <eric.renaud.houde@gmail.com> * Use OCIO_DirectX-Headers_RECOMMENDED_VERSION in InstallDirectX-Headers.cmake ocio_install_dependency already propagates the RECOMMENDED_VERSION from the ocio_handle_dependency call site. Consume it instead of hardcoding the version a second time. Matches the pattern in Installyaml-cpp.cmake and Installpystring.cmake. Signed-off-by: Eric Renaud-Houde <eric.renaud.houde@gmail.com> * Address local cleanup notes from PR #2271 Claude review. * Name CbvSrvHeapSize and throw in setShader if a shader needs more SRV slots than the heap holds. * Guard ~DxApp() so the GPU wait/CloseHandle are skipped when sync objects were never created (constructor partial-init). * Comment the 16-byte float4 stride used when packing UNIFORM_VECTOR_FLOAT/INT arrays into the HLSL constant buffer. * Only record m_windowClassName when RegisterClassExA actually succeeds, so cleanup won't unregister a class owned by another DxApp. * Drop the redundant trailing else in GPUUnitTest.cpp's shadingLanguage selector (initializer already covers it). Signed-off-by: Eric Renaud-Houde <eric.renaud.houde@gmail.com> --------- Signed-off-by: Eric Renaud-Houde <eric.renaud.houde@gmail.com> Co-authored-by: Doug Walker <doug.walker@autodesk.com> Signed-off-by: Mei Chu <meimchu@gmail.com>
1 parent 5b901de commit 11dbebe

26 files changed

Lines changed: 2509 additions & 351 deletions

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)