62 Commits
Author SHA1 Message Date
Cheryl Wei 45965e725a Vulkan: Translate border color's channel by image view format
ANGLE implementes some formats as other formats,such as ALPHA8 to R8,
this caused some tests failed due to missing border color's channel
translation,this change add a new textureBorderLoadFunction to
translate channels of border color by image view format.

Bug: angleproject:6046
Change-Id: I94ce719b4db3724ffd3dc862b51a412b5d9f3cce
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2972328
Reviewed-by: Shahbaz Youssefi <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
Commit-Queue: Jamie Madill <[email protected]>
2021-07-14 15:59:20 +00:00
Jamie Madill 18c9aa0dc3 Run test spec update as part of codegen.
Test specs now will be updated when the Chromium build files change.
It will be automatically included as part of the Chromium->ANGLE roll.

Bug: angleproject:5114
Change-Id: If99c2a20033d417a5999295f425a3bb203f5da3a
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2860962
Commit-Queue: Jamie Madill <[email protected]>
Reviewed-by: Yuly Novikov <[email protected]>
2021-05-05 19:39:47 +00:00
Alexey Knyazev 54294c9a43 Partially upgrade codegen to Python 3
Bug: angleproject:5707
Change-Id: I4e26c2c7ba4a36185b28ecd6e87be1161b60431a
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2729567
Commit-Queue: Jamie Madill <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
2021-03-04 16:47:52 +00:00
Jamie Madill 7e990ef4bb Clean ups to generate_entry_points.
Switches to Python 3 support. Made a change to run_code_generation to
support this. Affects several generators. Also updates the generator
to make a few other small cleanups.

Bug: angleproject:5653
Change-Id: I045173c9ca85947c4eac22285701032c09f4c8d0
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2699187
Commit-Queue: Jamie Madill <[email protected]>
Reviewed-by: Cody Northrop <[email protected]>
Reviewed-by: Geoff Lang <[email protected]>
2021-02-18 00:47:44 +00:00
Shahbaz Youssefi 6689a54d8a Vulkan: autogen for SPIR-V instruction build and parse
Handwritten SPIR-V instruction parse and build code is replaced with
autogenerated functions based on the SPIR-V grammar.

Bug: angleproject:4889
Change-Id: I09d724fd944e79c03fe4eadca3ee3e3ef0b49872
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2644721
Commit-Queue: Shahbaz Youssefi <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
Reviewed-by: Tim Van Patten <[email protected]>
2021-01-25 19:04:21 +00:00
Jamie Madill 5968da649c code gen: Be more robust to dirty hashes.
If any JSON files get out of whack this will print which file is
malformed. Also will show any temporary files (e.g. .rej or .orig)
as untracked in the code generation hashes dir.

Bug: angleproject:3691
Change-Id: I534e87bd2ea692182aa558bb80e09fb526e441b0
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2564000
Reviewed-by: Shahbaz Youssefi <[email protected]>
Commit-Queue: Jamie Madill <[email protected]>
2020-11-30 14:26:25 +00:00
Jamie Madill bda2205da1 Traces: Move up from tests/perf_tests/ to tests/.
The trace tests aren't strictly for performance. Since we'll be using
them for correctenss testing as well it makes sense to move them out
of the perf_tests/ folder.

Also renames RestrictedTraceTests.md to README.md so it'll load
automatically in gitiles.

Bug: angleproject:4090
Bug: b/168049670
Change-Id: I8be9f1d831489a9abf534d049a93441687850142
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2416913
Commit-Queue: Jamie Madill <[email protected]>
Reviewed-by: Cody Northrop <[email protected]>
2020-09-18 17:25:52 +00:00
Jamie Madill 4d3a0f6028 GN: Componentize D3D format tables.
These tables are used by both the GL and D3D11 back-ends. Also moves
them to renderer_utils to be in a shared place.

Bug: angleproject:3943
Change-Id: I1f5d79842396a87e795547fa03c6855d6f9c5e9a
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2405805
Commit-Queue: Jamie Madill <[email protected]>
Reviewed-by: Jonah Ryan-Davis <[email protected]>
Reviewed-by: Geoff Lang <[email protected]>
2020-09-16 01:08:50 +00:00
Jamie Madill 1c3e322cdb Work around strange git cl format issue.
For some reason this line of code confused git cl format
in that it would generate different results depending on when
it was called:

"PFNEGLSTREAMCONSUMERGLTEXTUREEXTERNALATTRIBSNVPROC
   ANGLE_EGL_StreamConsumerGLTextureExternalAttribsNV;"

I wasn't able to root cause the bug. Instead I worked around
it by changing the signatures for this file.

Bug: angleproject:4596
Change-Id: I4f18e03d27d378480b19831de51c4e85d815ca66
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2176157
Commit-Queue: Jamie Madill <[email protected]>
Reviewed-by: Mohan Maiya <[email protected]>
2020-05-01 19:42:36 +00:00
Jamie Madill 92b3a720a2 Capture/Replay: Generate code integration.
This sources the trace list from a json file and uses that to make the
"glue" that works with each individual trace test.

Bug: angleproject:4590
Change-Id: I40808cbd0e00f9ed01f93c4cfbd678401db3fec0
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2168539
Commit-Queue: Jamie Madill <[email protected]>
Reviewed-by: Cody Northrop <[email protected]>
2020-04-29 18:01:49 +00:00
Jamie Madill f144b77bc8 Make run_code_generation fail if git cl format fails.
The lack of error code was hiding errors in the Skia auto-roller.

