diff options
author | Vasily Khoruzhick <[email protected]> | 2019-11-01 19:23:57 -0700 |
---|---|---|
committer | Vasily Khoruzhick <[email protected]> | 2019-11-05 17:44:56 -0800 |
commit | 65a5b24aeea34b370cd38083ccbbd38efcac1d4e (patch) | |
tree | 070fc44b890fca8985920421c14a74a7940b191d /src/gallium/drivers/lima/ir | |
parent | 73cc2fec10574816ff968b21183bd62e77517b66 (diff) |
lima: add support for gl_PointSize
GP handles gl_PointSize similar to gl_Position, i.e. it needs
separate buffer and it has special type in varying descriptors, also
for indexed draw we need to emit special PLBU command to pass
address of gl_PointSize buffer.
Blob also clamps gl_PointSize to 1 .. 100 (as well as line width),
so let's do the same.
Reviewed-by: Andreas Baierl <[email protected]>
Signed-off-by: Vasily Khoruzhick <[email protected]>
Diffstat (limited to 'src/gallium/drivers/lima/ir')
-rw-r--r-- | src/gallium/drivers/lima/ir/gp/nir.c | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/src/gallium/drivers/lima/ir/gp/nir.c b/src/gallium/drivers/lima/ir/gp/nir.c index e405e1a6c62..9916a057656 100644 --- a/src/gallium/drivers/lima/ir/gp/nir.c +++ b/src/gallium/drivers/lima/ir/gp/nir.c @@ -457,6 +457,8 @@ bool gpir_compile_nir(struct lima_vs_shader_state *prog, struct nir_shader *nir, comp->constant_base = nir->num_uniforms; prog->uniform_pending_offset = nir->num_uniforms * 16; + prog->gl_pos_idx = 0; + prog->point_size_idx = -1; if (!gpir_emit_function(comp, func)) goto err_out0; @@ -483,13 +485,24 @@ bool gpir_compile_nir(struct lima_vs_shader_state *prog, struct nir_shader *nir, goto err_out0; nir_foreach_variable(var, &nir->outputs) { - if (var->data.location == VARYING_SLOT_POS) - assert(var->data.driver_location == 0); + bool varying = true; + switch (var->data.location) { + case VARYING_SLOT_POS: + prog->gl_pos_idx = var->data.driver_location; + varying = false; + break; + case VARYING_SLOT_PSIZ: + prog->point_size_idx = var->data.driver_location; + varying = false; + break; + } struct lima_varying_info *v = prog->varying + var->data.driver_location; if (!v->components) { v->component_size = gpir_glsl_type_size(glsl_get_base_type(var->type)); - prog->num_varying++; + prog->num_outputs++; + if (varying) + prog->num_varyings++; } v->components += glsl_get_components(var->type); |