Posts

Post not yet marked as solved
1 Replies
603 Views
I have a metal app that's not fullscreen on an iPad 4th gen (2020). I even tried it with a new Metal App in Obj-C from Xcode's File->New Project. I'm on iOS 14.4.2 but will update to 14.6 soon. The view bounds of this window says it's 1024x768 while the metal backbuffer is 2048x1536, essentially a standard iPad resolution. I tried switching the presentation mode from automatic to fullscreen on the view controller like many posts say but it doesn't change anything for a metal view controller.
Posted Last updated
.
Post marked as solved
2 Replies
932 Views
I have a simpler fragment shader :struct PSResources{ constant ConstantBufferStruct& uniforms [[ buffer(1) ]]; texture2d<float> Texture0 [[texture(0)]]; sampler GlobalSampler [[sampler(0)]];};fragment float4 SpritePS(VS_OUT in [[stage_in]], device PSResources & Resources ){//...}This only compiles under Language Version 2.0, however reflection says I have 1 input to my fragment function, the Resources "buffer" and the MTLStructType is non null, so I go into it to find 3 members, a MTLDataTypeTexture, MTLDataTypePointer and MTLDataTypeSampler. This all sounds good, but how do I get the binding points ? The MTLStructMember only has an argument index which starts from 0 and increments by 1 for each member, so for GlobalSampler the index is 2 instead of the binding point I'm looking for which is 0. Same goes for uniforms, I need the 1 but I get 0.I know I can manually move all inputs into the parameters for the fragment function and that "fixes" the issue by having arguments be present in the MTLRenderPipelineReflection.fragmentArguments, but I enjoy having my inputs in a nice structure in case I need to pass resources to functions and having just a single function parameter is way cleaner than having a ton of arguments for all functions.
Posted Last updated
.