Bug: skia:9812
Change-Id: Ib43e5eb1749161e9fa0186bfd4a293dadaf82f8a
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2024178
Reviewed-by: Jamie Madill <[email protected]>
Commit-Queue: Jamie Madill <[email protected]>
2020-01-28 13:46:03 +00:00
Shahbaz Youssefi 5efb36b9af Automatically call flex/bison if necessary
ANGLE translator's parser code generation is changed to use the binaries
of flex/bison stored in the cloud.  scripts/run_code_generation.py now
automatically runs these files if the input files change.

Bug: angleproject:3419
Change-Id: Icce4247f93b27baf8ee12dbb16112fa2cc98c111
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1940572
Reviewed-by: Shahbaz Youssefi <[email protected]>
Commit-Queue: Shahbaz Youssefi <[email protected]>
2019-12-03 19:29:42 +00:00
Tim Van Patten 11c487a891 Manually copy dEQP data files to output directory
dEQP has data files that live in several directories within dEQP's
source tree. For example, GLES3 has data files that live within:

data/gles3/data/
external/graphicsfuzz/data/gles3/

However, we can only tell dEQP about a single data directory during
initialization of dEQP. To get around this, we are manually copying all
of the necessary data files to the output generated files directory and
pointing dEQP to this single directory. This also helps us solve a
second problem related to the paths that dEQP uses when accessing
graphicsfuzz data files.

For the graphicsfuzz tests, dEQP will attempt to open the necessary
shaders by accessing them with the path:

data/gles3/graphicsfuzz/

However, those files would normally live at the path that matches their
location within the source tree:

external/graphicsfuzz/data/gles3/graphicsfuzz/

As part of the manual copy of these data files, we are also able to
strip the extra 'external/graphicsfuzz/' portion of the path.

Bug: angleproject:2322
Test: dEQP
Change-Id: Ibc96442c221485e2f246890fa8fe51f090c5e222
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1881759
Commit-Queue: Tim Van Patten <[email protected]>
Reviewed-by: Tim Van Patten <[email protected]>
2019-11-14 23:08:59 +00:00
Le Quyen 253019996d Metal implementation pt 1: autogen resources
Autogen format table and internal shaders for Metal.

Bug: angleproject:2634
Change-Id: I4d81fcd17a0e9959ba9c38a250acc7abb168f54c
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1855067
Commit-Queue: Jamie Madill <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
2019-10-11 21:59:00 +00:00
Shahbaz Youssefi 050b124d78 Reland "Vulkan: Debug overlay"
This is a reland of e54d0f90d1

This was reverted due to a build failure as a result of a missing
virtual destructor in the widget base class.

Original change's description:
> Vulkan: Debug overlay
>
> A debug overlay system for the Vulkan backend designed with efficiency
> and runtime configurability in mind.  Overlay widgets are of two
> fundamental types:
>
> - Text widgets: A single line of text with small, medium or large font.
> - Graph widgets: A bar graph of data.
>
> Built on these, various overlay widget types are defined that gather
> statistics.  Five such types are defined with one widget per type as
> example:
>
> - Count: A widget that counts something.  VulkanValidationMessageCount
>   is an overlay widget of this type that shows the number of validation
>   messages received from the validation layers.
> - Text: A generic text.  VulkanLastValidationMessage is an overlay
>   widget of this type that shows the last validation message.
> - PerSecond: A value that gets reset every second automatically.  FPS is
>   an overlay widget of this type that simply gets incremented on every
>   swap().
> - RunningGraph: A graph of last N values.  VulkanCommandGraphSize is an
>   overlay of this type.  On every vkQueueSubmit, the number of nodes in
>   the command graph is accumulated.  On every present(), the value is
>   taken as the number of nodes for the whole duration of the frame.
> - RunningHistogram: A histogram of last N values.  Input values are in
>   the [0, 1] range and they are ranked to N buckets for histogram
>   calculation.  VulkanSecondaryCommandBufferPoolWaste is an overlay
>   widget of this type.  On vkQueueSubmit, the memory waste from command
>   buffer pool allocations is recorded in the histogram.
>
> Overlay font is placed in libANGLE/overlay/ which gen_overlay_fonts.py
> processes to create an array of bits, which is processed at runtime to
> create the actual font image (an image with 3 layers).
>
> The overlay widget layout is defined in overlay_widgets.json which
> gen_overlay_widgets.py processes to generate an array of widgetss, each
> of its respective type, and sets their properties, such as color and
> bounding box.  The json file allows widgets to align against other
> widgets as well as against the framebuffer edges.
>
> Two compute shaders are implemented to efficiently render the UI:
>
> - OverlayCull: This shader creates a bitset of Text and Graph widgets
>   whose bounding boxes intersect a corresponding subgroup processed by
>   OverlayDraw.  This is done only when the enabled overlay widgets are
>   changed (a feature that is not yet implemented) or the surface is
>   resized.
> - OverlayDraw: Using the bitsets generated by OverlayCull, values that
>   are uniform for each workgroup (set to be equal to hardware subgroup
>   size), this shader loops over enabled widgets that can possibly
>   intersect the pixel being processed and renders and blends in texts
>   and graphs.  This is done once per frame on present().
>
> Currently, to enable overlay widgets an environment variable is used.
> For example:
>
>     $ export ANGLE_OVERLAY=FPS:VulkanSecondaryCommandBufferPoolWaste
>     $ ./hello_triangle --use-angle=vulkan
>
> Possible future work:
>
> - On Android, add settings in developer options and enable widgets based
>   on those.
> - Spawn a small server in ANGLE and write an application that sends
>   enable/disable commands remotely.
> - Implement overlay for other backends.
>
> Bug: angleproject:3757
> Change-Id: If9c6974d1935c18f460ec569e79b41188bd7afcc
> Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1729440
> Commit-Queue: Shahbaz Youssefi <[email protected]>
> Reviewed-by: Jamie Madill <[email protected]>

