-
Notifications
You must be signed in to change notification settings - Fork 6.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement WEBGL_clip_cull_distance as draft extension.
Extension is specified as: https://registry.khronos.org/webgl/extensions/WEBGL_clip_cull_distance/ Skip the extension availability test on the validating command decoder; the extension is only hooked up in ANGLE + the passthrough command decoder. Thanks to Alexey Knyazev for this patch. Bug: 1410603 Change-Id: Ifb1933cded268d861a51adcefec0bf83cd667b20 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4201271 Auto-Submit: Kenneth Russell <kbr@chromium.org> Reviewed-by: Gregg Tavares <gman@chromium.org> Commit-Queue: Kenneth Russell <kbr@chromium.org> Cr-Commit-Position: refs/heads/main@{#1099005}
- Loading branch information
1 parent
8635d52
commit 2be4352
Showing
15 changed files
with
185 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
third_party/blink/renderer/modules/webgl/webgl_clip_cull_distance.cc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
// Copyright 2022 The Chromium Authors | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
#include "third_party/blink/renderer/modules/webgl/webgl_clip_cull_distance.h" | ||
|
||
#include "third_party/blink/renderer/modules/webgl/webgl_rendering_context_base.h" | ||
|
||
namespace blink { | ||
|
||
WebGLClipCullDistance::WebGLClipCullDistance(WebGLRenderingContextBase* context) | ||
: WebGLExtension(context) { | ||
context->ExtensionsUtil()->EnsureExtensionEnabled( | ||
"GL_ANGLE_clip_cull_distance"); | ||
} | ||
|
||
WebGLExtensionName WebGLClipCullDistance::GetName() const { | ||
return kWebGLClipCullDistanceName; | ||
} | ||
|
||
bool WebGLClipCullDistance::Supported(WebGLRenderingContextBase* context) { | ||
return context->ExtensionsUtil()->SupportsExtension( | ||
"GL_ANGLE_clip_cull_distance"); | ||
} | ||
|
||
const char* WebGLClipCullDistance::ExtensionName() { | ||
return "WEBGL_clip_cull_distance"; | ||
} | ||
|
||
} // namespace blink |
27 changes: 27 additions & 0 deletions
27
third_party/blink/renderer/modules/webgl/webgl_clip_cull_distance.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
// Copyright 2022 The Chromium Authors | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
#ifndef THIRD_PARTY_BLINK_RENDERER_MODULES_WEBGL_WEBGL_CLIP_CULL_DISTANCE_H_ | ||
#define THIRD_PARTY_BLINK_RENDERER_MODULES_WEBGL_WEBGL_CLIP_CULL_DISTANCE_H_ | ||
|
||
#include "third_party/blink/renderer/modules/webgl/webgl_extension.h" | ||
#include "third_party/khronos/GLES2/gl2.h" | ||
|
||
namespace blink { | ||
|
||
class WebGLClipCullDistance final : public WebGLExtension { | ||
DEFINE_WRAPPERTYPEINFO(); | ||
|
||
public: | ||
static bool Supported(WebGLRenderingContextBase*); | ||
static const char* ExtensionName(); | ||
|
||
explicit WebGLClipCullDistance(WebGLRenderingContextBase*); | ||
|
||
WebGLExtensionName GetName() const override; | ||
}; | ||
|
||
} // namespace blink | ||
|
||
#endif // THIRD_PARTY_BLINK_RENDERER_MODULES_WEBGL_WEBGL_CLIP_CULL_DISTANCE_H_ |
22 changes: 22 additions & 0 deletions
22
third_party/blink/renderer/modules/webgl/webgl_clip_cull_distance.idl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
// Copyright 2022 The Chromium Authors | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
// https://www.khronos.org/registry/webgl/extensions/WEBGL_clip_cull_distance/ | ||
|
||
[ | ||
LegacyNoInterfaceObject, | ||
DoNotCheckConstants | ||
] interface WebGLClipCullDistance { | ||
const unsigned long MAX_CLIP_DISTANCES_WEBGL = 0x0D32; | ||
const unsigned long MAX_CULL_DISTANCES_WEBGL = 0x82F9; | ||
const unsigned long MAX_COMBINED_CLIP_AND_CULL_DISTANCES_WEBGL = 0x82FA; | ||
const unsigned long CLIP_DISTANCE0_WEBGL = 0x3000; | ||
const unsigned long CLIP_DISTANCE1_WEBGL = 0x3001; | ||
const unsigned long CLIP_DISTANCE2_WEBGL = 0x3002; | ||
const unsigned long CLIP_DISTANCE3_WEBGL = 0x3003; | ||
const unsigned long CLIP_DISTANCE4_WEBGL = 0x3004; | ||
const unsigned long CLIP_DISTANCE5_WEBGL = 0x3005; | ||
const unsigned long CLIP_DISTANCE6_WEBGL = 0x3006; | ||
const unsigned long CLIP_DISTANCE7_WEBGL = 0x3007; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters