freedreno: fix bind_sampler_states when hwcso is NULL

src/gallium/tests/trivial/compute.c expects samplers to be cleaned
when the samplers list is NULL.
Like in radeon, the function behave like when the number of samplers
parameter is set to 0.

[small s/hwsco/hwcso/ typo fix]
Signed-off-by: Rob Clark <robclark@freedesktop.org>
This commit is contained in:
Serge Martin 2015-12-06 15:32:15 +01:00 committed by Rob Clark
parent f32f80e19d
commit e63fec29a1
3 changed files with 9 additions and 0 deletions

View file

@ -106,6 +106,9 @@ fd2_sampler_states_bind(struct pipe_context *pctx,
unsigned shader, unsigned start, unsigned shader, unsigned start,
unsigned nr, void **hwcso) unsigned nr, void **hwcso)
{ {
if (!hwcso)
nr = 0;
if (shader == PIPE_SHADER_FRAGMENT) { if (shader == PIPE_SHADER_FRAGMENT) {
struct fd_context *ctx = fd_context(pctx); struct fd_context *ctx = fd_context(pctx);

View file

@ -149,6 +149,9 @@ fd3_sampler_states_bind(struct pipe_context *pctx,
uint16_t saturate_s = 0, saturate_t = 0, saturate_r = 0; uint16_t saturate_s = 0, saturate_t = 0, saturate_r = 0;
unsigned i; unsigned i;
if (!hwcso)
nr = 0;
for (i = 0; i < nr; i++) { for (i = 0; i < nr; i++) {
if (hwcso[i]) { if (hwcso[i]) {
struct fd3_sampler_stateobj *sampler = struct fd3_sampler_stateobj *sampler =

View file

@ -150,6 +150,9 @@ fd4_sampler_states_bind(struct pipe_context *pctx,
uint16_t saturate_s = 0, saturate_t = 0, saturate_r = 0; uint16_t saturate_s = 0, saturate_t = 0, saturate_r = 0;
unsigned i; unsigned i;
if (!hwcso)
nr = 0;
for (i = 0; i < nr; i++) { for (i = 0; i < nr; i++) {
if (hwcso[i]) { if (hwcso[i]) {
struct fd4_sampler_stateobj *sampler = struct fd4_sampler_stateobj *sampler =