Hash :
d8f088e0
Author :
Date :
2023-08-14T11:07:24
GL: Remove parallel compile/link without driver support This feature was practically disabled everywhere due to various bugs, and is complicating the code. In effect, the code was always spawning a thread for the compilation and link jobs, immediately fail it (due to a workaround), then do the job when compile/link is resolved (much closer to draw time). This leads to bad user experience, but also is racy because the shaders may get recompiled in the meantime and there is little the GL backend could do to stop that (efficiently). After this change, parallel compile/link is either done by the driver (if supported), or it isn't done. This is a partial revert of a100d8f471f79b9f88d387164992cc5bd9c6ee9f. Bug: angleproject:3031 Bug: chromium:922936 Bug: chromium:1184692 Bug: chromium:1202928 Change-Id: I6348bee3249ccb3828bb98ac2a69dc7d305f821c Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4774785 Reviewed-by: Geoff Lang <geofflang@chromium.org>
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165
Name
ANGLE_stream_producer_d3d_texture
Name Strings
EGL_ANGLE_stream_producer_d3d_texture
Contributors
Ian Ewell
Geoff Lang
John Bauman
Kelsey Gilbert
Contacts
Geoff Lang, Google (geofflang ‘at’ google.com)
Status
Draft
Version
Version 2, November 15, 2017
Number
EGL Extension #XXX
Dependencies
Requires EGL 1.4.
Requires OpenGL ES 2.0.
Requires the EGL_KHR_stream extension.
Requires the EGL_NV_stream_consumer_gltexture_yuv extension.
Requires the EGL_KHR_stream_consumer_gltexture extension.
Requires the EGL_ANGLE_device_d3d extension.
Overview
This extension allows D3D11 textures to be inserted into an EGL stream
with the expectation that the stream consumer will be either an RGB GL
texture consumer, or a YUV GL texture consumer using a two plane
configuration (i.e. a Y plane and a UV plane).
This will act as the producer of the stream.
New procedures and functions
EGLBoolean eglCreateStreamProducerD3DTextureANGLE(
EGLDisplay dpy,
EGLStreamKHR stream,
const EGLAttrib *attrib_list)
EGLBoolean eglStreamPostD3DTextureANGLE(EGLDisplay dpy,
EGLStreamKHR stream,
void *texture,
const EGLAttrib *attrib_list)
New Tokens
Accepted as an <attribute> in eglStreamPostD3DTextureANGLE:
EGL_D3D_TEXTURE_SUBRESOURCE_ID_ANGLE 0x33AB
Replace section "3.10.3.1 No way to connect producer to EGLStream" in the
EGL_KHR_stream extension with this:
3.10.3.1 Stream Surface Producer
Call
EGLBoolean eglCreateStreamProducerD3DTextureANGLE(
EGLDisplay dpy,
EGLStreamKHR stream,
const EGLAttrib *attrib_list)
to create a producer that accepts D3D11 textures and connect it as the
producer of <stream>. <attrib_list> is used to specify attributes for the
stream producer. Currently there are no attributes to specify, and the
attribute list is used as a placeholder for future additions.
On failure, eglCreateStreamProducerD3DTextureANGLE returns EGL_FALSE and
generates an error.
- EGL_BAD_STATE_KHR is generated if <stream> is not in the state
EGL_STREAM_STATE_CONNECTING_KHR.
- EGL_BAD_MATCH is generated if <stream> does not have a connected GL
texture consumer.
- EGL_BAD_STREAM_KHR is generated if <stream> is not a valid EGLStream
generated for <dpy>.
- EGL_BAD_DISPLAY is generated if <dpy> is not a valid, initialized
display.
Add a section preceding "3.9.3 Posting Semantics" in the EGL specification:
3.9.x Posting to a Stream
To post a D3D11 texture to a stream, call
EGLBoolean eglStreamPostD3DTextureANGLE(
EGLDisplay dpy,
EGLStreamKHR stream,
void *texture,
const EGLAttrib *attrib_list);
If <stream> is an appropriately configured stream and <texture> points to a
valid ID3D11Texture2D object of a supported format that is owned
by the same ID3D11Device that is queried with the EGL_ANGLE_device_d3d
extension, the texture will be posted to the stream and can be bound as one
or more OpenGL texture objects.
The parameter <attrib_list> allows for per-frame attributes to be specified
along with the texture. The only parameter currently available is
EGL_D3D_TEXTURE_SUBRESOURCE_ID_ANGLE, which allows the subresource id of
the texture that will be used to be specified. If this attribute is not
explicitly specified, it will default to the value of 0.
It is the responsibility of the application to perform any synchronization
between the insertion of the frame into the stream and the use of the
consumer textures output by the stream. The EGL_CONSUMER_LATENCY_USEC_KHR
attribute will have no effect on the function of the implementation of this
extension, but can still be used for communication between components of
the application.
The implementation will hold a reference to the D3D11 texture object if the
insertion is successful and will release the texture object when a new frame
is inserted or when the stream is destroyed.
On failure, eglStreamInsertD3DTexture returns EGL_FALSE and generates an
error.
- EGL_BAD_STATE is generated if <stream> is not in the state
EGL_STREAM_STATE_EMPTY_KHR, EGL_STREAM_STATE_NEW_FRAME_AVAILABLE_KHR,
or EGL_STREAM_STATE_OLD_FRAME_AVAILABLE_KHR.
- EGL_BAD_MATCH is generated if the stream is not associated with a
D3D11 texture producer.
- EGL_BAD_PARAMETER is generated if <texture> is not owned by the
queried device, is not a supported format, is not compatible with the
implementation, or if the specified value for
EGL_D3D_TEXTURE_SUBRESOURCE_ID_ANGLE is not a valid subresource id for
the texture.
- EGL_BAD_STREAM_KHR is generated if <stream> is not a valid EGLStream.
- EGL_BAD_ATTRIBUTE is generated if an attribute other than
EGL_D3D_TEXTURE_SUBRESOURCE_ID_ANGLE is specified in <attrib_list>.
Revision History
#1 (April 6, 2016) Ian Ewell
- initial draft
#2 (November 15, 2017) Kelsey Gilbert
- Rename from EGL_ANGLE_stream_producer_d3d_texture_nv12 to
EGL_ANGLE_stream_producer_d3d_texture
- Remove NV12 suffix from function names
- add RGB GL texture consumer support
- reduce required EGL version to 1.4 (from 1.5)