* and TGSI generic input indexes, plus input attrib semantic info.
*/
for (attr = 0; attr < VERT_ATTRIB_MAX; attr++) {
- if ((stvp->Base.InputsRead & BITFIELD64_BIT(attr)) != 0) {
+ if ((stvp->Base.info.inputs_read & BITFIELD64_BIT(attr)) != 0) {
input_to_index[attr] = stvp->num_inputs;
stvp->index_to_input[stvp->num_inputs] = attr;
stvp->num_inputs++;
- if ((stvp->Base.DoubleInputsRead & BITFIELD64_BIT(attr)) != 0) {
+ if ((stvp->Base.info.double_inputs_read &
+ BITFIELD64_BIT(attr)) != 0) {
/* add placeholder for second part of a double attribute */
stvp->index_to_input[stvp->num_inputs] = ST_DOUBLE_ATTRIB_PLACEHOLDER;
stvp->num_inputs++;
/* Compute mapping of vertex program outputs to slots.
*/
for (attr = 0; attr < VARYING_SLOT_MAX; attr++) {
- if ((stvp->Base.OutputsWritten & BITFIELD64_BIT(attr)) == 0) {
+ if ((stvp->Base.info.outputs_written & BITFIELD64_BIT(attr)) == 0) {
stvp->result_to_output[attr] = ~0;
}
else {
NULL, /* input semantic name */
NULL, /* input semantic index */
NULL, /* interp mode */
- NULL, /* interp location */
/* outputs */
num_outputs,
stvp->result_to_output,
GLuint inputMapping[VARYING_SLOT_MAX];
GLuint inputSlotToAttr[VARYING_SLOT_MAX];
GLuint interpMode[PIPE_MAX_SHADER_INPUTS]; /* XXX size? */
- GLuint interpLocation[PIPE_MAX_SHADER_INPUTS];
GLuint attr;
GLbitfield64 inputsRead;
struct ureg_program *ureg;
/* Non-GLSL programs: */
if (!stfp->glsl_to_tgsi && !stfp->shader_program) {
- _mesa_remove_output_reads(&stfp->Base.Base, PROGRAM_OUTPUT);
+ _mesa_remove_output_reads(&stfp->Base, PROGRAM_OUTPUT);
if (st->ctx->Const.GLSLFragCoordIsSysVal)
- _mesa_program_fragment_position_to_sysval(&stfp->Base.Base);
+ _mesa_program_fragment_position_to_sysval(&stfp->Base);
/* This determines which states will be updated when the assembly
* shader is bound.
ST_NEW_RENDER_SAMPLERS;
} else {
/* ARB_fp */
- if (stfp->Base.Base.SamplersUsed)
+ if (stfp->Base.SamplersUsed)
stfp->affected_states |= ST_NEW_FS_SAMPLER_VIEWS |
ST_NEW_RENDER_SAMPLERS;
}
/*
* Convert Mesa program inputs to TGSI input register semantics.
*/
- inputsRead = stfp->Base.Base.InputsRead;
+ inputsRead = stfp->Base.info.inputs_read;
for (attr = 0; attr < VARYING_SLOT_MAX; attr++) {
if ((inputsRead & BITFIELD64_BIT(attr)) != 0) {
const GLuint slot = fs_num_inputs++;
inputMapping[attr] = slot;
inputSlotToAttr[slot] = attr;
- if (stfp->Base.IsCentroid & BITFIELD64_BIT(attr))
- interpLocation[slot] = TGSI_INTERPOLATE_LOC_CENTROID;
- else if (stfp->Base.IsSample & BITFIELD64_BIT(attr))
- interpLocation[slot] = TGSI_INTERPOLATE_LOC_SAMPLE;
- else
- interpLocation[slot] = TGSI_INTERPOLATE_LOC_CENTER;
switch (attr) {
case VARYING_SLOT_POS:
* Semantics and mapping for outputs
*/
{
- GLbitfield64 outputsWritten = stfp->Base.Base.OutputsWritten;
+ GLbitfield64 outputsWritten = stfp->Base.info.outputs_written;
/* if z is written, emit that first */
if (outputsWritten & BITFIELD64_BIT(FRAG_RESULT_DEPTH)) {
/* handle remaining outputs (color) */
for (attr = 0; attr < ARRAY_SIZE(outputMapping); attr++) {
const GLbitfield64 written = attr < FRAG_RESULT_MAX ? outputsWritten :
- stfp->Base.Base.SecondaryOutputsWritten;
+ stfp->Base.SecondaryOutputsWritten;
const unsigned loc = attr % FRAG_RESULT_MAX;
if (written & BITFIELD64_BIT(loc)) {
}
if (stfp->shader_program) {
- nir_shader *nir = st_glsl_to_nir(st, &stfp->Base.Base,
- stfp->shader_program,
+ nir_shader *nir = st_glsl_to_nir(st, &stfp->Base, stfp->shader_program,
MESA_SHADER_FRAGMENT);
stfp->tgsi.type = PIPE_SHADER_IR_NIR;
return false;
if (ST_DEBUG & DEBUG_MESA) {
- _mesa_print_program(&stfp->Base.Base);
- _mesa_print_program_parameters(st->ctx, &stfp->Base.Base);
+ _mesa_print_program(&stfp->Base);
+ _mesa_print_program_parameters(st->ctx, &stfp->Base);
debug_printf("\n");
}
if (write_all == GL_TRUE)
ureg_property(ureg, TGSI_PROPERTY_FS_COLOR0_WRITES_ALL_CBUFS, 1);
- if (stfp->Base.FragDepthLayout != FRAG_DEPTH_LAYOUT_NONE) {
- switch (stfp->Base.FragDepthLayout) {
+ if (stfp->Base.info.fs.depth_layout != FRAG_DEPTH_LAYOUT_NONE) {
+ switch (stfp->Base.info.fs.depth_layout) {
case FRAG_DEPTH_LAYOUT_ANY:
ureg_property(ureg, TGSI_PROPERTY_FS_DEPTH_LAYOUT,
TGSI_FS_DEPTH_LAYOUT_ANY);
PIPE_SHADER_FRAGMENT,
ureg,
stfp->glsl_to_tgsi,
- &stfp->Base.Base,
+ &stfp->Base,
/* inputs */
fs_num_inputs,
inputMapping,
input_semantic_name,
input_semantic_index,
interpMode,
- interpLocation,
/* outputs */
fs_num_outputs,
outputMapping,
} else if (stfp->ati_fs)
st_translate_atifs_program(ureg,
stfp->ati_fs,
- &stfp->Base.Base,
+ &stfp->Base,
/* inputs */
fs_num_inputs,
inputMapping,
st_translate_mesa_program(st->ctx,
PIPE_SHADER_FRAGMENT,
ureg,
- &stfp->Base.Base,
+ &stfp->Base,
/* inputs */
fs_num_inputs,
inputMapping,
struct pipe_context *pipe = st->pipe;
struct st_fp_variant *variant = CALLOC_STRUCT(st_fp_variant);
struct pipe_shader_state tgsi = {0};
- struct gl_program_parameter_list *params = stfp->Base.Base.Parameters;
+ struct gl_program_parameter_list *params = stfp->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] =
if (key->bitmap) {
nir_lower_bitmap_options options = {0};
- variant->bitmap_sampler = ffs(~stfp->Base.Base.SamplersUsed) - 1;
+ variant->bitmap_sampler = ffs(~stfp->Base.SamplersUsed) - 1;
options.sampler = variant->bitmap_sampler;
options.swizzle_xxxx = (st->bitmap.tex_format == PIPE_FORMAT_L8_UNORM);
/* glDrawPixels (color only) */
if (key->drawpixels) {
nir_lower_drawpixels_options options = {{0}};
- unsigned samplers_used = stfp->Base.Base.SamplersUsed;
+ unsigned samplers_used = stfp->Base.SamplersUsed;
/* Find the first unused slot. */
variant->drawpix_sampler = ffs(~samplers_used) - 1;
NIR_PASS_V(tgsi.ir.nir, nir_lower_tex, &options);
}
- st_finalize_nir(st, &stfp->Base.Base, tgsi.ir.nir);
+ st_finalize_nir(st, &stfp->Base, tgsi.ir.nir);
if (unlikely(key->external.lower_nv12 || key->external.lower_iyuv)) {
/* This pass needs to happen *after* nir_lower_sampler */
NIR_PASS_V(tgsi.ir.nir, st_nir_lower_tex_src_plane,
- ~stfp->Base.Base.SamplersUsed,
+ ~stfp->Base.SamplersUsed,
key->external.lower_nv12,
key->external.lower_iyuv);
}
if (key->bitmap) {
const struct tgsi_token *tokens;
- variant->bitmap_sampler = ffs(~stfp->Base.Base.SamplersUsed) - 1;
+ variant->bitmap_sampler = ffs(~stfp->Base.SamplersUsed) - 1;
tokens = st_get_bitmap_shader(tgsi.tokens,
st->internal_target,
unsigned scale_const = 0, bias_const = 0, texcoord_const = 0;
/* Find the first unused slot. */
- variant->drawpix_sampler = ffs(~stfp->Base.Base.SamplersUsed) - 1;
+ variant->drawpix_sampler = ffs(~stfp->Base.SamplersUsed) - 1;
if (key->pixelMaps) {
- unsigned samplers_used = stfp->Base.Base.SamplersUsed |
+ unsigned samplers_used = stfp->Base.SamplersUsed |
(1 << variant->drawpix_sampler);
variant->pixelmap_sampler = ffs(~samplers_used) - 1;
assert(!(key->bitmap || key->drawpixels));
tokens = st_tgsi_lower_yuv(tgsi.tokens,
- ~stfp->Base.Base.SamplersUsed,
+ ~stfp->Base.SamplersUsed,
key->external.lower_nv12,
key->external.lower_iyuv);
if (tokens) {
* Convert Mesa program inputs to TGSI input register semantics.
*/
for (attr = 0; attr < VARYING_SLOT_MAX; attr++) {
- if ((prog->InputsRead & BITFIELD64_BIT(attr)) != 0) {
+ if ((prog->info.inputs_read & BITFIELD64_BIT(attr)) != 0) {
const GLuint slot = num_inputs++;
inputMapping[attr] = slot;
/* Also add patch inputs. */
for (attr = 0; attr < 32; attr++) {
- if (prog->PatchInputsRead & (1u << attr)) {
+ if (prog->info.patch_inputs_read & (1u << attr)) {
GLuint slot = num_inputs++;
GLuint patch_attr = VARYING_SLOT_PATCH0 + attr;
* mapping and the semantic information for each output.
*/
for (attr = 0; attr < VARYING_SLOT_MAX; attr++) {
- if (prog->OutputsWritten & BITFIELD64_BIT(attr)) {
+ if (prog->info.outputs_written & BITFIELD64_BIT(attr)) {
GLuint slot = num_outputs++;
outputMapping[attr] = slot;
/* Also add patch outputs. */
for (attr = 0; attr < 32; attr++) {
- if (prog->PatchOutputsWritten & (1u << attr)) {
+ if (prog->info.patch_outputs_written & (1u << attr)) {
GLuint slot = num_outputs++;
GLuint patch_attr = VARYING_SLOT_PATCH0 + attr;
input_semantic_name,
input_semantic_index,
NULL,
- NULL,
/* outputs */
num_outputs,
outputMapping,