forked from JetBrains/JetBrainsRuntime
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
JBR-5973 Implement rendering of no-AA shapes with Vulkan pipeline
Get rid of maxTextureSize in Vulkan code. This concept was introduced to fix macOS-specific bugs and don't map well to Vulkan implementation, as this value is tied to specific device and texture format, so get rid of it for now and see whether we need it at all. Refactored native surface data hierarchy. There was a C-style "inheritance" model with VKSDOps having an SurfaceDataOps as its first member and conversions back and forth between them. And then also privOps - pointer to the platform-specific part (WLVK). This was refactored into plain inheritance: SurfaceDataOps -> VKSurfaceData -> VKSwapchainSurfaceData -> WLVKSurfaceData State management, synchronization & layout transition. Now using dynamic rendering and synchronization2 extensions. Each device has a single timeline semaphore (basically 64-bit counter), monotonically increasing as device executes our commands, allowing us to track the state of the submitted batches and reuse resources which are no longer in use. Split command recording into primary and secondary command buffers. This allows us to record commands "in the past", before current render pass started, which gives possibility for some heavy optimizations: 1. When we suddenly need some texture in the middle of the render pass - no need to stop render pass in order to insert necessary synchronization - we can do it as if we knew it beforehand. 2. When we draw something and then clear the surface - just erase all commands inside current render pass we recorded earlier, so the actual drawing will never happen. Shaders are compiled with glslc or glslangValidator and bytecode is inlined directly into libawt_wlawt Memory management via VMA, vertex buffer pool, shader push constants. Other refactoring.
- Loading branch information
Showing
32 changed files
with
25,654 additions
and
568 deletions.
There are no files selected for viewing
This file contains 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 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 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 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,8 @@ | ||
#version 450 | ||
|
||
layout(location = 0) in vec4 inColor; | ||
layout(location = 0) out vec4 outColor; | ||
|
||
void main() { | ||
outColor = inColor; | ||
} |
This file contains 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 @@ | ||
#version 450 | ||
|
||
layout(push_constant) uniform Push { | ||
vec2 invViewport2; // 2.0/viewport | ||
} push; | ||
|
||
vec4 colors[3] = vec4[]( | ||
vec4(1,0,0,1), | ||
vec4(0,1,0,1), | ||
vec4(0,0,1,1) | ||
); | ||
|
||
layout(location = 0) in vec2 inPosition; | ||
|
||
layout(location = 0) out vec4 outColor; | ||
|
||
void main() { | ||
outColor = colors[gl_VertexIndex % 3]; | ||
gl_Position = vec4(inPosition * push.invViewport2 - 1.0, 0.0, 1.0); | ||
gl_PointSize = 1.0f; | ||
} |
Oops, something went wrong.