mesa/st: move things around a bit in st_create_fp_variant()
Prep work for next patch. Signed-off-by: Rob Clark <robclark@freedesktop.org> Reviewed-by: Marek Olšák <marek.olsak@amd.com>
This commit is contained in:
@@ -870,6 +870,13 @@ st_create_fp_variant(struct st_context *st,
|
|||||||
struct pipe_context *pipe = st->pipe;
|
struct pipe_context *pipe = st->pipe;
|
||||||
struct st_fp_variant *variant = CALLOC_STRUCT(st_fp_variant);
|
struct st_fp_variant *variant = CALLOC_STRUCT(st_fp_variant);
|
||||||
struct pipe_shader_state tgsi = {0};
|
struct pipe_shader_state tgsi = {0};
|
||||||
|
struct gl_program_parameter_list *params = stfp->Base.Base.Parameters;
|
||||||
|
static const gl_state_index texcoord_state[STATE_LENGTH] =
|
||||||
|
{ STATE_INTERNAL, STATE_CURRENT_ATTRIB, VERT_ATTRIB_TEX0 };
|
||||||
|
static const gl_state_index scale_state[STATE_LENGTH] =
|
||||||
|
{ STATE_INTERNAL, STATE_PT_SCALE };
|
||||||
|
static const gl_state_index bias_state[STATE_LENGTH] =
|
||||||
|
{ STATE_INTERNAL, STATE_PT_BIAS };
|
||||||
|
|
||||||
if (!variant)
|
if (!variant)
|
||||||
return NULL;
|
return NULL;
|
||||||
@@ -930,7 +937,6 @@ st_create_fp_variant(struct st_context *st,
|
|||||||
if (key->drawpixels) {
|
if (key->drawpixels) {
|
||||||
const struct tgsi_token *tokens;
|
const struct tgsi_token *tokens;
|
||||||
unsigned scale_const = 0, bias_const = 0, texcoord_const = 0;
|
unsigned scale_const = 0, bias_const = 0, texcoord_const = 0;
|
||||||
struct gl_program_parameter_list *params = stfp->Base.Base.Parameters;
|
|
||||||
|
|
||||||
/* Find the first unused slot. */
|
/* Find the first unused slot. */
|
||||||
variant->drawpix_sampler = ffs(~stfp->Base.Base.SamplersUsed) - 1;
|
variant->drawpix_sampler = ffs(~stfp->Base.Base.SamplersUsed) - 1;
|
||||||
@@ -943,21 +949,11 @@ st_create_fp_variant(struct st_context *st,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (key->scaleAndBias) {
|
if (key->scaleAndBias) {
|
||||||
static const gl_state_index scale_state[STATE_LENGTH] =
|
|
||||||
{ STATE_INTERNAL, STATE_PT_SCALE };
|
|
||||||
static const gl_state_index bias_state[STATE_LENGTH] =
|
|
||||||
{ STATE_INTERNAL, STATE_PT_BIAS };
|
|
||||||
|
|
||||||
scale_const = _mesa_add_state_reference(params, scale_state);
|
scale_const = _mesa_add_state_reference(params, scale_state);
|
||||||
bias_const = _mesa_add_state_reference(params, bias_state);
|
bias_const = _mesa_add_state_reference(params, bias_state);
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
texcoord_const = _mesa_add_state_reference(params, texcoord_state);
|
||||||
static const gl_state_index state[STATE_LENGTH] =
|
|
||||||
{ STATE_INTERNAL, STATE_CURRENT_ATTRIB, VERT_ATTRIB_TEX0 };
|
|
||||||
|
|
||||||
texcoord_const = _mesa_add_state_reference(params, state);
|
|
||||||
}
|
|
||||||
|
|
||||||
tokens = st_get_drawpix_shader(tgsi.tokens,
|
tokens = st_get_drawpix_shader(tgsi.tokens,
|
||||||
st->needs_texcoord_semantic,
|
st->needs_texcoord_semantic,
|
||||||
|
Reference in New Issue
Block a user