diff options
author | Chris Dalton <csmartdalton@google.com> | 2018-07-27 12:38:35 -0600 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2018-07-27 19:04:46 +0000 |
commit | 49d14e98fe43fdff818e7571c1a61cd5045fedc0 (patch) | |
tree | 18d48cd1922c646b6dafa851fbe214c8904aef87 /src/gpu/vk/GrVkPipeline.cpp | |
parent | f4f6bbfadac327619a3832acad9c8afe06629b55 (diff) |
sksl: Add a "sk_Clockwise" built-in
This allows us to identify clockwise-winding triangles, in terms of
Skia device space, in all backends and with all render target origins.
Bug: skia:
Change-Id: I220e1c459e0129d1cc4dee6458ef94277fbedd21
Reviewed-on: https://skia-review.googlesource.com/142662
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Diffstat (limited to 'src/gpu/vk/GrVkPipeline.cpp')
-rw-r--r-- | src/gpu/vk/GrVkPipeline.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/gpu/vk/GrVkPipeline.cpp b/src/gpu/vk/GrVkPipeline.cpp index 60e7f43259..6cdfc4eff9 100644 --- a/src/gpu/vk/GrVkPipeline.cpp +++ b/src/gpu/vk/GrVkPipeline.cpp @@ -436,7 +436,9 @@ static void setup_raster_state(const GrPipeline& pipeline, rasterInfo->polygonMode = caps->wireframeMode() ? VK_POLYGON_MODE_LINE : VK_POLYGON_MODE_FILL; rasterInfo->cullMode = VK_CULL_MODE_NONE; - rasterInfo->frontFace = VK_FRONT_FACE_COUNTER_CLOCKWISE; + // A triangle is front-facing if it winds clockwise in device space. + rasterInfo->frontFace = (kTopLeft_GrSurfaceOrigin == pipeline.proxy()->origin()) + ? VK_FRONT_FACE_CLOCKWISE : VK_FRONT_FACE_COUNTER_CLOCKWISE; rasterInfo->depthBiasEnable = VK_FALSE; rasterInfo->depthBiasConstantFactor = 0.0f; rasterInfo->depthBiasClamp = 0.0f; |