mirror of
https://github.com/utmapp/angle.git
synced 2026-12-01 14:00:09 -10:00
GLES1: Create multiple shaders based on state
This CL introduces the concept of having optimized shaders for given state combinations. In this first pass, all uniform bools have been moved to hard coded values in the GLES1 ubershader. Frame times on Android ARM with locked GPU clocks: Trace Before After dr_driving: 27.8145 -> 4.2986 sonic_the_hedgehog: 17.9779 -> 2.8223 summoners_war: 93.2040 -> 15.9810 wordscapes: 53.9227 -> 7.6167 zillow: 15.0323 -> 2.9368 Bug: angleproject:6644 Bug: angleproject:6652 Change-Id: I548bc5c6aa24bad5fbd740b9552c4a703ae41354 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3251688 Reviewed-by: Lingfeng Yang <[email protected]> Reviewed-by: Jamie Madill <[email protected]> Commit-Queue: Cody Northrop <[email protected]>
This commit is contained in:
1 parent
7e70818a62
commit
2091451e52
5 files changed
+467
-315
No files matched your search
+373
-266
@@ -37,7 +37,11 @@ void GLES1Renderer::onDestroy(Context *context, State *state)
|
||||
{
|
||||
(void)state->setProgram(context, 0);
|
||||
|
||||
mShaderPrograms->deleteProgram(context, {mProgramState.program});
|
||||
for (const auto &iter : mProgramStates)
|
||||
{
|
||||
const GLES1ProgramState &programState = iter.second;
|
||||
mShaderPrograms->deleteProgram(context, {programState.program});
|
||||
}
|
||||
mShaderPrograms->release(context);
|
||||
mShaderPrograms = nullptr;
|
||||
mRendererProgramInitialized = false;
|
||||
@@ -48,107 +52,151 @@ GLES1Renderer::~GLES1Renderer() = default;
|
||||
|
||||
angle::Result GLES1Renderer::prepareForDraw(PrimitiveMode mode, Context *context, State *glState)
|
||||
{
|
||||
ANGLE_TRY(initializeRendererProgram(context, glState));
|
||||
|
||||
GLES1State &gles1State = glState->gles1();
|
||||
|
||||
Program *programObject = getProgram(mProgramState.program);
|
||||
std::array<bool, kTexUnitCount> tex2DEnables;
|
||||
std::array<bool, kTexUnitCount> texCubeEnables;
|
||||
|
||||
GLES1UniformBuffers &uniformBuffers = mUniformBuffers;
|
||||
std::vector<int> tex2DFormats = {GL_RGBA, GL_RGBA, GL_RGBA, GL_RGBA};
|
||||
|
||||
std::array<Vec4Uniform, kTexUnitCount> texCropRects;
|
||||
Vec4Uniform *cropRectBuffer = texCropRects.data();
|
||||
|
||||
for (int i = 0; i < kTexUnitCount; i++)
|
||||
{
|
||||
// GL_OES_cube_map allows only one of TEXTURE_2D / TEXTURE_CUBE_MAP
|
||||
// to be enabled per unit, thankfully. From the extension text:
|
||||
//
|
||||
// -- Section 3.8.10 "Texture Application"
|
||||
//
|
||||
// Replace the beginning sentences of the first paragraph (page 138)
|
||||
// with:
|
||||
//
|
||||
// "Texturing is enabled or disabled using the generic Enable
|
||||
// and Disable commands, respectively, with the symbolic constants
|
||||
// TEXTURE_2D or TEXTURE_CUBE_MAP_OES to enable the two-dimensional or cube
|
||||
// map texturing respectively. If the cube map texture and the two-
|
||||
// dimensional texture are enabled, then cube map texturing is used. If
|
||||
// texturing is disabled, a rasterized fragment is passed on unaltered to the
|
||||
// next stage of the GL (although its texture coordinates may be discarded).
|
||||
// Otherwise, a texture value is found according to the parameter values of
|
||||
// the currently bound texture image of the appropriate dimensionality.
|
||||
|
||||
texCubeEnables[i] = gles1State.isTextureTargetEnabled(i, TextureType::CubeMap);
|
||||
tex2DEnables[i] =
|
||||
!texCubeEnables[i] && (gles1State.isTextureTargetEnabled(i, TextureType::_2D));
|
||||
|
||||
Texture *curr2DTexture = glState->getSamplerTexture(i, TextureType::_2D);
|
||||
if (curr2DTexture)
|
||||
{
|
||||
tex2DFormats[i] = gl::GetUnsizedFormat(
|
||||
curr2DTexture->getFormat(TextureTarget::_2D, 0).info->internalFormat);
|
||||
|
||||
const gl::Rectangle &cropRect = curr2DTexture->getCrop();
|
||||
|
||||
GLfloat textureWidth =
|
||||
static_cast<GLfloat>(curr2DTexture->getWidth(TextureTarget::_2D, 0));
|
||||
GLfloat textureHeight =
|
||||
static_cast<GLfloat>(curr2DTexture->getHeight(TextureTarget::_2D, 0));
|
||||
|
||||
if (textureWidth > 0.0f && textureHeight > 0.0f)
|
||||
{
|
||||
cropRectBuffer[i][0] = cropRect.x / textureWidth;
|
||||
cropRectBuffer[i][1] = cropRect.y / textureHeight;
|
||||
cropRectBuffer[i][2] = cropRect.width / textureWidth;
|
||||
cropRectBuffer[i][3] = cropRect.height / textureHeight;
|
||||
}
|
||||
}
|
||||
}
|
||||
mGLES1StateEnabled[GLES1StateEnables::Tex2d0] = tex2DEnables[0];
|
||||
mGLES1StateEnabled[GLES1StateEnables::Tex2d1] = tex2DEnables[1];
|
||||
mGLES1StateEnabled[GLES1StateEnables::Tex2d2] = tex2DEnables[2];
|
||||
mGLES1StateEnabled[GLES1StateEnables::Tex2d3] = tex2DEnables[3];
|
||||
|
||||
mGLES1StateEnabled[GLES1StateEnables::TexCube0] = texCubeEnables[0];
|
||||
mGLES1StateEnabled[GLES1StateEnables::TexCube1] = texCubeEnables[1];
|
||||
mGLES1StateEnabled[GLES1StateEnables::TexCube2] = texCubeEnables[2];
|
||||
mGLES1StateEnabled[GLES1StateEnables::TexCube3] = texCubeEnables[3];
|
||||
|
||||
bool enableClipPlanes = false;
|
||||
bool clipPlaneEnables[kClipPlaneCount];
|
||||
for (int i = 0; i < kClipPlaneCount; i++)
|
||||
{
|
||||
clipPlaneEnables[i] = glState->getEnableFeature(GL_CLIP_PLANE0 + i);
|
||||
enableClipPlanes = enableClipPlanes || clipPlaneEnables[i];
|
||||
}
|
||||
mGLES1StateEnabled[GLES1StateEnables::ClipPlanes] = enableClipPlanes;
|
||||
mGLES1StateEnabled[GLES1StateEnables::DrawTexture] = mDrawTextureEnabled;
|
||||
mGLES1StateEnabled[GLES1StateEnables::PointRasterization] = mode == PrimitiveMode::Points;
|
||||
mGLES1StateEnabled[GLES1StateEnables::ShadeModelFlat] =
|
||||
gles1State.mShadeModel == ShadingModel::Flat;
|
||||
mGLES1StateEnabled[GLES1StateEnables::AlphaTest] = glState->getEnableFeature(GL_ALPHA_TEST);
|
||||
mGLES1StateEnabled[GLES1StateEnables::Lighting] = glState->getEnableFeature(GL_LIGHTING);
|
||||
mGLES1StateEnabled[GLES1StateEnables::RescaleNormal] =
|
||||
glState->getEnableFeature(GL_RESCALE_NORMAL);
|
||||
mGLES1StateEnabled[GLES1StateEnables::Normalize] = glState->getEnableFeature(GL_NORMALIZE);
|
||||
mGLES1StateEnabled[GLES1StateEnables::Fog] = glState->getEnableFeature(GL_FOG);
|
||||
mGLES1StateEnabled[GLES1StateEnables::PointSprite] =
|
||||
glState->getEnableFeature(GL_POINT_SPRITE_OES);
|
||||
mGLES1StateEnabled[GLES1StateEnables::ColorMaterial] =
|
||||
glState->getEnableFeature(GL_COLOR_MATERIAL);
|
||||
|
||||
// TODO ([email protected]): Implement two-sided lighting model (lightModel.twoSided)
|
||||
mGLES1StateEnabled[GLES1StateEnables::LightModelTwoSided] = false;
|
||||
|
||||
bool pointSpriteCoordReplaces[kTexUnitCount];
|
||||
for (int i = 0; i < kTexUnitCount; i++)
|
||||
{
|
||||
const auto &env = gles1State.textureEnvironment(i);
|
||||
pointSpriteCoordReplaces[i] = env.pointSpriteCoordReplace;
|
||||
}
|
||||
mGLES1StateEnabled[GLES1StateEnables::PointSpriteCoordReplaces0] = pointSpriteCoordReplaces[0];
|
||||
mGLES1StateEnabled[GLES1StateEnables::PointSpriteCoordReplaces1] = pointSpriteCoordReplaces[1];
|
||||
mGLES1StateEnabled[GLES1StateEnables::PointSpriteCoordReplaces2] = pointSpriteCoordReplaces[2];
|
||||
mGLES1StateEnabled[GLES1StateEnables::PointSpriteCoordReplaces3] = pointSpriteCoordReplaces[3];
|
||||
|
||||
bool lightEnables[kLightCount];
|
||||
for (int i = 0; i < kLightCount; i++)
|
||||
{
|
||||
const auto &light = gles1State.mLights[i];
|
||||
lightEnables[i] = light.enabled;
|
||||
}
|
||||
mGLES1StateEnabled[GLES1StateEnables::Light0] = lightEnables[0];
|
||||
mGLES1StateEnabled[GLES1StateEnables::Light1] = lightEnables[1];
|
||||
mGLES1StateEnabled[GLES1StateEnables::Light2] = lightEnables[2];
|
||||
mGLES1StateEnabled[GLES1StateEnables::Light3] = lightEnables[3];
|
||||
mGLES1StateEnabled[GLES1StateEnables::Light4] = lightEnables[4];
|
||||
mGLES1StateEnabled[GLES1StateEnables::Light5] = lightEnables[5];
|
||||
mGLES1StateEnabled[GLES1StateEnables::Light6] = lightEnables[6];
|
||||
mGLES1StateEnabled[GLES1StateEnables::Light7] = lightEnables[7];
|
||||
|
||||
mGLES1StateEnabled[GLES1StateEnables::ClipPlane0] = clipPlaneEnables[0];
|
||||
mGLES1StateEnabled[GLES1StateEnables::ClipPlane1] = clipPlaneEnables[1];
|
||||
mGLES1StateEnabled[GLES1StateEnables::ClipPlane2] = clipPlaneEnables[2];
|
||||
mGLES1StateEnabled[GLES1StateEnables::ClipPlane3] = clipPlaneEnables[3];
|
||||
mGLES1StateEnabled[GLES1StateEnables::ClipPlane4] = clipPlaneEnables[4];
|
||||
mGLES1StateEnabled[GLES1StateEnables::ClipPlane5] = clipPlaneEnables[5];
|
||||
|
||||
ANGLE_TRY(initializeRendererProgram(context, glState));
|
||||
|
||||
uint64_t stateEnables = mGLES1StateEnabled.to_ulong();
|
||||
const GLES1ProgramState &programState = mProgramStates[stateEnables];
|
||||
|
||||
Program *programObject = getProgram(programState.program);
|
||||
|
||||
GLES1UniformBuffers &uniformBuffers = mUniformBuffers[stateEnables];
|
||||
|
||||
// If anything is dirty in gles1 or the common parts of gles1/2, just redo these parts
|
||||
// completely for now.
|
||||
|
||||
// Feature enables
|
||||
{
|
||||
setUniform1i(context, programObject, mProgramState.enableAlphaTestLoc,
|
||||
glState->getEnableFeature(GL_ALPHA_TEST));
|
||||
setUniform1i(context, programObject, mProgramState.enableLightingLoc,
|
||||
glState->getEnableFeature(GL_LIGHTING));
|
||||
setUniform1i(context, programObject, mProgramState.enableRescaleNormalLoc,
|
||||
glState->getEnableFeature(GL_RESCALE_NORMAL));
|
||||
setUniform1i(context, programObject, mProgramState.enableNormalizeLoc,
|
||||
glState->getEnableFeature(GL_NORMALIZE));
|
||||
setUniform1i(context, programObject, mProgramState.enableColorMaterialLoc,
|
||||
glState->getEnableFeature(GL_COLOR_MATERIAL));
|
||||
setUniform1i(context, programObject, mProgramState.fogEnableLoc,
|
||||
glState->getEnableFeature(GL_FOG));
|
||||
|
||||
bool enableClipPlanes = false;
|
||||
for (int i = 0; i < kClipPlaneCount; i++)
|
||||
{
|
||||
uniformBuffers.clipPlaneEnables[i] = glState->getEnableFeature(GL_CLIP_PLANE0 + i);
|
||||
enableClipPlanes = enableClipPlanes || uniformBuffers.clipPlaneEnables[i];
|
||||
}
|
||||
|
||||
setUniform1i(context, programObject, mProgramState.enableClipPlanesLoc, enableClipPlanes);
|
||||
}
|
||||
|
||||
// Texture unit enables and format info
|
||||
{
|
||||
std::array<GLint, kTexUnitCount> &tex2DEnables = uniformBuffers.tex2DEnables;
|
||||
std::array<GLint, kTexUnitCount> &texCubeEnables = uniformBuffers.texCubeEnables;
|
||||
|
||||
std::vector<int> tex2DFormats = {GL_RGBA, GL_RGBA, GL_RGBA, GL_RGBA};
|
||||
|
||||
Vec4Uniform *cropRectBuffer = uniformBuffers.texCropRects.data();
|
||||
|
||||
for (int i = 0; i < kTexUnitCount; i++)
|
||||
{
|
||||
// GL_OES_cube_map allows only one of TEXTURE_2D / TEXTURE_CUBE_MAP
|
||||
// to be enabled per unit, thankfully. From the extension text:
|
||||
//
|
||||
// -- Section 3.8.10 "Texture Application"
|
||||
//
|
||||
// Replace the beginning sentences of the first paragraph (page 138)
|
||||
// with:
|
||||
//
|
||||
// "Texturing is enabled or disabled using the generic Enable
|
||||
// and Disable commands, respectively, with the symbolic constants
|
||||
// TEXTURE_2D or TEXTURE_CUBE_MAP_OES to enable the two-dimensional or cube
|
||||
// map texturing respectively. If the cube map texture and the two-
|
||||
// dimensional texture are enabled, then cube map texturing is used. If
|
||||
// texturing is disabled, a rasterized fragment is passed on unaltered to the
|
||||
// next stage of the GL (although its texture coordinates may be discarded).
|
||||
// Otherwise, a texture value is found according to the parameter values of
|
||||
// the currently bound texture image of the appropriate dimensionality.
|
||||
|
||||
texCubeEnables[i] = gles1State.isTextureTargetEnabled(i, TextureType::CubeMap);
|
||||
tex2DEnables[i] =
|
||||
!texCubeEnables[i] && (gles1State.isTextureTargetEnabled(i, TextureType::_2D));
|
||||
|
||||
Texture *curr2DTexture = glState->getSamplerTexture(i, TextureType::_2D);
|
||||
if (curr2DTexture)
|
||||
{
|
||||
tex2DFormats[i] = gl::GetUnsizedFormat(
|
||||
curr2DTexture->getFormat(TextureTarget::_2D, 0).info->internalFormat);
|
||||
|
||||
const gl::Rectangle &cropRect = curr2DTexture->getCrop();
|
||||
|
||||
GLfloat textureWidth =
|
||||
static_cast<GLfloat>(curr2DTexture->getWidth(TextureTarget::_2D, 0));
|
||||
GLfloat textureHeight =
|
||||
static_cast<GLfloat>(curr2DTexture->getHeight(TextureTarget::_2D, 0));
|
||||
|
||||
if (textureWidth > 0.0f && textureHeight > 0.0f)
|
||||
{
|
||||
cropRectBuffer[i][0] = cropRect.x / textureWidth;
|
||||
cropRectBuffer[i][1] = cropRect.y / textureHeight;
|
||||
cropRectBuffer[i][2] = cropRect.width / textureWidth;
|
||||
cropRectBuffer[i][3] = cropRect.height / textureHeight;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
setUniform1iv(context, programObject, mProgramState.enableTexture2DLoc, kTexUnitCount,
|
||||
tex2DEnables.data());
|
||||
setUniform1iv(context, programObject, mProgramState.enableTextureCubeMapLoc, kTexUnitCount,
|
||||
texCubeEnables.data());
|
||||
|
||||
setUniform1iv(context, programObject, mProgramState.textureFormatLoc, kTexUnitCount,
|
||||
setUniform1iv(context, programObject, programState.textureFormatLoc, kTexUnitCount,
|
||||
tex2DFormats.data());
|
||||
|
||||
setUniform4fv(programObject, mProgramState.drawTextureNormalizedCropRectLoc, kTexUnitCount,
|
||||
setUniform4fv(programObject, programState.drawTextureNormalizedCropRectLoc, kTexUnitCount,
|
||||
reinterpret_cast<GLfloat *>(cropRectBuffer));
|
||||
}
|
||||
|
||||
@@ -190,14 +238,14 @@ angle::Result GLES1Renderer::prepareForDraw(PrimitiveMode mode, Context *context
|
||||
if (gles1State.isDirty(GLES1State::DIRTY_GLES1_MATRICES))
|
||||
{
|
||||
angle::Mat4 proj = gles1State.mProjectionMatrices.back();
|
||||
setUniformMatrix4fv(programObject, mProgramState.projMatrixLoc, 1, GL_FALSE, proj.data());
|
||||
setUniformMatrix4fv(programObject, programState.projMatrixLoc, 1, GL_FALSE, proj.data());
|
||||
|
||||
angle::Mat4 modelview = gles1State.mModelviewMatrices.back();
|
||||
setUniformMatrix4fv(programObject, mProgramState.modelviewMatrixLoc, 1, GL_FALSE,
|
||||
setUniformMatrix4fv(programObject, programState.modelviewMatrixLoc, 1, GL_FALSE,
|
||||
modelview.data());
|
||||
|
||||
angle::Mat4 modelviewInvTr = modelview.transpose().inverse();
|
||||
setUniformMatrix4fv(programObject, mProgramState.modelviewInvTrLoc, 1, GL_FALSE,
|
||||
setUniformMatrix4fv(programObject, programState.modelviewInvTrLoc, 1, GL_FALSE,
|
||||
modelviewInvTr.data());
|
||||
|
||||
Mat4Uniform *textureMatrixBuffer = uniformBuffers.textureMatrices.data();
|
||||
@@ -208,7 +256,7 @@ angle::Result GLES1Renderer::prepareForDraw(PrimitiveMode mode, Context *context
|
||||
memcpy(textureMatrixBuffer + i, textureMatrix.data(), sizeof(Mat4Uniform));
|
||||
}
|
||||
|
||||
setUniformMatrix4fv(programObject, mProgramState.textureMatrixLoc, kTexUnitCount, GL_FALSE,
|
||||
setUniformMatrix4fv(programObject, programState.textureMatrixLoc, kTexUnitCount, GL_FALSE,
|
||||
reinterpret_cast<float *>(uniformBuffers.textureMatrices.data()));
|
||||
}
|
||||
|
||||
@@ -243,80 +291,67 @@ angle::Result GLES1Renderer::prepareForDraw(PrimitiveMode mode, Context *context
|
||||
|
||||
uniformBuffers.texEnvRgbScales[i] = env.rgbScale;
|
||||
uniformBuffers.texEnvAlphaScales[i] = env.alphaScale;
|
||||
|
||||
uniformBuffers.pointSpriteCoordReplaces[i] = env.pointSpriteCoordReplace;
|
||||
}
|
||||
|
||||
setUniform1iv(context, programObject, mProgramState.textureEnvModeLoc, kTexUnitCount,
|
||||
setUniform1iv(context, programObject, programState.textureEnvModeLoc, kTexUnitCount,
|
||||
uniformBuffers.texEnvModes.data());
|
||||
setUniform1iv(context, programObject, mProgramState.combineRgbLoc, kTexUnitCount,
|
||||
setUniform1iv(context, programObject, programState.combineRgbLoc, kTexUnitCount,
|
||||
uniformBuffers.texCombineRgbs.data());
|
||||
setUniform1iv(context, programObject, mProgramState.combineAlphaLoc, kTexUnitCount,
|
||||
setUniform1iv(context, programObject, programState.combineAlphaLoc, kTexUnitCount,
|
||||
uniformBuffers.texCombineAlphas.data());
|
||||
|
||||
setUniform1iv(context, programObject, mProgramState.src0rgbLoc, kTexUnitCount,
|
||||
setUniform1iv(context, programObject, programState.src0rgbLoc, kTexUnitCount,
|
||||
uniformBuffers.texCombineSrc0Rgbs.data());
|
||||
setUniform1iv(context, programObject, mProgramState.src0alphaLoc, kTexUnitCount,
|
||||
setUniform1iv(context, programObject, programState.src0alphaLoc, kTexUnitCount,
|
||||
uniformBuffers.texCombineSrc0Alphas.data());
|
||||
setUniform1iv(context, programObject, mProgramState.src1rgbLoc, kTexUnitCount,
|
||||
setUniform1iv(context, programObject, programState.src1rgbLoc, kTexUnitCount,
|
||||
uniformBuffers.texCombineSrc1Rgbs.data());
|
||||
setUniform1iv(context, programObject, mProgramState.src1alphaLoc, kTexUnitCount,
|
||||
setUniform1iv(context, programObject, programState.src1alphaLoc, kTexUnitCount,
|
||||
uniformBuffers.texCombineSrc1Alphas.data());
|
||||
setUniform1iv(context, programObject, mProgramState.src2rgbLoc, kTexUnitCount,
|
||||
setUniform1iv(context, programObject, programState.src2rgbLoc, kTexUnitCount,
|
||||
uniformBuffers.texCombineSrc2Rgbs.data());
|
||||
setUniform1iv(context, programObject, mProgramState.src2alphaLoc, kTexUnitCount,
|
||||
setUniform1iv(context, programObject, programState.src2alphaLoc, kTexUnitCount,
|
||||
uniformBuffers.texCombineSrc2Alphas.data());
|
||||
|
||||
setUniform1iv(context, programObject, mProgramState.op0rgbLoc, kTexUnitCount,
|
||||
setUniform1iv(context, programObject, programState.op0rgbLoc, kTexUnitCount,
|
||||
uniformBuffers.texCombineOp0Rgbs.data());
|
||||
setUniform1iv(context, programObject, mProgramState.op0alphaLoc, kTexUnitCount,
|
||||
setUniform1iv(context, programObject, programState.op0alphaLoc, kTexUnitCount,
|
||||
uniformBuffers.texCombineOp0Alphas.data());
|
||||
setUniform1iv(context, programObject, mProgramState.op1rgbLoc, kTexUnitCount,
|
||||
setUniform1iv(context, programObject, programState.op1rgbLoc, kTexUnitCount,
|
||||
uniformBuffers.texCombineOp1Rgbs.data());
|
||||
setUniform1iv(context, programObject, mProgramState.op1alphaLoc, kTexUnitCount,
|
||||
setUniform1iv(context, programObject, programState.op1alphaLoc, kTexUnitCount,
|
||||
uniformBuffers.texCombineOp1Alphas.data());
|
||||
setUniform1iv(context, programObject, mProgramState.op2rgbLoc, kTexUnitCount,
|
||||
setUniform1iv(context, programObject, programState.op2rgbLoc, kTexUnitCount,
|
||||
uniformBuffers.texCombineOp2Rgbs.data());
|
||||
setUniform1iv(context, programObject, mProgramState.op2alphaLoc, kTexUnitCount,
|
||||
setUniform1iv(context, programObject, programState.op2alphaLoc, kTexUnitCount,
|
||||
uniformBuffers.texCombineOp2Alphas.data());
|
||||
|
||||
setUniform4fv(programObject, mProgramState.textureEnvColorLoc, kTexUnitCount,
|
||||
setUniform4fv(programObject, programState.textureEnvColorLoc, kTexUnitCount,
|
||||
reinterpret_cast<float *>(uniformBuffers.texEnvColors.data()));
|
||||
setUniform1fv(programObject, mProgramState.rgbScaleLoc, kTexUnitCount,
|
||||
setUniform1fv(programObject, programState.rgbScaleLoc, kTexUnitCount,
|
||||
uniformBuffers.texEnvRgbScales.data());
|
||||
setUniform1fv(programObject, mProgramState.alphaScaleLoc, kTexUnitCount,
|
||||
setUniform1fv(programObject, programState.alphaScaleLoc, kTexUnitCount,
|
||||
uniformBuffers.texEnvAlphaScales.data());
|
||||
|
||||
setUniform1iv(context, programObject, mProgramState.pointSpriteCoordReplaceLoc,
|
||||
kTexUnitCount, uniformBuffers.pointSpriteCoordReplaces.data());
|
||||
}
|
||||
|
||||
// Alpha test
|
||||
if (gles1State.isDirty(GLES1State::DIRTY_GLES1_ALPHA_TEST))
|
||||
{
|
||||
setUniform1i(context, programObject, mProgramState.alphaFuncLoc,
|
||||
setUniform1i(context, programObject, programState.alphaFuncLoc,
|
||||
ToGLenum(gles1State.mAlphaTestFunc));
|
||||
setUniform1f(programObject, mProgramState.alphaTestRefLoc, gles1State.mAlphaTestRef);
|
||||
setUniform1f(programObject, programState.alphaTestRefLoc, gles1State.mAlphaTestRef);
|
||||
}
|
||||
|
||||
// Shading, materials, and lighting
|
||||
if (gles1State.isDirty(GLES1State::DIRTY_GLES1_SHADE_MODEL))
|
||||
{
|
||||
setUniform1i(context, programObject, mProgramState.shadeModelFlatLoc,
|
||||
gles1State.mShadeModel == ShadingModel::Flat);
|
||||
}
|
||||
|
||||
if (gles1State.isDirty(GLES1State::DIRTY_GLES1_MATERIAL))
|
||||
{
|
||||
const auto &material = gles1State.mMaterial;
|
||||
|
||||
setUniform4fv(programObject, mProgramState.materialAmbientLoc, 1, material.ambient.data());
|
||||
setUniform4fv(programObject, mProgramState.materialDiffuseLoc, 1, material.diffuse.data());
|
||||
setUniform4fv(programObject, mProgramState.materialSpecularLoc, 1,
|
||||
material.specular.data());
|
||||
setUniform4fv(programObject, mProgramState.materialEmissiveLoc, 1,
|
||||
material.emissive.data());
|
||||
setUniform1f(programObject, mProgramState.materialSpecularExponentLoc,
|
||||
setUniform4fv(programObject, programState.materialAmbientLoc, 1, material.ambient.data());
|
||||
setUniform4fv(programObject, programState.materialDiffuseLoc, 1, material.diffuse.data());
|
||||
setUniform4fv(programObject, programState.materialSpecularLoc, 1, material.specular.data());
|
||||
setUniform4fv(programObject, programState.materialEmissiveLoc, 1, material.emissive.data());
|
||||
setUniform1f(programObject, programState.materialSpecularExponentLoc,
|
||||
material.specularExponent);
|
||||
}
|
||||
|
||||
@@ -324,16 +359,12 @@ angle::Result GLES1Renderer::prepareForDraw(PrimitiveMode mode, Context *context
|
||||
{
|
||||
const auto &lightModel = gles1State.mLightModel;
|
||||
|
||||
setUniform4fv(programObject, mProgramState.lightModelSceneAmbientLoc, 1,
|
||||
setUniform4fv(programObject, programState.lightModelSceneAmbientLoc, 1,
|
||||
lightModel.color.data());
|
||||
|
||||
// TODO ([email protected]): Implement two-sided lighting model
|
||||
// gl->uniform1i(mProgramState.lightModelTwoSidedLoc, lightModel.twoSided);
|
||||
|
||||
for (int i = 0; i < kLightCount; i++)
|
||||
{
|
||||
const auto &light = gles1State.mLights[i];
|
||||
uniformBuffers.lightEnables[i] = light.enabled;
|
||||
const auto &light = gles1State.mLights[i];
|
||||
memcpy(uniformBuffers.lightAmbients.data() + i, light.ambient.data(),
|
||||
sizeof(Vec4Uniform));
|
||||
memcpy(uniformBuffers.lightDiffuses.data() + i, light.diffuse.data(),
|
||||
@@ -351,56 +382,48 @@ angle::Result GLES1Renderer::prepareForDraw(PrimitiveMode mode, Context *context
|
||||
uniformBuffers.attenuationQuadratics[i] = light.attenuationQuadratic;
|
||||
}
|
||||
|
||||
setUniform1iv(context, programObject, mProgramState.lightEnablesLoc, kLightCount,
|
||||
uniformBuffers.lightEnables.data());
|
||||
setUniform4fv(programObject, mProgramState.lightAmbientsLoc, kLightCount,
|
||||
setUniform4fv(programObject, programState.lightAmbientsLoc, kLightCount,
|
||||
reinterpret_cast<float *>(uniformBuffers.lightAmbients.data()));
|
||||
setUniform4fv(programObject, mProgramState.lightDiffusesLoc, kLightCount,
|
||||
setUniform4fv(programObject, programState.lightDiffusesLoc, kLightCount,
|
||||
reinterpret_cast<float *>(uniformBuffers.lightDiffuses.data()));
|
||||
setUniform4fv(programObject, mProgramState.lightSpecularsLoc, kLightCount,
|
||||
setUniform4fv(programObject, programState.lightSpecularsLoc, kLightCount,
|
||||
reinterpret_cast<float *>(uniformBuffers.lightSpeculars.data()));
|
||||
setUniform4fv(programObject, mProgramState.lightPositionsLoc, kLightCount,
|
||||
setUniform4fv(programObject, programState.lightPositionsLoc, kLightCount,
|
||||
reinterpret_cast<float *>(uniformBuffers.lightPositions.data()));
|
||||
setUniform3fv(programObject, mProgramState.lightDirectionsLoc, kLightCount,
|
||||
setUniform3fv(programObject, programState.lightDirectionsLoc, kLightCount,
|
||||
reinterpret_cast<float *>(uniformBuffers.lightDirections.data()));
|
||||
setUniform1fv(programObject, mProgramState.lightSpotlightExponentsLoc, kLightCount,
|
||||
setUniform1fv(programObject, programState.lightSpotlightExponentsLoc, kLightCount,
|
||||
reinterpret_cast<float *>(uniformBuffers.spotlightExponents.data()));
|
||||
setUniform1fv(programObject, mProgramState.lightSpotlightCutoffAnglesLoc, kLightCount,
|
||||
setUniform1fv(programObject, programState.lightSpotlightCutoffAnglesLoc, kLightCount,
|
||||
reinterpret_cast<float *>(uniformBuffers.spotlightCutoffAngles.data()));
|
||||
setUniform1fv(programObject, mProgramState.lightAttenuationConstsLoc, kLightCount,
|
||||
setUniform1fv(programObject, programState.lightAttenuationConstsLoc, kLightCount,
|
||||
reinterpret_cast<float *>(uniformBuffers.attenuationConsts.data()));
|
||||
setUniform1fv(programObject, mProgramState.lightAttenuationLinearsLoc, kLightCount,
|
||||
setUniform1fv(programObject, programState.lightAttenuationLinearsLoc, kLightCount,
|
||||
reinterpret_cast<float *>(uniformBuffers.attenuationLinears.data()));
|
||||
setUniform1fv(programObject, mProgramState.lightAttenuationQuadraticsLoc, kLightCount,
|
||||
setUniform1fv(programObject, programState.lightAttenuationQuadraticsLoc, kLightCount,
|
||||
reinterpret_cast<float *>(uniformBuffers.attenuationQuadratics.data()));
|
||||
}
|
||||
|
||||
if (gles1State.isDirty(GLES1State::DIRTY_GLES1_FOG))
|
||||
{
|
||||
const FogParameters &fog = gles1State.fogParameters();
|
||||
setUniform1i(context, programObject, mProgramState.fogModeLoc, ToGLenum(fog.mode));
|
||||
setUniform1f(programObject, mProgramState.fogDensityLoc, fog.density);
|
||||
setUniform1f(programObject, mProgramState.fogStartLoc, fog.start);
|
||||
setUniform1f(programObject, mProgramState.fogEndLoc, fog.end);
|
||||
setUniform4fv(programObject, mProgramState.fogColorLoc, 1, fog.color.data());
|
||||
setUniform1i(context, programObject, programState.fogModeLoc, ToGLenum(fog.mode));
|
||||
setUniform1f(programObject, programState.fogDensityLoc, fog.density);
|
||||
setUniform1f(programObject, programState.fogStartLoc, fog.start);
|
||||
setUniform1f(programObject, programState.fogEndLoc, fog.end);
|
||||
setUniform4fv(programObject, programState.fogColorLoc, 1, fog.color.data());
|
||||
}
|
||||
|
||||
// Clip planes
|
||||
if (gles1State.isDirty(GLES1State::DIRTY_GLES1_CLIP_PLANES))
|
||||
{
|
||||
bool enableClipPlanes = false;
|
||||
for (int i = 0; i < kClipPlaneCount; i++)
|
||||
{
|
||||
uniformBuffers.clipPlaneEnables[i] = glState->getEnableFeature(GL_CLIP_PLANE0 + i);
|
||||
enableClipPlanes = enableClipPlanes || uniformBuffers.clipPlaneEnables[i];
|
||||
gles1State.getClipPlane(
|
||||
i, reinterpret_cast<float *>(uniformBuffers.clipPlanes.data() + i));
|
||||
}
|
||||
|
||||
setUniform1i(context, programObject, mProgramState.enableClipPlanesLoc, enableClipPlanes);
|
||||
setUniform1iv(context, programObject, mProgramState.clipPlaneEnablesLoc, kClipPlaneCount,
|
||||
uniformBuffers.clipPlaneEnables.data());
|
||||
setUniform4fv(programObject, mProgramState.clipPlanesLoc, kClipPlaneCount,
|
||||
setUniform4fv(programObject, programState.clipPlanesLoc, kClipPlaneCount,
|
||||
reinterpret_cast<float *>(uniformBuffers.clipPlanes.data()));
|
||||
}
|
||||
|
||||
@@ -408,25 +431,20 @@ angle::Result GLES1Renderer::prepareForDraw(PrimitiveMode mode, Context *context
|
||||
{
|
||||
const PointParameters &pointParams = gles1State.mPointParameters;
|
||||
|
||||
setUniform1i(context, programObject, mProgramState.pointRasterizationLoc,
|
||||
mode == PrimitiveMode::Points);
|
||||
setUniform1i(context, programObject, mProgramState.pointSpriteEnabledLoc,
|
||||
glState->getEnableFeature(GL_POINT_SPRITE_OES));
|
||||
setUniform1f(programObject, mProgramState.pointSizeMinLoc, pointParams.pointSizeMin);
|
||||
setUniform1f(programObject, mProgramState.pointSizeMaxLoc, pointParams.pointSizeMax);
|
||||
setUniform3fv(programObject, mProgramState.pointDistanceAttenuationLoc, 1,
|
||||
setUniform1f(programObject, programState.pointSizeMinLoc, pointParams.pointSizeMin);
|
||||
setUniform1f(programObject, programState.pointSizeMaxLoc, pointParams.pointSizeMax);
|
||||
setUniform3fv(programObject, programState.pointDistanceAttenuationLoc, 1,
|
||||
pointParams.pointDistanceAttenuation.data());
|
||||
}
|
||||
|
||||
// Draw texture
|
||||
{
|
||||
setUniform1i(context, programObject, mProgramState.enableDrawTextureLoc,
|
||||
mDrawTextureEnabled ? 1 : 0);
|
||||
setUniform4fv(programObject, mProgramState.drawTextureCoordsLoc, 1, mDrawTextureCoords);
|
||||
setUniform2fv(programObject, mProgramState.drawTextureDimsLoc, 1, mDrawTextureDims);
|
||||
setUniform4fv(programObject, programState.drawTextureCoordsLoc, 1, mDrawTextureCoords);
|
||||
setUniform2fv(programObject, programState.drawTextureDimsLoc, 1, mDrawTextureDims);
|
||||
}
|
||||
|
||||
gles1State.clearDirty();
|
||||
|
||||
// None of those are changes in sampler, so there is no need to set the GL_PROGRAM dirty.
|
||||
// Otherwise, put the dirtying here.
|
||||
|
||||
@@ -614,30 +632,142 @@ angle::Result GLES1Renderer::linkProgram(Context *context,
|
||||
return angle::Result::Continue;
|
||||
}
|
||||
|
||||
const char *GLES1Renderer::getShaderBool(GLES1StateEnables state)
|
||||
{
|
||||
if (mGLES1StateEnabled[state])
|
||||
{
|
||||
return "true";
|
||||
}
|
||||
else
|
||||
{
|
||||
return "false";
|
||||
}
|
||||
}
|
||||
|
||||
void GLES1Renderer::addShaderDefine(std::stringstream &outStream,
|
||||
GLES1StateEnables state,
|
||||
const char *enableString)
|
||||
{
|
||||
outStream << "\n";
|
||||
outStream << "#define " << enableString << " " << getShaderBool(state);
|
||||
}
|
||||
|
||||
void GLES1Renderer::addVertexShaderDefs(std::stringstream &outStream)
|
||||
{
|
||||
addShaderDefine(outStream, GLES1StateEnables::DrawTexture, "enable_draw_texture");
|
||||
addShaderDefine(outStream, GLES1StateEnables::PointRasterization, "point_rasterization");
|
||||
addShaderDefine(outStream, GLES1StateEnables::RescaleNormal, "enable_rescale_normal");
|
||||
addShaderDefine(outStream, GLES1StateEnables::Normalize, "enable_normalize");
|
||||
}
|
||||
|
||||
void GLES1Renderer::addFragmentShaderDefs(std::stringstream &outStream)
|
||||
{
|
||||
addShaderDefine(outStream, GLES1StateEnables::Lighting, "enable_lighting");
|
||||
addShaderDefine(outStream, GLES1StateEnables::Fog, "enable_fog");
|
||||
addShaderDefine(outStream, GLES1StateEnables::ClipPlanes, "enable_clip_planes");
|
||||
addShaderDefine(outStream, GLES1StateEnables::DrawTexture, "enable_draw_texture");
|
||||
addShaderDefine(outStream, GLES1StateEnables::PointRasterization, "point_rasterization");
|
||||
addShaderDefine(outStream, GLES1StateEnables::PointSprite, "point_sprite_enabled");
|
||||
addShaderDefine(outStream, GLES1StateEnables::AlphaTest, "enable_alpha_test");
|
||||
addShaderDefine(outStream, GLES1StateEnables::ShadeModelFlat, "shade_model_flat");
|
||||
addShaderDefine(outStream, GLES1StateEnables::ColorMaterial, "enable_color_material");
|
||||
addShaderDefine(outStream, GLES1StateEnables::LightModelTwoSided, "light_model_two_sided");
|
||||
|
||||
// bool enable_texture_2d[kMaxTexUnits] = bool[kMaxTexUnits](...);
|
||||
outStream << "\n";
|
||||
outStream << "bool enable_texture_2d[kMaxTexUnits] = bool[kMaxTexUnits]("
|
||||
<< getShaderBool(GLES1StateEnables::Tex2d0) << ", "
|
||||
<< getShaderBool(GLES1StateEnables::Tex2d1) << ", "
|
||||
<< getShaderBool(GLES1StateEnables::Tex2d2) << ", "
|
||||
<< getShaderBool(GLES1StateEnables::Tex2d3) << ");";
|
||||
|
||||
// bool enable_texture_cube_map[kMaxTexUnits] = bool[kMaxTexUnits](...);
|
||||
outStream << "\n";
|
||||
outStream << "bool enable_texture_cube_map[kMaxTexUnits] = bool[kMaxTexUnits]("
|
||||
<< getShaderBool(GLES1StateEnables::TexCube0) << ", "
|
||||
<< getShaderBool(GLES1StateEnables::TexCube1) << ", "
|
||||
<< getShaderBool(GLES1StateEnables::TexCube2) << ", "
|
||||
<< getShaderBool(GLES1StateEnables::TexCube3) << ");";
|
||||
|
||||
// bool point_sprite_coord_replace[kMaxTexUnits] = bool[kMaxTexUnits](...);
|
||||
outStream << "\n";
|
||||
outStream << "bool point_sprite_coord_replace[kMaxTexUnits] = bool[kMaxTexUnits]("
|
||||
<< getShaderBool(GLES1StateEnables::PointSpriteCoordReplaces0) << ", "
|
||||
<< getShaderBool(GLES1StateEnables::PointSpriteCoordReplaces1) << ", "
|
||||
<< getShaderBool(GLES1StateEnables::PointSpriteCoordReplaces2) << ", "
|
||||
<< getShaderBool(GLES1StateEnables::PointSpriteCoordReplaces3) << ");";
|
||||
|
||||
// bool light_enables[kMaxLights] = bool[kMaxLights](...);
|
||||
outStream << "\n";
|
||||
outStream << "bool light_enables[kMaxLights] = bool[kMaxLights]("
|
||||
<< getShaderBool(GLES1StateEnables::Light0) << ", "
|
||||
<< getShaderBool(GLES1StateEnables::Light1) << ", "
|
||||
<< getShaderBool(GLES1StateEnables::Light2) << ", "
|
||||
<< getShaderBool(GLES1StateEnables::Light3) << ", "
|
||||
<< getShaderBool(GLES1StateEnables::Light4) << ", "
|
||||
<< getShaderBool(GLES1StateEnables::Light5) << ", "
|
||||
<< getShaderBool(GLES1StateEnables::Light6) << ", "
|
||||
<< getShaderBool(GLES1StateEnables::Light7) << ");";
|
||||
|
||||
// bool clip_plane_enables[kMaxClipPlanes] = bool[kMaxClipPlanes](
|
||||
outStream << "\n";
|
||||
outStream << "bool clip_plane_enables[kMaxClipPlanes] = bool[kMaxClipPlanes]("
|
||||
<< getShaderBool(GLES1StateEnables::ClipPlane0) << ", "
|
||||
<< getShaderBool(GLES1StateEnables::ClipPlane1) << ", "
|
||||
<< getShaderBool(GLES1StateEnables::ClipPlane2) << ", "
|
||||
<< getShaderBool(GLES1StateEnables::ClipPlane3) << ", "
|
||||
<< getShaderBool(GLES1StateEnables::ClipPlane4) << ", "
|
||||
<< getShaderBool(GLES1StateEnables::ClipPlane5) << ");";
|
||||
}
|
||||
|
||||
angle::Result GLES1Renderer::initializeRendererProgram(Context *context, State *glState)
|
||||
{
|
||||
if (mRendererProgramInitialized)
|
||||
uint64_t currentGLES1State = mGLES1StateEnabled.to_ulong();
|
||||
|
||||
// See if we have the shader for this combination of states
|
||||
if (mProgramStates.find(currentGLES1State) != mProgramStates.end())
|
||||
{
|
||||
// If we're already done the initialization/compilation, but there has been some
|
||||
// state change, just reload the compiled program.
|
||||
GLES1State &gles1State = glState->gles1();
|
||||
if (gles1State.shouldHandleDirtyProgram())
|
||||
Program *programObject = getProgram(mProgramStates[currentGLES1State].program);
|
||||
|
||||
// If this is different than the current program, we need to sync everything
|
||||
// TODO: This could be optimized to only dirty state that differs between the two programs
|
||||
if (glState->getProgram()->id() != programObject->id())
|
||||
{
|
||||
Program *programObject = getProgram(mProgramState.program);
|
||||
ANGLE_TRY(glState->setProgram(context, programObject));
|
||||
glState->gles1().setAllDirty();
|
||||
}
|
||||
|
||||
ANGLE_TRY(glState->setProgram(context, programObject));
|
||||
return angle::Result::Continue;
|
||||
}
|
||||
|
||||
mShaderPrograms = new ShaderProgramManager();
|
||||
if (!mRendererProgramInitialized)
|
||||
{
|
||||
mShaderPrograms = new ShaderProgramManager();
|
||||
}
|
||||
|
||||
// If we get here, we don't have a shader for this state, need to create it
|
||||
GLES1ProgramState &programState = mProgramStates[currentGLES1State];
|
||||
|
||||
ShaderProgramID vertexShader;
|
||||
ShaderProgramID fragmentShader;
|
||||
|
||||
ANGLE_TRY(compileShader(context, ShaderType::Vertex, kGLES1DrawVShader, &vertexShader));
|
||||
std::stringstream GLES1DrawVShaderStateDefs;
|
||||
addVertexShaderDefs(GLES1DrawVShaderStateDefs);
|
||||
|
||||
std::stringstream vertexStream;
|
||||
vertexStream << kGLES1DrawVShaderHeader;
|
||||
vertexStream << GLES1DrawVShaderStateDefs.str();
|
||||
vertexStream << kGLES1DrawVShader;
|
||||
|
||||
ANGLE_TRY(
|
||||
compileShader(context, ShaderType::Vertex, vertexStream.str().c_str(), &vertexShader));
|
||||
|
||||
std::stringstream GLES1DrawFShaderStateDefs;
|
||||
addFragmentShaderDefs(GLES1DrawFShaderStateDefs);
|
||||
|
||||
std::stringstream fragmentStream;
|
||||
fragmentStream << kGLES1DrawFShaderHeader;
|
||||
fragmentStream << GLES1DrawFShaderStateDefs.str();
|
||||
fragmentStream << kGLES1DrawFShaderUniformDefs;
|
||||
fragmentStream << kGLES1DrawFShaderFunctions;
|
||||
fragmentStream << kGLES1DrawFShaderMultitexturing;
|
||||
@@ -661,17 +791,17 @@ angle::Result GLES1Renderer::initializeRendererProgram(Context *context, State *
|
||||
}
|
||||
|
||||
ANGLE_TRY(linkProgram(context, glState, vertexShader, fragmentShader, attribLocs,
|
||||
&mProgramState.program));
|
||||
&programState.program));
|
||||
|
||||
mShaderPrograms->deleteShader(context, vertexShader);
|
||||
mShaderPrograms->deleteShader(context, fragmentShader);
|
||||
|
||||
Program *programObject = getProgram(mProgramState.program);
|
||||
Program *programObject = getProgram(programState.program);
|
||||
|
||||
mProgramState.projMatrixLoc = programObject->getUniformLocation("projection");
|
||||
mProgramState.modelviewMatrixLoc = programObject->getUniformLocation("modelview");
|
||||
mProgramState.textureMatrixLoc = programObject->getUniformLocation("texture_matrix");
|
||||
mProgramState.modelviewInvTrLoc = programObject->getUniformLocation("modelview_invtr");
|
||||
programState.projMatrixLoc = programObject->getUniformLocation("projection");
|
||||
programState.modelviewMatrixLoc = programObject->getUniformLocation("modelview");
|
||||
programState.textureMatrixLoc = programObject->getUniformLocation("texture_matrix");
|
||||
programState.modelviewInvTrLoc = programObject->getUniformLocation("modelview_invtr");
|
||||
|
||||
for (int i = 0; i < kTexUnitCount; i++)
|
||||
{
|
||||
@@ -681,113 +811,90 @@ angle::Result GLES1Renderer::initializeRendererProgram(Context *context, State *
|
||||
ss2d << "tex_sampler" << i;
|
||||
sscube << "tex_cube_sampler" << i;
|
||||
|
||||
mProgramState.tex2DSamplerLocs[i] = programObject->getUniformLocation(ss2d.str().c_str());
|
||||
mProgramState.texCubeSamplerLocs[i] =
|
||||
programState.tex2DSamplerLocs[i] = programObject->getUniformLocation(ss2d.str().c_str());
|
||||
programState.texCubeSamplerLocs[i] =
|
||||
programObject->getUniformLocation(sscube.str().c_str());
|
||||
}
|
||||
|
||||
mProgramState.enableTexture2DLoc = programObject->getUniformLocation("enable_texture_2d");
|
||||
mProgramState.enableTextureCubeMapLoc =
|
||||
programObject->getUniformLocation("enable_texture_cube_map");
|
||||
programState.textureFormatLoc = programObject->getUniformLocation("texture_format");
|
||||
programState.textureEnvModeLoc = programObject->getUniformLocation("texture_env_mode");
|
||||
programState.combineRgbLoc = programObject->getUniformLocation("combine_rgb");
|
||||
programState.combineAlphaLoc = programObject->getUniformLocation("combine_alpha");
|
||||
programState.src0rgbLoc = programObject->getUniformLocation("src0_rgb");
|
||||
programState.src0alphaLoc = programObject->getUniformLocation("src0_alpha");
|
||||
programState.src1rgbLoc = programObject->getUniformLocation("src1_rgb");
|
||||
programState.src1alphaLoc = programObject->getUniformLocation("src1_alpha");
|
||||
programState.src2rgbLoc = programObject->getUniformLocation("src2_rgb");
|
||||
programState.src2alphaLoc = programObject->getUniformLocation("src2_alpha");
|
||||
programState.op0rgbLoc = programObject->getUniformLocation("op0_rgb");
|
||||
programState.op0alphaLoc = programObject->getUniformLocation("op0_alpha");
|
||||
programState.op1rgbLoc = programObject->getUniformLocation("op1_rgb");
|
||||
programState.op1alphaLoc = programObject->getUniformLocation("op1_alpha");
|
||||
programState.op2rgbLoc = programObject->getUniformLocation("op2_rgb");
|
||||
programState.op2alphaLoc = programObject->getUniformLocation("op2_alpha");
|
||||
programState.textureEnvColorLoc = programObject->getUniformLocation("texture_env_color");
|
||||
programState.rgbScaleLoc = programObject->getUniformLocation("texture_env_rgb_scale");
|
||||
programState.alphaScaleLoc = programObject->getUniformLocation("texture_env_alpha_scale");
|
||||
|
||||
mProgramState.textureFormatLoc = programObject->getUniformLocation("texture_format");
|
||||
mProgramState.textureEnvModeLoc = programObject->getUniformLocation("texture_env_mode");
|
||||
mProgramState.combineRgbLoc = programObject->getUniformLocation("combine_rgb");
|
||||
mProgramState.combineAlphaLoc = programObject->getUniformLocation("combine_alpha");
|
||||
mProgramState.src0rgbLoc = programObject->getUniformLocation("src0_rgb");
|
||||
mProgramState.src0alphaLoc = programObject->getUniformLocation("src0_alpha");
|
||||
mProgramState.src1rgbLoc = programObject->getUniformLocation("src1_rgb");
|
||||
mProgramState.src1alphaLoc = programObject->getUniformLocation("src1_alpha");
|
||||
mProgramState.src2rgbLoc = programObject->getUniformLocation("src2_rgb");
|
||||
mProgramState.src2alphaLoc = programObject->getUniformLocation("src2_alpha");
|
||||
mProgramState.op0rgbLoc = programObject->getUniformLocation("op0_rgb");
|
||||
mProgramState.op0alphaLoc = programObject->getUniformLocation("op0_alpha");
|
||||
mProgramState.op1rgbLoc = programObject->getUniformLocation("op1_rgb");
|
||||
mProgramState.op1alphaLoc = programObject->getUniformLocation("op1_alpha");
|
||||
mProgramState.op2rgbLoc = programObject->getUniformLocation("op2_rgb");
|
||||
mProgramState.op2alphaLoc = programObject->getUniformLocation("op2_alpha");
|
||||
mProgramState.textureEnvColorLoc = programObject->getUniformLocation("texture_env_color");
|
||||
mProgramState.rgbScaleLoc = programObject->getUniformLocation("texture_env_rgb_scale");
|
||||
mProgramState.alphaScaleLoc = programObject->getUniformLocation("texture_env_alpha_scale");
|
||||
mProgramState.pointSpriteCoordReplaceLoc =
|
||||
programObject->getUniformLocation("point_sprite_coord_replace");
|
||||
programState.alphaFuncLoc = programObject->getUniformLocation("alpha_func");
|
||||
programState.alphaTestRefLoc = programObject->getUniformLocation("alpha_test_ref");
|
||||
|
||||
mProgramState.enableAlphaTestLoc = programObject->getUniformLocation("enable_alpha_test");
|
||||
mProgramState.alphaFuncLoc = programObject->getUniformLocation("alpha_func");
|
||||
mProgramState.alphaTestRefLoc = programObject->getUniformLocation("alpha_test_ref");
|
||||
|
||||
mProgramState.shadeModelFlatLoc = programObject->getUniformLocation("shade_model_flat");
|
||||
mProgramState.enableLightingLoc = programObject->getUniformLocation("enable_lighting");
|
||||
mProgramState.enableRescaleNormalLoc =
|
||||
programObject->getUniformLocation("enable_rescale_normal");
|
||||
mProgramState.enableNormalizeLoc = programObject->getUniformLocation("enable_normalize");
|
||||
mProgramState.enableColorMaterialLoc =
|
||||
programObject->getUniformLocation("enable_color_material");
|
||||
|
||||
mProgramState.materialAmbientLoc = programObject->getUniformLocation("material_ambient");
|
||||
mProgramState.materialDiffuseLoc = programObject->getUniformLocation("material_diffuse");
|
||||
mProgramState.materialSpecularLoc = programObject->getUniformLocation("material_specular");
|
||||
mProgramState.materialEmissiveLoc = programObject->getUniformLocation("material_emissive");
|
||||
mProgramState.materialSpecularExponentLoc =
|
||||
programState.materialAmbientLoc = programObject->getUniformLocation("material_ambient");
|
||||
programState.materialDiffuseLoc = programObject->getUniformLocation("material_diffuse");
|
||||
programState.materialSpecularLoc = programObject->getUniformLocation("material_specular");
|
||||
programState.materialEmissiveLoc = programObject->getUniformLocation("material_emissive");
|
||||
programState.materialSpecularExponentLoc =
|
||||
programObject->getUniformLocation("material_specular_exponent");
|
||||
|
||||
mProgramState.lightModelSceneAmbientLoc =
|
||||
programState.lightModelSceneAmbientLoc =
|
||||
programObject->getUniformLocation("light_model_scene_ambient");
|
||||
mProgramState.lightModelTwoSidedLoc =
|
||||
programObject->getUniformLocation("light_model_two_sided");
|
||||
|
||||
mProgramState.lightEnablesLoc = programObject->getUniformLocation("light_enables");
|
||||
mProgramState.lightAmbientsLoc = programObject->getUniformLocation("light_ambients");
|
||||
mProgramState.lightDiffusesLoc = programObject->getUniformLocation("light_diffuses");
|
||||
mProgramState.lightSpecularsLoc = programObject->getUniformLocation("light_speculars");
|
||||
mProgramState.lightPositionsLoc = programObject->getUniformLocation("light_positions");
|
||||
mProgramState.lightDirectionsLoc = programObject->getUniformLocation("light_directions");
|
||||
mProgramState.lightSpotlightExponentsLoc =
|
||||
programState.lightAmbientsLoc = programObject->getUniformLocation("light_ambients");
|
||||
programState.lightDiffusesLoc = programObject->getUniformLocation("light_diffuses");
|
||||
programState.lightSpecularsLoc = programObject->getUniformLocation("light_speculars");
|
||||
programState.lightPositionsLoc = programObject->getUniformLocation("light_positions");
|
||||
programState.lightDirectionsLoc = programObject->getUniformLocation("light_directions");
|
||||
programState.lightSpotlightExponentsLoc =
|
||||
programObject->getUniformLocation("light_spotlight_exponents");
|
||||
mProgramState.lightSpotlightCutoffAnglesLoc =
|
||||
programState.lightSpotlightCutoffAnglesLoc =
|
||||
programObject->getUniformLocation("light_spotlight_cutoff_angles");
|
||||
mProgramState.lightAttenuationConstsLoc =
|
||||
programState.lightAttenuationConstsLoc =
|
||||
programObject->getUniformLocation("light_attenuation_consts");
|
||||
mProgramState.lightAttenuationLinearsLoc =
|
||||
programState.lightAttenuationLinearsLoc =
|
||||
programObject->getUniformLocation("light_attenuation_linears");
|
||||
mProgramState.lightAttenuationQuadraticsLoc =
|
||||
programState.lightAttenuationQuadraticsLoc =
|
||||
programObject->getUniformLocation("light_attenuation_quadratics");
|
||||
|
||||
mProgramState.fogEnableLoc = programObject->getUniformLocation("enable_fog");
|
||||
mProgramState.fogModeLoc = programObject->getUniformLocation("fog_mode");
|
||||
mProgramState.fogDensityLoc = programObject->getUniformLocation("fog_density");
|
||||
mProgramState.fogStartLoc = programObject->getUniformLocation("fog_start");
|
||||
mProgramState.fogEndLoc = programObject->getUniformLocation("fog_end");
|
||||
mProgramState.fogColorLoc = programObject->getUniformLocation("fog_color");
|
||||
programState.fogModeLoc = programObject->getUniformLocation("fog_mode");
|
||||
programState.fogDensityLoc = programObject->getUniformLocation("fog_density");
|
||||
programState.fogStartLoc = programObject->getUniformLocation("fog_start");
|
||||
programState.fogEndLoc = programObject->getUniformLocation("fog_end");
|
||||
programState.fogColorLoc = programObject->getUniformLocation("fog_color");
|
||||
|
||||
mProgramState.enableClipPlanesLoc = programObject->getUniformLocation("enable_clip_planes");
|
||||
mProgramState.clipPlaneEnablesLoc = programObject->getUniformLocation("clip_plane_enables");
|
||||
mProgramState.clipPlanesLoc = programObject->getUniformLocation("clip_planes");
|
||||
programState.clipPlanesLoc = programObject->getUniformLocation("clip_planes");
|
||||
|
||||
mProgramState.pointRasterizationLoc = programObject->getUniformLocation("point_rasterization");
|
||||
mProgramState.pointSizeMinLoc = programObject->getUniformLocation("point_size_min");
|
||||
mProgramState.pointSizeMaxLoc = programObject->getUniformLocation("point_size_max");
|
||||
mProgramState.pointDistanceAttenuationLoc =
|
||||
programState.pointSizeMinLoc = programObject->getUniformLocation("point_size_min");
|
||||
programState.pointSizeMaxLoc = programObject->getUniformLocation("point_size_max");
|
||||
programState.pointDistanceAttenuationLoc =
|
||||
programObject->getUniformLocation("point_distance_attenuation");
|
||||
mProgramState.pointSpriteEnabledLoc = programObject->getUniformLocation("point_sprite_enabled");
|
||||
|
||||
mProgramState.enableDrawTextureLoc = programObject->getUniformLocation("enable_draw_texture");
|
||||
mProgramState.drawTextureCoordsLoc = programObject->getUniformLocation("draw_texture_coords");
|
||||
mProgramState.drawTextureDimsLoc = programObject->getUniformLocation("draw_texture_dims");
|
||||
mProgramState.drawTextureNormalizedCropRectLoc =
|
||||
programState.drawTextureCoordsLoc = programObject->getUniformLocation("draw_texture_coords");
|
||||
programState.drawTextureDimsLoc = programObject->getUniformLocation("draw_texture_dims");
|
||||
programState.drawTextureNormalizedCropRectLoc =
|
||||
programObject->getUniformLocation("draw_texture_normalized_crop_rect");
|
||||
|
||||
ANGLE_TRY(glState->setProgram(context, programObject));
|
||||
|
||||
for (int i = 0; i < kTexUnitCount; i++)
|
||||
{
|
||||
setUniform1i(context, programObject, mProgramState.tex2DSamplerLocs[i], i);
|
||||
setUniform1i(context, programObject, mProgramState.texCubeSamplerLocs[i],
|
||||
i + kTexUnitCount);
|
||||
setUniform1i(context, programObject, programState.tex2DSamplerLocs[i], i);
|
||||
setUniform1i(context, programObject, programState.texCubeSamplerLocs[i], i + kTexUnitCount);
|
||||
}
|
||||
|
||||
glState->setObjectDirty(GL_PROGRAM);
|
||||
|
||||
// We just created a new program, we need to sync everything
|
||||
glState->gles1().setAllDirty();
|
||||
|
||||
mRendererProgramInitialized = true;
|
||||
return angle::Result::Continue;
|
||||
}
|
||||
|
||||
@@ -27,6 +27,51 @@ class State;
|
||||
class Shader;
|
||||
class ShaderProgramManager;
|
||||
|
||||
enum class GLES1StateEnables : uint64_t
|
||||
{
|
||||
Lighting = 0,
|
||||
Fog = 1,
|
||||
ClipPlanes = 2,
|
||||
DrawTexture = 3,
|
||||
PointRasterization = 4,
|
||||
PointSprite = 5,
|
||||
RescaleNormal = 6,
|
||||
Normalize = 7,
|
||||
AlphaTest = 8,
|
||||
ShadeModelFlat = 9,
|
||||
ColorMaterial = 10,
|
||||
LightModelTwoSided = 11,
|
||||
Tex2d0 = 12,
|
||||
Tex2d1 = 13,
|
||||
Tex2d2 = 14,
|
||||
Tex2d3 = 15,
|
||||
TexCube0 = 16,
|
||||
TexCube1 = 17,
|
||||
TexCube2 = 18,
|
||||
TexCube3 = 19,
|
||||
PointSpriteCoordReplaces0 = 20,
|
||||
PointSpriteCoordReplaces1 = 21,
|
||||
PointSpriteCoordReplaces2 = 22,
|
||||
PointSpriteCoordReplaces3 = 23,
|
||||
Light0 = 24,
|
||||
Light1 = 25,
|
||||
Light2 = 26,
|
||||
Light3 = 27,
|
||||
Light4 = 28,
|
||||
Light5 = 29,
|
||||
Light6 = 30,
|
||||
Light7 = 31,
|
||||
ClipPlane0 = 32,
|
||||
ClipPlane1 = 33,
|
||||
ClipPlane2 = 34,
|
||||
ClipPlane3 = 35,
|
||||
ClipPlane4 = 36,
|
||||
ClipPlane5 = 37,
|
||||
|
||||
InvalidEnum = 38,
|
||||
EnumCount = 38,
|
||||
};
|
||||
|
||||
class GLES1Renderer final : angle::NonCopyable
|
||||
{
|
||||
public:
|
||||
@@ -117,6 +162,17 @@ class GLES1Renderer final : angle::NonCopyable
|
||||
bool mRendererProgramInitialized;
|
||||
ShaderProgramManager *mShaderPrograms;
|
||||
|
||||
using GLES1StateEnabledBitSet = angle::PackedEnumBitSet<GLES1StateEnables, uint64_t>;
|
||||
|
||||
GLES1StateEnabledBitSet mGLES1StateEnabled;
|
||||
|
||||
const char *getShaderBool(GLES1StateEnables state);
|
||||
void addShaderDefine(std::stringstream &outStream,
|
||||
GLES1StateEnables state,
|
||||
const char *enableString);
|
||||
void addVertexShaderDefs(std::stringstream &outStream);
|
||||
void addFragmentShaderDefs(std::stringstream &outStream);
|
||||
|
||||
struct GLES1ProgramState
|
||||
{
|
||||
ShaderProgramID program;
|
||||
@@ -127,8 +183,6 @@ class GLES1Renderer final : angle::NonCopyable
|
||||
UniformLocation modelviewInvTrLoc;
|
||||
|
||||
// Texturing
|
||||
UniformLocation enableTexture2DLoc;
|
||||
UniformLocation enableTextureCubeMapLoc;
|
||||
std::array<UniformLocation, kTexUnitCount> tex2DSamplerLocs;
|
||||
std::array<UniformLocation, kTexUnitCount> texCubeSamplerLocs;
|
||||
|
||||
@@ -152,20 +206,12 @@ class GLES1Renderer final : angle::NonCopyable
|
||||
UniformLocation textureEnvColorLoc;
|
||||
UniformLocation rgbScaleLoc;
|
||||
UniformLocation alphaScaleLoc;
|
||||
UniformLocation pointSpriteCoordReplaceLoc;
|
||||
|
||||
// Alpha test
|
||||
UniformLocation enableAlphaTestLoc;
|
||||
UniformLocation alphaFuncLoc;
|
||||
UniformLocation alphaTestRefLoc;
|
||||
|
||||
// Shading, materials, and lighting
|
||||
UniformLocation shadeModelFlatLoc;
|
||||
UniformLocation enableLightingLoc;
|
||||
UniformLocation enableRescaleNormalLoc;
|
||||
UniformLocation enableNormalizeLoc;
|
||||
UniformLocation enableColorMaterialLoc;
|
||||
|
||||
UniformLocation materialAmbientLoc;
|
||||
UniformLocation materialDiffuseLoc;
|
||||
UniformLocation materialSpecularLoc;
|
||||
@@ -173,9 +219,7 @@ class GLES1Renderer final : angle::NonCopyable
|
||||
UniformLocation materialSpecularExponentLoc;
|
||||
|
||||
UniformLocation lightModelSceneAmbientLoc;
|
||||
UniformLocation lightModelTwoSidedLoc;
|
||||
|
||||
UniformLocation lightEnablesLoc;
|
||||
UniformLocation lightAmbientsLoc;
|
||||
UniformLocation lightDiffusesLoc;
|
||||
UniformLocation lightSpecularsLoc;
|
||||
@@ -188,7 +232,6 @@ class GLES1Renderer final : angle::NonCopyable
|
||||
UniformLocation lightAttenuationQuadraticsLoc;
|
||||
|
||||
// Fog
|
||||
UniformLocation fogEnableLoc;
|
||||
UniformLocation fogModeLoc;
|
||||
UniformLocation fogDensityLoc;
|
||||
UniformLocation fogStartLoc;
|
||||
@@ -196,19 +239,14 @@ class GLES1Renderer final : angle::NonCopyable
|
||||
UniformLocation fogColorLoc;
|
||||
|
||||
// Clip planes
|
||||
UniformLocation enableClipPlanesLoc;
|
||||
UniformLocation clipPlaneEnablesLoc;
|
||||
UniformLocation clipPlanesLoc;
|
||||
|
||||
// Point rasterization
|
||||
UniformLocation pointRasterizationLoc;
|
||||
UniformLocation pointSizeMinLoc;
|
||||
UniformLocation pointSizeMaxLoc;
|
||||
UniformLocation pointDistanceAttenuationLoc;
|
||||
UniformLocation pointSpriteEnabledLoc;
|
||||
|
||||
// Draw texture
|
||||
UniformLocation enableDrawTextureLoc;
|
||||
UniformLocation drawTextureCoordsLoc;
|
||||
UniformLocation drawTextureDimsLoc;
|
||||
UniformLocation drawTextureNormalizedCropRectLoc;
|
||||
@@ -239,10 +277,8 @@ class GLES1Renderer final : angle::NonCopyable
|
||||
std::array<Vec4Uniform, kTexUnitCount> texEnvColors;
|
||||
std::array<GLfloat, kTexUnitCount> texEnvRgbScales;
|
||||
std::array<GLfloat, kTexUnitCount> texEnvAlphaScales;
|
||||
std::array<GLint, kTexUnitCount> pointSpriteCoordReplaces;
|
||||
|
||||
// Lighting
|
||||
std::array<GLint, kLightCount> lightEnables;
|
||||
std::array<Vec4Uniform, kLightCount> lightAmbients;
|
||||
std::array<Vec4Uniform, kLightCount> lightDiffuses;
|
||||
std::array<Vec4Uniform, kLightCount> lightSpeculars;
|
||||
@@ -255,15 +291,14 @@ class GLES1Renderer final : angle::NonCopyable
|
||||
std::array<GLfloat, kLightCount> attenuationQuadratics;
|
||||
|
||||
// Clip planes
|
||||
std::array<GLint, kClipPlaneCount> clipPlaneEnables;
|
||||
std::array<Vec4Uniform, kClipPlaneCount> clipPlanes;
|
||||
|
||||
// Texture crop rectangles
|
||||
std::array<Vec4Uniform, kTexUnitCount> texCropRects;
|
||||
};
|
||||
|
||||
GLES1UniformBuffers mUniformBuffers;
|
||||
GLES1ProgramState mProgramState;
|
||||
angle::HashMap<uint64_t, GLES1UniformBuffers> mUniformBuffers;
|
||||
angle::HashMap<uint64_t, GLES1ProgramState> mProgramStates;
|
||||
|
||||
bool mDrawTextureEnabled = false;
|
||||
GLfloat mDrawTextureCoords[4] = {0.0f, 0.0f, 0.0f, 0.0f};
|
||||
|
||||
@@ -6,10 +6,31 @@
|
||||
|
||||
// GLES1Shaders.inc: Defines GLES1 emulation shader.
|
||||
|
||||
constexpr char kGLES1DrawVShader[] = R"(#version 300 es
|
||||
// The following variables are added in GLES1Renderer::initializeRendererProgram
|
||||
// clip_plane_enables
|
||||
// enable_alpha_test
|
||||
// enable_clip_planes
|
||||
// enable_color_material
|
||||
// enable_draw_texture
|
||||
// enable_fog
|
||||
// enable_lighting
|
||||
// enable_normalize
|
||||
// enable_rescale_normal
|
||||
// enable_texture_2d
|
||||
// enable_texture_cube_map
|
||||
// light_enables
|
||||
// light_model_two_sided
|
||||
// point_rasterization
|
||||
// point_sprite_coord_replace
|
||||
// point_sprite_enabled
|
||||
// shade_model_flat
|
||||
|
||||
constexpr char kGLES1DrawVShaderHeader[] = R"(#version 300 es
|
||||
precision highp float;
|
||||
|
||||
#define kMaxTexUnits 4
|
||||
#define kMaxTexUnits 4)";
|
||||
|
||||
constexpr char kGLES1DrawVShader[] = R"(
|
||||
|
||||
in vec4 pos;
|
||||
in vec3 normal;
|
||||
@@ -25,19 +46,14 @@ uniform mat4 modelview;
|
||||
uniform mat4 modelview_invtr;
|
||||
uniform mat4 texture_matrix[kMaxTexUnits];
|
||||
|
||||
uniform bool enable_rescale_normal;
|
||||
uniform bool enable_normalize;
|
||||
|
||||
// Point rasterization//////////////////////////////////////////////////////////
|
||||
|
||||
uniform bool point_rasterization;
|
||||
uniform float point_size_min;
|
||||
uniform float point_size_max;
|
||||
uniform vec3 point_distance_attenuation;
|
||||
|
||||
// GL_OES_draw_texture uniforms/////////////////////////////////////////////////
|
||||
|
||||
uniform bool enable_draw_texture;
|
||||
uniform vec4 draw_texture_coords;
|
||||
uniform vec2 draw_texture_dims;
|
||||
uniform vec4 draw_texture_normalized_crop_rect[kMaxTexUnits];
|
||||
@@ -259,9 +275,6 @@ constexpr char kGLES1DrawFShaderUniformDefs[] = R"(
|
||||
|
||||
// Texture units ///////////////////////////////////////////////////////////////
|
||||
|
||||
uniform bool enable_texture_2d[kMaxTexUnits];
|
||||
uniform bool enable_texture_cube_map[kMaxTexUnits];
|
||||
|
||||
// These are not arrays because hw support for arrays
|
||||
// of samplers is rather lacking.
|
||||
|
||||
@@ -297,7 +310,6 @@ uniform int op2_alpha[kMaxTexUnits];
|
||||
uniform vec4 texture_env_color[kMaxTexUnits];
|
||||
uniform float texture_env_rgb_scale[kMaxTexUnits];
|
||||
uniform float texture_env_alpha_scale[kMaxTexUnits];
|
||||
uniform bool point_sprite_coord_replace[kMaxTexUnits];
|
||||
|
||||
// Vertex attributes////////////////////////////////////////////////////////////
|
||||
|
||||
@@ -312,16 +324,11 @@ in vec4 texcoord3_varying;
|
||||
|
||||
// Alpha test///////////////////////////////////////////////////////////////////
|
||||
|
||||
uniform bool enable_alpha_test;
|
||||
uniform int alpha_func;
|
||||
uniform float alpha_test_ref;
|
||||
|
||||
// Shading: flat shading, lighting, and materials///////////////////////////////
|
||||
|
||||
uniform bool shade_model_flat;
|
||||
uniform bool enable_lighting;
|
||||
uniform bool enable_color_material;
|
||||
|
||||
uniform vec4 material_ambient;
|
||||
uniform vec4 material_diffuse;
|
||||
uniform vec4 material_specular;
|
||||
@@ -329,9 +336,7 @@ uniform vec4 material_emissive;
|
||||
uniform float material_specular_exponent;
|
||||
|
||||
uniform vec4 light_model_scene_ambient;
|
||||
uniform bool light_model_two_sided;
|
||||
|
||||
uniform bool light_enables[kMaxLights];
|
||||
uniform vec4 light_ambients[kMaxLights];
|
||||
uniform vec4 light_diffuses[kMaxLights];
|
||||
uniform vec4 light_speculars[kMaxLights];
|
||||
@@ -345,7 +350,6 @@ uniform float light_attenuation_quadratics[kMaxLights];
|
||||
|
||||
// Fog /////////////////////////////////////////////////////////////////////////
|
||||
|
||||
uniform bool enable_fog;
|
||||
uniform int fog_mode;
|
||||
uniform float fog_density;
|
||||
uniform float fog_start;
|
||||
@@ -354,19 +358,12 @@ uniform vec4 fog_color;
|
||||
|
||||
// User clip plane /////////////////////////////////////////////////////////////
|
||||
|
||||
uniform bool enable_clip_planes;
|
||||
uniform bool clip_plane_enables[kMaxClipPlanes];
|
||||
uniform vec4 clip_planes[kMaxClipPlanes];
|
||||
|
||||
// Point rasterization//////////////////////////////////////////////////////////
|
||||
|
||||
uniform bool point_rasterization;
|
||||
uniform bool point_sprite_enabled;
|
||||
|
||||
// GL_OES_draw_texture//////////////////////////////////////////////////////////
|
||||
|
||||
uniform bool enable_draw_texture;
|
||||
|
||||
// Outgoing fragment////////////////////////////////////////////////////////////
|
||||
|
||||
out vec4 frag_color;
|
||||
|
||||
@@ -383,3 +383,13 @@
|
||||
|
||||
// Metal internal compiler error
|
||||
6581 MAC AMD METAL : ProgramBinaryES3Test.SaveAndLoadDetachedShaders/* = SKIP
|
||||
|
||||
// GLES1 failures introduced during ubershader optimization
|
||||
6652 MAC INTEL OPENGL : BootAnimationTest.DefaultBootAnimation/* = SKIP
|
||||
6652 MAC INTEL OPENGL : DrawTextureTest.Basic/* = SKIP
|
||||
6652 MAC INTEL OPENGL : DrawTextureTest.VertexAttributesNoCrash/* = SKIP
|
||||
6652 MAC INTEL OPENGL : DrawTextureTest.ColorArrayNotUsed/* = SKIP
|
||||
6652 MAC INTEL OPENGL : DrawTextureTest.CorrectNdcForOddViewportDimensions/* = SKIP
|
||||
6652 WIN AMD VULKAN : BasicDrawTest.EnableDisableTexture/* = SKIP
|
||||
6652 WIN AMD VULKAN : DrawTextureTest.ColorArrayDifferentTypes/* = SKIP
|
||||
6652 WIN AMD VULKAN : PointSpriteTest.TrianglesNotTreatedAsPointSprites/* = SKIP
|
||||
@@ -515,6 +515,9 @@ TEST_P(GLES1ConformanceTest, PointSizeArray)
|
||||
|
||||
TEST_P(GLES1ConformanceTest, PointSprite)
|
||||
{
|
||||
// http://anglebug.com/6652
|
||||
ANGLE_SKIP_TEST_IF(IsWindows() && IsIntel() && IsVulkan());
|
||||
|
||||
ASSERT_NE(CONFORMANCE_TEST_ERROR, PointSpriteExec());
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user