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

Shaders + Matrix: Added mat3 and mat4 #36

Merged
merged 3 commits into from
Jan 23, 2023

Conversation

Vaimer9
Copy link

@Vaimer9 Vaimer9 commented Jan 22, 2023

This PR implements the matrix support outlined in issue #34. All commits are non-breaking and can be found in include\modern_pipeline\shaders.h, Shaders.c and include\core\matrix.h

@Vaimer9
Copy link
Author

Vaimer9 commented Jan 22, 2023

#34

@Vaimer9
Copy link
Author

Vaimer9 commented Jan 22, 2023

It seems as if I removed the newlines at the end of the files, due to unix encoding. Was worried that would happen. Let me know if thats a problem.

Copy link
Contributor

@OkiStuff OkiStuff left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good PR, just one thing:

  • The mat3 and mat4 types do not specify size, it is not guaranteed that these are an array, simply a pointer to a float, or an array that does not match the needed size. typedef int array_type_example[5]; array_type_example my_array = {1,2,3,4,5}.
  • It may also be a good idea to check if the array is NULL, but I can implement that as I want to rework assertions in Muzzle.

@OkiStuff OkiStuff added the enhancement New feature or request label Jan 22, 2023
@OkiStuff OkiStuff linked an issue Jan 22, 2023 that may be closed by this pull request
@Vaimer9
Copy link
Author

Vaimer9 commented Jan 23, 2023

Good PR, just one thing:

  • The mat3 and mat4 types do not specify size, it is not guaranteed that these are an array, simply a pointer to a float, or an array that does not match the needed size. typedef int array_type_example[5]; array_type_example my_array = {1,2,3,4,5}.
  • It may also be a good idea to check if the array is NULL, but I can implement that as I want to rework assertions in Muzzle.

What exactly should be done if the array is NULL? Should I check the entire array's size for NULL?

@OkiStuff
Copy link
Contributor

OkiStuff commented Jan 23, 2023

Good PR, just one thing:

  • The mat3 and mat4 types do not specify size, it is not guaranteed that these are an array, simply a pointer to a float, or an array that does not match the needed size. typedef int array_type_example[5]; array_type_example my_array = {1,2,3,4,5}.
  • It may also be a good idea to check if the array is NULL, but I can implement that as I want to rework assertions in Muzzle.

What exactly should be done if the array is NULL? Should I check the entire array's size for NULL?

No, just the pointer. Also use log_status() for Error Logging. Again I can do that part. I just need the sized types

@OkiStuff OkiStuff changed the title Matrices! Added mat3 and mat4 Shaders + Matrix: Added mat3 and mat4 Jan 23, 2023
@OkiStuff OkiStuff self-requested a review January 23, 2023 14:58
Also replaced error checking with TODO as I need to revamp MZ_ASSERT
Copy link
Contributor

@OkiStuff OkiStuff left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Everything Looks good!

@OkiStuff OkiStuff merged commit 5beaf12 into PikoStudios:revamped_renderer Jan 23, 2023
@OkiStuff
Copy link
Contributor

NOTE: Commit was squashed into one commit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Shader + Matrix: Matrix3 and Matrix4 Uniform uploading
2 participants