summaryrefslogtreecommitdiff
path: root/src/mesa/drivers
diff options
context:
space:
mode:
authorPaul Berry <stereotype441@gmail.com>2013-03-23 10:51:53 -0700
committerPaul Berry <stereotype441@gmail.com>2013-08-01 20:21:26 -0700
commit13022c9c5f3cb67c76ed76eae9cd8a49355874a5 (patch)
tree8ff6407c6b2766ac0c5b462e9120f6001b5a333e /src/mesa/drivers
parent2548092ad80156a407281a124f833a6a93fbf2f3 (diff)
mesa: Refactor copying of linked program data.
This patch creates a single function to copy the the UsesClipDistance flag from gl_shader_program.Vert to gl_vertex_program. Previously this logic was duplicated in the i965-specific function brw_link_shader() and the core mesa function _mesa_ir_link_shader(). This logic will have to be expanded to support geometry shaders, and I don't want to have to update it in two separate places. Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Diffstat (limited to 'src/mesa/drivers')
-rw-r--r--src/mesa/drivers/dri/i965/brw_shader.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_shader.cpp b/src/mesa/drivers/dri/i965/brw_shader.cpp
index 418ea9b033..9a2e8bebfd 100644
--- a/src/mesa/drivers/dri/i965/brw_shader.cpp
+++ b/src/mesa/drivers/dri/i965/brw_shader.cpp
@@ -29,6 +29,7 @@ extern "C" {
#include "brw_fs.h"
#include "glsl/ir_optimization.h"
#include "glsl/glsl_parser_extras.h"
+#include "main/shaderapi.h"
struct gl_shader *
brw_new_shader(struct gl_context *ctx, GLuint name, GLuint type)
@@ -127,10 +128,7 @@ brw_link_shader(struct gl_context *ctx, struct gl_shader_program *shProg)
return false;
prog->Parameters = _mesa_new_parameter_list();
- if (stage == 0) {
- struct gl_vertex_program *vp = (struct gl_vertex_program *) prog;
- vp->UsesClipDistance = shProg->Vert.UsesClipDistance;
- }
+ _mesa_copy_linked_program_data((gl_shader_type) stage, shProg, prog);
void *mem_ctx = ralloc_context(NULL);
bool progress;