This commit is contained in:
RedShip
2025-01-10 21:31:55 +01:00
parent 9aa1de378f
commit 08fb9c37ad
8 changed files with 181 additions and 181 deletions

View File

@ -6,7 +6,7 @@
/* By: ycontre <ycontre@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/09/27 14:51:49 by TheRed #+# #+# */
/* Updated: 2025/01/09 16:17:29 by tomoron ### ########.fr */
/* Updated: 2025/01/10 19:12:40 by ycontre ### ########.fr */
/* */
/* ************************************************************************** */
@ -44,7 +44,7 @@ int main(int argc, char **argv)
glGetIntegerv(GL_MAX_SHADER_STORAGE_BLOCK_SIZE, &max_gpu_size);
const std::vector<GPUObject> &object_data = scene.getObjectData();
const std::vector<GPUMaterial> &material_data = scene.getMaterialData();
std::vector<GPUMaterial> &material_data = scene.getMaterialData();
std::cout << "Sending " << object_data.size() << " objects for " << \
object_data.size() * sizeof(GPUObject) + material_data.size() * sizeof(GPUMaterial) \
<< " / " << max_gpu_size << " bytes" << std::endl;
@ -56,11 +56,11 @@ int main(int argc, char **argv)
glBindBuffer(GL_SHADER_STORAGE_BUFFER, objectSSBO);
glBufferData(GL_SHADER_STORAGE_BUFFER, object_data.size() * sizeof(GPUObject), object_data.data(), GL_DYNAMIC_DRAW);
glBindBufferBase(GL_SHADER_STORAGE_BUFFER, 1, objectSSBO);
glBindBufferBase(GL_SHADER_STORAGE_BUFFER, 0, objectSSBO);
glBindBuffer(GL_SHADER_STORAGE_BUFFER, materialSSBO);
glBufferData(GL_SHADER_STORAGE_BUFFER, material_data.size() * sizeof(GPUMaterial), material_data.data(), GL_DYNAMIC_DRAW);
glBindBufferBase(GL_SHADER_STORAGE_BUFFER, 2, materialSSBO);
glBindBufferBase(GL_SHADER_STORAGE_BUFFER, 1, materialSSBO);
GPUCamera camera_data = scene.getCamera()->getGPUData();
glBindBuffer(GL_UNIFORM_BUFFER, cameraUBO);

View File

@ -6,7 +6,7 @@
/* By: ycontre <ycontre@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/12/23 18:29:41 by ycontre #+# #+# */
/* Updated: 2025/01/08 20:08:03 by ycontre ### ########.fr */
/* Updated: 2025/01/10 18:58:57 by ycontre ### ########.fr */
/* */
/* ************************************************************************** */
@ -153,7 +153,7 @@ const std::vector<GPUObject>& Scene::getObjectData() const
return (_gpu_objects);
}
const std::vector<GPUMaterial>& Scene::getMaterialData() const
std::vector<GPUMaterial>& Scene::getMaterialData()
{
return (_gpu_materials);
}

View File

@ -6,7 +6,7 @@
/* By: ycontre <ycontre@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/10/13 20:21:13 by ycontre #+# #+# */
/* Updated: 2024/10/14 19:52:40 by ycontre ### ########.fr */
/* Updated: 2025/01/10 18:53:39 by ycontre ### ########.fr */
/* */
/* ************************************************************************** */