@@ -147,7 +147,7 @@ uint CGeometryShader::GetInputPrimitiveVertexCount(USC::GSHADER_INPUT_PRIMITIVE_
147
147
case USC::GSHADER_INPUT_PATCHLIST_30 : return 30 ;
148
148
case USC::GSHADER_INPUT_PATCHLIST_31 : return 31 ;
149
149
case USC::GSHADER_INPUT_PATCHLIST_32 : return 32 ;
150
-
150
+
151
151
default :
152
152
assert (0 && " Input primitive type not implemented" );
153
153
return 0 ;
@@ -233,7 +233,7 @@ CVariable* CGeometryShader::GetURBInputHandle(CVariable* pVertexIndex)
233
233
{
234
234
encoder.SetSrcSubVar (0 , vertexIndex);
235
235
}
236
-
236
+
237
237
encoder.Copy (pSelectedHandles, GetURBReadHandlesReg ());
238
238
encoder.Push ();
239
239
}
@@ -245,7 +245,7 @@ CVariable* CGeometryShader::GetURBInputHandle(CVariable* pVertexIndex)
245
245
{
246
246
encoder.SetSrcRegion (0 , 16 , 8 , 2 );
247
247
}
248
-
248
+
249
249
if (!m_properties.Input ().HasInstancing ())
250
250
{
251
251
// offset = vertexIndex * 32 since offset needs to be in bytes, not grf numbers
@@ -269,27 +269,22 @@ CVariable* CGeometryShader::GetURBInputHandle(CVariable* pVertexIndex)
269
269
CVariable* URBHandles = GetURBReadHandlesReg ();
270
270
pSelectedHandles = GetNewAddressVariable (
271
271
pOffset->IsUniform () ? 1 : numLanes (m_SIMDSize),
272
- ISA_TYPE_UD,
273
- pOffset->IsUniform (),
272
+ ISA_TYPE_UD,
273
+ pOffset->IsUniform (),
274
274
URBHandles->IsUniform ());
275
275
encoder.AddrAdd (pSelectedHandles, URBHandles, pOffset);
276
276
encoder.Push ();
277
277
}
278
278
return pSelectedHandles;
279
279
}
280
280
281
- QuadEltUnit CGeometryShader::GetFinalGlobalOffet (QuadEltUnit globalOffset)
282
- {
283
- return globalOffset;
284
- }
285
-
286
281
void CGeometryShader::AllocatePayload ()
287
282
{
288
283
uint offset = 0 ;
289
284
290
285
// Allocate 8 DWORDS for the global URB Header which stores the cut bits.
291
286
// 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
293
288
// (1024 max dwords so assuming no attributes).
294
289
295
290
// R0 & R1 are always allocated.
@@ -327,7 +322,7 @@ void CGeometryShader::AllocatePayload()
327
322
328
323
assert (offset % getGRFSize () == 0 );
329
324
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
331
326
// laid out like in constant buffers, i.e. one attribute takes four subregisters
332
327
// of one GRF register.
333
328
const uint varSize = m_properties.Input ().HasInstancing () ? SIZE_DWORD : getGRFSize ();
@@ -363,38 +358,38 @@ void CGeometryShader::FillProgram(SGeometryShaderKernelProgram* pKernelProgram)
363
358
// Gen 7 specific Compiler Output
364
359
pKernelProgram->OutputTopology = m_properties.Output ().TopologyType ();
365
360
pKernelProgram->SamplerCount = m_properties.SamplerCount ();
366
-
361
+
367
362
pKernelProgram->OutputVertexSize = GetOutputVertexSize ();
368
363
pKernelProgram->VertexEntryReadLength = GetVertexEntryReadLength ();
369
364
370
365
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.
372
367
pKernelProgram->VertexEntryReadOffset = OctEltUnit (0 ); // Include also vertex header, so start from the beginning.
373
368
374
369
pKernelProgram->ControlDataHeaderFormat = m_properties.Output ().ControlDataFormat ();
375
370
pKernelProgram->GSEnable = true ;
376
371
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
378
373
// not considering it right now.
379
374
auto defStreamID = m_properties.Output ().DefaultStreamID ();
380
375
pKernelProgram->DefaultStreamID = (defStreamID != -1 ? defStreamID : 0 );
381
376
382
377
pKernelProgram->ControlDataHeaderSize = m_properties.Output ().ControlDataHeaderSize ();
383
-
378
+
384
379
// Since we support only channel serial, the only mode for GS is SIMD8.
385
380
pKernelProgram->DispatchMode = USC::GFX3DSTATE_GEOMETRY_SHADER_DISPATCH_MODE_SIMD8;
386
-
381
+
387
382
pKernelProgram->IncludePrimitiveIDEnable = (m_pPrimitiveID != nullptr );
388
383
auto instanceCount = m_properties.Input ().InstanceCount ();
389
384
pKernelProgram->InstanceCount = (instanceCount == 0 ) ? 1 : instanceCount;
390
385
pKernelProgram->ReorderEnable = true ;
391
386
pKernelProgram->DiscardAdjacencyEnable = CGeometryShader::DiscardAdjacency (m_properties.Input ().InputPrimitiveType ());
392
387
pKernelProgram->SBEVertexURBEntryReadOffset = pKernelProgram->VertexEntryReadOffset ;
393
-
388
+
394
389
pKernelProgram->URBAllocationSize = GetURBAllocationSize ();
395
390
396
391
pKernelProgram->UserClipDistancesMask = m_properties.Output ().PerVertex ().ClipDistanceMask ();
397
- pKernelProgram->UserCullDistancesMask = m_properties.Output ().PerVertex ().CullDistanceMask ();
392
+ pKernelProgram->UserCullDistancesMask = m_properties.Output ().PerVertex ().CullDistanceMask ();
398
393
399
394
pKernelProgram->MaxOutputVertexCount = m_properties.Output ().MaxVertexCount ();
400
395
@@ -407,9 +402,9 @@ void CGeometryShader::FillProgram(SGeometryShaderKernelProgram* pKernelProgram)
407
402
TODO (" Max threads should be calculated based on the registers spilled. -> This needs to change" )
408
403
pKernelProgram->ExpectedVertexCount = m_properties.Input ().VertexCount ();
409
404
pKernelProgram->StaticOutput = !m_properties.Output ().HasNonstaticVertexCount ();
410
-
411
- pKernelProgram->StaticOutputVertexCount =
412
- (m_properties.Output ().HasNonstaticVertexCount ()) ?
405
+
406
+ pKernelProgram->StaticOutputVertexCount =
407
+ (m_properties.Output ().HasNonstaticVertexCount ()) ?
413
408
0 : m_properties.Output ().ActualStaticVertexCount ();
414
409
415
410
pKernelProgram->GSVertexURBEntryOutputReadOffset = GetVertexURBEntryOutputReadOffset ();
@@ -481,7 +476,7 @@ Unit<Element> CGeometryShader::GetLocalOffset(SGVUsage usage)
481
476
URBAllocationUnit CGeometryShader::GetURBAllocationSize () const
482
477
{
483
478
// 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 ()?
485
480
m_properties.Output ().MaxVertexCount () : m_properties.Output ().ActualStaticVertexCount ();
486
481
487
482
const OctEltUnit vertexSpace = round_up<OctElement>(
@@ -498,7 +493,7 @@ URBAllocationUnit CGeometryShader::GetURBAllocationSize() const
498
493
}
499
494
500
495
// / Returns the size of the output vertex.
501
- // / Unit: 16B = 4 DWORDs
496
+ // / Unit: 16B = 4 DWORDs
502
497
// / Note: Each output vertex must be 32B-aligned when rendering is enabled (Ref. GS URB Entry).
503
498
// / Therefore, the output vertex size is also rounded up to a multiple of 2.
504
499
QuadEltUnit CGeometryShader::GetOutputVertexSize () const
@@ -514,7 +509,7 @@ OctEltUnit CGeometryShader::GetInputVertexHeaderSize() const
514
509
515
510
OctEltUnit CGeometryShader::GetVertexEntryReadLength () const
516
511
{
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
518
513
// in that case Vertex Entry Read Length should be zero.
519
514
// If we don't use URB read handles, we cannot have read length zero (even if we don't read
520
515
// anything from inputs) because of hardware restriction.
0 commit comments