Bug: angleproject:3757
Change-Id: I47915d88b37b6f882c686c2de13fca309a10b572
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1780897
Reviewed-by: Jamie Madill <[email protected]>
Commit-Queue: Shahbaz Youssefi <[email protected]>
2019-09-03 18:33:07 +00:00
Corentin Wallez fc58af4797 Revert "Vulkan: Debug overlay"
This reverts commit e54d0f90d1.

Reason for revert: causes compile failure on Linux CFI bot.

Sample build: https://ci.chromium.org/p/chromium/builders/ci/Linux%20CFI/14810

Sample log: https://logs.chromium.org/logs/chromium/buildbucket/cr-buildbucket.appspot.com/8903575125463586160/+/steps/compile/0/stdout?format=raw

Original change's description:
> Vulkan: Debug overlay
>
> A debug overlay system for the Vulkan backend designed with efficiency
> and runtime configurability in mind.  Overlay widgets are of two
> fundamental types:
>
> - Text widgets: A single line of text with small, medium or large font.
> - Graph widgets: A bar graph of data.
>
> Built on these, various overlay widget types are defined that gather
> statistics.  Five such types are defined with one widget per type as
> example:
>
> - Count: A widget that counts something.  VulkanValidationMessageCount
>   is an overlay widget of this type that shows the number of validation
>   messages received from the validation layers.
> - Text: A generic text.  VulkanLastValidationMessage is an overlay
>   widget of this type that shows the last validation message.
> - PerSecond: A value that gets reset every second automatically.  FPS is
>   an overlay widget of this type that simply gets incremented on every
>   swap().
> - RunningGraph: A graph of last N values.  VulkanCommandGraphSize is an
>   overlay of this type.  On every vkQueueSubmit, the number of nodes in
>   the command graph is accumulated.  On every present(), the value is
>   taken as the number of nodes for the whole duration of the frame.
> - RunningHistogram: A histogram of last N values.  Input values are in
>   the [0, 1] range and they are ranked to N buckets for histogram
>   calculation.  VulkanSecondaryCommandBufferPoolWaste is an overlay
>   widget of this type.  On vkQueueSubmit, the memory waste from command
>   buffer pool allocations is recorded in the histogram.
>
> Overlay font is placed in libANGLE/overlay/ which gen_overlay_fonts.py
> processes to create an array of bits, which is processed at runtime to
> create the actual font image (an image with 3 layers).
>
> The overlay widget layout is defined in overlay_widgets.json which
> gen_overlay_widgets.py processes to generate an array of widgetss, each
> of its respective type, and sets their properties, such as color and
> bounding box.  The json file allows widgets to align against other
> widgets as well as against the framebuffer edges.
>
> Two compute shaders are implemented to efficiently render the UI:
>
> - OverlayCull: This shader creates a bitset of Text and Graph widgets
>   whose bounding boxes intersect a corresponding subgroup processed by
>   OverlayDraw.  This is done only when the enabled overlay widgets are
>   changed (a feature that is not yet implemented) or the surface is
>   resized.
> - OverlayDraw: Using the bitsets generated by OverlayCull, values that
>   are uniform for each workgroup (set to be equal to hardware subgroup
>   size), this shader loops over enabled widgets that can possibly
>   intersect the pixel being processed and renders and blends in texts
>   and graphs.  This is done once per frame on present().
>
> Currently, to enable overlay widgets an environment variable is used.
> For example:
>
>     $ export ANGLE_OVERLAY=FPS:VulkanSecondaryCommandBufferPoolWaste
>     $ ./hello_triangle --use-angle=vulkan
>
> Possible future work:
>
> - On Android, add settings in developer options and enable widgets based
>   on those.
> - Spawn a small server in ANGLE and write an application that sends
>   enable/disable commands remotely.
> - Implement overlay for other backends.
>
> Bug: angleproject:3757
> Change-Id: If9c6974d1935c18f460ec569e79b41188bd7afcc
> Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1729440
> Commit-Queue: Shahbaz Youssefi <[email protected]>
> Reviewed-by: Jamie Madill <[email protected]>

[email protected],[email protected],[email protected]

Bug: angleproject:3757
Change-Id: Ib08e2e7b1a9449ca097673acb11655df5d2bbf31
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1778862
Commit-Queue: Corentin Wallez <[email protected]>
Reviewed-by: Corentin Wallez <[email protected]>
2019-09-02 11:54:11 +00:00
Shahbaz Youssefi e54d0f90d1 Vulkan: Debug overlay
A debug overlay system for the Vulkan backend designed with efficiency
and runtime configurability in mind.  Overlay widgets are of two
fundamental types:

- Text widgets: A single line of text with small, medium or large font.
- Graph widgets: A bar graph of data.

