xCollateral / VulkanMod

Vulkan renderer mod for Minecraft.
GNU Lesser General Public License v3.0
1.59k stars 181 forks source link

Implement OpenGL default texture #526

Open Fox2Code opened 1 month ago

Fox2Code commented 1 month ago

Also I cannot initialize the defaultTexture field in the static initializer because it crashes due to cycling dependencies.

This is required to properly support Not-Enough-Crashes

xCollateral commented 2 weeks ago

As stated by OpenGL spec:

Texture names are unsigned integers. The value zero is reserved to represent the default texture for each texture target..

Your current implementation is not following that as there's only one global default texture. At the current state it can only be used as a temporary workaround to prevent crashes in cases where the 0 value is bound.

Fox2Code commented 2 weeks ago

As stated by OpenGL spec:

Texture names are unsigned integers. The value zero is reserved to represent the default texture for each texture target..

Your current implementation is not following that as there's only one global default texture. At the current state it can only be used as a temporary workaround to prevent crashes in cases where the 0 value is bound.

Well, I implemented as close to my understanding as possible, if I'm that far from the OpenGL spec, this means I for sure don't understand what the OpenGL spec want to say by using thoses words.

I used this exact statement to guide the implementation included in this PR.

Fox2Code commented 3 days ago

Note: @xCollateral want to do the commit himself, I keep this PR as a reminder for him.