Branimir Karadžić il y a 8 ans
Parent
commit
3bbbb4c324
2 fichiers modifiés avec 14 ajouts et 16 suppressions
  1. 13 15
      examples/08-update/cs_update.sc
  2. 1 1
      examples/08-update/update.cpp

+ 13 - 15
examples/08-update/cs_update.sc

@@ -5,28 +5,26 @@
 
 
 #include "bgfx_compute.sh"
 #include "bgfx_compute.sh"
 
 
-IMAGE2D_ARRAY_WR(s_texColor,rgba8,0);
+IMAGE2D_ARRAY_WR(s_texColor, rgba8, 0);
 uniform vec4 u_time;
 uniform vec4 u_time;
 
 
 NUM_THREADS(16, 16, 1)
 NUM_THREADS(16, 16, 1)
 void main()
 void main()
 {
 {
-	vec3 colors[] = {
-		vec3(1,0,0),
-		vec3(1,1,0),
-		vec3(1,0,1),
-		vec3(0,1,0),
-		vec3(0,1,1),
-		vec3(0,0,1),
+	vec3 colors[] =
+	{
+		vec3(1.0, 0.0, 0.0),
+		vec3(1.0, 1.0, 0.0),
+		vec3(1.0, 0.0, 1.0),
+		vec3(0.0, 1.0, 0.0),
+		vec3(0.0, 1.0, 1.0),
+		vec3(0.0, 0.0, 1.0),
 	};
 	};
 
 
-	for (int face=0;face<6;face++)
+	for (int face = 0; face < 6; face++)
 	{
 	{
-		vec3 color = colors[face]*0.75 + sin( u_time.x*4.0 )*0.25;
-		ivec3 dest = ivec3( gl_GlobalInvocationID.xy, face );
-		imageStore( s_texColor, dest, vec4(color,1) );
+		vec3 color = colors[face]*0.75 + sin(u_time.x*4.0)*0.25;
+		ivec3 dest = ivec3(gl_GlobalInvocationID.xy, face);
+		imageStore(s_texColor, dest, vec4(color,1) );
 	}
 	}
 }
 }
-
-
-

+ 1 - 1
examples/08-update/update.cpp

@@ -256,7 +256,7 @@ public:
 		if (m_computeSupported)
 		if (m_computeSupported)
 		{
 		{
 			m_textureCube[2] = bgfx::createTextureCube(
 			m_textureCube[2] = bgfx::createTextureCube(
-				textureside
+				  textureside
 				, false
 				, false
 				, 1
 				, 1
 				, bgfx::TextureFormat::RGBA8
 				, bgfx::TextureFormat::RGBA8