Cycles: make Hydra display driver optional, for USD without OpenGL
OpenGL support was removed from Blender's USD precompiled libraries. This is currently only useful when building against other applications anyway.
This commit is contained in:
parent
e0315a5ef0
commit
a6f951b464
|
@ -26,7 +26,6 @@ set(INC_HD_CYCLES
|
|||
camera.h
|
||||
config.h
|
||||
curves.h
|
||||
display_driver.h
|
||||
field.h
|
||||
geometry.h
|
||||
geometry.inl
|
||||
|
@ -48,7 +47,6 @@ set(SRC_HD_CYCLES
|
|||
attribute.cpp
|
||||
curves.cpp
|
||||
camera.cpp
|
||||
display_driver.cpp
|
||||
field.cpp
|
||||
instancer.cpp
|
||||
light.cpp
|
||||
|
@ -73,6 +71,13 @@ if(WITH_OPENVDB)
|
|||
)
|
||||
endif()
|
||||
|
||||
# Blender libraries do not include hgiGL, so build without display driver then.
|
||||
if(EXISTS ${USD_INCLUDE_DIR}/pxr/imaging/hgiGL)
|
||||
add_definitions(-DWITH_HYDRA_DISPLAY_DRIVER)
|
||||
list(APPEND SRC_HD_CYCLES display_driver.cpp)
|
||||
list(APPEND INC_HD_CYCLES display_driver.h)
|
||||
endif()
|
||||
|
||||
include_directories(${INC})
|
||||
include_directories(SYSTEM ${INC_SYS})
|
||||
|
||||
|
|
|
@ -155,7 +155,7 @@ void HdCyclesDelegate::SetDrivers(const HdDriverVector &drivers)
|
|||
|
||||
bool HdCyclesDelegate::IsDisplaySupported() const
|
||||
{
|
||||
#ifdef _WIN32
|
||||
#if defined(_WIN32) && defined(WITH_HYDRA_DISPLAY_DRIVER)
|
||||
return _hgi && _hgi->GetAPIName() == HgiTokens->OpenGL;
|
||||
#else
|
||||
return false;
|
||||
|
|
|
@ -4,14 +4,19 @@
|
|||
|
||||
#include "hydra/render_pass.h"
|
||||
#include "hydra/camera.h"
|
||||
#include "hydra/display_driver.h"
|
||||
#include "hydra/output_driver.h"
|
||||
#include "hydra/render_buffer.h"
|
||||
#include "hydra/render_delegate.h"
|
||||
#include "hydra/session.h"
|
||||
|
||||
#ifdef WITH_HYDRA_DISPLAY_DRIVER
|
||||
# include "hydra/display_driver.h"
|
||||
#endif
|
||||
|
||||
#include "scene/camera.h"
|
||||
#include "scene/integrator.h"
|
||||
#include "scene/scene.h"
|
||||
|
||||
#include "session/session.h"
|
||||
|
||||
#include <pxr/imaging/hd/renderPassState.h>
|
||||
|
@ -32,8 +37,10 @@ HdCyclesRenderPass::HdCyclesRenderPass(HdRenderIndex *index,
|
|||
const auto renderDelegate = static_cast<const HdCyclesDelegate *>(
|
||||
GetRenderIndex()->GetRenderDelegate());
|
||||
if (renderDelegate->IsDisplaySupported()) {
|
||||
#ifdef WITH_HYDRA_DISPLAY_DRIVER
|
||||
session->set_display_driver(
|
||||
make_unique<HdCyclesDisplayDriver>(renderParam, renderDelegate->GetHgi()));
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue