Skip to content
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

Merged
merged 3 commits into from Aug 13, 2018
Merged

Conversation

PatrickvL
Copy link
Member

@PatrickvL PatrickvL commented Aug 13, 2018

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)

@Voxel9
Copy link
Member

Voxel9 commented Aug 13, 2018

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);
Copy link
Member

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.

Copy link
Member Author

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

Copy link
Member

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;
Copy link
Member

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. 😉

@RadWolfie
Copy link
Member

Since it is getting accurate. I'm merging this pull request.

@RadWolfie RadWolfie merged commit 1926e04 into Cxbx-Reloaded:develop Aug 13, 2018
@PatrickvL PatrickvL deleted the SetVertexData_fixes branch August 14, 2018 07:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants