st/mesa: consolidate setting MaxTextureImageUnits
Reviewed-by: Brian Paul <brianp@vmware.com>
This commit is contained in:
@@ -89,25 +89,10 @@ void st_init_limits(struct st_context *st)
|
|||||||
c->MaxArrayTextureLayers
|
c->MaxArrayTextureLayers
|
||||||
= screen->get_param(screen, PIPE_CAP_MAX_TEXTURE_ARRAY_LAYERS);
|
= screen->get_param(screen, PIPE_CAP_MAX_TEXTURE_ARRAY_LAYERS);
|
||||||
|
|
||||||
c->FragmentProgram.MaxTextureImageUnits
|
|
||||||
= _min(screen->get_shader_param(screen, PIPE_SHADER_FRAGMENT,
|
|
||||||
PIPE_SHADER_CAP_MAX_TEXTURE_SAMPLERS),
|
|
||||||
MAX_TEXTURE_IMAGE_UNITS);
|
|
||||||
|
|
||||||
c->VertexProgram.MaxTextureImageUnits
|
|
||||||
= _min(screen->get_shader_param(screen, PIPE_SHADER_VERTEX,
|
|
||||||
PIPE_SHADER_CAP_MAX_TEXTURE_SAMPLERS),
|
|
||||||
MAX_TEXTURE_IMAGE_UNITS);
|
|
||||||
|
|
||||||
c->MaxCombinedTextureImageUnits
|
c->MaxCombinedTextureImageUnits
|
||||||
= _min(screen->get_param(screen, PIPE_CAP_MAX_COMBINED_SAMPLERS),
|
= _min(screen->get_param(screen, PIPE_CAP_MAX_COMBINED_SAMPLERS),
|
||||||
MAX_COMBINED_TEXTURE_IMAGE_UNITS);
|
MAX_COMBINED_TEXTURE_IMAGE_UNITS);
|
||||||
|
|
||||||
c->MaxTextureCoordUnits
|
|
||||||
= _min(c->FragmentProgram.MaxTextureImageUnits, MAX_TEXTURE_COORD_UNITS);
|
|
||||||
|
|
||||||
c->MaxTextureUnits = _min(c->FragmentProgram.MaxTextureImageUnits, c->MaxTextureCoordUnits);
|
|
||||||
|
|
||||||
/* Define max viewport size and max renderbuffer size in terms of
|
/* Define max viewport size and max renderbuffer size in terms of
|
||||||
* max texture size (note: max tex RECT size = max tex 2D size).
|
* max texture size (note: max tex RECT size = max tex 2D size).
|
||||||
* If this isn't true for some hardware we'll need new PIPE_CAP_ queries.
|
* If this isn't true for some hardware we'll need new PIPE_CAP_ queries.
|
||||||
@@ -188,6 +173,11 @@ void st_init_limits(struct st_context *st)
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pc->MaxTextureImageUnits =
|
||||||
|
_min(screen->get_shader_param(screen, sh,
|
||||||
|
PIPE_SHADER_CAP_MAX_TEXTURE_SAMPLERS),
|
||||||
|
MAX_TEXTURE_IMAGE_UNITS);
|
||||||
|
|
||||||
pc->MaxInstructions = pc->MaxNativeInstructions =
|
pc->MaxInstructions = pc->MaxNativeInstructions =
|
||||||
screen->get_shader_param(screen, sh, PIPE_SHADER_CAP_MAX_INSTRUCTIONS);
|
screen->get_shader_param(screen, sh, PIPE_SHADER_CAP_MAX_INSTRUCTIONS);
|
||||||
pc->MaxAluInstructions = pc->MaxNativeAluInstructions =
|
pc->MaxAluInstructions = pc->MaxNativeAluInstructions =
|
||||||
@@ -253,6 +243,12 @@ void st_init_limits(struct st_context *st)
|
|||||||
options->LowerClipDistance = true;
|
options->LowerClipDistance = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* This depends on program constants. */
|
||||||
|
c->MaxTextureCoordUnits
|
||||||
|
= _min(c->FragmentProgram.MaxTextureImageUnits, MAX_TEXTURE_COORD_UNITS);
|
||||||
|
|
||||||
|
c->MaxTextureUnits = _min(c->FragmentProgram.MaxTextureImageUnits, c->MaxTextureCoordUnits);
|
||||||
|
|
||||||
c->VertexProgram.MaxAttribs = MIN2(c->VertexProgram.MaxAttribs, 16);
|
c->VertexProgram.MaxAttribs = MIN2(c->VertexProgram.MaxAttribs, 16);
|
||||||
|
|
||||||
/* PIPE_SHADER_CAP_MAX_INPUTS for the FS specifies the maximum number
|
/* PIPE_SHADER_CAP_MAX_INPUTS for the FS specifies the maximum number
|
||||||
|
Reference in New Issue
Block a user