medfall

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs

commit f7a4321d9a9ce0735a32ff6a88fcabc4618822e1
parent 3ddbd0db73ff252a016fb176d719f964856c7091
Author: Michael Savage <mikejsavage@gmail.com>
Date:   Tue Dec 27 18:12:26 +0200

Fix terrain renderer on AMD

Diffstat:
gpubtt.cc | 7++-----
1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/gpubtt.cc b/gpubtt.cc @@ -60,10 +60,9 @@ void gpubtt_init( PROFILE_BLOCK( "gpubtt_build" ); gpubtt_build( verts, &num_vertices, ohm, btts.left_root, bl, tl, tr ); gpubtt_build( verts, &num_vertices, ohm, btts.right_root, tr, br, bl ); + ASSERT( num_leaves * 3 == num_vertices ); } - VB positions = renderer_new_vb( verts, num_vertices * sizeof( v3 ) ); - TextureConfig normals_config; normals_config.width = ohm->hm.width; normals_config.height = ohm->hm.height; @@ -79,11 +78,9 @@ void gpubtt_init( gpubtt->horizon_map = renderer_new_texture( horizons_config ); MeshConfig mesh_config; - mesh_config.positions = positions; + mesh_config.positions = renderer_new_vb( verts, num_vertices * sizeof( v3 ) ); mesh_config.num_vertices = num_vertices; gpubtt->mesh = renderer_new_mesh( mesh_config ); - - renderer_delete_vb( positions ); } void gpubtt_destroy( GPUBTT * gpubtt ) {