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.
|
// limitations under the License.
|
||||||
#extension GL_OES_EGL_image_external : require
|
#extension GL_OES_EGL_image_external : require
|
||||||
precision mediump float;
|
precision mediump float;
|
||||||
uniform samplerExternalOES tex_sampler;
|
uniform samplerExternalOES uTexSampler;
|
||||||
varying vec2 v_texcoord;
|
varying vec2 vTexCoords;
|
||||||
void main() {
|
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.
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
// See the License for the specific language governing permissions and
|
// See the License for the specific language governing permissions and
|
||||||
// limitations under the License.
|
// limitations under the License.
|
||||||
attribute vec4 a_position;
|
attribute vec4 aPosition;
|
||||||
attribute vec4 a_texcoord;
|
attribute vec4 aTexCoords;
|
||||||
uniform mat4 tex_transform;
|
uniform mat4 uTexTransform;
|
||||||
uniform mat4 transformation_matrix;
|
uniform mat4 uTransformationMatrix;
|
||||||
varying vec2 v_texcoord;
|
varying vec2 vTexCoords;
|
||||||
void main() {
|
void main() {
|
||||||
gl_Position = transformation_matrix * a_position;
|
gl_Position = uTransformationMatrix * aPosition;
|
||||||
v_texcoord = (tex_transform * a_texcoord).xy;
|
vTexCoords = (uTexTransform * aTexCoords).xy;
|
||||||
}
|
}
|
||||||
|
@ -74,7 +74,7 @@ import java.util.concurrent.atomic.AtomicInteger;
|
|||||||
}
|
}
|
||||||
|
|
||||||
glProgram.setBufferAttribute(
|
glProgram.setBufferAttribute(
|
||||||
"a_position",
|
"aPosition",
|
||||||
new float[] {
|
new float[] {
|
||||||
-1.0f, -1.0f, 0.0f, 1.0f,
|
-1.0f, -1.0f, 0.0f, 1.0f,
|
||||||
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);
|
/* size= */ 4);
|
||||||
glProgram.setBufferAttribute(
|
glProgram.setBufferAttribute(
|
||||||
"a_texcoord",
|
"aTexCoords",
|
||||||
new float[] {
|
new float[] {
|
||||||
0.0f, 0.0f, 0.0f, 1.0f,
|
0.0f, 0.0f, 0.0f, 1.0f,
|
||||||
1.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,
|
1.0f, 1.0f, 0.0f, 1.0f,
|
||||||
},
|
},
|
||||||
/* size= */ 4);
|
/* size= */ 4);
|
||||||
glProgram.setSamplerTexIdUniform("tex_sampler", textureId, /* unit= */ 0);
|
glProgram.setSamplerTexIdUniform("uTexSampler", textureId, /* unit= */ 0);
|
||||||
|
|
||||||
float[] transformationMatrixArray = getGlMatrixArray(transformationMatrix);
|
float[] transformationMatrixArray = getGlMatrixArray(transformationMatrix);
|
||||||
glProgram.setFloatsUniform("transformation_matrix", transformationMatrixArray);
|
glProgram.setFloatsUniform("uTransformationMatrix", transformationMatrixArray);
|
||||||
|
|
||||||
@Nullable
|
@Nullable
|
||||||
SurfaceView debugSurfaceView =
|
SurfaceView debugSurfaceView =
|
||||||
@ -230,7 +230,7 @@ import java.util.concurrent.atomic.AtomicInteger;
|
|||||||
public void processData() {
|
public void processData() {
|
||||||
inputSurfaceTexture.updateTexImage();
|
inputSurfaceTexture.updateTexImage();
|
||||||
inputSurfaceTexture.getTransformMatrix(textureTransformMatrix);
|
inputSurfaceTexture.getTransformMatrix(textureTransformMatrix);
|
||||||
glProgram.setFloatsUniform("tex_transform", textureTransformMatrix);
|
glProgram.setFloatsUniform("uTexTransform", textureTransformMatrix);
|
||||||
glProgram.bindAttributesAndUniforms();
|
glProgram.bindAttributesAndUniforms();
|
||||||
|
|
||||||
focusAndDrawQuad(eglSurface, outputWidth, outputHeight);
|
focusAndDrawQuad(eglSurface, outputWidth, outputHeight);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user