+ | Better memory organising

This commit is contained in:
TheRedShip
2025-01-06 10:58:06 +01:00
parent a0cd7a3709
commit cbd1768fcc
10 changed files with 9 additions and 8 deletions

BIN
.objs/srcs/RT.o Normal file

Binary file not shown.

BIN
.objs/srcs/class/Camera.o Normal file

Binary file not shown.

BIN
.objs/srcs/class/Scene.o Normal file

Binary file not shown.

Binary file not shown.

BIN
.objs/srcs/class/Shader.o Normal file

Binary file not shown.

BIN
.objs/srcs/class/Window.o Normal file

Binary file not shown.

BIN
.objs/srcs/gl.o Normal file

Binary file not shown.

BIN
RT Executable file

Binary file not shown.

View File

@ -19,15 +19,16 @@ struct GPUObject
{ {
alignas(16) glm::vec3 position; alignas(16) glm::vec3 position;
int mat_index; alignas(16) glm::vec3 normal; // plane triangle
float radius; // sphere
alignas(16) glm::vec3 normal; // plane
alignas(16) glm::vec3 vertex1; //quad triangle alignas(16) glm::vec3 vertex1; //quad triangle
alignas(16) glm::vec3 vertex2; //quad triangle alignas(16) glm::vec3 vertex2; //quad triangle
float radius; // sphere
int mat_index;
int type; int type;
}; };
struct GPUMaterial struct GPUMaterial

View File

@ -7,14 +7,14 @@ layout(binding = 1, rgba32f) uniform image2D accumulation_image;
struct GPUObject { struct GPUObject {
vec3 position; // 12 + 4 vec3 position; // 12 + 4
int mat_index; // 4
float radius; // 4
vec3 normal; // 12 + 4 vec3 normal; // 12 + 4
vec3 vertex1; // 12 + 4 vec3 vertex1; // 12 + 4
vec3 vertex2; // 12 + 4 vec3 vertex2; // 12 + 4
float radius; // 4
int mat_index; // 4
int type; // 4 int type; // 4
}; };