I have written a class for managing GPU memory buffers.
I've got one method for building a buffer initialized with a chunk of CPU memory (if pData is null, then allocated block of GPU memory is not initialized, remaining with indeterminate values) and an overload for building it initialized with the same byte value:
IBuffer* CreateBuffer(IDevice* pDevice, int byteWidth, const void* pData);
IBuffer* CreateBuffer(IDevice* pDevice, int byteWidth, byte fillValue);
Use cases are:
CreateBuffer(pDev, 512, pData); //OK
CreateBuffer(pDev, 512, nullptr); //OK
CreateBuffer(pDev, 512, 0xCD); //OK
CreateBuffer(pDev, 512, 0x01); //OK
CreateBuffer(pDev, 512, 0x00); //error: ambiguous call to overloaded function
Sure, I can force a cast or change the method name for solving the issue. I'm just wondering if there's a more serious issue somewhere causing that or if it's just a compiler restriction/bug.
Thanks!