Switch naming convention for shaders
Switch to using sentence-case naming convention but with one character prefixes for different types. This is a no-op change. PiperOrigin-RevId: 417791624
This commit is contained in:
parent
0e61f44d4d
commit
920d0c5842
@ -13,8 +13,8 @@
|
||||
// limitations under the License.
|
||||
#extension GL_OES_EGL_image_external : require
|
||||
precision mediump float;
|
||||
uniform samplerExternalOES tex_sampler;
|
||||
varying vec2 v_texcoord;
|
||||
uniform samplerExternalOES uTexSampler;
|
||||
varying vec2 vTexCoords;
|
||||
void main() {
|
||||
gl_FragColor = texture2D(tex_sampler, v_texcoord);
|
||||
gl_FragColor = texture2D(uTexSampler, vTexCoords);
|
||||
}
|
||||
|
@ -11,12 +11,12 @@
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
attribute vec4 a_position;
|
||||
attribute vec4 a_texcoord;
|
||||
uniform mat4 tex_transform;
|
||||
uniform mat4 transformation_matrix;
|
||||
varying vec2 v_texcoord;
|
||||
attribute vec4 aPosition;
|
||||
attribute vec4 aTexCoords;
|
||||
uniform mat4 uTexTransform;
|
||||
uniform mat4 uTransformationMatrix;
|
||||
varying vec2 vTexCoords;
|
||||
void main() {
|
||||
gl_Position = transformation_matrix * a_position;
|
||||
v_texcoord = (tex_transform * a_texcoord).xy;
|
||||
gl_Position = uTransformationMatrix * aPosition;
|
||||
vTexCoords = (uTexTransform * aTexCoords).xy;
|
||||
}
|
||||
|
@ -74,7 +74,7 @@ import java.util.concurrent.atomic.AtomicInteger;
|
||||
}
|
||||
|
||||
glProgram.setBufferAttribute(
|
||||
"a_position",
|
||||
"aPosition",
|
||||
new float[] {
|
||||
-1.0f, -1.0f, 0.0f, 1.0f,
|
||||
1.0f, -1.0f, 0.0f, 1.0f,
|
||||
@ -83,7 +83,7 @@ import java.util.concurrent.atomic.AtomicInteger;
|
||||
},
|
||||
/* size= */ 4);
|
||||
glProgram.setBufferAttribute(
|
||||
"a_texcoord",
|
||||
"aTexCoords",
|
||||
new float[] {
|
||||
0.0f, 0.0f, 0.0f, 1.0f,
|
||||
1.0f, 0.0f, 0.0f, 1.0f,
|
||||
@ -91,10 +91,10 @@ import java.util.concurrent.atomic.AtomicInteger;
|
||||
1.0f, 1.0f, 0.0f, 1.0f,
|
||||
},
|
||||
/* size= */ 4);
|
||||
glProgram.setSamplerTexIdUniform("tex_sampler", textureId, /* unit= */ 0);
|
||||
glProgram.setSamplerTexIdUniform("uTexSampler", textureId, /* unit= */ 0);
|
||||
|
||||
float[] transformationMatrixArray = getGlMatrixArray(transformationMatrix);
|
||||
glProgram.setFloatsUniform("transformation_matrix", transformationMatrixArray);
|
||||
glProgram.setFloatsUniform("uTransformationMatrix", transformationMatrixArray);
|
||||
|
||||
@Nullable
|
||||
SurfaceView debugSurfaceView =
|
||||
@ -230,7 +230,7 @@ import java.util.concurrent.atomic.AtomicInteger;
|
||||
public void processData() {
|
||||
inputSurfaceTexture.updateTexImage();
|
||||
inputSurfaceTexture.getTransformMatrix(textureTransformMatrix);
|
||||
glProgram.setFloatsUniform("tex_transform", textureTransformMatrix);
|
||||
glProgram.setFloatsUniform("uTexTransform", textureTransformMatrix);
|
||||
glProgram.bindAttributesAndUniforms();
|
||||
|
||||
focusAndDrawQuad(eglSurface, outputWidth, outputHeight);
|
||||
|
Loading…
x
Reference in New Issue
Block a user