summaryrefslogtreecommitdiffstats
path: root/src/mesa/program/ir_to_mesa.cpp
diff options
context:
space:
mode:
authorTimothy Arceri <[email protected]>2017-06-16 10:17:56 +1000
committerTimothy Arceri <[email protected]>2018-03-20 14:17:33 +1100
commitedded1237607348683f492db313e823dc2e380c3 (patch)
tree1fb861be1d324eb309fbef50e6b353dfff4a0c83 /src/mesa/program/ir_to_mesa.cpp
parentb13b9eb432a3b67efb29ca25c3e244b467c3c4af (diff)
mesa: rework ParameterList to allow packing
Currently everything is padded to 4 components. Making the list more flexible will allow us to do uniform packing. V2 (suggestions from Nicolai): - always pass existing calls to _mesa_add_parameter() true for padd_and_align - fix bindless param value offsets - remove left over wip logic from pad and align code - zero out param value padding - whitespace fix Reviewed-by: Marek Olšák <[email protected]>
Diffstat (limited to 'src/mesa/program/ir_to_mesa.cpp')
-rw-r--r--src/mesa/program/ir_to_mesa.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/mesa/program/ir_to_mesa.cpp b/src/mesa/program/ir_to_mesa.cpp
index 29025d1c177..f26eddc9000 100644
--- a/src/mesa/program/ir_to_mesa.cpp
+++ b/src/mesa/program/ir_to_mesa.cpp
@@ -2452,7 +2452,7 @@ add_uniform_to_shader::visit_field(const glsl_type *type, const char *name,
for (unsigned i = 0; i < num_params; i++) {
unsigned comps = 4;
_mesa_add_parameter(params, PROGRAM_UNIFORM, name, comps,
- type->gl_type, NULL, NULL);
+ type->gl_type, NULL, NULL, true);
}
/* The first part of the uniform that's processed determines the base
@@ -2582,9 +2582,10 @@ _mesa_associate_uniform_storage(struct gl_context *ctx,
break;
}
+ unsigned pvo = params->ParameterValueOffset[i];
_mesa_uniform_attach_driver_storage(storage, dmul * columns, dmul,
format,
- &params->ParameterValues[i]);
+ &params->ParameterValues[pvo]);
/* When a bindless sampler/image is bound to a texture/image unit, we
* have to overwrite the constant value by the resident handle
@@ -2601,11 +2602,11 @@ _mesa_associate_uniform_storage(struct gl_context *ctx,
if (storage->type->without_array()->is_sampler()) {
assert(unit >= 0 && unit < prog->sh.NumBindlessSamplers);
prog->sh.BindlessSamplers[unit].data =
- &params->ParameterValues[i] + j;
+ &params->ParameterValues[pvo] + 4 * j;
} else if (storage->type->without_array()->is_image()) {
assert(unit >= 0 && unit < prog->sh.NumBindlessImages);
prog->sh.BindlessImages[unit].data =
- &params->ParameterValues[i] + j;
+ &params->ParameterValues[pvo] + 4 * j;
}
}
}