VulkanMod icon indicating copy to clipboard operation
VulkanMod copied to clipboard

Implement OpenGL default texture

Open Fox2Code opened this issue 1 year ago • 3 comments

  • https://registry.khronos.org/OpenGL-Refpages/gl4/html/glBindTexture.xhtml
    "The value zero is reserved to represent the default texture for each texture target."

  • https://stackoverflow.com/questions/15273674/binding-a-zero-texture-in-opengl
    (Link show graphics drivers usually make it black or white, but specifics are undefined)

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

Fox2Code avatar Oct 14 '24 16:10 Fox2Code

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.

xCollateral avatar Nov 03 '24 14:11 xCollateral

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 avatar Nov 03 '24 23:11 Fox2Code

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

Fox2Code avatar Nov 19 '24 15:11 Fox2Code