Skip to content

Commit

Permalink
Merge #176
Browse files Browse the repository at this point in the history
176: Fix instanced rendering of textured meshes r=kvark a=vitvakatu
  • Loading branch information
bors[bot] committed Feb 6, 2018
2 parents 24e1cd9 + 1f32a94 commit 95bf8e9
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions src/render/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -797,10 +797,16 @@ impl Renderer {
let pso_data = material.to_pso_data();

if let Some(ref key) = gpu_data.instance_cache_key {
let uv_range = [0.0; 4];
let (color, mat_param) = match pso_data {
PsoData::Basic { color, param0, .. } => (color, param0),
PsoData::Pbr { .. } => (!0, 0.0),
let (color, mat_param, uv_range) = match pso_data {
PsoData::Basic { color, param0, ref map } => {
let uv_range = if let Some(ref texture) = *map {
texture.uv_range()
} else {
[0.0; 4]
};
(color, param0, uv_range)
},
PsoData::Pbr { .. } => (!0, 0.0, [0.0; 4]),
};
let vec = self.instance_cache.entry(key.clone()).or_insert((
InstanceData {
Expand Down

0 comments on commit 95bf8e9

Please sign in to comment.