/* 
 * This file is automaticaly generated, Please dont edit this file! 
 */
#include <engine/renderPasses/renderPassCompute.h> 




























void compute_prepare( compute * this ) {

		printf("\n\n\n		Prepare renderPass Compute\n\n\n\n\n");

		shader * computeShader = shader_newPointer( GL_COMPUTE_SHADER );

		shader_loadFromFile( computeShader,  "assets/shaders/addition.comp" );


		this->program 			= program_newPointer();

		program_addShader( this->program,  computeShader );

		program_create( this->program );


		vector_vector2 * inputA = vector_vector2_newPointer();

		for (int i = 0; i < 100; ++i)
		{

			vector2 a	= vector2_new( i, i );

			vector_vector2_add( inputA,  a );

		}

		vector_vector2 * inputB = vector_vector2_newPointer();

		for (int i = 0; i < 100; ++i)
		{

			vector2 a	= vector2_new( 0, 10 );

			vector_vector2_add( inputB,  a );

		}

		block * inputBlock				= program_getBlock( this->program,  "inputBlock" );

		block_setMemberArray( inputBlock,  "array_a[0]", ( float * ) inputA->items );

		block_setMemberArray( inputBlock,  "array_b[0]", ( float * ) inputB->items );

		block_upload( inputBlock );

	}

void compute_render( compute * this ) {

		program_use( this->program );

		program_bindBlock( this->program,  "inputBlock");

		program_bindBlock( this->program,  "outputBlock");


		glDispatchCompute( 1, 1, 1 );

		glMemoryBarrier( GL_SHADER_STORAGE_BARRIER_BIT );

	}

compute compute_new() {

	compute instance;

	instance.active =  true;

	return instance;

}

compute * compute_newPointer() {

	struct compute * pointer = malloc( sizeof ( struct compute ) );

	pointer->active =  true;

	return pointer;

}

