Bug 4967 - Vertex and fragment program handling shoudl be unified
Summary: Vertex and fragment program handling shoudl be unified
Status: RESOLVED FIXED
Alias: None
Product: Mesa
Classification: Unclassified
Component: Mesa core (show other bugs)
Version: git
Hardware: All All
: high normal
Assignee: mesa-dev
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-11-04 17:33 UTC by Ian Romanick
Modified: 2009-08-24 12:23 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments
First pass at unifying vertex and fragment program handling (80.20 KB, patch)
2005-11-04 18:25 UTC, Ian Romanick
Details | Splinter Review
Second pass at unifying vertex and fragment program handling (82.52 KB, patch)
2005-11-04 18:45 UTC, Ian Romanick
Details | Splinter Review

Description Ian Romanick 2005-11-04 17:33:51 UTC
The instruction sets handled by ARB_vertex_program and ARB_fragment_program are
nearly idential.  They are even more similar when NV_vertex_program3 and
NV_fragment_program2 are layered on them.  The internal handling of the programs
(i.e., the representation of the instructions and their parameters) should be
unified.
Comment 1 Ian Romanick 2005-11-04 18:25:31 UTC
Created attachment 3710 [details] [review]
First pass at unifying vertex and fragment program handling

The old {fp,vp}_{program,src_register,dst_register} structures were merged into
new prog_{program,src_register,dst_register} structures.  This adds about 80
lines of code, but pretty much all of the added lines are comments.

I have verified that this code works with serveral of the vertex and fragment
programs in progs/tests.

The next step is to refactor some of the code that operates on these
structures.
Comment 2 Ian Romanick 2005-11-04 18:45:21 UTC
Created attachment 3711 [details] [review]
Second pass at unifying vertex and fragment program handling

This patch fixes a problem with the number of bits allocated to Precision in
the previous patch.

It also replaces _mesa_init_(vp|fp)_instruction with _mesa_init_instruction. 
This eliminates about 20 lines of code versus the previous patch.
Comment 3 Brian Paul 2005-11-05 07:43:36 UTC
Ian, I'm working on the same thing.  I'll see about merging your changes with my
local changes...
Comment 4 Brian Paul 2005-11-05 09:12:51 UTC
I've checked in your patch, plus unification of the vertex/fragment program
opcodes.  Closing this report now, though there's more follow-on work to be
done, like unifying struct vertex_program and struct fragment_program (or at
least moving common fields into the base program class).
Comment 5 Adam Jackson 2009-08-24 12:23:33 UTC
Mass version move, cvs -> git


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.