This repository was archived by the owner on Feb 25, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6k
[Impeller] support half precision uniforms and half precision samplers #40590
Merged
Merged
Changes from all commits
Commits
Show all changes
28 commits
Select commit
Hold shift + click to select a range
02ccd58
[Impeller] support f16vec4 in shaders and use in solid color uniform
jonahwilliams 3c00839
use compiler intrinsic
jonahwilliams 43ff491
++
jonahwilliams 68b1009
++
jonahwilliams b6e6f81
++
jonahwilliams d739b58
Merge branch 'master' of github.com:flutter/engine into support-half-…
jonahwilliams f1919b4
++
jonahwilliams a98fa07
fix licenses
jonahwilliams 7dca490
make half a wrapper type
jonahwilliams 9599b62
use hardware supported conversion
jonahwilliams 4bdc197
disable for windows and add more conversion tests
jonahwilliams a8b80ed
compile
jonahwilliams 8e9892b
++
jonahwilliams 1bce547
Merge branch 'main' into support-half-vec4
jonahwilliams 22a0bd1
test
jonahwilliams c802c7c
Merge branch 'support-half-vec4' of github.com:jonahwilliams/engine i…
jonahwilliams 251564b
++
jonahwilliams 51d7bb7
++
jonahwilliams 9001fe1
Update geometry_unittests.cc
jonahwilliams 11f0c9f
Update geometry_unittests.cc
jonahwilliams 6998f76
++
jonahwilliams 205db32
Merge branch 'support-half-vec4' of github.com:jonahwilliams/engine i…
jonahwilliams 736a3e5
make this unreachable
jonahwilliams 0af6ab9
++
jonahwilliams 31cf48a
Merge branch 'main' into support-half-vec4
jonahwilliams c9ffbc5
++
jonahwilliams b2996a8
Merge branch 'support-half-vec4' of github.com:jonahwilliams/engine i…
jonahwilliams 2f1f5c3
++
jonahwilliams File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 |
---|---|---|
|
@@ -5,11 +5,11 @@ | |
#include <impeller/types.glsl> | ||
|
||
uniform FragInfo { | ||
vec4 color; | ||
f16vec4 color; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Doesn't this require There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It does not, I'm not actually using a f16vec4 on glsl, here is the compiled shader:
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. oh - but this is all in types.glsl too |
||
} | ||
frag_info; | ||
|
||
out vec4 frag_color; | ||
out f16vec4 frag_color; | ||
|
||
void main() { | ||
frag_color = frag_info.color; | ||
|
This file contains hidden or 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 hidden or 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,21 @@ | ||
// Copyright 2013 The Flutter Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
#extension GL_AMD_gpu_shader_half_float : enable | ||
#extension GL_AMD_gpu_shader_half_float_fetch : enable | ||
#extension GL_EXT_shader_explicit_arithmetic_types_float16 : enable | ||
|
||
uniform FragInfo { | ||
float16_t half_1; | ||
f16vec2 half_2; | ||
f16vec3 half_3; | ||
f16vec4 half_4; | ||
} | ||
frag_info; | ||
|
||
out vec4 frag_color; | ||
|
||
void main() { | ||
frag_color = vec4(0); | ||
} |
This file contains hidden or 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 hidden or 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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Argument comments are of the format
/*arg_name=*/
: https://google.github.io/styleguide/cppguide.html#Function_Argument_CommentsThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is following the style of the rest of the file.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
...also this is a struct, not a function call.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you use
/*field_name=*/
we can use the linter to verify that their name is correct. I turned this on years ago. I don't know if it still runs.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not a function call, but with C++20, you can use aggregate initialization and do this without comments:
{.type = "HalfVector2"}
.