Delete `GlobalTypeKind`.
Break out `Writer::write_global`'s code into two new functions,
`write_simple_global` and `write_interface_block`. This introduces
some repeated code, but the way we need to produce interface blocks
and normal globals are sufficiently different that I think it's
clearer overall to just separate them entirely. Much of the details
are handled by their callees.
Loosen the interface block code to support arbitrary types.
* [hlsl-out] add padding at the end of structs and after struct members of type matrix and array (when necessary)
* use wrapped constructor fn for constants
* add array as fn arg test
* fix glsl array fn arg
* add wrapped constructor for arrays
* [glsl-out] support multidimensional arrays
* address comments
* Implement Clamp function.
* Fix the return error type.
Change `ConstantSolvingError::InvalidMathArg` to `ConstantSolvingError::NotImplemented`
for the clamp function with the input of unimplemented types.
Unimplemented types:
- vec2
- vec3
- vec4
* [glsl-in] Add helpers that implement the glsl's `max` and `min` functions.
Co-authored-by: JCapucho <jcapucho7@gmail.com>
* Fix grammar.
Co-authored-by: JCapucho <jcapucho7@gmail.com>
* hlsl-out: don't output interpolation modifier if it's the default (linear/`Interpolation::Perspective`)
* Remove linear interpolation modifiers from HLSL output tests
Without this change, `LifetimeTracker::triage_suspected` never notices
that compute or render pipelines are free, and they stick around until
the hub is destroyed.
Fixes#2564.
Go ahead and call `global.device_drop` from `direct::Context::device_drop`.
Let `Global::device_drop` simply drop the life guard's `RefCount`, and
put off everything else entailed in freeing a device until
`Device::maintain` says its queue is empty and there are no more
references to it. (The user can reach that function, even after
dropping their `Device`, by calling `wgpu::Instance::poll_all`.)
Fixes#2563.
* add support for zero value constructors and constructors that infer their type from their parameters
* address comments
* extract constructor machinery into new module
* fix doc link