mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Avoid a wgpu SPIR-V warning about BitFieldUExtract
premultiply-alpha-vert.glsl contains a function unpack() which, without this change, causes the following warnings: WARN wgpu_core::device: Failed to parse shader SPIR-V code for Some("premultiply-alpha-vert.glsl …"): UnsupportedInstruction(Function, BitFieldUExtract) WARN wgpu_core::device: Proceeding unsafely without validation This avoids that warning (and removes now-unnecessary type conversions).
This commit is contained in:
parent
448e1ba64a
commit
dc0725e104
@ -13,17 +13,14 @@ layout(push_constant) uniform Params {
|
||||
|
||||
layout(location = 0) out vec2 source_coords;
|
||||
|
||||
uvec2 unpack(uint xy) {
|
||||
return uvec2(
|
||||
bitfieldExtract(xy, 0, 16),
|
||||
bitfieldExtract(xy, 16, 16)
|
||||
);
|
||||
vec2 unpack(uint xy) {
|
||||
return vec2(xy & 0xFFFF, (xy >> 16) & 0xFFFF);
|
||||
}
|
||||
|
||||
void main() {
|
||||
vec2 source_size = vec2(unpack(source_size_xy));
|
||||
vec2 target_offset = vec2(unpack(target_offset_xy));
|
||||
vec2 target_size = vec2(unpack(target_size_xy));
|
||||
vec2 source_size = unpack(source_size_xy);
|
||||
vec2 target_offset = unpack(target_offset_xy);
|
||||
vec2 target_size = unpack(target_size_xy);
|
||||
|
||||
// Generate rectangle (counter clockwise triangles)
|
||||
//
|
||||
|
Loading…
Reference in New Issue
Block a user