swr: [rasterizer core] remove driverType

Reviewed-by: Bruce Cherniak <bruce.cherniak@intel.com>
This commit is contained in:
Tim Rowley
2016-11-09 18:24:20 -06:00
parent ddc898aaf3
commit c8a51fa75d
5 changed files with 2 additions and 49 deletions
@@ -73,7 +73,6 @@ HANDLE SwrCreateContext(
memset(pContextMem, 0, sizeof(SWR_CONTEXT));
SWR_CONTEXT *pContext = new (pContextMem) SWR_CONTEXT();
pContext->driverType = pCreateInfo->driver;
pContext->privateStateSize = pCreateInfo->privateStateSize;
pContext->dcRing.Init(KNOB_MAX_DRAWS_IN_FLIGHT);
@@ -715,43 +714,8 @@ void SwrSetViewports(
API_STATE* pState = GetDrawState(pContext);
memcpy(&pState->vp[0], pViewports, sizeof(SWR_VIEWPORT) * numViewports);
if (pMatrices != nullptr)
{
// @todo Faster to copy portions of the SOA or just copy all of it?
memcpy(&pState->vpMatrices, pMatrices, sizeof(SWR_VIEWPORT_MATRICES));
}
else
{
// Compute default viewport transform.
for (uint32_t i = 0; i < numViewports; ++i)
{
if (pContext->driverType == DX)
{
pState->vpMatrices.m00[i] = pState->vp[i].width / 2.0f;
pState->vpMatrices.m11[i] = -pState->vp[i].height / 2.0f;
pState->vpMatrices.m22[i] = pState->vp[i].maxZ - pState->vp[i].minZ;
pState->vpMatrices.m30[i] = pState->vp[i].x + pState->vpMatrices.m00[i];
pState->vpMatrices.m31[i] = pState->vp[i].y - pState->vpMatrices.m11[i];
pState->vpMatrices.m32[i] = pState->vp[i].minZ;
}
else
{
// Standard, with the exception that Y is inverted.
pState->vpMatrices.m00[i] = (pState->vp[i].width - pState->vp[i].x) / 2.0f;
pState->vpMatrices.m11[i] = (pState->vp[i].y - pState->vp[i].height) / 2.0f;
pState->vpMatrices.m22[i] = (pState->vp[i].maxZ - pState->vp[i].minZ) / 2.0f;
pState->vpMatrices.m30[i] = pState->vp[i].x + pState->vpMatrices.m00[i];
pState->vpMatrices.m31[i] = pState->vp[i].height + pState->vpMatrices.m11[i];
pState->vpMatrices.m32[i] = pState->vp[i].minZ + pState->vpMatrices.m22[i];
// Now that the matrix is calculated, clip the view coords to screen size.
// OpenGL allows for -ve x,y in the viewport.
pState->vp[i].x = std::max(pState->vp[i].x, 0.0f);
pState->vp[i].y = std::max(pState->vp[i].y, 0.0f);
}
}
}
// @todo Faster to copy portions of the SOA or just copy all of it?
memcpy(&pState->vpMatrices, pMatrices, sizeof(SWR_VIEWPORT_MATRICES));
updateGuardbands(pState);
}
@@ -192,8 +192,6 @@ struct SWR_THREADING_INFO
/////////////////////////////////////////////////////////////////////////
struct SWR_CREATECONTEXT_INFO
{
DRIVER_TYPE driver;
// External functions (e.g. sampler) need per draw context state.
// Use SwrGetPrivateContextState() to access private state.
uint32_t privateStateSize;
@@ -484,8 +484,6 @@ struct SWR_CONTEXT
std::condition_variable FifosNotEmpty;
std::mutex WaitLock;
DRIVER_TYPE driverType;
uint32_t privateStateSize;
HotTileMgr *pHotTileMgr;
@@ -36,12 +36,6 @@
#define SWR_CLEAR_DEPTH (1 << 1)
#define SWR_CLEAR_STENCIL (1 << 2)
enum DRIVER_TYPE
{
DX,
GL
};
//////////////////////////////////////////////////////////////////////////
/// PRIMITIVE_TOPOLOGY.
//////////////////////////////////////////////////////////////////////////
-1
View File
@@ -400,7 +400,6 @@ swr_create_context(struct pipe_screen *p_screen, void *priv, unsigned flags)
SWR_CREATECONTEXT_INFO createInfo;
memset(&createInfo, 0, sizeof(createInfo));
createInfo.driver = GL;
createInfo.privateStateSize = sizeof(swr_draw_context);
createInfo.pfnLoadTile = swr_LoadHotTile;
createInfo.pfnStoreTile = swr_StoreHotTile;