summaryrefslogtreecommitdiff
path: root/client/src/scene_render.rs
diff options
context:
space:
mode:
Diffstat (limited to 'client/src/scene_render.rs')
-rw-r--r--client/src/scene_render.rs10
1 files changed, 6 insertions, 4 deletions
diff --git a/client/src/scene_render.rs b/client/src/scene_render.rs
index f80f6c2..68d0c49 100644
--- a/client/src/scene_render.rs
+++ b/client/src/scene_render.rs
@@ -5,9 +5,9 @@ use wgpu::{
ColorWrites, CommandEncoder, Device, FragmentState, FrontFace, IndexFormat, LoadOp,
MultisampleState, Operations, PipelineCompilationOptions, PipelineLayoutDescriptor,
PolygonMode, PrimitiveState, PrimitiveTopology, RenderPassColorAttachment,
- RenderPassDescriptor, RenderPipeline, RenderPipelineDescriptor, StoreOp, TextureFormat,
- TextureView, VertexAttribute, VertexBufferLayout, VertexFormat, VertexState, VertexStepMode,
- include_wgsl,
+ RenderPassDescriptor, RenderPipeline, RenderPipelineDescriptor, ShaderStages, StoreOp,
+ TextureFormat, TextureView, VertexAttribute, VertexBufferLayout, VertexFormat, VertexState,
+ VertexStepMode, include_wgsl,
};
use crate::scene_prepare::RPrefab;
@@ -113,7 +113,9 @@ impl ScenePipeline {
for ob in scene.objects.values() {
if let Some(prefab) = self.prefabs.get(&ob.res) {
- for part in &prefab.0 {
+ for (affine, part) in &prefab.0 {
+ let affine = affine.to_cols_array().map(|v| v.to_le_bytes());
+ rpass.set_push_constants(ShaderStages::VERTEX, 0, affine.as_flattened());
rpass.set_index_buffer(part.index.slice(..), IndexFormat::Uint16);
rpass.set_vertex_buffer(0, part.positions.slice(..));
rpass.set_vertex_buffer(1, part.normals.slice(..));