Built on these, various overlay widget types are defined that gather
statistics.  Five such types are defined with one widget per type as
example:

- Count: A widget that counts something.  VulkanValidationMessageCount
  is an overlay widget of this type that shows the number of validation
  messages received from the validation layers.
- Text: A generic text.  VulkanLastValidationMessage is an overlay
  widget of this type that shows the last validation message.
- PerSecond: A value that gets reset every second automatically.  FPS is
  an overlay widget of this type that simply gets incremented on every
  swap().
- RunningGraph: A graph of last N values.  VulkanCommandGraphSize is an
  overlay of this type.  On every vkQueueSubmit, the number of nodes in
  the command graph is accumulated.  On every present(), the value is
  taken as the number of nodes for the whole duration of the frame.
- RunningHistogram: A histogram of last N values.  Input values are in
  the [0, 1] range and they are ranked to N buckets for histogram
  calculation.  VulkanSecondaryCommandBufferPoolWaste is an overlay
  widget of this type.  On vkQueueSubmit, the memory waste from command
  buffer pool allocations is recorded in the histogram.

Overlay font is placed in libANGLE/overlay/ which gen_overlay_fonts.py
processes to create an array of bits, which is processed at runtime to
create the actual font image (an image with 3 layers).

The overlay widget layout is defined in overlay_widgets.json which
gen_overlay_widgets.py processes to generate an array of widgetss, each
of its respective type, and sets their properties, such as color and
bounding box.  The json file allows widgets to align against other
widgets as well as against the framebuffer edges.

Two compute shaders are implemented to efficiently render the UI:

- OverlayCull: This shader creates a bitset of Text and Graph widgets
  whose bounding boxes intersect a corresponding subgroup processed by
  OverlayDraw.  This is done only when the enabled overlay widgets are
  changed (a feature that is not yet implemented) or the surface is
  resized.
- OverlayDraw: Using the bitsets generated by OverlayCull, values that
  are uniform for each workgroup (set to be equal to hardware subgroup
  size), this shader loops over enabled widgets that can possibly
  intersect the pixel being processed and renders and blends in texts
  and graphs.  This is done once per frame on present().

Currently, to enable overlay widgets an environment variable is used.
For example:

    $ export ANGLE_OVERLAY=FPS:VulkanSecondaryCommandBufferPoolWaste
    $ ./hello_triangle --use-angle=vulkan

Possible future work:

- On Android, add settings in developer options and enable widgets based
  on those.
- Spawn a small server in ANGLE and write an application that sends
  enable/disable commands remotely.
- Implement overlay for other backends.

Bug: angleproject:3757
Change-Id: If9c6974d1935c18f460ec569e79b41188bd7afcc
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1729440
Commit-Queue: Shahbaz Youssefi <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
2019-08-31 03:40:44 +00:00
Clemen Deng d7d425404b Don't build symbol table for GLSL built-ins if on Android
The GLSL + ESSL autogenerated symbol table is too large for
android, and android also doesn't need desktop GL functionality
If on android, compile the ESSL only symbol table

Bug: chromium:996286
Change-Id: I14dfc7748dae389e78c35f82a390c67962665356
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1757372
Commit-Queue: Clemen Deng <[email protected]>
Reviewed-by: Shahbaz Youssefi <[email protected]>
Reviewed-by: Geoff Lang <[email protected]>
2019-08-23 16:43:26 +00:00
Clemen Deng 44f518b584 Have run_code_generation only call vpython when needed
gen_builtin_symbols.py uses a vpython module to generate
a perfect hash function
Also seeded the perfect hash function to make it deterministic

Bug: angleproject:3747
Change-Id: I660fe71bd6b2213be9d4ccc2f68641637a49a047
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1738747
Commit-Queue: Clemen Deng <[email protected]>
Reviewed-by: Geoff Lang <[email protected]>
2019-08-07 15:27:21 +00:00
Jiacheng Lu f3dbf0a7ae FrameCapture dump GLenum to enum instead of value
Add functionality to capture GLenum and GLbitfield parameters as enum
names instead of values.

Bug: angleproject:3611
Change-Id: I7ddc21093d44d1480b205563f30d89f82779b1f1
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1724460
Commit-Queue: Jamie Madill <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
2019-08-05 21:10:13 +00:00
Clemen Deng 9031bdd9ba Use perfect-hash module in gen_builtin_symbols.py
The script currently takes ~4 minutes to run
Using this module instead of manually hashing
will improve runtime significantly

Bug: angleproject:3747
Change-Id: I7e2d2ef5bbfd136b0299d571e0acc11f334c80b5
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1724667
Commit-Queue: Clemen Deng <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
2019-08-05 15:52:09 +00:00
Jamie Madill 53aff41e47 Use separate json files for each code generator.
This should reduce the number of merge conflicts when multiple people
touch different generators. There still will be merge conflicts when
two people touch the same code generator.

Bug: angleproject:3691
Change-Id: I0b179368a1352331c091972568c00213ab106e46
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1698650
Reviewed-by: Yuly Novikov <[email protected]>
Reviewed-by: Ian Elliott <[email protected]>
Commit-Queue: Jamie Madill <[email protected]>
2019-07-11 20:17:04 +00:00
Clemen Deng 7558e836ef Windows Desktop GL Implementation
Bug: angleproject:3620
Change-Id: I4ef4ab3ee145e5ce9b1ebf0c2d61d0777db72c43
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1678405
Reviewed-by: Jamie Madill <[email protected]>
Reviewed-by: Geoff Lang <[email protected]>
Commit-Queue: Jamie Madill <[email protected]>
2019-07-03 12:49:04 +00:00
Geoff Lang d7d42395ac Format all of ANGLE's python code.
BUG=angleproject:3421

