Skip to content

impellerc can generate a vertex shader with no PerVertexData #102521

@dnfield

Description

@dnfield

shader:

// Copyright 2013 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

uniform FrameInfo {
  mat4 mvp;
  vec2 atlas_size;
  vec4 text_color;
} frame_info;

in vec2 unit_vertex;
in mat4 glyph_position;
in vec2 glyph_size;
in vec2 atlas_position;
in vec2 atlas_glyph_size;

out vec2 v_unit_vertex;
out vec2 v_atlas_position;
out vec2 v_atlas_glyph_size;
out vec2 v_atlas_size;
out vec4 v_text_color;

void main() {
  gl_Position = frame_info.mvp
              * glyph_position
              * vec4(unit_vertex.x * glyph_size.x,
                     unit_vertex.y * glyph_size.y, 0.0, 1.0);

  v_unit_vertex = unit_vertex;
  v_atlas_position = atlas_position;
  v_atlas_glyph_size = atlas_glyph_size;
  v_atlas_size = frame_info.atlas_size;
  v_text_color = frame_info.text_color;
}

If you move the mat4 in param to the end, it compiles. @chinmaygarde says he knows what's up.

Metadata

Metadata

Assignees

Labels

P1High-priority issues at the top of the work liste: impellerImpeller rendering backend issues and features requests

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions