Skip to content

Commit

Permalink
Begin initializing caps for webgpu
Browse files Browse the repository at this point in the history
Bug: angleproject:8457
Change-Id: Idde0673297ec675a13bd3e4fd4d220ec47392153
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5391987
Reviewed-by: Matthew Denton <[email protected]>
Reviewed-by: Geoff Lang <[email protected]>
Commit-Queue: Liza Burakova <[email protected]>
  • Loading branch information
Liza Burakova authored and Angle LUCI CQ committed Apr 15, 2024
1 parent 2218db2 commit 041b0a4
Show file tree
Hide file tree
Showing 5 changed files with 106 additions and 75 deletions.
11 changes: 11 additions & 0 deletions src/libANGLE/renderer/renderer_utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -453,6 +453,17 @@ const gl::ColorGeneric AdjustBorderColor(const angle::ColorGeneric &borderColorG
const angle::Format &format,
bool stencilMode);

template <typename LargerInt>
GLint LimitToInt(const LargerInt physicalDeviceValue)
{
static_assert(sizeof(LargerInt) >= sizeof(int32_t), "Incorrect usage of LimitToInt");

// Limit to INT_MAX / 2 instead of INT_MAX. If the limit is queried as float, the imprecision
// in floating point can cause the value to exceed INT_MAX. This trips dEQP up.
return static_cast<GLint>(std::min(
physicalDeviceValue, static_cast<LargerInt>(std::numeric_limits<int32_t>::max() / 2)));
}

enum class PipelineType
{
Graphics = 0,
Expand Down
Loading

0 comments on commit 041b0a4

Please sign in to comment.