Change-Id: I1d7282ac513c046de5d8ed87f7789290780d30a6
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1595440
Reviewed-by: Jamie Madill <[email protected]>
Commit-Queue: Geoff Lang <[email protected]>
2019-05-06 18:56:09 +00:00
Jamie Madill 13264033c8 Minor cleanups to run_code_generation.
Prints more info when a particular file is not found.

Bug: angleproject:3333
Change-Id: I11ceb0d319023cd1fd23fd25297e5367030342a0
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1550899
Reviewed-by: Yuly Novikov <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
Commit-Queue: Jamie Madill <[email protected]>
2019-04-03 19:35:34 +00:00
Jamie Madill 3c1f5a6bd4 Include script outputs in run_code_generation.py.
This will prevent incorrect modifications to outputs from being checked
into the repository. Requires a few changes to some generators.

Bug: angleproject:3227
Change-Id: I5285cb78a9d85df155a5272edf8b6b8cd27fc04c
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1515212
Reviewed-by: Shahbaz Youssefi <[email protected]>
Reviewed-by: Geoff Lang <[email protected]>
Commit-Queue: Jamie Madill <[email protected]>
2019-03-12 21:29:07 +00:00
Jamie Madill 0f34f3f2f7 Use auto_script in run_code_generation.
Cleans up the generator scripts to prepare for listing outputs in the
generated hashes file. Also reorganizes the scripts somewhat to make
them a bit more maintainable.

Bug: angleproject:3227
Change-Id: If40946c2004941d3f6cd51d5521c7db8cc0b52df
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1512052
Reviewed-by: Shahbaz Youssefi <[email protected]>
Reviewed-by: Geoff Lang <[email protected]>
Commit-Queue: Jamie Madill <[email protected]>
2019-03-11 22:23:49 +00:00
Jamie Madill 14126505b2 Revert "Use a constexpr array for es3 copy conversion table."
This reverts commit f30808db86.

Reason for revert: build/android/gyp/assert_static_initializers.py thinks this adds a static initializer.

See https://ci.chromium.org/p/chromium/builders/try/android-marshmallow-arm64-rel/208664

Need to revert since this is blocking the roll.

Original change's description:
> Use a constexpr array for es3 copy conversion table.
> 
> With the relaxed C++14 constexpr rules allowed in Chromium, we can
> use a constexpr sorted array to store our table data. This can lead
> to very fast lookups while being more maintanable than using auto-
> generator scripts for every lookup table.
> 
> Note that to be sure this syntax is permitted, we should land this
> through the bots and let it sit for a little while.
> 
> Bug: angleproject:1389
> Change-Id: I9395c40276470108ce3e5786d8f1b8d85462c517
> Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/777544
> Commit-Queue: Jamie Madill <[email protected]>
> Reviewed-by: Yuly Novikov <[email protected]>

[email protected],[email protected],[email protected],[email protected]

# Not skipping CQ checks because original CL landed > 1 day ago.

Bug: angleproject:1389
Change-Id: I482729b6f16975896b0e5c29999f9a081056e800
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1506238
Reviewed-by: Jamie Madill <[email protected]>
Reviewed-by: Shahbaz Youssefi <[email protected]>
Commit-Queue: Jamie Madill <[email protected]>
2019-03-06 22:24:56 +00:00
Jamie Madill f30808db86 Use a constexpr array for es3 copy conversion table.
With the relaxed C++14 constexpr rules allowed in Chromium, we can
use a constexpr sorted array to store our table data. This can lead
to very fast lookups while being more maintanable than using auto-
generator scripts for every lookup table.

Note that to be sure this syntax is permitted, we should land this
through the bots and let it sit for a little while.

Bug: angleproject:1389
Change-Id: I9395c40276470108ce3e5786d8f1b8d85462c517
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/777544
Commit-Queue: Jamie Madill <[email protected]>
Reviewed-by: Yuly Novikov <[email protected]>
2019-03-05 20:11:12 +00:00
Jamie Madill 2f1c1d7eee Minor improvements to run_code_generation.
Isolate variables better. And add a check for out-of-date hases.
Currently if a generator is removed the hashes will stick around.

Bug: angleproject:3227
Change-Id: I9b9da245b9b29093b1f3f320a81810cd7da82395
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1500575
Commit-Queue: Jamie Madill <[email protected]>
Reviewed-by: Shahbaz Youssefi <[email protected]>
2019-03-05 14:28:16 +00:00
Shahbaz Youssefi 98a3550bce Add a presubmit step to make sure autogenerated code is up-to-date
While here, added a presubmit test for the Bug: tag too.

Bug: angleproject:3046
Change-Id: I7030685230b4ce4bfc435c14ef85324e16b76274
Reviewed-on: https://chromium-review.googlesource.com/c/1402061
Commit-Queue: Shahbaz Youssefi <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
2019-01-09 14:58:25 +00:00
Jamie Madill 4638dc9def Re-land "Load correct libGLESv2 on Linux and Mac."
Re-land fixes build to ensure commit_id is built before libEGL.

