summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKenneth Graunke <[email protected]>2018-04-23 13:26:06 -0700
committerKenneth Graunke <[email protected]>2019-02-21 10:26:06 -0800
commit0e3870b9de797783a3ee796e5c001316e0955255 (patch)
tree4d1f9cb7633e8b567a6ca574887d7c74a1e1f407
parent01fe6df0eda62842a0b2332bce2a5a47acd10a70 (diff)
iris: blorp URB
-rw-r--r--src/gallium/drivers/iris/iris_blorp.c30
1 files changed, 23 insertions, 7 deletions
diff --git a/src/gallium/drivers/iris/iris_blorp.c b/src/gallium/drivers/iris/iris_blorp.c
index 6b43a86a658..795a80ae073 100644
--- a/src/gallium/drivers/iris/iris_blorp.c
+++ b/src/gallium/drivers/iris/iris_blorp.c
@@ -26,6 +26,7 @@
#include "iris_resource.h"
#include "iris_context.h"
+#include "intel/common/gen_l3_config.h"
#include "blorp/blorp_genX_exec.h"
#include "util/u_upload_mgr.h"
@@ -218,13 +219,28 @@ blorp_emit_urb_config(struct blorp_batch *blorp_batch,
unsigned vs_entry_size,
UNUSED unsigned sf_entry_size)
{
- // XXX: URB...
-#if 0
- if (ice->urb.vsize >= vs_entry_size)
- return;
-
- gen7_upload_urb(ice, vs_entry_size, false, false);
-#endif
+ struct iris_context *ice = blorp_batch->blorp->driver_ctx;
+ struct iris_batch *batch = blorp_batch->driver_batch;
+ const struct gen_device_info *devinfo = &batch->screen->devinfo;
+
+ // XXX: Track last URB config and avoid re-emitting it if it's good enough
+ const unsigned push_size_kB = 32;
+ unsigned entries[4];
+ unsigned start[4];
+ unsigned size[4] = { vs_entry_size, 1, 1, 1 };
+
+ gen_get_urb_config(devinfo, 1024 * push_size_kB,
+ 1024 * ice->shaders.urb_size,
+ false, false, size, entries, start);
+
+ for (int i = MESA_SHADER_VERTEX; i <= MESA_SHADER_GEOMETRY; i++) {
+ blorp_emit(blorp_batch, GENX(3DSTATE_URB_VS), urb) {
+ urb._3DCommandSubOpcode += i;
+ urb.VSURBStartingAddress = start[i];
+ urb.VSURBEntryAllocationSize = size[i] - 1;
+ urb.VSNumberofURBEntries = entries[i];
+ }
+ }
}
static void