summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/swr/rasterizer/scripts
diff options
context:
space:
mode:
authorGeorge Kyriazis <[email protected]>2016-10-15 17:35:26 -0500
committerTim Rowley <[email protected]>2016-10-31 09:05:25 -0500
commit1a3ed86348d608d42b5fdbd8dcf101d06f0b2cb0 (patch)
tree18b1d03720a24c7226ec5caf712270d7a2689b0c /src/gallium/drivers/swr/rasterizer/scripts
parent7a2387c3e0e91f649676661c607d71f3b4eba5d5 (diff)
swr: [rasterizer archrast] Add thread tags to event files.
This allows the post-processor to easily detect the API thread and to process frame information. The frame information is needed to optimized how data is processed from worker threads. Reviewed-by: Bruce Cherniak <[email protected]>
Diffstat (limited to 'src/gallium/drivers/swr/rasterizer/scripts')
-rw-r--r--src/gallium/drivers/swr/rasterizer/scripts/gen_archrast.py5
-rw-r--r--src/gallium/drivers/swr/rasterizer/scripts/templates/ar_event_h.template3
-rw-r--r--src/gallium/drivers/swr/rasterizer/scripts/templates/ar_eventhandlerfile_h.template4
3 files changed, 11 insertions, 1 deletions
diff --git a/src/gallium/drivers/swr/rasterizer/scripts/gen_archrast.py b/src/gallium/drivers/swr/rasterizer/scripts/gen_archrast.py
index 1b89a91b8fd..901d6d8d05b 100644
--- a/src/gallium/drivers/swr/rasterizer/scripts/gen_archrast.py
+++ b/src/gallium/drivers/swr/rasterizer/scripts/gen_archrast.py
@@ -49,6 +49,8 @@ def parse_event_fields(lines, idx, event_dict):
field_types = []
end_of_event = False
+ num_fields = 0
+
# record all fields in event definition.
# note: we don't check if there's a leading brace.
while not end_of_event and idx < len(lines):
@@ -60,11 +62,14 @@ def parse_event_fields(lines, idx, event_dict):
if field:
field_types.append(field.group(2))
field_names.append(field.group(4))
+ num_fields += 1
end_of_event = re.match(r"(\s*)};", line)
event_dict['field_types'] = field_types
event_dict['field_names'] = field_names
+ event_dict['num_fields'] = num_fields
+
return idx
def parse_enums(lines, idx, event_dict):
diff --git a/src/gallium/drivers/swr/rasterizer/scripts/templates/ar_event_h.template b/src/gallium/drivers/swr/rasterizer/scripts/templates/ar_event_h.template
index e5c94c7a8d6..b0e67961304 100644
--- a/src/gallium/drivers/swr/rasterizer/scripts/templates/ar_event_h.template
+++ b/src/gallium/drivers/swr/rasterizer/scripts/templates/ar_event_h.template
@@ -86,9 +86,10 @@ namespace ArchRast
${field_types[i]} ${field_names[i]},
% endif
% if i == len(field_names)-1:
- ${field_types[i]} ${field_names[i]})
+ ${field_types[i]} ${field_names[i]}
% endif
% endfor
+ )
{
% for i in range(len(field_names)):
data.${field_names[i]} = ${field_names[i]};
diff --git a/src/gallium/drivers/swr/rasterizer/scripts/templates/ar_eventhandlerfile_h.template b/src/gallium/drivers/swr/rasterizer/scripts/templates/ar_eventhandlerfile_h.template
index 1924b15ca32..6a62f170a83 100644
--- a/src/gallium/drivers/swr/rasterizer/scripts/templates/ar_eventhandlerfile_h.template
+++ b/src/gallium/drivers/swr/rasterizer/scripts/templates/ar_eventhandlerfile_h.template
@@ -83,7 +83,11 @@ namespace ArchRast
% for name in protos['event_names']:
virtual void handle(${name}& event)
{
+% if protos['events'][name]['num_fields'] == 0:
+ write(${protos['events'][name]['event_id']}, (char*)&event.data, 0);
+% else:
write(${protos['events'][name]['event_id']}, (char*)&event.data, sizeof(event.data));
+%endif
}
% endfor