Improve GLSL renderer compatibility with GLES and older cards. #254
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This branch makes some adjustments to the GLSL renderer's texture packing to make it easier for older cards with bad float precision and GLES implementations (which may not have high precision floats in the fragment shader) to not display complete garbage. Requires a minor version increase since it significantly changes the shaders. As a side note, this method of fixing the issue performs a lot better than other (less compatible) solutions I tried like uniform buffers and performing the unpacking step in the vertex shader.
mediump
.Fix char precision issues withoutNot possible with standard 2^-10highp
if possible.mediump
floats; they simply can't accurately represent the texture coordinates required including error (my Nexus 7's Adreno 320 will accumulate too much error withmediump
floats as early as the initialtexture2D()
call to get the layer data!). Instead, MZX will print warnings whenhighp
is unavailable for fragment shaders (and particularly whenmediump
may not be able to handle the fragment shaders).highp
floats when available.These may be unchecked as changes are added.