@@ -147,7 +147,7 @@ uint CGeometryShader::GetInputPrimitiveVertexCount(USC::GSHADER_INPUT_PRIMITIVE_
147147 case USC::GSHADER_INPUT_PATCHLIST_30 : return 30 ;
148148 case USC::GSHADER_INPUT_PATCHLIST_31 : return 31 ;
149149 case USC::GSHADER_INPUT_PATCHLIST_32 : return 32 ;
150-
150+
151151 default :
152152 assert (0 && " Input primitive type not implemented" );
153153 return 0 ;
@@ -233,7 +233,7 @@ CVariable* CGeometryShader::GetURBInputHandle(CVariable* pVertexIndex)
233233 {
234234 encoder.SetSrcSubVar (0 , vertexIndex);
235235 }
236-
236+
237237 encoder.Copy (pSelectedHandles, GetURBReadHandlesReg ());
238238 encoder.Push ();
239239 }
@@ -245,7 +245,7 @@ CVariable* CGeometryShader::GetURBInputHandle(CVariable* pVertexIndex)
245245 {
246246 encoder.SetSrcRegion (0 , 16 , 8 , 2 );
247247 }
248-
248+
249249 if (!m_properties.Input ().HasInstancing ())
250250 {
251251 // offset = vertexIndex * 32 since offset needs to be in bytes, not grf numbers
@@ -269,27 +269,22 @@ CVariable* CGeometryShader::GetURBInputHandle(CVariable* pVertexIndex)
269269 CVariable* URBHandles = GetURBReadHandlesReg ();
270270 pSelectedHandles = GetNewAddressVariable (
271271 pOffset->IsUniform () ? 1 : numLanes (m_SIMDSize),
272- ISA_TYPE_UD,
273- pOffset->IsUniform (),
272+ ISA_TYPE_UD,
273+ pOffset->IsUniform (),
274274 URBHandles->IsUniform ());
275275 encoder.AddrAdd (pSelectedHandles, URBHandles, pOffset);
276276 encoder.Push ();
277277 }
278278 return pSelectedHandles;
279279}
280280
281- QuadEltUnit CGeometryShader::GetFinalGlobalOffet (QuadEltUnit globalOffset)
282- {
283- return globalOffset;
284- }
285-
286281void CGeometryShader::AllocatePayload ()
287282{
288283 uint offset = 0 ;
289284
290285 // Allocate 8 DWORDS for the global URB Header which stores the cut bits.
291286 // The global header is 16 DWORDS which is a max of 512 bits.
292- // So a GS can max output 1024 DWORDS/ 3 channels = 341 vertices
287+ // So a GS can max output 1024 DWORDS/ 3 channels = 341 vertices
293288 // (1024 max dwords so assuming no attributes).
294289
295290 // R0 & R1 are always allocated.
@@ -327,7 +322,7 @@ void CGeometryShader::AllocatePayload()
327322
328323 assert (offset % getGRFSize () == 0 );
329324
330- // when instancing mode is on, there is only one set of inputs and it's
325+ // when instancing mode is on, there is only one set of inputs and it's
331326 // laid out like in constant buffers, i.e. one attribute takes four subregisters
332327 // of one GRF register.
333328 const uint varSize = m_properties.Input ().HasInstancing () ? SIZE_DWORD : getGRFSize ();
@@ -363,38 +358,38 @@ void CGeometryShader::FillProgram(SGeometryShaderKernelProgram* pKernelProgram)
363358 // Gen 7 specific Compiler Output
364359 pKernelProgram->OutputTopology = m_properties.Output ().TopologyType ();
365360 pKernelProgram->SamplerCount = m_properties.SamplerCount ();
366-
361+
367362 pKernelProgram->OutputVertexSize = GetOutputVertexSize ();
368363 pKernelProgram->VertexEntryReadLength = GetVertexEntryReadLength ();
369364
370365 TODO (" Fix compiler output structures for uninitialized fields" );
371- pKernelProgram->IncludeVertexHandles = (m_pURBReadHandlesReg!=nullptr ); // Used for PULL model.
366+ pKernelProgram->IncludeVertexHandles = (m_pURBReadHandlesReg!=nullptr ); // Used for PULL model.
372367 pKernelProgram->VertexEntryReadOffset = OctEltUnit (0 ); // Include also vertex header, so start from the beginning.
373368
374369 pKernelProgram->ControlDataHeaderFormat = m_properties.Output ().ControlDataFormat ();
375370 pKernelProgram->GSEnable = true ;
376371
377- // Default StreamID is also dependent on the GSEnable but since we set it to true here we are
372+ // Default StreamID is also dependent on the GSEnable but since we set it to true here we are
378373 // not considering it right now.
379374 auto defStreamID = m_properties.Output ().DefaultStreamID ();
380375 pKernelProgram->DefaultStreamID = (defStreamID != -1 ? defStreamID : 0 );
381376
382377 pKernelProgram->ControlDataHeaderSize = m_properties.Output ().ControlDataHeaderSize ();
383-
378+
384379 // Since we support only channel serial, the only mode for GS is SIMD8.
385380 pKernelProgram->DispatchMode = USC::GFX3DSTATE_GEOMETRY_SHADER_DISPATCH_MODE_SIMD8;
386-
381+
387382 pKernelProgram->IncludePrimitiveIDEnable = (m_pPrimitiveID != nullptr );
388383 auto instanceCount = m_properties.Input ().InstanceCount ();
389384 pKernelProgram->InstanceCount = (instanceCount == 0 ) ? 1 : instanceCount;
390385 pKernelProgram->ReorderEnable = true ;
391386 pKernelProgram->DiscardAdjacencyEnable = CGeometryShader::DiscardAdjacency (m_properties.Input ().InputPrimitiveType ());
392387 pKernelProgram->SBEVertexURBEntryReadOffset = pKernelProgram->VertexEntryReadOffset ;
393-
388+
394389 pKernelProgram->URBAllocationSize = GetURBAllocationSize ();
395390
396391 pKernelProgram->UserClipDistancesMask = m_properties.Output ().PerVertex ().ClipDistanceMask ();
397- pKernelProgram->UserCullDistancesMask = m_properties.Output ().PerVertex ().CullDistanceMask ();
392+ pKernelProgram->UserCullDistancesMask = m_properties.Output ().PerVertex ().CullDistanceMask ();
398393
399394 pKernelProgram->MaxOutputVertexCount = m_properties.Output ().MaxVertexCount ();
400395
@@ -407,9 +402,9 @@ void CGeometryShader::FillProgram(SGeometryShaderKernelProgram* pKernelProgram)
407402 TODO (" Max threads should be calculated based on the registers spilled. -> This needs to change" )
408403 pKernelProgram->ExpectedVertexCount = m_properties.Input ().VertexCount ();
409404 pKernelProgram->StaticOutput = !m_properties.Output ().HasNonstaticVertexCount ();
410-
411- pKernelProgram->StaticOutputVertexCount =
412- (m_properties.Output ().HasNonstaticVertexCount ()) ?
405+
406+ pKernelProgram->StaticOutputVertexCount =
407+ (m_properties.Output ().HasNonstaticVertexCount ()) ?
413408 0 : m_properties.Output ().ActualStaticVertexCount ();
414409
415410 pKernelProgram->GSVertexURBEntryOutputReadOffset = GetVertexURBEntryOutputReadOffset ();
@@ -481,7 +476,7 @@ Unit<Element> CGeometryShader::GetLocalOffset(SGVUsage usage)
481476URBAllocationUnit CGeometryShader::GetURBAllocationSize () const
482477{
483478 // Calculate the size of all vertices to be emitted, rounded up to 32B.
484- auto vertexCount = m_properties.Output ().HasNonstaticVertexCount ()?
479+ auto vertexCount = m_properties.Output ().HasNonstaticVertexCount ()?
485480 m_properties.Output ().MaxVertexCount () : m_properties.Output ().ActualStaticVertexCount ();
486481
487482 const OctEltUnit vertexSpace = round_up<OctElement>(
@@ -498,7 +493,7 @@ URBAllocationUnit CGeometryShader::GetURBAllocationSize() const
498493}
499494
500495// / Returns the size of the output vertex.
501- // / Unit: 16B = 4 DWORDs
496+ // / Unit: 16B = 4 DWORDs
502497// / Note: Each output vertex must be 32B-aligned when rendering is enabled (Ref. GS URB Entry).
503498// / Therefore, the output vertex size is also rounded up to a multiple of 2.
504499QuadEltUnit CGeometryShader::GetOutputVertexSize () const
@@ -514,7 +509,7 @@ OctEltUnit CGeometryShader::GetInputVertexHeaderSize() const
514509
515510OctEltUnit CGeometryShader::GetVertexEntryReadLength () const
516511{
517- // if we use pull model, we don't use payload data and use URB read handles
512+ // if we use pull model, we don't use payload data and use URB read handles
518513 // in that case Vertex Entry Read Length should be zero.
519514 // If we don't use URB read handles, we cannot have read length zero (even if we don't read
520515 // anything from inputs) because of hardware restriction.
0 commit comments