libEGL was implicitly loading libGLESv2 on startup. This is bad
because on platforms like Linux and Mac we could sometimes use the
incorrect rpath. This in turn meant we needed workarounds like using
"_angle" extensions to our shared objects to get the correct loading
behaviour.

Fix this by loading libGLESv2 dynamically in libEGL. We build the
loader automatically from egl.xml. The loader itself is lazily
initialized on every EGL entry point call. This is necessary because
on Linux, etc, there is no equivalent to Windows' DLLMain.

We also use an EGL.h with different generation options so we have the
proper function pointer types. A README is included for instructions
on how to regenerate EGL.h.

The entry point generation script is refactored into a helper class
that is used in the loader generator. Also adds the libGLESv2 versions
of the EGL entry points in the DEF file on Windows. This allows them to
be imported properly in 32-bit configurations.

Also fixes up some errors in ANGLE's entry point definitions. Also
includes a clang-format disable rule for the Khronos headers.

This CL will help us to run ANGLE tests against native drivers.

Bug: angleproject:2871
Bug: chromium:915731
Change-Id: I4192a938d1f4117cea1bf1399c98bda7ac25ddab
Reviewed-on: https://chromium-review.googlesource.com/c/1380511
Reviewed-by: Yuly Novikov <[email protected]>
Commit-Queue: Jamie Madill <[email protected]>
2018-12-18 18:54:44 +00:00
Yuly Novikov 175d918a1f Revert "Load correct libGLESv2 on Linux and Mac."
This reverts commit dd815b623e.

Reason for revert: Broke https://luci-milo.appspot.com/p/chromium/builders/luci.chromium.ci/win-rel/8006

Original change's description:
> Load correct libGLESv2 on Linux and Mac.
> 
> libEGL was implicitly loading libGLESv2 on startup. This is bad
> because on platforms like Linux and Mac we could sometimes use the
> incorrect rpath. This in turn meant we needed workarounds like using
> "_angle" extensions to our shared objects to get the correct loading
> behaviour.
> 
> Fix this by loading libGLESv2 dynamically in libEGL. We build the
> loader automatically from egl.xml. The loader itself is lazily
> initialized on every EGL entry point call. This is necessary because
> on Linux, etc, there is no equivalent to Windows' DLLMain.
> 
> We also use an EGL.h with different generation options so we have the
> proper function pointer types. A README is included for instructions
> on how to regenerate EGL.h.
> 
> The entry point generation script is refactored into a helper class
> that is used in the loader generator. Also adds the libGLESv2 versions
> of the EGL entry points in the DEF file on Windows. This allows them to
> be imported properly in 32-bit configurations.
> 
> Also fixes up some errors in ANGLE's entry point definitions. Also
> includes a clang-format disable rule for the Khronos headers.
> 
> This CL will help us to run ANGLE tests against native drivers.
> 
> Bug: angleproject:2871
> Change-Id: Id6ecf969308f17b1be4083538428c9c1a1836572
> Reviewed-on: https://chromium-review.googlesource.com/c/1370725
> Commit-Queue: Jamie Madill <[email protected]>
> Reviewed-by: Geoff Lang <[email protected]>

[email protected],[email protected],[email protected]

Change-Id: I921b3c45435ab4f05cbc2d1c1172b4185d6257b0
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: angleproject:2871
Reviewed-on: https://chromium-review.googlesource.com/c/1378887
Reviewed-by: Yuly Novikov <[email protected]>
Commit-Queue: Yuly Novikov <[email protected]>
2018-12-16 19:53:36 +00:00
Jamie Madill dd815b623e Load correct libGLESv2 on Linux and Mac.
libEGL was implicitly loading libGLESv2 on startup. This is bad
because on platforms like Linux and Mac we could sometimes use the
incorrect rpath. This in turn meant we needed workarounds like using
"_angle" extensions to our shared objects to get the correct loading
behaviour.

Fix this by loading libGLESv2 dynamically in libEGL. We build the
loader automatically from egl.xml. The loader itself is lazily
initialized on every EGL entry point call. This is necessary because
on Linux, etc, there is no equivalent to Windows' DLLMain.

We also use an EGL.h with different generation options so we have the
proper function pointer types. A README is included for instructions
on how to regenerate EGL.h.

The entry point generation script is refactored into a helper class
that is used in the loader generator. Also adds the libGLESv2 versions
of the EGL entry points in the DEF file on Windows. This allows them to
be imported properly in 32-bit configurations.

Also fixes up some errors in ANGLE's entry point definitions. Also
includes a clang-format disable rule for the Khronos headers.

This CL will help us to run ANGLE tests against native drivers.

Bug: angleproject:2871
Change-Id: Id6ecf969308f17b1be4083538428c9c1a1836572
Reviewed-on: https://chromium-review.googlesource.com/c/1370725
Commit-Queue: Jamie Madill <[email protected]>
Reviewed-by: Geoff Lang <[email protected]>
2018-12-16 14:04:28 +00:00
Jamie Madill 8dc27f99b5 Use packed enum for DrawElementsType.
The packing and unpacking take a few extra instructions. But it
completely obviates the need for any switches in the validation code.
Speed is slightly faster or the similar depending on the back-end.

Also add gl_angle_ext.xml to GL entry point generator inputs. This was
missing and would cause the code generation to miss certain changes.

