Commit f40b5723 authored by Marek Olšák's avatar Marek Olšák
Browse files

st/mesa: set the centroid qualifier in fragment shader inputs



This fixes some centroid tests in the EXT_framebuffer_multisample piglit group.
Reviewed-by: default avatarBrian Paul <brianp@vmware.com>
parent 162b3ad9
......@@ -4481,6 +4481,7 @@ st_translate_program(
const ubyte inputSemanticName[],
const ubyte inputSemanticIndex[],
const GLuint interpMode[],
const GLboolean is_centroid[],
GLuint numOutputs,
const GLuint outputMapping[],
const ubyte outputSemanticName[],
......@@ -4522,10 +4523,11 @@ st_translate_program(
*/
if (procType == TGSI_PROCESSOR_FRAGMENT) {
for (i = 0; i < numInputs; i++) {
t->inputs[i] = ureg_DECL_fs_input(ureg,
inputSemanticName[i],
inputSemanticIndex[i],
interpMode[i]);
t->inputs[i] = ureg_DECL_fs_input_cyl_centroid(ureg,
inputSemanticName[i],
inputSemanticIndex[i],
interpMode[i], 0,
is_centroid[i]);
}
if (proginfo->InputsRead & FRAG_BIT_WPOS) {
......
......@@ -45,6 +45,7 @@ enum pipe_error st_translate_program(
const ubyte inputSemanticName[],
const ubyte inputSemanticIndex[],
const GLuint interpMode[],
const GLboolean is_centroid[],
GLuint numOutputs,
const GLuint outputMapping[],
const ubyte outputSemanticName[],
......
......@@ -347,6 +347,7 @@ st_translate_vertex_program(struct st_context *st,
NULL, /* input semantic name */
NULL, /* input semantic index */
NULL, /* interp mode */
NULL, /* is centroid */
/* outputs */
stvp->num_outputs,
stvp->result_to_output,
......@@ -484,6 +485,7 @@ st_translate_fragment_program(struct st_context *st,
ubyte input_semantic_name[PIPE_MAX_SHADER_INPUTS];
ubyte input_semantic_index[PIPE_MAX_SHADER_INPUTS];
GLboolean is_centroid[PIPE_MAX_SHADER_INPUTS];
uint fs_num_inputs = 0;
ubyte fs_output_semantic_name[PIPE_MAX_SHADER_OUTPUTS];
......@@ -537,6 +539,7 @@ st_translate_fragment_program(struct st_context *st,
const GLuint slot = fs_num_inputs++;
inputMapping[attr] = slot;
is_centroid[slot] = (stfp->Base.IsCentroid & BITFIELD64_BIT(attr)) != 0;
switch (attr) {
case FRAG_ATTRIB_WPOS:
......@@ -716,6 +719,7 @@ st_translate_fragment_program(struct st_context *st,
input_semantic_name,
input_semantic_index,
interpMode,
is_centroid,
/* outputs */
fs_num_outputs,
outputMapping,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment