Jump to content

  • Log In with Google      Sign In   
  • Create Account

#Actualachild

Posted 20 December 2012 - 10:42 AM

Again, keep in mind DOD and OOP are not mutually exclusive.

Using the SoA example, say you have a 3d model resource that stores its vertices. You may store them as a vector of Vec3, or you may store them as 3 separate float vectors. Either way your 3d model resource is hopefully very simple in purpose (SRP) as a container of the necessary data. The way you organize that data is up to you. Now, even in this example, it's not as easy as SoA versus AoS. The 3 vectors of floats might be nice for SIMD usage, but those vectors could be in very different parts of memory. If you are bound by memory transfer rates then the vector of Vec3 (or Vec4) might actually be a more optimized organization of your data. And SIMD doens't have to be out of the question here because more and more I am seeing horizontal instructions.

DOD is not about doing it this way or that, it is about programming around the best way to organize your data. You have to figure out what "best way" means though, given your situation. [edit] And it doesn't get you off the hook from figuring out how to best organize your code Posted Image

As another example, think about how you might store a binary tree in a single array...


[a lot of thoughtful insight]

This sounds to me like a mix of Data Driven Programming and Data Oriented Design. Just wanted to make note that they are 2 very different concepts.

#3achild

Posted 20 December 2012 - 10:37 AM

Again, keep in mind DOD and OOP are not mutually exclusive.

Using the SoA example, say you have a 3d model resource that stores its vertices. You may store them as a vector of Vec3, or you may store them as 3 separate float vectors. Either way your 3d model resource is hopefully very simple in purpose (SRP) as a container of the necessary data. The way you organize that data is up to you. Now, even in this example, it's not as easy as SoA versus AoS. The 3 vectors of floats might be nice for SIMD usage, but those vectors could be in very different parts of memory. If you are bound by memory transfer rates then the vector of Vec3 (or Vec4) might actually be a more optimized organization of your data. And SIMD doens't have to be out of the question here because more and more I am seeing horizontal instructions.

DOD is not about doing it this way or that, it is about programming around the best way to organize your data. You have to figure out what "best way" means though, given your situation.

As another example, think about how you might store a binary tree in a single array...


[a lot of thoughtful insight]

This sounds to me like a mix of Data Driven Programming and Data Oriented Design. Just wanted to make note that they are 2 very different concepts.

#2achild

Posted 20 December 2012 - 10:36 AM

Again, keep in mind DOD and OOP are not mutually exclusive.

Using the SoA example, say you have a 3d model resource that stores its vertices. You may store them as a vector of Vec3, or you may store them as 3 separate float vectors. Either way your 3d model resource is hopefully very simple in purpose (SRP) as a container of the necessary data. The way you organize that data is up to you. Now, even in this example, it's not as easy as SoA versus AoS. The 3 vectors of floats might be nice for SIMD usage, but those vectors could be in very different parts of memory. If you are bound by memory transfer rates then the vector of Vec3 (or Vec4) might actually be a more optimized organization of your data. And SIMD doens't have to be out of the question here because more and more I am seeing horizontal instructions.

DOD is not about doing it this way or that, it is about programming around the best way to organize your data. You have to figure out what "best way" means though, given your situation.

As another example, think about how you might store a binary tree in a single array...


[a lot of thoughtful insight]

I believe you are thinking of Data Driven Programming rather than Data Oriented Design.

#1achild

Posted 20 December 2012 - 10:36 AM

Again, keep in mind DOD and OOP are not mutually exclusive.

Using the SoA example, say you have a 3d model resource that stores its vertices. You may store them as a vector of Vec3, or you may store them as 3 separate float vectors. Either way your 3d model resource is hopefully very simple in purpose (SRP) as a container of the necessary data. The way you organize that data is up to you. Now, even in this example, it's not as easy as SoA versus AoS. The 3 vectors of floats might be nice for SIMD usage, but those vectors could be in very different parts of memory. If you are bound by memory transfer rates then the vector of Vec3 (or Vec4) might actually be a more optimized organization of your data. And SIMD doens't have to be out of the question here because more and more I am seeing horizontal instructions.

DOD is not about doing it this way or that, it is about programming around the best way to organize your data. You have to figure out what "best way" means though, given your situation.

As another example, think about how you might store a binary tree in a single array...


[a lot of thoughtful insight]

I believe you are thinking of Data Driven Programming rather than Data Oriented Design.

PARTNERS