const SWR_RASTSTATE &rastState = pState->state.rastState;
const SWR_PS_STATE &psState = pState->state.psState;
BACKEND_FUNCS& backendFuncs = pState->backendFuncs;
- const uint32_t forcedSampleCount = (rastState.bForcedSampleCount) ? 1 : 0;
+ const uint32_t forcedSampleCount = (rastState.forcedSampleCount) ? 1 : 0;
// setup backend
if (psState.pfnPixelShader == nullptr)
}
else
{
- const bool bMultisampleEnable = ((rastState.sampleCount > SWR_MULTISAMPLE_1X) || rastState.bForcedSampleCount) ? 1 : 0;
+ const bool bMultisampleEnable = ((rastState.sampleCount > SWR_MULTISAMPLE_1X) || rastState.forcedSampleCount) ? 1 : 0;
const uint32_t centroid = ((psState.barycentricsMask & SWR_BARYCENTRIC_CENTROID_MASK) > 0) ? 1 : 0;
const uint32_t canEarlyZ = (psState.forceEarlyZ || (!psState.writesODepth && !psState.usesSourceDepth && !psState.usesUAV)) ? 1 : 0;
scale *= ComputeMaxDepthSlope(pTri);
}
- float bias = pState->depthBias * ComputeBiasFactor(pState, pTri, z) + scale;
+ float bias = pState->depthBias;
+ if (!pState->depthBiasPreAdjusted)
+ {
+ bias *= ComputeBiasFactor(pState, pTri, z);
+ }
+ bias += scale;
+
if (pState->depthBiasClamp > 0.0f)
{
bias = std::min(bias, pState->depthBiasClamp);
uint32_t lod; // for render targets, the lod being rendered to
uint32_t arrayIndex; // for render targets, the array index being rendered to for arrayed surfaces
SWR_TILE_MODE tileMode; // @llvm_enum
- bool bInterleavedSamples; // are MSAA samples stored interleaved or planar
uint32_t halign;
uint32_t valign;
uint32_t xOffset;
uint32_t lodOffsets[2][15]; // lod offsets for sampled surfaces
uint8_t *pAuxBaseAddress; // Used for compression, append/consume counter, etc.
+
+ bool bInterleavedSamples; // are MSAA samples stored interleaved or planar
};
// vertex fetch state
//////////////////////////////////////////////////////////////////////////
struct SWR_RASTSTATE
{
- uint32_t cullMode : 2;
- uint32_t fillMode : 2;
- uint32_t frontWinding : 1;
- uint32_t scissorEnable : 1;
- uint32_t depthClipEnable : 1;
+ uint32_t cullMode : 2;
+ uint32_t fillMode : 2;
+ uint32_t frontWinding : 1;
+ uint32_t scissorEnable : 1;
+ uint32_t depthClipEnable : 1;
+ uint32_t pointParam : 1;
+ uint32_t pointSpriteEnable : 1;
+ uint32_t pointSpriteTopOrigin : 1;
+ uint32_t msaaRastEnable : 1;
+ uint32_t forcedSampleCount : 1;
+ uint32_t pixelOffset : 1;
+ uint32_t depthBiasPreAdjusted : 1; ///< depth bias constant is in float units, not per-format Z units
+
float pointSize;
float lineWidth;
- // point size output from the VS
- bool pointParam;
-
- // point sprite
- bool pointSpriteEnable;
- bool pointSpriteTopOrigin;
-
- // depth bias
float depthBias;
float slopeScaledDepthBias;
float depthBiasClamp;
///@todo: MSAA lines
// multisample state for MSAA lines
- bool msaaRastEnable;
SWR_MSAA_RASTMODE rastMode; // @llvm_enum
// sample count the rasterizer is running at
SWR_MULTISAMPLE_COUNT sampleCount; // @llvm_enum
- bool bForcedSampleCount;
uint32_t pixelLocation; // UL or Center
- bool pixelOffset; // offset pixel positions by .5 in both the horizontal and vertical direction
SWR_MULTISAMPLE_POS iSamplePos[SWR_MAX_NUM_MULTISAMPLES];
SWR_MSAA_SAMPLE_PATTERN samplePattern; // @llvm_enum