New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Set vertex data fixes #1386
Set vertex data fixes #1386
Conversation
Nice work, can confirm that in cartoon the gradients are corrected properly still with this. :-) |
// Handle persistent vertex attribute flags, by resetting non-persistent colors | ||
// to their default value (and leaving the persistent colors alone - see the | ||
// "Copy all attributes of the previous vertex" comment below) : | ||
static const uint32_t ColorBlack = D3DCOLOR_ARGB(0, 0, 0, 0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Incorrect, it is suppose to be 255 (Alpha), 0 (Red), 0 (Green), 0 (Blue). That's the correct define as black.
P.S. If setting Alpha to 0, then any color is not visible.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
True, except D3D seems to set zero too
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since you know more about DirectX than I do. I'll assume you are correct, since I do not have enough data to determine which one is right.
LOG_TEST_CASE("D3DDevice_SetVertexData4f with active VertexShader"); | ||
X_D3DVertexShader *pXboxVertexShader = VshHandleToXboxVertexShader(g_CurrentXboxVertexShaderHandle); | ||
if (!(pXboxVertexShader->Flags & 0x10/*=X_VERTEXSHADER_PROGRAM*/)) { | ||
ActiveVertexAttributeFlags = pXboxVertexShader->Flags; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 I don't think I would ever find out how to use the current shader into a "X_D3DVertexShader" pointer. 😉
Since it is getting accurate. I'm merging this pull request. |
This builds upon and extends RadWolfie's solution, fixing #1385.
Test case : BeginPush XDK sample.
(One path is untested, thus marked with LOG_TEST_CASE)