From c8a51fa75d2642d71ac23a04f37f570613ac9a87 Mon Sep 17 00:00:00 2001 From: Tim Rowley Date: Wed, 9 Nov 2016 18:24:20 -0600 Subject: [PATCH] swr: [rasterizer core] remove driverType Reviewed-by: Bruce Cherniak --- .../drivers/swr/rasterizer/core/api.cpp | 40 +------------------ src/gallium/drivers/swr/rasterizer/core/api.h | 2 - .../drivers/swr/rasterizer/core/context.h | 2 - .../drivers/swr/rasterizer/core/state.h | 6 --- src/gallium/drivers/swr/swr_context.cpp | 1 - 5 files changed, 2 insertions(+), 49 deletions(-) diff --git a/src/gallium/drivers/swr/rasterizer/core/api.cpp b/src/gallium/drivers/swr/rasterizer/core/api.cpp index 3c41aecf9b0..7e305dafe77 100644 --- a/src/gallium/drivers/swr/rasterizer/core/api.cpp +++ b/src/gallium/drivers/swr/rasterizer/core/api.cpp @@ -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); } diff --git a/src/gallium/drivers/swr/rasterizer/core/api.h b/src/gallium/drivers/swr/rasterizer/core/api.h index cf4bf688ca1..6bebc39d3da 100644 --- a/src/gallium/drivers/swr/rasterizer/core/api.h +++ b/src/gallium/drivers/swr/rasterizer/core/api.h @@ -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; diff --git a/src/gallium/drivers/swr/rasterizer/core/context.h b/src/gallium/drivers/swr/rasterizer/core/context.h index 5eb13651bcd..69be280fc35 100644 --- a/src/gallium/drivers/swr/rasterizer/core/context.h +++ b/src/gallium/drivers/swr/rasterizer/core/context.h @@ -484,8 +484,6 @@ struct SWR_CONTEXT std::condition_variable FifosNotEmpty; std::mutex WaitLock; - DRIVER_TYPE driverType; - uint32_t privateStateSize; HotTileMgr *pHotTileMgr; diff --git a/src/gallium/drivers/swr/rasterizer/core/state.h b/src/gallium/drivers/swr/rasterizer/core/state.h index 062a1defbcc..f6b6ed205ef 100644 --- a/src/gallium/drivers/swr/rasterizer/core/state.h +++ b/src/gallium/drivers/swr/rasterizer/core/state.h @@ -36,12 +36,6 @@ #define SWR_CLEAR_DEPTH (1 << 1) #define SWR_CLEAR_STENCIL (1 << 2) -enum DRIVER_TYPE -{ - DX, - GL -}; - ////////////////////////////////////////////////////////////////////////// /// PRIMITIVE_TOPOLOGY. ////////////////////////////////////////////////////////////////////////// diff --git a/src/gallium/drivers/swr/swr_context.cpp b/src/gallium/drivers/swr/swr_context.cpp index cbc60e0aa01..6c0782a40d3 100644 --- a/src/gallium/drivers/swr/swr_context.cpp +++ b/src/gallium/drivers/swr/swr_context.cpp @@ -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; -- 2.30.2