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

MTIDataBuffer passed to shader not changed #350

Open
2 tasks done
veewis opened this issue Feb 9, 2023 · 1 comment
Open
2 tasks done

MTIDataBuffer passed to shader not changed #350

veewis opened this issue Feb 9, 2023 · 1 comment

Comments

@veewis
Copy link

veewis commented Feb 9, 2023

Checklist

I pass multiple float values in the shader using the following method:

float outPoints[24];
MTIDataBuffer *buffer = [[MTIDataBuffer alloc] initWithBytes:outPoints length:sizeof(float) * 24 options:MTLResourceCPUCacheModeDefaultCache];
return [self.class.kernel applyToInputImages:@[self.inputImage, result] parameters:@{
        @"points": buffer
    } outputTextureDimensions:self.inputImage.dimensions outputPixelFormat:self.outputPixelFormat];

However, when the outPoints value changes, the buffer is also regenerated, but the shader value doesn't seem to change because I get the same result.

I would like to know how to solve the problem of not passing the outPoints correctly, thanks.

@YuAo
Copy link
Member

YuAo commented Feb 14, 2023

Cannot reproduce the issue. Can you provide a complete example?

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

2 participants