Move the declaration of DrawCall after Renderer. This allows compilers targeting the MS ABI to select the correct inheritance model for the member function pointer field DrawCall::setupPrimitives using the complete type of Renderer. It will allow us to enable the new Clang flag -fcomplete-member-pointers globally. Bug: chromium:847724 Change-Id: Ied5859ec2f5d38b3ccf51608527506caec53f470 Reviewed-on: https://swiftshader-review.googlesource.com/19068 Tested-by: Peter Collingbourne <pcc@google.com> Reviewed-by: Nicolas Capens <nicolascapens@google.com>
diff --git a/src/Renderer/Renderer.hpp b/src/Renderer/Renderer.hpp index 8893fb5..b37da5f 100644 --- a/src/Renderer/Renderer.hpp +++ b/src/Renderer/Renderer.hpp
@@ -29,12 +29,12 @@ namespace sw { class Clipper; + struct DrawCall; class PixelShader; class VertexShader; class SwiftConfig; struct Task; class Resource; - class Renderer; struct Constants; enum TranscendentalPrecision @@ -202,55 +202,6 @@ float4 a2c3; }; - struct DrawCall - { - DrawCall(); - - ~DrawCall(); - - AtomicInt drawType; - AtomicInt batchSize; - - Routine *vertexRoutine; - Routine *setupRoutine; - Routine *pixelRoutine; - - VertexProcessor::RoutinePointer vertexPointer; - SetupProcessor::RoutinePointer setupPointer; - PixelProcessor::RoutinePointer pixelPointer; - - int (Renderer::*setupPrimitives)(int batch, int count); - SetupProcessor::State setupState; - - Resource *vertexStream[MAX_VERTEX_INPUTS]; - Resource *indexBuffer; - Surface *renderTarget[RENDERTARGETS]; - Surface *depthBuffer; - Surface *stencilBuffer; - Resource *texture[TOTAL_IMAGE_UNITS]; - Resource* pUniformBuffers[MAX_UNIFORM_BUFFER_BINDINGS]; - Resource* vUniformBuffers[MAX_UNIFORM_BUFFER_BINDINGS]; - Resource* transformFeedbackBuffers[MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS]; - - unsigned int vsDirtyConstF; - unsigned int vsDirtyConstI; - unsigned int vsDirtyConstB; - - unsigned int psDirtyConstF; - unsigned int psDirtyConstI; - unsigned int psDirtyConstB; - - std::list<Query*> *queries; - - AtomicInt clipFlags; - - AtomicInt primitive; // Current primitive to enter pipeline - AtomicInt count; // Number of primitives to render - AtomicInt references; // Remaining references to this draw call, 0 when done drawing, -1 when resources unlocked and slot is free - - DrawData *data; - }; - struct Viewport { float x0; @@ -502,6 +453,55 @@ Routine *setupRoutine; Routine *pixelRoutine; }; + + struct DrawCall + { + DrawCall(); + + ~DrawCall(); + + AtomicInt drawType; + AtomicInt batchSize; + + Routine *vertexRoutine; + Routine *setupRoutine; + Routine *pixelRoutine; + + VertexProcessor::RoutinePointer vertexPointer; + SetupProcessor::RoutinePointer setupPointer; + PixelProcessor::RoutinePointer pixelPointer; + + int (Renderer::*setupPrimitives)(int batch, int count); + SetupProcessor::State setupState; + + Resource *vertexStream[MAX_VERTEX_INPUTS]; + Resource *indexBuffer; + Surface *renderTarget[RENDERTARGETS]; + Surface *depthBuffer; + Surface *stencilBuffer; + Resource *texture[TOTAL_IMAGE_UNITS]; + Resource* pUniformBuffers[MAX_UNIFORM_BUFFER_BINDINGS]; + Resource* vUniformBuffers[MAX_UNIFORM_BUFFER_BINDINGS]; + Resource* transformFeedbackBuffers[MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS]; + + unsigned int vsDirtyConstF; + unsigned int vsDirtyConstI; + unsigned int vsDirtyConstB; + + unsigned int psDirtyConstF; + unsigned int psDirtyConstI; + unsigned int psDirtyConstB; + + std::list<Query*> *queries; + + AtomicInt clipFlags; + + AtomicInt primitive; // Current primitive to enter pipeline + AtomicInt count; // Number of primitives to render + AtomicInt references; // Remaining references to this draw call, 0 when done drawing, -1 when resources unlocked and slot is free + + DrawData *data; + }; } #endif // sw_Renderer_hpp