Commit f25a1c68 by Nicolas Capens Committed by Nicolas Capens

Always rasterize lines as a rectangle

This is Vulkan 1.1's "preferred method of line rasterization, and must be used when the implementation advertises the strictLines limit in VkPhysicalDeviceLimits as VK_TRUE." The 'Diamond test convention' code path, which implemented coverage corresponding to the Bresenham algorithm (except for endpoints, see b/80135519), is now inactive, but might become of use again for implementing VK_LINE_RASTERIZATION_MODE_BRESENHAM_EXT so it is kept, for now. Bug: b/139755234 Tests: dEQP-VK.*line* Change-Id: I0113c04e35c1aca8031194223e589962942e18fa Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/35308Reviewed-by: 's avatarChris Forbes <chrisforbes@google.com> Tested-by: 's avatarNicolas Capens <nicolascapens@google.com> Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>
parent 92eb0415
...@@ -932,7 +932,6 @@ namespace sw ...@@ -932,7 +932,6 @@ namespace sw
bool Renderer::setupLine(Primitive &primitive, Triangle &triangle, const DrawCall &draw) bool Renderer::setupLine(Primitive &primitive, Triangle &triangle, const DrawCall &draw)
{ {
const SetupProcessor::RoutinePointer &setupRoutine = draw.setupPointer; const SetupProcessor::RoutinePointer &setupRoutine = draw.setupPointer;
const SetupProcessor::State &state = draw.setupState;
const DrawData &data = *draw.data; const DrawData &data = *draw.data;
float lineWidth = data.lineWidth; float lineWidth = data.lineWidth;
...@@ -959,7 +958,7 @@ namespace sw ...@@ -959,7 +958,7 @@ namespace sw
return false; return false;
} }
if(state.multiSample > 1) // Rectangle if(true) // Rectangle centered on the line segment
{ {
float4 P[4]; float4 P[4];
int C[4]; int C[4];
......
...@@ -246,8 +246,8 @@ const VkPhysicalDeviceLimits& PhysicalDevice::getLimits() const ...@@ -246,8 +246,8 @@ const VkPhysicalDeviceLimits& PhysicalDevice::getLimits() const
{ 1.0, 1.0 }, // lineWidthRange[2] (unsupported) { 1.0, 1.0 }, // lineWidthRange[2] (unsupported)
0.0, // pointSizeGranularity (unsupported) 0.0, // pointSizeGranularity (unsupported)
0.0, // lineWidthGranularity (unsupported) 0.0, // lineWidthGranularity (unsupported)
VK_FALSE, // strictLines VK_TRUE, // strictLines
VK_TRUE, // standardSampleLocations VK_TRUE, // standardSampleLocations
64, // optimalBufferCopyOffsetAlignment 64, // optimalBufferCopyOffsetAlignment
64, // optimalBufferCopyRowPitchAlignment 64, // optimalBufferCopyRowPitchAlignment
256, // nonCoherentAtomSize 256, // nonCoherentAtomSize
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment