--output rasterizer/jitter \
--gen_x86_h
-rasterizer/archrast/gen_ar_event.hpp: rasterizer/codegen/gen_archrast.py rasterizer/codegen/templates/gen_ar_event.hpp rasterizer/archrast/events.proto rasterizer/codegen/gen_common.py
+rasterizer/archrast/gen_ar_event.hpp: rasterizer/codegen/gen_archrast.py rasterizer/codegen/templates/gen_ar_event.hpp rasterizer/archrast/events.proto rasterizer/archrast/events_private.proto rasterizer/codegen/gen_common.py
$(MKDIR_GEN)
$(PYTHON_GEN) \
$(srcdir)/rasterizer/codegen/gen_archrast.py \
--proto $(srcdir)/rasterizer/archrast/events.proto \
+ --proto_private $(srcdir)/rasterizer/archrast/events_private.proto \
--output rasterizer/archrast/gen_ar_event.hpp \
- --gen_event_h
+ --gen_event_hpp
-rasterizer/archrast/gen_ar_event.cpp: rasterizer/codegen/gen_archrast.py rasterizer/codegen/templates/gen_ar_event.cpp rasterizer/archrast/events.proto rasterizer/codegen/gen_common.py
+rasterizer/archrast/gen_ar_event.cpp: rasterizer/codegen/gen_archrast.py rasterizer/codegen/templates/gen_ar_event.cpp rasterizer/archrast/events.proto rasterizer/archrast/events_private.proto rasterizer/codegen/gen_common.py
$(MKDIR_GEN)
$(PYTHON_GEN) \
$(srcdir)/rasterizer/codegen/gen_archrast.py \
--proto $(srcdir)/rasterizer/archrast/events.proto \
+ --proto_private $(srcdir)/rasterizer/archrast/events_private.proto \
--output rasterizer/archrast/gen_ar_event.cpp \
--gen_event_cpp
-rasterizer/archrast/gen_ar_eventhandler.hpp: rasterizer/codegen/gen_archrast.py rasterizer/codegen/templates/gen_ar_eventhandler.hpp rasterizer/archrast/events.proto rasterizer/codegen/gen_common.py
+rasterizer/archrast/gen_ar_eventhandler.hpp: rasterizer/codegen/gen_archrast.py rasterizer/codegen/templates/gen_ar_eventhandler.hpp rasterizer/archrast/events.proto rasterizer/archrast/events_private.proto rasterizer/codegen/gen_common.py
$(MKDIR_GEN)
$(PYTHON_GEN) \
$(srcdir)/rasterizer/codegen/gen_archrast.py \
--proto $(srcdir)/rasterizer/archrast/events.proto \
+ --proto_private $(srcdir)/rasterizer/archrast/events_private.proto \
--output rasterizer/archrast/gen_ar_eventhandler.hpp \
- --gen_eventhandler_h
+ --gen_eventhandler_hpp
-rasterizer/archrast/gen_ar_eventhandlerfile.hpp: rasterizer/codegen/gen_archrast.py rasterizer/codegen/templates/gen_ar_eventhandlerfile.hpp rasterizer/archrast/events.proto rasterizer/codegen/gen_common.py
+rasterizer/archrast/gen_ar_eventhandlerfile.hpp: rasterizer/codegen/gen_archrast.py rasterizer/codegen/templates/gen_ar_eventhandlerfile.hpp rasterizer/archrast/events.proto rasterizer/archrast/events_private.proto rasterizer/codegen/gen_common.py
$(MKDIR_GEN)
$(PYTHON_GEN) \
$(srcdir)/rasterizer/codegen/gen_archrast.py \
--proto $(srcdir)/rasterizer/archrast/events.proto \
+ --proto_private $(srcdir)/rasterizer/archrast/events_private.proto \
--output rasterizer/archrast/gen_ar_eventhandlerfile.hpp \
- --gen_eventhandlerfile_h
+ --gen_eventhandlerfile_hpp
rasterizer/core/backends/gen_BackendPixelRate0.cpp \
rasterizer/core/backends/gen_BackendPixelRate1.cpp \
])
swrroot = '#src/gallium/drivers/swr/'
+srcroot = Dir(swrroot).abspath
bldroot = Dir('.').abspath
env.CodeGenerate(
target = 'rasterizer/archrast/gen_ar_event.hpp',
script = swrroot + 'rasterizer/codegen/gen_archrast.py',
source = 'rasterizer/archrast/events.proto',
- command = python_cmd + ' $SCRIPT --proto $SOURCE --output $TARGET --gen_event_h'
+ command = python_cmd + ' $SCRIPT --proto $SOURCE --proto_private ' + srcroot + '/rasterizer/archrast/events_private.proto --output $TARGET --gen_event_hpp'
)
+Depends('rasterizer/archrast/gen_ar_event.hpp',
+ swrroot + 'rasterizer/archrast/events_private.proto')
Depends('rasterizer/jitter/gen_state_llvm.h',
swrroot + 'rasterizer/codegen/templates/gen_ar_event.hpp')
target = 'rasterizer/archrast/gen_ar_event.cpp',
script = swrroot + 'rasterizer/codegen/gen_archrast.py',
source = 'rasterizer/archrast/events.proto',
- command = python_cmd + ' $SCRIPT --proto $SOURCE --output $TARGET --gen_event_cpp'
+ command = python_cmd + ' $SCRIPT --proto $SOURCE --proto_private ' + srcroot + '/rasterizer/archrast/events_private.proto --output $TARGET --gen_event_cpp'
)
+Depends('rasterizer/archrast/gen_ar_event.cpp',
+ swrroot + 'rasterizer/archrast/events_private.proto')
Depends('rasterizer/jitter/gen_state_llvm.h',
swrroot + 'rasterizer/codegen/templates/gen_ar_event.cpp')
target = 'rasterizer/archrast/gen_ar_eventhandler.hpp',
script = swrroot + 'rasterizer/codegen/gen_archrast.py',
source = 'rasterizer/archrast/events.proto',
- command = python_cmd + ' $SCRIPT --proto $SOURCE --output $TARGET --gen_eventhandler_h'
+ command = python_cmd + ' $SCRIPT --proto $SOURCE --proto_private ' + srcroot + '/rasterizer/archrast/events_private.proto --output $TARGET --gen_eventhandler_hpp'
)
+Depends('rasterizer/archrast/gen_ar_eventhandler.hpp',
+ swrroot + 'rasterizer/archrast/events_private.proto')
Depends('rasterizer/jitter/gen_state_llvm.h',
swrroot + 'rasterizer/codegen/templates/gen_ar_eventhandler.hpp')
target = 'rasterizer/archrast/gen_ar_eventhandlerfile.hpp',
script = swrroot + 'rasterizer/codegen/gen_archrast.py',
source = 'rasterizer/archrast/events.proto',
- command = python_cmd + ' $SCRIPT --proto $SOURCE --output $TARGET --gen_eventhandlerfile_h'
+ command = python_cmd + ' $SCRIPT --proto $SOURCE --proto_private ' + srcroot + '/rasterizer/archrast/events_private.proto --output $TARGET --gen_eventhandlerfile_hpp'
)
+Depends('rasterizer/archrast/gen_ar_eventhandlerfile.hpp',
+ swrroot + 'rasterizer/archrast/events_private.proto')
Depends('rasterizer/jitter/gen_state_llvm.h',
swrroot + 'rasterizer/codegen/templates/gen_ar_eventhandlerfile.hpp')
swr_context_files = files('swr_context.h')
swr_state_files = files('rasterizer/core/state.h')
swr_event_proto_files = files('rasterizer/archrast/events.proto')
+swr_event_pproto_files = files('rasterizer/archrast/events_private.proto')
swr_gen_backend_files = files('rasterizer/codegen/templates/gen_backend.cpp')
swr_gen_rasterizer_files = files('rasterizer/codegen/templates/gen_rasterizer.cpp')
swr_gen_header_init_files = files('rasterizer/codegen/templates/gen_header_init.hpp')
};
-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;
uint64_t failCount;
};
-event GSPrimInfo
-{
- uint64_t inputPrimCount;
- uint64_t primGeneratedCount;
- uint64_t vertsInput;
-};
-
event GSInputPrims
{
uint32_t drawId;
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;
--- /dev/null
+# 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;
+};
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):
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)
args = parser.parse_args()
proto_filename = args.proto
+ proto_private_filename = args.proto_private
(output_dir, output_filename) = os.path.split(args.output)
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:
['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(