Skip to content

Commit

Permalink
Merge branch 'dev_1.39' into bhata/addEnvLightIntensity
Browse files Browse the repository at this point in the history
  • Loading branch information
ashwinbhat authored Mar 18, 2024
2 parents d4fc9fa + 0067b57 commit 7ee026a
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 6 deletions.
4 changes: 2 additions & 2 deletions source/MaterialXGenShader/Syntax.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ string Syntax::getSwizzledVariable(const string& srcName, TypeDesc srcType, cons
else
{
const size_t channelIndex = it->second;
if (channelIndex < 0 || channelIndex >= srcMembers.size())
if (channelIndex >= srcMembers.size())
{
throw ExceptionShaderGenError("Given channel index: '" + string(1, ch) + "' in channels pattern is incorrect for type '" + srcType.getName() + "'.");
}
Expand Down Expand Up @@ -197,7 +197,7 @@ ValuePtr Syntax::getSwizzledValue(ValuePtr value, TypeDesc srcType, const string
else
{
const size_t channelIndex = it->second;
if (channelIndex < 0 || channelIndex >= srcMembers.size())
if (channelIndex >= srcMembers.size())
{
throw ExceptionShaderGenError("Given channel index: '" + string(1, ch) + "' in channels pattern is incorrect for type '" + srcType.getName() + "'.");
}
Expand Down
8 changes: 7 additions & 1 deletion source/MaterialXRender/GeometryHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,13 @@

MATERIALX_NAMESPACE_BEGIN

namespace
{

const float MAX_FLOAT = std::numeric_limits<float>::max();

} // anonymous namespace

void GeometryHandler::addLoader(GeometryLoaderPtr loader)
{
const StringSet& extensions = loader->supportedExtensions();
Expand Down Expand Up @@ -63,7 +70,6 @@ void GeometryHandler::getGeometry(MeshList& meshes, const string& location)

void GeometryHandler::computeBounds()
{
const float MAX_FLOAT = std::numeric_limits<float>::max();
_minimumBounds = { MAX_FLOAT, MAX_FLOAT, MAX_FLOAT };
_maximumBounds = { -MAX_FLOAT, -MAX_FLOAT, -MAX_FLOAT };
for (const auto& mesh : _meshes)
Expand Down
2 changes: 1 addition & 1 deletion source/MaterialXRenderGlsl/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ if(WIN32)
elseif(APPLE)
target_link_libraries(
${MATERIALX_MODULE_NAME}
OpenGL::GL
"-framework OpenGL"
"-framework Foundation"
"-framework Cocoa"
"-framework Metal")
Expand Down
2 changes: 1 addition & 1 deletion source/MaterialXRenderHw/SimpleWindowWindows.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -111,9 +111,9 @@ SimpleWindow::~SimpleWindow()
if (hWnd)
{
_windowWrapper->release();
DestroyWindow(hWnd);
}

DestroyWindow(hWnd);
UnregisterClass(_windowClassName, GetModuleHandle(NULL));
}

Expand Down
2 changes: 1 addition & 1 deletion source/MaterialXRenderMsl/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ elseif(APPLE)
target_link_libraries(
${MATERIALX_MODULE_NAME}
"-framework Cocoa"
OpenGL::GL)
"-framework OpenGL")
endif()
target_link_libraries(
${MATERIALX_MODULE_NAME}
Expand Down

0 comments on commit 7ee026a

Please sign in to comment.