i965: Set up sampler numbers in the FS backend.
+10 piglits
This commit is contained in:
parent
a32893221c
commit
2999a44968
|
@ -34,6 +34,7 @@ extern "C" {
|
||||||
#include "program/prog_parameter.h"
|
#include "program/prog_parameter.h"
|
||||||
#include "program/prog_print.h"
|
#include "program/prog_print.h"
|
||||||
#include "program/prog_optimize.h"
|
#include "program/prog_optimize.h"
|
||||||
|
#include "program/sampler.h"
|
||||||
#include "program/hash_table.h"
|
#include "program/hash_table.h"
|
||||||
#include "brw_context.h"
|
#include "brw_context.h"
|
||||||
#include "brw_eu.h"
|
#include "brw_eu.h"
|
||||||
|
@ -387,6 +388,7 @@ public:
|
||||||
this->c = c;
|
this->c = c;
|
||||||
this->p = &c->func;
|
this->p = &c->func;
|
||||||
this->brw = p->brw;
|
this->brw = p->brw;
|
||||||
|
this->fp = brw->fragment_program;
|
||||||
this->intel = &brw->intel;
|
this->intel = &brw->intel;
|
||||||
this->ctx = &intel->ctx;
|
this->ctx = &intel->ctx;
|
||||||
this->mem_ctx = talloc_new(NULL);
|
this->mem_ctx = talloc_new(NULL);
|
||||||
|
@ -456,6 +458,7 @@ public:
|
||||||
int setup_uniform_values(int loc, const glsl_type *type);
|
int setup_uniform_values(int loc, const glsl_type *type);
|
||||||
|
|
||||||
struct brw_context *brw;
|
struct brw_context *brw;
|
||||||
|
const struct gl_fragment_program *fp;
|
||||||
struct intel_context *intel;
|
struct intel_context *intel;
|
||||||
GLcontext *ctx;
|
GLcontext *ctx;
|
||||||
struct brw_wm_compile *c;
|
struct brw_wm_compile *c;
|
||||||
|
@ -550,7 +553,6 @@ fs_visitor::variable_storage(ir_variable *var)
|
||||||
int
|
int
|
||||||
fs_visitor::setup_uniform_values(int loc, const glsl_type *type)
|
fs_visitor::setup_uniform_values(int loc, const glsl_type *type)
|
||||||
{
|
{
|
||||||
const struct gl_program *fp = &this->brw->fragment_program->Base;
|
|
||||||
unsigned int offset = 0;
|
unsigned int offset = 0;
|
||||||
float *vec_values;
|
float *vec_values;
|
||||||
|
|
||||||
|
@ -571,7 +573,7 @@ fs_visitor::setup_uniform_values(int loc, const glsl_type *type)
|
||||||
case GLSL_TYPE_UINT:
|
case GLSL_TYPE_UINT:
|
||||||
case GLSL_TYPE_INT:
|
case GLSL_TYPE_INT:
|
||||||
case GLSL_TYPE_BOOL:
|
case GLSL_TYPE_BOOL:
|
||||||
vec_values = fp->Parameters->ParameterValues[loc];
|
vec_values = fp->Base.Parameters->ParameterValues[loc];
|
||||||
for (unsigned int i = 0; i < type->vector_elements; i++) {
|
for (unsigned int i = 0; i < type->vector_elements; i++) {
|
||||||
c->prog_data.param[c->prog_data.nr_params++] = &vec_values[i];
|
c->prog_data.param[c->prog_data.nr_params++] = &vec_values[i];
|
||||||
}
|
}
|
||||||
|
@ -1045,6 +1047,12 @@ fs_visitor::visit(ir_texture *ir)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
inst->sampler =
|
||||||
|
_mesa_get_sampler_uniform_value(ir->sampler,
|
||||||
|
ctx->Shader.CurrentProgram,
|
||||||
|
&brw->fragment_program->Base);
|
||||||
|
inst->sampler = c->fp->program.Base.SamplerUnits[inst->sampler];
|
||||||
|
|
||||||
this->result = dst;
|
this->result = dst;
|
||||||
|
|
||||||
if (ir->shadow_comparitor)
|
if (ir->shadow_comparitor)
|
||||||
|
|
Loading…
Reference in New Issue