Bug: angleproject:2985
Change-Id: I1ea41a71db71135000166ead8305ec42d22ff7b3
Reviewed-on: https://chromium-review.googlesource.com/c/1351729
Commit-Queue: Jamie Madill <[email protected]>
Reviewed-by: Shahbaz Youssefi <[email protected]>
2018-11-29 18:13:39 +00:00
Brandon Jones b77884b78b Autogenerate Repeated Portions of Blit11
Introduces a script to generate Blit11's
BlitShaderType enum and shader mapping functions.

Bug: angleproject:2870
Change-Id: I5b704f55bdde1706614a519ecb0ee3756f7799e0
Reviewed-on: https://chromium-review.googlesource.com/c/1273725
Reviewed-by: Jamie Madill <[email protected]>
Reviewed-by: Geoff Lang <[email protected]>
Commit-Queue: Geoff Lang <[email protected]>
2018-11-15 19:10:21 +00:00
jchen10 547edfe22c Fix angle::Format::ID in gen_dxgi_format_table.py
The dxgi_format_map_autogen.cpp was updated, but the generating script
was missed to submit in https://crrev.com/c/1142299.

Bug: angleproject:2729

Change-Id: I8d726854581d27881a737f12457482ac955e6312
Reviewed-on: https://chromium-review.googlesource.com/1242853
Commit-Queue: Jie A Chen <[email protected]>
Reviewed-by: Geoff Lang <[email protected]>
2018-09-26 02:15:51 +00:00
Frank Henigman 569b9cb983 Fix run_code_generation.py hash calculation.
Open files with mode 'r' instead of 'rb' so the hash calculation
produces the same results on Linux and Windows.
Recalculate the hashes and proc_table_autogen.cpp which was out of date.

BUG=angleproject:2711

Change-Id: I31562c96ce36e6df009c44c565fe9a3f1b5ba6c4
Reviewed-on: https://chromium-review.googlesource.com/1128549
Reviewed-by: Jamie Madill <[email protected]>
Commit-Queue: Frank Henigman <[email protected]>
2018-07-10 22:25:05 +00:00
Geoff Lang b1cc789c70 Finish populating the new_hashes map after finding a dirty input.
any_input_dirty would return early when finding a dirty input and not finish
filling the new_hashes map.  This would require multiple runs of the code
generation script to fully generate all the outputs.

BUG=angleproject:2695

Change-Id: Ie62190efe2765df432b0a535fb8d33ed2ffa66a7
Reviewed-on: https://chromium-review.googlesource.com/1127439
Commit-Queue: Geoff Lang <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
2018-07-05 21:13:22 +00:00
Geoff Lang 9a25780193 Write relative paths with forward slashes to the code generation hashes.
This should avoid generating diffs when running the code generation with
different source directories or on different platforms.

BUG=angleproject:2695

Change-Id: I67776883bdbeb867a49bea00f16998c04f7857b4
Reviewed-on: https://chromium-review.googlesource.com/1127355
Commit-Queue: Geoff Lang <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
2018-07-05 21:07:02 +00:00
Geoff Lang 5695a5b24c Allow the run_code_generation.py script to be run from any directory.
BUG=angleproject:2695

Change-Id: I9a083bf67b17ca0dc1ee213b75caa4ecece62f00
Reviewed-on: https://chromium-review.googlesource.com/1127354
Commit-Queue: Geoff Lang <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
2018-07-05 20:53:02 +00:00
Jamie Madill a72f400c5f run_code_generation: Compare hashes instead of mtime.
Using mtime is fundamentally flawed when working with git. Replace
these flaky checks with hash comparisons. The hashes are stored in an
autogenerated json file that will be stored in the repository.

This makes the run_code_generation script robust against any and all
input changes. It also removes the need to track script outputs as
dependencies.

Bug: angleproject:2697
Change-Id: I60f2a87a8680b1f775ad678b05112f5b16c7dde7
Reviewed-on: https://chromium-review.googlesource.com/1120159
Commit-Queue: Jamie Madill <[email protected]>
Reviewed-by: Yuly Novikov <[email protected]>
2018-06-29 21:30:39 +00:00
Frank Henigman 388f991ce8 Vulkan: fix third_party path.
run_code_generation.py stopped working, likely as a result of the big Vulkan repo reorganization.
I fixed a path, regenerated everything (by temporarily hacking the script so it thought everything
was dirty), and nothing changed except one comment.

BUG=angleproject:2558

Change-Id: I5ac4c040ac1ec207098172303cc2f2507cccdecb
Reviewed-on: https://chromium-review.googlesource.com/1103281
Reviewed-by: Yuly Novikov <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
Reviewed-by: Tobin Ehlis <[email protected]>
2018-06-18 19:31:17 +00:00
Jamie Madill d4703d5058 Move packed enum code to common/
This makes it accessible in the utilities files.

Bug: angleproject:2574
Bug: angleproject:2169
Change-Id: I0fdd34b4233e72b7534cb2b09f451539c1a394cd
Reviewed-on: https://chromium-review.googlesource.com/1067110
Commit-Queue: Jamie Madill <[email protected]>
Reviewed-by: Yuly Novikov <[email protected]>
2018-05-24 22:49:25 +00:00
Jamie Madill 1c597eea31 Fix run_code_generation for huge diffs.
This uses the --full argument to work around max path limitations
on Windows. Also includes a couple minor changes for generators
to generate already-formatted code.

