Add shader constructor for in-memory buffer.