mirror of
https://github.com/gfx-rs/wgpu.git
synced 2024-11-23 15:23:33 +00:00
[glsl-in] Allow field selection behind pointers (#948)
This commit is contained in:
parent
87748a2fe3
commit
1c3baf4557
@ -116,7 +116,11 @@ impl Program<'_> {
|
||||
name: &str,
|
||||
meta: SourceMetadata,
|
||||
) -> Result<Handle<Expression>, ErrorKind> {
|
||||
match *self.resolve_type(ctx, expression, meta)? {
|
||||
let ty = match *self.resolve_type(ctx, expression, meta)? {
|
||||
TypeInner::Pointer { base, .. } => &self.module.types[base].inner,
|
||||
ref ty => ty,
|
||||
};
|
||||
match *ty {
|
||||
TypeInner::Struct { ref members, .. } => {
|
||||
let index = members
|
||||
.iter()
|
||||
|
9
tests/in/glsl/901-lhs-field-select.vert
Normal file
9
tests/in/glsl/901-lhs-field-select.vert
Normal file
@ -0,0 +1,9 @@
|
||||
// AUTHOR: JCapucho
|
||||
// ISSUE: #901
|
||||
// FIX: #948
|
||||
#version 450
|
||||
|
||||
void main() {
|
||||
vec4 a = vec4(1.0);
|
||||
a.x = 2.0;
|
||||
}
|
Loading…
Reference in New Issue
Block a user