Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qwindowsd3d11planesplitter_shaders_p.h
Go to the documentation of this file.
1// Copyright (C) 2026 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3#ifndef QWINDOWSD3D11PLANESPLITTER_SHADERS_P_H
4#define QWINDOWSD3D11PLANESPLITTER_SHADERS_P_H
5
6//
7// W A R N I N G
8// -------------
9//
10// This file is not part of the Qt API. It exists purely as an
11// implementation detail. This header file may change from version to
12// version without notice, or even be removed.
13//
14// We mean it.
15//
16
17#include <QtCore/qglobal.h>
18
19#include <d3d11.h>
20
21// Precompiled DXBC bytecode for the two tiny shaders used by QWindowsD3D11PlaneSplitter to copy
22// one plane-view of a multi-planar D3D11 texture into its own single-plane render target. Using
23// precompiled bytecode (rather than calling D3DCompile at runtime) avoids adding a runtime
24// dependency on d3dcompiler_47.dll for this module.
25//
26// To regenerate: copy each block below verbatim into its file and run the fxc command underneath
27// it (Windows SDK's fxc.exe). No stripping or unescaping needed.
28
29// --- plane_split_vs.hlsl ---
30/*
31 // Fullscreen triangle without any vertex/index buffer or input layout.
32 // Draw(3, 0) with a null input layout feeds ids 0, 1, 2 into SV_VertexID:
33 // id 0 -> uv (0,0) -> pos (-1, +1, 0, 1) (top-left)
34 // id 1 -> uv (2,0) -> pos (+3, +1, 0, 1) (top-right, off-screen)
35 // id 2 -> uv (0,2) -> pos (-1, -3, 0, 1) (bottom-left, off-screen)
36 // The oversized triangle covers every viewport pixel; the rasterizer clips it.
37 // Y is flipped (uv.y * -2 + 1) for D3D texture coordinates.
38 void main(in uint id : SV_VertexID, out float4 pos : SV_Position)
39 {
40 float2 uv = float2((id << 1) & 2, id & 2);
41 pos = float4(uv * float2(2.0, -2.0) + float2(-1.0, 1.0), 0.0, 1.0);
42 }
43*/
44// fxc /T vs_4_0 /E main /Fh vs.h /Vn g_planeSplitVS plane_split_vs.hlsl
45
46// --- plane_split_ps.hlsl ---
47/*
48 // Per-plane texel copy. The SRV is a format-override Texture2DArray view of one
49 // slice (FirstArraySlice) of the source texture, so Load reads the plane at its
50 // native resolution with no sampler or filtering.
51 // SV_Position is already in integer render-target pixel coordinates.
52 Texture2DArray<float4> g_planeView : register(t0);
53
54 float4 main(float4 pos : SV_Position) : SV_Target0
55 {
56 return g_planeView.Load(int4(int2(pos.xy), 0, 0));
57 }
58*/
59// fxc /T ps_4_0 /E main /Fh ps.h /Vn g_planeSplitPS plane_split_ps.hlsl
60
61// HLSL texture-fetch rule relied upon: the missing components of the generic float4 load
62// default to 0 (alpha to 1), so the same bytecode serves both the single-channel luma plane
63// and the two-channel chroma plane, and both 8- and 16-bit formats — only as many components
64// as the bound render target actually stores are written.
65
67
68namespace QtMultimediaPrivate {
69
70// clang-format off
71constexpr BYTE g_planeSplitVS[] =
72{
73 68, 88, 66, 67, 53, 98,
74 221, 212, 186, 157, 245, 96,
75 19, 95, 165, 87, 229, 177,
76 102, 204, 1, 0, 0, 0,
77 100, 2, 0, 0, 5, 0,
78 0, 0, 52, 0, 0, 0,
79 128, 0, 0, 0, 180, 0,
80 0, 0, 232, 0, 0, 0,
81 232, 1, 0, 0, 82, 68,
82 69, 70, 68, 0, 0, 0,
83 0, 0, 0, 0, 0, 0,
84 0, 0, 0, 0, 0, 0,
85 28, 0, 0, 0, 0, 4,
86 254, 255, 0, 1, 0, 0,
87 28, 0, 0, 0, 77, 105,
88 99, 114, 111, 115, 111, 102,
89 116, 32, 40, 82, 41, 32,
90 72, 76, 83, 76, 32, 83,
91 104, 97, 100, 101, 114, 32,
92 67, 111, 109, 112, 105, 108,
93 101, 114, 32, 49, 48, 46,
94 49, 0, 73, 83, 71, 78,
95 44, 0, 0, 0, 1, 0,
96 0, 0, 8, 0, 0, 0,
97 32, 0, 0, 0, 0, 0,
98 0, 0, 6, 0, 0, 0,
99 1, 0, 0, 0, 0, 0,
100 0, 0, 1, 1, 0, 0,
101 83, 86, 95, 86, 101, 114,
102 116, 101, 120, 73, 68, 0,
103 79, 83, 71, 78, 44, 0,
104 0, 0, 1, 0, 0, 0,
105 8, 0, 0, 0, 32, 0,
106 0, 0, 0, 0, 0, 0,
107 1, 0, 0, 0, 3, 0,
108 0, 0, 0, 0, 0, 0,
109 15, 0, 0, 0, 83, 86,
110 95, 80, 111, 115, 105, 116,
111 105, 111, 110, 0, 83, 72,
112 68, 82, 248, 0, 0, 0,
113 64, 0, 1, 0, 62, 0,
114 0, 0, 96, 0, 0, 4,
115 18, 16, 16, 0, 0, 0,
116 0, 0, 6, 0, 0, 0,
117 103, 0, 0, 4, 242, 32,
118 16, 0, 0, 0, 0, 0,
119 1, 0, 0, 0, 104, 0,
120 0, 2, 1, 0, 0, 0,
121 41, 0, 0, 7, 18, 0,
122 16, 0, 0, 0, 0, 0,
123 10, 16, 16, 0, 0, 0,
124 0, 0, 1, 64, 0, 0,
125 1, 0, 0, 0, 1, 0,
126 0, 7, 18, 0, 16, 0,
127 0, 0, 0, 0, 10, 0,
128 16, 0, 0, 0, 0, 0,
129 1, 64, 0, 0, 2, 0,
130 0, 0, 1, 0, 0, 7,
131 66, 0, 16, 0, 0, 0,
132 0, 0, 10, 16, 16, 0,
133 0, 0, 0, 0, 1, 64,
134 0, 0, 2, 0, 0, 0,
135 86, 0, 0, 5, 50, 0,
136 16, 0, 0, 0, 0, 0,
137 134, 0, 16, 0, 0, 0,
138 0, 0, 50, 0, 0, 15,
139 50, 32, 16, 0, 0, 0,
140 0, 0, 70, 0, 16, 0,
141 0, 0, 0, 0, 2, 64,
142 0, 0, 0, 0, 0, 64,
143 0, 0, 0, 192, 0, 0,
144 0, 0, 0, 0, 0, 0,
145 2, 64, 0, 0, 0, 0,
146 128, 191, 0, 0, 128, 63,
147 0, 0, 0, 0, 0, 0,
148 0, 0, 54, 0, 0, 8,
149 194, 32, 16, 0, 0, 0,
150 0, 0, 2, 64, 0, 0,
151 0, 0, 0, 0, 0, 0,
152 0, 0, 0, 0, 0, 0,
153 0, 0, 128, 63, 62, 0,
154 0, 1, 83, 84, 65, 84,
155 116, 0, 0, 0, 7, 0,
156 0, 0, 1, 0, 0, 0,
157 0, 0, 0, 0, 2, 0,
158 0, 0, 1, 0, 0, 0,
159 1, 0, 0, 0, 2, 0,
160 0, 0, 1, 0, 0, 0,
161 0, 0, 0, 0, 0, 0,
162 0, 0, 0, 0, 0, 0,
163 0, 0, 0, 0, 0, 0,
164 0, 0, 0, 0, 0, 0,
165 0, 0, 0, 0, 0, 0,
166 0, 0, 0, 0, 0, 0,
167 0, 0, 0, 0, 0, 0,
168 0, 0, 1, 0, 0, 0,
169 0, 0, 0, 0, 1, 0,
170 0, 0, 0, 0, 0, 0,
171 0, 0, 0, 0, 0, 0,
172 0, 0, 0, 0, 0, 0,
173 0, 0, 0, 0, 0, 0,
174 0, 0, 0, 0, 0, 0,
175};
176
177constexpr BYTE g_planeSplitPS[] =
178{
179 68, 88, 66, 67, 62, 209,
180 231, 68, 159, 106, 7, 25,
181 79, 72, 170, 49, 182, 154,
182 2, 249, 1, 0, 0, 0,
183 40, 2, 0, 0, 5, 0,
184 0, 0, 52, 0, 0, 0,
185 172, 0, 0, 0, 224, 0,
186 0, 0, 20, 1, 0, 0,
187 172, 1, 0, 0, 82, 68,
188 69, 70, 112, 0, 0, 0,
189 0, 0, 0, 0, 0, 0,
190 0, 0, 1, 0, 0, 0,
191 28, 0, 0, 0, 0, 4,
192 255, 255, 0, 1, 0, 0,
193 72, 0, 0, 0, 60, 0,
194 0, 0, 2, 0, 0, 0,
195 5, 0, 0, 0, 5, 0,
196 0, 0, 255, 255, 255, 255,
197 0, 0, 0, 0, 1, 0,
198 0, 0, 13, 0, 0, 0,
199 103, 95, 112, 108, 97, 110,
200 101, 86, 105, 101, 119, 0,
201 77, 105, 99, 114, 111, 115,
202 111, 102, 116, 32, 40, 82,
203 41, 32, 72, 76, 83, 76,
204 32, 83, 104, 97, 100, 101,
205 114, 32, 67, 111, 109, 112,
206 105, 108, 101, 114, 32, 49,
207 48, 46, 49, 0, 73, 83,
208 71, 78, 44, 0, 0, 0,
209 1, 0, 0, 0, 8, 0,
210 0, 0, 32, 0, 0, 0,
211 0, 0, 0, 0, 1, 0,
212 0, 0, 3, 0, 0, 0,
213 0, 0, 0, 0, 15, 3,
214 0, 0, 83, 86, 95, 80,
215 111, 115, 105, 116, 105, 111,
216 110, 0, 79, 83, 71, 78,
217 44, 0, 0, 0, 1, 0,
218 0, 0, 8, 0, 0, 0,
219 32, 0, 0, 0, 0, 0,
220 0, 0, 0, 0, 0, 0,
221 3, 0, 0, 0, 0, 0,
222 0, 0, 15, 0, 0, 0,
223 83, 86, 95, 84, 97, 114,
224 103, 101, 116, 0, 171, 171,
225 83, 72, 68, 82, 144, 0,
226 0, 0, 64, 0, 0, 0,
227 36, 0, 0, 0, 88, 64,
228 0, 4, 0, 112, 16, 0,
229 0, 0, 0, 0, 85, 85,
230 0, 0, 100, 32, 0, 4,
231 50, 16, 16, 0, 0, 0,
232 0, 0, 1, 0, 0, 0,
233 101, 0, 0, 3, 242, 32,
234 16, 0, 0, 0, 0, 0,
235 104, 0, 0, 2, 1, 0,
236 0, 0, 27, 0, 0, 5,
237 50, 0, 16, 0, 0, 0,
238 0, 0, 70, 16, 16, 0,
239 0, 0, 0, 0, 54, 0,
240 0, 8, 194, 0, 16, 0,
241 0, 0, 0, 0, 2, 64,
242 0, 0, 0, 0, 0, 0,
243 0, 0, 0, 0, 0, 0,
244 0, 0, 0, 0, 0, 0,
245 45, 0, 0, 7, 242, 32,
246 16, 0, 0, 0, 0, 0,
247 70, 14, 16, 0, 0, 0,
248 0, 0, 70, 126, 16, 0,
249 0, 0, 0, 0, 62, 0,
250 0, 1, 83, 84, 65, 84,
251 116, 0, 0, 0, 4, 0,
252 0, 0, 1, 0, 0, 0,
253 0, 0, 0, 0, 2, 0,
254 0, 0, 0, 0, 0, 0,
255 0, 0, 0, 0, 0, 0,
256 0, 0, 1, 0, 0, 0,
257 0, 0, 0, 0, 0, 0,
258 0, 0, 0, 0, 0, 0,
259 0, 0, 0, 0, 0, 0,
260 0, 0, 0, 0, 0, 0,
261 0, 0, 0, 0, 1, 0,
262 0, 0, 0, 0, 0, 0,
263 0, 0, 0, 0, 0, 0,
264 0, 0, 1, 0, 0, 0,
265 0, 0, 0, 0, 1, 0,
266 0, 0, 0, 0, 0, 0,
267 0, 0, 0, 0, 0, 0,
268 0, 0, 0, 0, 0, 0,
269 0, 0, 0, 0, 0, 0,
270 0, 0, 0, 0, 0, 0,
271};
272// clang-format on
273
274} // namespace QtMultimediaPrivate
275
276QT_END_NAMESPACE
277
278#endif // QWINDOWSD3D11PLANESPLITTER_SHADERS_P_H
Combined button and popup list for selecting options.