diff options
author | Tim Rowley <[email protected]> | 2017-09-07 18:53:03 -0500 |
---|---|---|
committer | Tim Rowley <[email protected]> | 2017-09-13 10:09:54 -0500 |
commit | 000e2958f59a8d8e07f06e384546aa942d49b15f (patch) | |
tree | 8e112305dd938835cbf966d31a13abe355edc0f7 /src/gallium/drivers/swr/rasterizer | |
parent | ead0dfe31ec7a1b1928e4abbfa99d59e0e5e929a (diff) |
swr/rast: Fetch compile state changes
Add InstanceStrideEnable field and rename InstanceDataStepRate to
InstanceAdvancementState in INPUT_ELEMENT_DESC structure.
Add stubs for handling InstanceStrideEnable in FetchJit::JitLoadVertices()
and FetchJit::JitGatherVertices() and assert if they are triggered.
Reviewed-by: Bruce Cherniak <[email protected]>
Diffstat (limited to 'src/gallium/drivers/swr/rasterizer')
-rw-r--r-- | src/gallium/drivers/swr/rasterizer/jitter/fetch_jit.cpp | 12 | ||||
-rw-r--r-- | src/gallium/drivers/swr/rasterizer/jitter/fetch_jit.h | 7 |
2 files changed, 14 insertions, 5 deletions
diff --git a/src/gallium/drivers/swr/rasterizer/jitter/fetch_jit.cpp b/src/gallium/drivers/swr/rasterizer/jitter/fetch_jit.cpp index 761c58ca27e..f3a4b27d9a9 100644 --- a/src/gallium/drivers/swr/rasterizer/jitter/fetch_jit.cpp +++ b/src/gallium/drivers/swr/rasterizer/jitter/fetch_jit.cpp @@ -360,7 +360,7 @@ void FetchJit::JitLoadVertices(const FETCH_COMPILE_STATE &fetchState, Value* str Value *startOffset; if(ied.InstanceEnable) { - Value* stepRate = C(ied.InstanceDataStepRate); + Value* stepRate = C(ied.InstanceAdvancementState); // prevent a div by 0 for 0 step rate Value* isNonZeroStep = ICMP_UGT(stepRate, C(0)); @@ -376,6 +376,10 @@ void FetchJit::JitLoadVertices(const FETCH_COMPILE_STATE &fetchState, Value* str startOffset = startInstance; } + else if (ied.InstanceStrideEnable) + { + SWR_ASSERT((0), "TODO: Fill out more once driver sends this down."); + } else { // offset indices by baseVertex @@ -825,7 +829,7 @@ void FetchJit::JitGatherVertices(const FETCH_COMPILE_STATE &fetchState, Value *startOffset; if(ied.InstanceEnable) { - Value* stepRate = C(ied.InstanceDataStepRate); + Value* stepRate = C(ied.InstanceAdvancementState); // prevent a div by 0 for 0 step rate Value* isNonZeroStep = ICMP_UGT(stepRate, C(0)); @@ -841,6 +845,10 @@ void FetchJit::JitGatherVertices(const FETCH_COMPILE_STATE &fetchState, startOffset = startInstance; } + else if (ied.InstanceStrideEnable) + { + SWR_ASSERT((0), "TODO: Fill out more once driver sends this down."); + } else { // offset indices by baseVertex diff --git a/src/gallium/drivers/swr/rasterizer/jitter/fetch_jit.h b/src/gallium/drivers/swr/rasterizer/jitter/fetch_jit.h index 4f456afffce..0dd6de759ad 100644 --- a/src/gallium/drivers/swr/rasterizer/jitter/fetch_jit.h +++ b/src/gallium/drivers/swr/rasterizer/jitter/fetch_jit.h @@ -45,16 +45,17 @@ struct INPUT_ELEMENT_DESC uint32_t Format : 10; uint32_t StreamIndex : 6; uint32_t InstanceEnable : 1; + uint32_t InstanceStrideEnable : 1; uint32_t ComponentControl0 : 3; uint32_t ComponentControl1 : 3; uint32_t ComponentControl2 : 3; uint32_t ComponentControl3 : 3; uint32_t ComponentPacking : 4; - uint32_t _reserved : 19; + uint32_t _reserved : 18; }; uint64_t bits; }; - uint32_t InstanceDataStepRate; + uint32_t InstanceAdvancementState; }; // used to set ComponentPacking @@ -124,7 +125,7 @@ struct FETCH_COMPILE_STATE { if((layout[i].bits != other.layout[i].bits) || ((layout[i].InstanceEnable == 1) && - (layout[i].InstanceDataStepRate != other.layout[i].InstanceDataStepRate))){ + (layout[i].InstanceAdvancementState != other.layout[i].InstanceAdvancementState))){ return false; } } |