diff options
author | George Kyriazis <[email protected]> | 2018-01-31 01:09:53 -0600 |
---|---|---|
committer | George Kyriazis <[email protected]> | 2018-02-16 10:53:59 -0600 |
commit | 0420b2be89a4023eb6c1b45740d98184bb77e7cd (patch) | |
tree | 75665344e205c1ab391452d76f395863ae6fb37e /src/gallium/drivers/swr/rasterizer | |
parent | e48dd2489c646745720610bfde6c9f803d9297ed (diff) |
swr/rast: Separate event types to public and private
Split into two proto files and modify appropriate build rules for
configure / scons / meson builds.
There are private internal events (proxy) that communicate information
from rasterizer to ArchRast. ArchRast can use these events to calculate
a final answer and then emit other public events which will be saved to
file. Users will use the public proto file and not the private one.
Reviewed-by: Bruce Cherniak <[email protected]>
Diffstat (limited to 'src/gallium/drivers/swr/rasterizer')
4 files changed, 130 insertions, 108 deletions
diff --git a/src/gallium/drivers/swr/rasterizer/archrast/events.proto b/src/gallium/drivers/swr/rasterizer/archrast/events.proto index 68773270f30..f9be5844333 100644 --- a/src/gallium/drivers/swr/rasterizer/archrast/events.proto +++ b/src/gallium/drivers/swr/rasterizer/archrast/events.proto @@ -131,72 +131,6 @@ event BackendStatsEvent }; -event EarlyDepthStencilInfoSingleSample -{ - uint64_t depthPassMask; - uint64_t stencilPassMask; - uint64_t coverageMask; -}; - -event EarlyDepthStencilInfoSampleRate -{ - uint64_t depthPassMask; - uint64_t stencilPassMask; - uint64_t coverageMask; -}; - -event EarlyDepthStencilInfoNullPS -{ - uint64_t depthPassMask; - uint64_t stencilPassMask; - uint64_t coverageMask; -}; - -event LateDepthStencilInfoSingleSample -{ - uint64_t depthPassMask; - uint64_t stencilPassMask; - uint64_t coverageMask; -}; - -event LateDepthStencilInfoSampleRate -{ - uint64_t depthPassMask; - uint64_t stencilPassMask; - uint64_t coverageMask; -}; - -event LateDepthStencilInfoNullPS -{ - uint64_t depthPassMask; - uint64_t stencilPassMask; - uint64_t coverageMask; -}; - -event EarlyDepthInfoPixelRate -{ - uint64_t depthPassCount; - uint64_t activeLanes; -}; - - -event LateDepthInfoPixelRate -{ - uint64_t depthPassCount; - uint64_t activeLanes; -}; - - -event BackendDrawEndEvent -{ - uint32_t drawId; -}; - -event FrontendDrawEndEvent -{ - uint32_t drawId; -}; - event EarlyZSingleSample { uint32_t drawId; @@ -310,13 +244,6 @@ event LateOmStencil uint64_t failCount; }; -event GSPrimInfo -{ - uint64_t inputPrimCount; - uint64_t primGeneratedCount; - uint64_t vertsInput; -}; - event GSInputPrims { uint32_t drawId; @@ -335,35 +262,12 @@ event GSVertsInput uint64_t vertsInput; }; -event ClipVertexCount -{ - uint64_t vertsPerPrim; - uint64_t primMask; -}; - -//REMOVE AND REPLACE -event FlushVertClip -{ - uint32_t drawId; -}; - event VertsClipped { uint32_t drawId; uint64_t clipCount; }; -event TessPrimCount -{ - uint64_t primCount; -}; - -//REMOVE AND REPLACE -event TessPrimFlush -{ - uint32_t drawId; -}; - event TessPrims { uint32_t drawId; diff --git a/src/gallium/drivers/swr/rasterizer/archrast/events_private.proto b/src/gallium/drivers/swr/rasterizer/archrast/events_private.proto new file mode 100644 index 00000000000..e0fe9b93104 --- /dev/null +++ b/src/gallium/drivers/swr/rasterizer/archrast/events_private.proto @@ -0,0 +1,109 @@ +# Copyright (C) 2018 Intel Corporation. All Rights Reserved. +# +# Permission is hereby granted, free of charge, to any person obtaining a +# copy of this software and associated documentation files (the "Software"), +# to deal in the Software without restriction, including without limitation +# the rights to use, copy, modify, merge, publish, distribute, sublicense, +# and/or sell copies of the Software, and to permit persons to whom the +# Software is furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice (including the next +# paragraph) shall be included in all copies or substantial portions of the +# Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. +# +# Provides definitions for private internal events that are only used internally +# to rasty for communicating information between Rasty and Archrast. One goal for +# ArchRast is to not pollute the Rasty code with lots of calculations, etc. that +# are needed to compute per draw statistics, etc. + +event EarlyDepthStencilInfoSingleSample +{ + uint64_t depthPassMask; + uint64_t stencilPassMask; + uint64_t coverageMask; +}; + +event EarlyDepthStencilInfoSampleRate +{ + uint64_t depthPassMask; + uint64_t stencilPassMask; + uint64_t coverageMask; +}; + +event EarlyDepthStencilInfoNullPS +{ + uint64_t depthPassMask; + uint64_t stencilPassMask; + uint64_t coverageMask; +}; + +event LateDepthStencilInfoSingleSample +{ + uint64_t depthPassMask; + uint64_t stencilPassMask; + uint64_t coverageMask; +}; + +event LateDepthStencilInfoSampleRate +{ + uint64_t depthPassMask; + uint64_t stencilPassMask; + uint64_t coverageMask; +}; + +event LateDepthStencilInfoNullPS +{ + uint64_t depthPassMask; + uint64_t stencilPassMask; + uint64_t coverageMask; +}; + +event EarlyDepthInfoPixelRate +{ + uint64_t depthPassCount; + uint64_t activeLanes; +}; + + +event LateDepthInfoPixelRate +{ + uint64_t depthPassCount; + uint64_t activeLanes; +}; + + +event BackendDrawEndEvent +{ + uint32_t drawId; +}; + +event FrontendDrawEndEvent +{ + uint32_t drawId; +}; + +event ClipVertexCount +{ + uint64_t vertsPerPrim; + uint64_t primMask; +}; + +event TessPrimCount +{ + uint64_t primCount; +}; + +event GSPrimInfo +{ + uint64_t inputPrimCount; + uint64_t primGeneratedCount; + uint64_t vertsInput; +}; diff --git a/src/gallium/drivers/swr/rasterizer/codegen/gen_archrast.py b/src/gallium/drivers/swr/rasterizer/codegen/gen_archrast.py index 06a3dea4ad9..aa09f220c3f 100644 --- a/src/gallium/drivers/swr/rasterizer/codegen/gen_archrast.py +++ b/src/gallium/drivers/swr/rasterizer/codegen/gen_archrast.py @@ -77,19 +77,13 @@ def parse_enums(lines, idx, event_dict): event_dict['names'] = enum_names return idx -def parse_protos(filename): - protos = {} +def parse_protos(protos, filename): with open(filename, 'r') as f: lines=f.readlines() idx = 0 - protos['events'] = {} # event dictionary containing events with their fields - protos['event_names'] = [] # needed to keep events in order parsed. dict is not ordered. - protos['enums'] = {} - protos['enum_names'] = [] - eventId = 0 raw_text = [] while idx < len(lines): @@ -118,13 +112,12 @@ def parse_protos(filename): protos['enums'][enum_name] = {} idx = parse_enums(lines, idx, protos['enums'][enum_name]) - return protos - def main(): # Parse args... parser = ArgumentParser() parser.add_argument('--proto', '-p', help='Path to proto file', required=True) + parser.add_argument('--proto_private', '-pp', help='Path to private proto file', required=True) parser.add_argument('--output', '-o', help='Output filename (i.e. event.hpp)', required=True) parser.add_argument('--gen_event_hpp', help='Generate event header', action='store_true', default=False) parser.add_argument('--gen_event_cpp', help='Generate event cpp', action='store_true', default=False) @@ -133,6 +126,7 @@ def main(): args = parser.parse_args() proto_filename = args.proto + proto_private_filename = args.proto_private (output_dir, output_filename) = os.path.split(args.output) @@ -146,7 +140,18 @@ def main(): print('Error: Could not find proto file %s' % proto_filename, file=sys.stderr) return 1 - protos = parse_protos(proto_filename) + if not os.path.exists(proto_private_filename): + print('Error: Could not find private proto file %s' % proto_private_filename, file=sys.stderr) + return 1 + + protos = {} + protos['events'] = {} # event dictionary containing events with their fields + protos['event_names'] = [] # needed to keep events in order parsed. dict is not ordered. + protos['enums'] = {} + protos['enum_names'] = [] + + parse_protos(protos, proto_filename) + parse_protos(protos, proto_private_filename) # Generate event header if args.gen_event_hpp: diff --git a/src/gallium/drivers/swr/rasterizer/codegen/meson.build b/src/gallium/drivers/swr/rasterizer/codegen/meson.build index a6e127b8c5f..bbe6efff01a 100644 --- a/src/gallium/drivers/swr/rasterizer/codegen/meson.build +++ b/src/gallium/drivers/swr/rasterizer/codegen/meson.build @@ -67,10 +67,14 @@ foreach x : [['gen_ar_event.hpp', '--gen_event_hpp'], ['gen_ar_eventhandlerfile.hpp', '--gen_eventhandlerfile_h']] files_swr_common += custom_target( x[0], - input : ['gen_archrast.py', swr_event_proto_files], + input : ['gen_archrast.py', swr_event_proto_files, swr_event_pproto_files], output : x[0], command : [ - prog_python2, '@INPUT0@', '--proto', '@INPUT1@', '--output', '@OUTPUT@', + prog_python2, + '@INPUT0@', + '--proto', '@INPUT1@', + '--proto_private', '@INPUT2@', + '--output', '@OUTPUT@', x[1], ], depend_files : files( |