diff options
author | Kenneth Graunke <kenneth@whitecape.org> | 2016-07-14 16:52:10 -0700 |
---|---|---|
committer | Kenneth Graunke <kenneth@whitecape.org> | 2016-07-17 19:26:53 -0700 |
commit | 7ef7738a61ded5632105b8de6f8141307592e20a (patch) | |
tree | 0e8aa05531fc5b7bc2e432d110596dfa0af64b6f /src/mesa/drivers/dri/i965/brw_fs.cpp | |
parent | a03812c32188f6d29d386165ca02771fe0865352 (diff) |
i965: Write gl_FragCoord directly to the destination.
This patch makes emit_general_interpolation take a destination register
as an argument, and write directly to that. This is simpler than the
old approach of ralloc'ing a register, writing to that temporary, and
then making the caller emit per-component MOVs to copy it to the actual
destination.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Timothy Arceri <timothy.arceri@collabora.com>
Diffstat (limited to 'src/mesa/drivers/dri/i965/brw_fs.cpp')
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_fs.cpp | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_fs.cpp b/src/mesa/drivers/dri/i965/brw_fs.cpp index 940f425b98e..7316247dbd2 100644 --- a/src/mesa/drivers/dri/i965/brw_fs.cpp +++ b/src/mesa/drivers/dri/i965/brw_fs.cpp @@ -1039,12 +1039,10 @@ fs_visitor::import_uniforms(fs_visitor *v) this->uniforms = v->uniforms; } -fs_reg * -fs_visitor::emit_fragcoord_interpolation() +void +fs_visitor::emit_fragcoord_interpolation(fs_reg wpos) { assert(stage == MESA_SHADER_FRAGMENT); - fs_reg *reg = new(this->mem_ctx) fs_reg(vgrf(glsl_type::vec4_type)); - fs_reg wpos = *reg; /* gl_FragCoord.x */ bld.MOV(wpos, this->pixel_x); @@ -1066,8 +1064,6 @@ fs_visitor::emit_fragcoord_interpolation() /* gl_FragCoord.w: Already set up in emit_interpolation */ bld.MOV(wpos, this->wpos_w); - - return reg; } static enum brw_barycentric_mode |