Transformer GL: Rename TexCoords to TexSampleCoords.
The variable marks the coordinates used to sample from a texture, so hopefully this makes the naming a bit more descriptive. This renames vTexCoords and aTexCoords. No functional changes intended. PiperOrigin-RevId: 433499934
This commit is contained in:
parent
e531e788df
commit
0587a4f9c4
@ -18,7 +18,7 @@
|
|||||||
|
|
||||||
precision mediump float;
|
precision mediump float;
|
||||||
uniform sampler2D uTexSampler;
|
uniform sampler2D uTexSampler;
|
||||||
varying vec2 vTexCoords;
|
varying vec2 vTexSamplingCoord;
|
||||||
void main() {
|
void main() {
|
||||||
gl_FragColor = texture2D(uTexSampler, vTexCoords);
|
gl_FragColor = texture2D(uTexSampler, vTexSamplingCoord);
|
||||||
}
|
}
|
||||||
|
@ -19,7 +19,7 @@
|
|||||||
#extension GL_OES_EGL_image_external : require
|
#extension GL_OES_EGL_image_external : require
|
||||||
precision mediump float;
|
precision mediump float;
|
||||||
uniform samplerExternalOES uTexSampler;
|
uniform samplerExternalOES uTexSampler;
|
||||||
varying vec2 vTexCoords;
|
varying vec2 vTexSamplingCoord;
|
||||||
void main() {
|
void main() {
|
||||||
gl_FragColor = texture2D(uTexSampler, vTexCoords);
|
gl_FragColor = texture2D(uTexSampler, vTexSamplingCoord);
|
||||||
}
|
}
|
||||||
|
@ -24,10 +24,10 @@
|
|||||||
precision mediump float;
|
precision mediump float;
|
||||||
uniform __samplerExternal2DY2YEXT uTexSampler;
|
uniform __samplerExternal2DY2YEXT uTexSampler;
|
||||||
uniform mat3 uColorTransform;
|
uniform mat3 uColorTransform;
|
||||||
in vec2 vTexCoords;
|
in vec2 vTexSamplingCoord;
|
||||||
out vec4 outColor;
|
out vec4 outColor;
|
||||||
void main() {
|
void main() {
|
||||||
vec3 srcYuv = texture(uTexSampler, vTexCoords).xyz;
|
vec3 srcYuv = texture(uTexSampler, vTexSamplingCoord).xyz;
|
||||||
vec3 yuvOffset;
|
vec3 yuvOffset;
|
||||||
yuvOffset.x = srcYuv.r - 0.0625;
|
yuvOffset.x = srcYuv.r - 0.0625;
|
||||||
yuvOffset.y = srcYuv.g - 0.5;
|
yuvOffset.y = srcYuv.g - 0.5;
|
||||||
|
@ -18,10 +18,10 @@
|
|||||||
// locations.
|
// locations.
|
||||||
|
|
||||||
attribute vec4 aFramePosition;
|
attribute vec4 aFramePosition;
|
||||||
attribute vec4 aTexCoords;
|
attribute vec4 aTexSamplingCoord;
|
||||||
uniform mat4 uTexTransform;
|
uniform mat4 uTexTransform;
|
||||||
varying vec2 vTexCoords;
|
varying vec2 vTexSamplingCoord;
|
||||||
void main() {
|
void main() {
|
||||||
gl_Position = aFramePosition;
|
gl_Position = aFramePosition;
|
||||||
vTexCoords = (uTexTransform * aTexCoords).xy;
|
vTexSamplingCoord = (uTexTransform * aTexSamplingCoord).xy;
|
||||||
}
|
}
|
||||||
|
@ -18,10 +18,10 @@
|
|||||||
// locations.
|
// locations.
|
||||||
|
|
||||||
in vec4 aFramePosition;
|
in vec4 aFramePosition;
|
||||||
in vec4 aTexCoords;
|
in vec4 aTexSamplingCoord;
|
||||||
uniform mat4 uTexTransform;
|
uniform mat4 uTexTransform;
|
||||||
out vec2 vTexCoords;
|
out vec2 vTexSamplingCoord;
|
||||||
void main() {
|
void main() {
|
||||||
gl_Position = aFramePosition;
|
gl_Position = aFramePosition;
|
||||||
vTexCoords = (uTexTransform * aTexCoords).xy;
|
vTexSamplingCoord = (uTexTransform * aTexSamplingCoord).xy;
|
||||||
}
|
}
|
||||||
|
@ -17,10 +17,10 @@
|
|||||||
// uTransformationMatrix.
|
// uTransformationMatrix.
|
||||||
|
|
||||||
attribute vec4 aFramePosition;
|
attribute vec4 aFramePosition;
|
||||||
attribute vec4 aTexCoords;
|
attribute vec4 aTexSamplingCoord;
|
||||||
uniform mat4 uTransformationMatrix;
|
uniform mat4 uTransformationMatrix;
|
||||||
varying vec2 vTexCoords;
|
varying vec2 vTexSamplingCoord;
|
||||||
void main() {
|
void main() {
|
||||||
gl_Position = uTransformationMatrix * aFramePosition;
|
gl_Position = uTransformationMatrix * aFramePosition;
|
||||||
vTexCoords = aTexCoords.xy;
|
vTexSamplingCoord = aTexSamplingCoord.xy;
|
||||||
}
|
}
|
||||||
|
@ -74,7 +74,7 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
|
|||||||
glProgram.setBufferAttribute(
|
glProgram.setBufferAttribute(
|
||||||
"aFramePosition", GlUtil.getNormalizedCoordinateBounds(), GlUtil.RECTANGLE_VERTICES_COUNT);
|
"aFramePosition", GlUtil.getNormalizedCoordinateBounds(), GlUtil.RECTANGLE_VERTICES_COUNT);
|
||||||
glProgram.setBufferAttribute(
|
glProgram.setBufferAttribute(
|
||||||
"aTexCoords", GlUtil.getTextureCoordinateBounds(), GlUtil.RECTANGLE_VERTICES_COUNT);
|
"aTexSamplingCoord", GlUtil.getTextureCoordinateBounds(), GlUtil.RECTANGLE_VERTICES_COUNT);
|
||||||
if (enableExperimentalHdrEditing) {
|
if (enableExperimentalHdrEditing) {
|
||||||
// In HDR editing mode the decoder output is sampled in YUV.
|
// In HDR editing mode the decoder output is sampled in YUV.
|
||||||
glProgram.setFloatsUniform("uColorTransform", MATRIX_YUV_TO_BT2020_COLOR_TRANSFORM);
|
glProgram.setFloatsUniform("uColorTransform", MATRIX_YUV_TO_BT2020_COLOR_TRANSFORM);
|
||||||
|
@ -101,7 +101,7 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
|
|||||||
glProgram.setBufferAttribute(
|
glProgram.setBufferAttribute(
|
||||||
"aFramePosition", GlUtil.getNormalizedCoordinateBounds(), GlUtil.RECTANGLE_VERTICES_COUNT);
|
"aFramePosition", GlUtil.getNormalizedCoordinateBounds(), GlUtil.RECTANGLE_VERTICES_COUNT);
|
||||||
glProgram.setBufferAttribute(
|
glProgram.setBufferAttribute(
|
||||||
"aTexCoords", GlUtil.getTextureCoordinateBounds(), GlUtil.RECTANGLE_VERTICES_COUNT);
|
"aTexSamplingCoord", GlUtil.getTextureCoordinateBounds(), GlUtil.RECTANGLE_VERTICES_COUNT);
|
||||||
glProgram.setFloatsUniform("uTransformationMatrix", getGlMatrixArray(transformationMatrix));
|
glProgram.setFloatsUniform("uTransformationMatrix", getGlMatrixArray(transformationMatrix));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user