Skip to content

Commit 06fed02

Browse files
committed
test(tvos): inspect producer sampler texture and shader uniforms
1 parent dad1ea1 commit 06fed02

3 files changed

Lines changed: 24 additions & 2 deletions

File tree

‎.github/workflows/tvos.yml‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,8 @@ jobs:
171171
if any(marker in line for marker in ["orientation:", "decoder:", "viewport:", "video result:",
172172
"render context was not ready", "first video frame",
173173
"render context handoff did not complete", "native target:",
174-
"native GL provider:", "native draw:", "native renderer result:"]):
174+
"native GL provider:", "native draw:", "native renderer result:",
175+
"native uniform:", "native sampler:"]):
175176
print(line)
176177
raise SystemExit(1)
177178
finally:

‎src/player/MpvVideoItem.cpp‎

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,26 @@ namespace {
9292
double(nativeVertexData[2]), double(nativeVertexData[3]), double(nativeVertexData[4]), double(nativeVertexData[5]),
9393
double(nativeVertexData[6]), double(nativeVertexData[7]), double(nativeVertexData[8]), double(nativeVertexData[9]),
9494
double(nativeVertexData[10]), double(nativeVertexData[11]), unsigned(::glGetError()));
95+
for (const char *name : { "texture_size0", "texture_rot0", "texture_off0", "pixel_size0" }) {
96+
const GLint location = ::glGetUniformLocation(program, name);
97+
GLfloat values[16] {};
98+
if (location >= 0)
99+
::glGetUniformfv(program, location, values);
100+
std::fprintf(stderr, "native uniform: name=%s location=%d values=%g,%g,%g,%g\n", name, location,
101+
double(values[0]), double(values[1]), double(values[2]), double(values[3]));
102+
}
103+
const GLint sampler = ::glGetUniformLocation(program, "texture0");
104+
if (sampler >= 0) {
105+
GLint unit = 0, active = 0, texture = 0, width = 0, height = 0;
106+
::glGetUniformiv(program, sampler, &unit);
107+
::glGetIntegerv(GL_ACTIVE_TEXTURE, &active);
108+
::glActiveTexture(GL_TEXTURE0 + unit);
109+
::glGetIntegerv(GL_TEXTURE_BINDING_2D, &texture);
110+
::glGetTexLevelParameteriv(GL_TEXTURE_2D, 0, GL_TEXTURE_WIDTH, &width);
111+
::glGetTexLevelParameteriv(GL_TEXTURE_2D, 0, GL_TEXTURE_HEIGHT, &height);
112+
std::fprintf(stderr, "native sampler: unit=%d texture=%d size=%dx%d\n", unit, texture, width, height);
113+
::glActiveTexture(active);
114+
}
95115
}
96116
::glDrawArrays(mode, first, count);
97117
}

‎tools/apple/smoke-tvos.sh‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,8 @@ for bundle, arguments, expected in checks:
103103
marker in line for marker in ["[vd]", "[vo/libmpv]", "[libmpv_render", "[ffmpeg/video]",
104104
"player: render backend", "first video frame",
105105
"render context handoff did not complete", "native target:", "native GL provider:",
106-
"native presentation diagnostic:", "native draw:", "native renderer result:"]):
106+
"native presentation diagnostic:", "native draw:", "native renderer result:",
107+
"native uniform:", "native sampler:"]):
107108
print(re.sub(r"https?://\S+", "[redacted-url]", line))
108109
if any(marker in line for marker in ["launch test:", "video result:", "orientation:", "viewport:", "decoder:",
109110
"render context was not ready", "failed to initialize mpv",

0 commit comments

Comments
 (0)