gpu: Update GrGLCaps usage of fTextureRectangle with chromium.

R=bsalomon@google.com

Bug:900706
Change-Id: I0ca0062f12f905c47e9f096acf675b93f131e390
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/234990
Commit-Queue: Khushal Sagar <khushalsagar@chromium.org>
Reviewed-by: Brian Salomon <bsalomon@google.com>
This commit is contained in:
Khushal 2019-08-21 16:55:07 -07:00 committed by Skia Commit-Bot
parent 3c8f9cb45d
commit c43ab22a8c
3 changed files with 11 additions and 7 deletions

View File

@ -220,9 +220,9 @@ void GrTextureDomain::GLDomain::setData(const GrGLSLProgramDataManager& pdman,
};
if (proxy->textureType() == GrTextureType::kRectangle) {
SkASSERT(values[0] >= 0.0f && values[0] <= proxy->height());
SkASSERT(values[0] >= 0.0f && values[0] <= proxy->width());
SkASSERT(values[1] >= 0.0f && values[1] <= proxy->height());
SkASSERT(values[2] >= 0.0f && values[2] <= proxy->height());
SkASSERT(values[2] >= 0.0f && values[2] <= proxy->width());
SkASSERT(values[3] >= 0.0f && values[3] <= proxy->height());
} else {
SkASSERT(values[0] >= 0.0f && values[0] <= 1.0f);

View File

@ -237,10 +237,14 @@ void GrGLCaps::init(const GrContextOptions& contextOptions,
fRectangleTextureSupport = true;
}
} else if (GR_IS_GR_GL_ES(standard)) {
// ANGLE will advertise the extension in ES2 contexts but actually using the texture in
// a shader requires ES3 shading language.
fRectangleTextureSupport = ctxInfo.hasExtension("GL_ANGLE_texture_rectangle") &&
ctxInfo.glslGeneration() >= k330_GrGLSLGeneration;
if (kChromium_GrGLDriver == ctxInfo.driver()) {
fRectangleTextureSupport = ctxInfo.hasExtension("GL_ARB_texture_rectangle");
} else {
// ANGLE will advertise the extension in ES2 contexts but actually using the texture in
// a shader requires ES3 shading language.
fRectangleTextureSupport = ctxInfo.hasExtension("GL_ANGLE_texture_rectangle") &&
ctxInfo.glslGeneration() >= k330_GrGLSLGeneration;
}
} // no WebGL support
// GrCaps defaults fClampToBorderSupport to true, so disable when unsupported

View File

@ -656,7 +656,7 @@ void GLSLCodeGenerator::writeFunctionCall(const FunctionCall& c) {
proj = false;
break;
case SpvDimRect:
dim = "Rect";
dim = "2DRect";
proj = false;
break;
case SpvDimBuffer: