[4.6pre-229] Player color not changing using Vulkan

Sat May 15, 2021 10:37 pm

I don't know since when this bug has been present, but I just noticed it using the latest devbuild (aaf8323eb294b1a5ab258b729df714488be11c2a).

Using Vulkan, if you go to Player Setup and change colors, they don't get reflected in the player preview box, instead it uses the last color that was applied to the sprite (caching related?).

Steps to reproduce:

- Use the Vulkan backend.
- Go to Player Setup, and change the player color.

Re: [4.6pre-229] Player color not changing using Vulkan

Tue May 18, 2021 5:42 am

I will investigate this further later if I have time, but I had to stop temporarily. So far in my investigation though, I've found that VkRenderState::ApplyMaterial() is not called anywhere near the same way that FGLRenderState::ApplyMaterial(FMaterial *mat, int clampmode, int translation, int overrideshader) is - which has actual parameters in its function prototype. Which is relevant because the GL version has this line:
Code:
   lastTranslation = translation;


Hopefully I can do more with this later. Not even sure if I am hitting the right function here - but the Vulkan version of that function is quite a bit more simplified.

Re: [4.6pre-229] Player color not changing using Vulkan

Tue May 18, 2021 7:14 am

Well turns out I can't fix this one on my own, I don't know enough about what is going on here. I attempted this to fix it:
Spoiler:

but that did absolutely nothing to help with the situation.

Re: [4.6pre-229] Player color not changing using Vulkan

Sat May 22, 2021 2:54 pm

I noticed that this seemed to be fixed in gzdoom-x64-g4.6pre-259-gfef835bca, but is misbehaving again in gzdoom-x64-g4.6pre-264-gbe4e19b07.

EDIT: I take it back, I was using OpenGL when it worked, and didn't notice the correlation.