Commit 7e9c0cd6 authored by James Darpinian's avatar James Darpinian Committed by Commit Bot

Optimize disabling ARB_texture_rectangle

In https://crrev.com/c/1991969 I added a new, faster way to disable
ARB_texture_rectangle support in ANGLE's shader translator. This change
starts using it in Chrome, replacing the earlier change introduced in
https://crrev.com/c/1842223

Bug: angleproject:3770
Change-Id: Ica718828581b49efc34230f9f53f28fdec77eb67
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1992548
Commit-Queue: James Darpinian <jdarpinian@chromium.org>
Reviewed-by: default avatarKenneth Russell <kbr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#732221}
parent 567da340
......@@ -1198,6 +1198,14 @@ gpu::ContextResult GLES2DecoderPassthroughImpl::Initialize(
api()->glGetIntegervFn(GL_SCISSOR_BOX, scissor_);
ApplySurfaceDrawOffset();
#if defined(OS_MACOSX)
// On mac we need the ANGLE_texture_rectangle extension to support IOSurface
// backbuffers, but we don't want it exposed to WebGL user shaders. This
// disables support for it in the shader compiler.
if (feature_info_->IsWebGLContext())
api()->glDisableFn(GL_TEXTURE_RECTANGLE_ANGLE);
#endif
set_initialized();
return gpu::ContextResult::kSuccess;
}
......
......@@ -8,7 +8,6 @@
#include "base/metrics/histogram_macros.h"
#include "base/numerics/ranges.h"
#include "base/strings/string_number_conversions.h"
#include "build/build_config.h"
#include "gpu/command_buffer/common/discardable_handle.h"
#include "gpu/command_buffer/service/decoder_client.h"
#include "gpu/command_buffer/service/gl_stream_texture_image.h"
......@@ -709,18 +708,7 @@ error::Error GLES2DecoderPassthroughImpl::DoColorMask(GLboolean red,
}
error::Error GLES2DecoderPassthroughImpl::DoCompileShader(GLuint shader) {
#if defined(OS_MACOSX)
// On mac we need this extension to support IOSurface backbuffers, but we
// don't want it exposed to WebGL user shaders. Temporarily disable it during
// shader compilation.
if (feature_info_->IsWebGLContext())
api()->glDisableExtensionANGLEFn("GL_ANGLE_texture_rectangle");
#endif
api()->glCompileShaderFn(GetShaderServiceID(shader, resources_));
#if defined(OS_MACOSX)
if (feature_info_->IsWebGLContext())
api()->glRequestExtensionANGLEFn("GL_ANGLE_texture_rectangle");
#endif
return error::kNoError;
}
......
......@@ -84,6 +84,12 @@
#define GL_TEXTURE_BINDING_EXTERNAL_OES 0x8D67
#define GL_REQUIRED_TEXTURE_IMAGE_UNITS_OES 0x8D68
// GL_ANGLE_texture_rectangle
#define GL_MAX_RECTANGLE_TEXTURE_SIZE_ANGLE 0x84F8
#define GL_TEXTURE_RECTANGLE_ANGLE 0x84F5
#define GL_TEXTURE_BINDING_RECTANGLE_ANGLE 0x84F6
#define GL_SAMPLER_2D_RECT_ANGLE 0x8B63
// GL_ANGLE_translated_shader_source
#define GL_TRANSLATED_SHADER_SOURCE_LENGTH_ANGLE 0x93A0
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment