|
1 | 1 | // currently windows only because here we need a concrete gfx and os implementation |
2 | | -#![cfg(target_os = "macos")] |
| 2 | +#![cfg(target_os = "windows")] |
3 | 3 |
|
4 | 4 | /// |
5 | 5 | /// Cubemap |
@@ -70,25 +70,26 @@ pub fn setup_cubemap( |
70 | 70 | pub fn render_meshes_cubemap( |
71 | 71 | pmfx: &Res<PmfxRes>, |
72 | 72 | view: &pmfx::View<gfx_platform::Device>, |
| 73 | + cmd_buf: &mut <gfx_platform::Device as Device>::CmdBuf, |
73 | 74 | mesh_draw_query: Query<(&WorldMatrix, &MeshComponent, &TextureInstance)>) -> Result<(), hotline_rs::Error> { |
74 | 75 |
|
75 | 76 | let fmt = view.pass.get_format_hash(); |
76 | 77 | let pipeline = pmfx.get_render_pipeline_for_format(&view.view_pipeline, fmt)?; |
77 | 78 | let camera = pmfx.get_camera_constants(&view.camera)?; |
78 | 79 |
|
79 | | - view.cmd_buf.set_render_pipeline(pipeline); |
80 | | - view.cmd_buf.push_render_constants(0, 16, 0, gfx::as_u8_slice(&camera.view_projection_matrix)); |
| 80 | + cmd_buf.set_render_pipeline(pipeline); |
| 81 | + cmd_buf.push_render_constants(0, 16, 0, gfx::as_u8_slice(&camera.view_projection_matrix)); |
81 | 82 |
|
82 | | - view.cmd_buf.set_heap(pipeline, &pmfx.shader_heap); |
| 83 | + cmd_buf.set_heap(pipeline, &pmfx.shader_heap); |
83 | 84 |
|
84 | 85 | let mut mip = 0; |
85 | 86 | for (world_matrix, mesh, cubemap) in &mesh_draw_query { |
86 | | - view.cmd_buf.push_render_constants(1, 12, 0, &world_matrix.0); |
87 | | - view.cmd_buf.push_render_constants(1, 2, 16, gfx::as_u8_slice(&[cubemap.0, mip, 0, 0])); |
| 87 | + cmd_buf.push_render_constants(1, 12, 0, &world_matrix.0); |
| 88 | + cmd_buf.push_render_constants(1, 2, 16, gfx::as_u8_slice(&[cubemap.0, mip, 0, 0])); |
88 | 89 |
|
89 | | - view.cmd_buf.set_index_buffer(&mesh.0.ib); |
90 | | - view.cmd_buf.set_vertex_buffer(&mesh.0.vb, 0); |
91 | | - view.cmd_buf.draw_indexed_instanced(mesh.0.num_indices, 1, 0, 0, 0); |
| 90 | + cmd_buf.set_index_buffer(&mesh.0.ib); |
| 91 | + cmd_buf.set_vertex_buffer(&mesh.0.vb, 0); |
| 92 | + cmd_buf.draw_indexed_instanced(mesh.0.num_indices, 1, 0, 0, 0); |
92 | 93 |
|
93 | 94 | mip += 1; |
94 | 95 | } |
|
0 commit comments