Skip to content

Commit

Permalink
ruby/metal: Emit librashader shader creation errors (#1647)
Browse files Browse the repository at this point in the history
Displaying errors from librashader shader loads in Metal will make
librashader debugging easier.
  • Loading branch information
jcm93 authored Sep 18, 2024
1 parent 0b46609 commit d6858ad
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions ruby/video/metal/metal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -162,13 +162,15 @@ struct VideoMetal : VideoDriver, Metal {
}

if(file::exists(pathname)) {
if (_libra.preset_create(pathname.data(), &_preset) != NULL) {
if (auto error = _libra.preset_create(pathname.data(), &_preset)) {
print(string{"Metal: Failed to load shader: ", pathname, "\n"});
_libra.error_print(error);
return false;
}

if (_libra.mtl_filter_chain_create(&_preset, _commandQueue, nil, &_filterChain) != NULL) {
if (auto error = _libra.mtl_filter_chain_create(&_preset, _commandQueue, nil, &_filterChain)) {
print(string{"Metal: Failed to create filter chain for: ", pathname, "\n"});
_libra.error_print(error);
return false;
};
} else {
Expand Down

0 comments on commit d6858ad

Please sign in to comment.