Bug: angleproject:2578
Change-Id: I1e400b02e828bfdca21cacb73c649f41226bef55
Reviewed-on: https://chromium-review.googlesource.com/1072161
Reviewed-by: Lingfeng Yang <[email protected]>
Reviewed-by: Luc Ferron <[email protected]>
Reviewed-by: Brandon1 Jones <[email protected]>
Commit-Queue: Jamie Madill <[email protected]>
2018-05-24 22:03:19 +00:00
Jamie Madill d47044ad53 Vulkan: Add framework for internal shaders.
Vulkan intenal shaders are stored in a ShaderLibrary, and this is
owned by the RendererVk. This way the shaders are reused between all
the different Contexts. They are initialized lazily to keep init time
low. They also have an associated Serial (called a ProgramSerial) so
they can be identified in a PipelineDesc (used by the Pipeline cache).

We use a python script to build and invoke the glslang validator, that
also produces SPIR-V binary code snippets. These snippets are gathered
into an auto-generated file that is exposed via an auto-generated
header file. The InternalShaderID enum class gives access to the
internal shaders that are shared through the Vulkan back-end.

This also adds simple clear shaders to be used in masked color clears.
The patch doesn't add any functionality but it is split off from the
color clear functionality to keep the code size down.

Bug: angleproject:2339
Bug: angleproject:2455
Change-Id: Ie83043eda217c9f013817b198c92a3b7ba0878b4
Reviewed-on: https://chromium-review.googlesource.com/1031372
Commit-Queue: Jamie Madill <[email protected]>
Reviewed-by: Geoff Lang <[email protected]>
2018-05-01 20:39:47 +00:00
Jamie Madill 0ade8e88d8 Use time tolerance in run_code_generation check.
The mtime values I was seeing on my file system were sometimes
floating point numbers that were very very close but not exactly
the same. This might be due to numerical errors. Increasing the
tolerance to something still very small, precision is less than
a second. It will lead to fewer rebuilds of non-dirty files.

Bug: angleproject:2455
Change-Id: I95dc3214ee91af7a70a20cc625405e0e2bc18698
Reviewed-on: https://chromium-review.googlesource.com/1032855
Reviewed-by: Luc Ferron <[email protected]>
Commit-Queue: Jamie Madill <[email protected]>
2018-04-30 14:55:45 +00:00
Geoff Lang 8ceea819c6 Refactor packed enum generation to support EGL enums.
Convert the very simple EGL texture type enum.

BUG=angleproject:1618

Change-Id: Ieea382a282a8f2544f2982627e8445e6e5cea826
Reviewed-on: https://chromium-review.googlesource.com/1019386
Commit-Queue: Geoff Lang <[email protected]>
Reviewed-by: Geoff Lang <[email protected]>
2018-04-20 17:58:27 +00:00
Olli Etuaho 5fec7ab262 Identify functions by unique id in BuiltInFunctionEmulator
Now that unique ids of all builtins are compile-time constants, we can
use them to look up functions in BuiltInFunctionEmulator. This is
simpler than using a custom struct with the name and parameters for
identifying functions.

This requires that we store a reference to a TFunction in those
TIntermUnary nodes that were created based on a function.

This decreases shader_translator binary size by about 6 KB on Windows.

BUG=angleproject:2267
BUG=chromium:823856
TEST=angle_unittests

Change-Id: Idd5a00c772c6f26dd36fdbbfbe161d22ab27c2fe
Reviewed-on: https://chromium-review.googlesource.com/995372
Reviewed-by: Jamie Madill <[email protected]>
Commit-Queue: Olli Etuaho <[email protected]>
2018-04-05 14:14:47 +00:00
Olli Etuaho 89398b6534 Avoid mangled name comparisons of 3-parameter functions
The hash values used for looking up built-ins now encode whether the
mangled name contains arrays, structs or interface blocks in its
parameters list. This is written in the most significant bit of the
hash value.

We check this bit at the start of built-in lookup and if the bit is
set we exit early. After that we know that the lookup name doesn't
contain array, struct or interface block parameters.

When we find a hash that matches a hash of a built-in function, we now
know 3 things:
1) the length of the mangled name matches
2) the open parentheses in the mangled name matches
3) the lookup doesn't contain array, struct or block parameters.

Additionally, we have an if statement checking whether the function
name matches. Collisions are only possible with functions that
1) have the same name
2) have the same number of parameters

With these preconditions we can check beforehand whether collisions
are possible for 3-parameter functions. If there are no collisions, we
don't need to compare the full mangled name. This is similar to what
was already being done with functions that had 0 to 2 parameters.

This reduces shader_translator binary size by around 4 KB on Windows.

Besides increased complexity, the tradeoff is that an exhaustive
search of hash values for possible 3-parameter combinations is costly,
so the gen_builtin_functions.py code generation script now takes
around one minute to run on a high-end workstation. Due to this, the
script now exits early if it detects it has already been run with the
same inputs based on a hash value stored in
builtin_symbols_hash_autogen.txt.

BUG=angleproject:2267
BUG=chromium:823856
TEST=angle_unittests

Change-Id: I3ff8c6eb85b90d3c4971ac8d73ee171a07a7e55f
Reviewed-on: https://chromium-review.googlesource.com/973372
Reviewed-by: Corentin Wallez <[email protected]>
Commit-Queue: Olli Etuaho <[email protected]>
2018-04-03 17:35:57 +00:00