diff options
author | Eric Anholt <[email protected]> | 2018-12-07 12:18:34 -0800 |
---|---|---|
committer | Eric Anholt <[email protected]> | 2018-12-07 16:48:23 -0800 |
commit | b38e4d313fc27a225a36c42f84b2bee9933e62e6 (patch) | |
tree | c4cb203d7e79ebc7ace5b7c79772ea9b3efc5247 /src/gallium/drivers/v3d/v3dx_draw.c | |
parent | 191188876098801edeaaa231f95fed545fbcc08a (diff) |
v3d: Create a state uploader for packing our shaders together.
Shaders are usually quite short, and are private to the context. We can
save memory and reduce the work the kernel needs to do at exec time by
packing them together in a stream uploader for long-lived state.
Diffstat (limited to 'src/gallium/drivers/v3d/v3dx_draw.c')
-rw-r--r-- | src/gallium/drivers/v3d/v3dx_draw.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/gallium/drivers/v3d/v3dx_draw.c b/src/gallium/drivers/v3d/v3dx_draw.c index 7db1285f11d..2016db7fa81 100644 --- a/src/gallium/drivers/v3d/v3dx_draw.c +++ b/src/gallium/drivers/v3d/v3dx_draw.c @@ -192,11 +192,14 @@ v3d_emit_gl_shader_state(struct v3d_context *v3d, shader.fragment_shader_propagate_nans = true; shader.coordinate_shader_code_address = - cl_address(v3d->prog.cs->bo, 0); + cl_address(v3d_resource(v3d->prog.cs->resource)->bo, + v3d->prog.cs->offset); shader.vertex_shader_code_address = - cl_address(v3d->prog.vs->bo, 0); + cl_address(v3d_resource(v3d->prog.vs->resource)->bo, + v3d->prog.vs->offset); shader.fragment_shader_code_address = - cl_address(v3d->prog.fs->bo, 0); + cl_address(v3d_resource(v3d->prog.fs->resource)->bo, + v3d->prog.fs->offset); /* XXX: Use combined input/output size flag in the common * case. |