Repository navigation
gfx: one name per uniform statement, so the Tizen emulator compiles the ambient shader - #1481
Merged
Merged
Conversation
…ribute A host test, red against vs_ambient.vert's four-name uniform statement. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
On the Samsung TV 10.0 emulator (YaGL, which hands shaders to Mesa llvmpipe) the three programs built on vs_ambient.vert fail to link with "all shaders must use same shading language version", while the eleven other required pairs link. `uniform vec4 u_atl, u_atr, u_abr, u_abl;` is the only multi-declarator statement in shaders/, so it is split into four one-name declarations. The uniforms are looked up by name, so a conforming driver reads the same program. The scan test the previous commit added now passes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The emulator rejects VS_AMBIENT_DITHERED at its dither varying; the four-name uniform statement was the only multi-declarator, which makes it the suspected cause, not a confirmed one. The test's doc, its failure message and the shader's comment now say that. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
On the TV 10.0 x86_64 emulator, with the Tizen hello-world probe (samsung/hello-tpk at e8da14c), the unsplit vs_ambient.vert failed, the split source compiled, a cut-down variant did the same, and with the split all 14 required programs compiled and linked and plx_gfx drew. The host test's doc comment and the shader's comment said the split was only the suspected cause; they now state what was measured and what is still not established (why YaGL rejects the statement, and the optional straighten program that still fails there). The doc comment also no longer says that gfx_compile exits the process: a required shader's rejection stops the app from starting, whichever way that is done. The test's assertion message says the same as the comment. Co-Authored-By: Claude <noreply@anthropic.com>
The comment said every declaration names one variable, and that the host test keeps the sources one-per-statement. The test enforces only uniform, varying and attribute statements, and its self-test allows a local `vec2 a, b;`. The comment now says the same as the test's doc comment. Co-Authored-By: Claude <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Samsung's TV 10.0 emulator (YaGL GLES 2.0 over the host's Mesa) rejected the ambient vertex shader. plx_gfx could not start there: a required shader's rejection stops the app from starting. The one statement that declared four uniforms at once is now four statements, and a host test keeps every shader at one name per
uniform/varying/attributestatement.Evidence (emulator, probe build
samsung/hello-tpkate8da14ce6)VS_AMBIENT_DITHEREDfails with0:37(9): error: syntax error, unexpected NEW_IDENTIFIER, atvarying highp vec2 v_dither_nc;. The same source with the four corners split compiles. A cut-down variant shows the same before and after.#version 100preamble also makes it compile, but the link then fails ("all shaders must use same shading language version"), so that route was dropped.init_gl,init_text,init_imageandinit_blurreturn, and plx_gfx draws a rect and text, with glGetError 0 at init, frame and swap, for 3420 frames.webOS: the same GPU code (measured on the dev set)
The question was whether the split could cost frames on LG. It cannot, because the driver compiles both spellings to the same program. A scratch-only build of
e2088058d(before) and of9ed56b066(after), bothARM_PROFILE=release, read each program back withglGetProgramBinaryOES(Mali format0x8f61). Each side ran one--guest --mockboot, no keys sent.vs_ambient.vert)APROGcb84345b…abeae19APROG_PLAIN50f2bc08…099c237SCRIM_PROGa8a8f462…af366f2a5ART_WASHea59375d…9a2d5PROG(control, unchanged)22586859…bd9e2bSPROG(control, unchanged)716b5515…c82aglUniform4f.Tests
the_one_name_per_declaration_scan_counts_exactly_the_storage_statements_with_two_names: the scan countsuniform vec4 a, b;and its array and multi-line forms. It does not count commas in comments, parameter lists, array sizes, locals, or identifiers that merely contain a storage keyword.every_shader_keeps_one_name_per_declaration_in_a_uniform_varying_or_attribute_statement: walksshaders/, so a new shader is covered by being added. It was red before the split.make test-crate C=plx_gfx:test result: ok. 282 passed; 0 failed; 14 ignored.🤖 Generated with Claude Code