I think it's risky to store the lock in the vkd3d_view, because if the current thread hasn't already inc'd the ref count, the view could be deallocated at any time.

The core problem is that while ref counting is fine for concurrent management of object lifetime, it's not a safe way to acquire a reference to an object to which we have no reference. You could have just incremented the ref count of a deallocated object! So we need locks to protect the acquisition of a reference. I've attached a patch which does this and is sufficient to get the game working. It uses the device mutex so is not optimal, but it's designed to spend the minimum amount of time locked. See if you can make a faster spinlock version.