texturing problems
Texture errors and my debugging/RE notes.
This covers all the GLES2 texture fails for GC3000, there are more mipmap / cubemap related fails on GC7000Lite.
-
G7000Lite texture sampling in vertex shader not working at all - Use
VIVS_NTE_DESCRIPTOR_ADDR_MIRROR
instead ofVIVS_NTE_DESCRIPTOR_ADDR
- change
VIVS_VS_SAMPLER_BASE
(we add the base offset ourselves in the shader) - missing flush/synchronization after changing texture state (works if 2000 NOPs inserted...)
- Use
-
G7000Lite RGB565 texture - blt engine is using
B4G4R4A4
format for the blit - somehow the 4-bit alpha channel is set to all ones (RGB565 works if the blt engine uses RGB565 for the blit)
- blt engine is using
-
linear_nearest
/nearest_linear
filters broken- Looks like HW will never choose MIN filter if LOD_CONFIG_MAX is 0, setting it to at least 1 fixes it (on GC7000Lite, SAMP_LOD_MINMAX_MAX, needs to be at least 4 - I guess this means rnndb is wrong and the lower 2 bits don't exist)
-
nearest
filter behavior is wrong- caused the
VIVS_TE_SAMPLER_CONFIG0_ROUND_UV
bit, which shouldn't be set
- caused the
-
cube map texture alignment problem - The use of
etna_adjust_rs_align
to adjust Y alignment is wrong, as there's no way to tell the texture hardware about this alignment (this affects cubemaps and array textures if they get implemented). In GLES2 this affects A8 / L8A8 formats on GC3000, because the tiling mode has a Y alignment of 4 which is then adjusted to 8.
- The use of
-
rendering to cube maps is broken (for resource copy / mipmap generation) - Using the software mipmaps/blit works as a temporary fix, haven't yet figured out the real problem
-
cube map sampling from wrong mipmap layer (GC3000, possibly others) - HW rounding error when calculating LOD for cube map mipmaps? the deqp test draws (for example) a 8x8 surface and one pixel comes from the 4x4 mipmap layer (other pixels OK). The error seems large because I need to hack in a LOD_BIAS of -3 (-0.09375) for it to not sample from the next layer (-2 is not enough).