Posts

Post not yet marked as solved
1 Replies
1.3k Views
Hi Guys,Got an issue that is halting progress. I have dug around on the internet and other than finding a couple of people who are having the same issue, no sign of a solution.When I bind a shader for the first time, it creates a RenderPassDescriptor and caches it.The vertex descriptor looks fine.You can see it has a float4 at offset 0 of size 16 bytes, and a float2 at offset 16 of size 8 bytesWhen I create the render pipeline it all goes wrong.My float4 now has size of 24 bytes, and my float2 now has size of 16 bytesWhen it gets to the draw call I get the validation layer exception that confirms this,validateFunctionArguments:3485: failed assertion `Vertex Function(VShader): argument vertexBuffer.0[0] from buffer(0) with offset(0) and length(16) has space for 16 bytes, but argument has a length(24).'Has anyone come across this before?Cheers guys
Posted
by Stainless.
Last updated
.
Post marked as solved
13 Replies
3.2k Views
I have a major issue that is blocking development.The game I am working on use an archive system for handling assets based on stream operators.This code works perfectly on Windows and Linux but fails on Mac.Originally the code had a single string streamer...Archive& operator <<(Archive& ar, std::string& val)When I tried to link the game I got the errorUndefined symbol: ge::operator<<(ge::Archive&, std::__1::basic_string<char, std::__1::char_traits<char="">, std::__1::allocator >)I checked around and other people had had this issue.They all swapped from libc++ to libstdc++. I cannot do thatSo I added ...Archive& operator <<(Archive &ar, std::basic_string<char,std::char_traits,std::allocator>val)Just to get it to link, hoping the runtime code would perform as expected.It doesn't.The basic_string version is the method that is called and the problem with that is it creates a new string instead of writing to the supplied string.So you cannot load any strings.I also have had problems with templates.template<> TMap<std::string, soundbuffer=""> UrlResourceCache::map;Won't link. I had to do ...template<typename T> TMap<std::string, T*> UrlResourceCache<T>::map;I am finding it harder and harder to work in c++ on MacHas anyone come up with a solution for the archive issue?
Posted
by Stainless.
Last updated
.
Post marked as solved
3 Replies
1.6k Views
Hi all,So I am porting a DX9 game to metal, and I need to be able to parse the compiled shader to find out what goes where.All the shaders take a bunch of parameters in a single global structure which is generated by game data setup by artists, so it's dynamic. So when the shader has been loaded into a libray and the vertex and fragment functions have been created, I tried to create a dummy render pipeline state so I can get the MTLRenderPipelineReflection structure and work everything out.But the render pipeline fails to compile. I think this is because I haven't setup the vertex inputs etc yet, which I cannot do until I have the reflection structure.So I am stuck in a chicken and egg situation.I need to setup the pipeline before I can get the information I need to setup the pipeline.Any ideas?Really stuck on this one.CheersStainless
Posted
by Stainless.
Last updated
.