Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MSL Incorrect Sampler Name #43

Open
SausCode opened this issue Jul 22, 2019 · 0 comments
Open

MSL Incorrect Sampler Name #43

SausCode opened this issue Jul 22, 2019 · 0 comments

Comments

@SausCode
Copy link

SausCode commented Jul 22, 2019

Hi all,

I am converting a Direct X SDK Sample Code (June 2010 DX SDK Tutorial 7) to MSL, and the sampler ends up being declared as sampler samplersamLinear, and later used as samLinear.

I believe it is because of an incorrect order of ternary operator assignment in toMetalDecleration.cpp (line 1965):

// for some reason we have some samplers start with "sampler" and some not
const bool startsWithSampler = name.find("sampler") == 0;

std::ostringstream samplerOss;
samplerOss << (startsWithSampler ? "" : "sampler") << name;
std::string samplerName = samplerOss.str();

I believe it should be:

samplerOss << (startsWithSampler ? "sampler" : "" ) << name;

This fix ends up working correctly for me.

Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant