Commit Graph

7247 Commits

Author SHA1 Message Date
Brian 272622a2e0 do bounds check in _slang_push_var_table(), added comment 2007-01-17 18:21:00 -07:00
Brian 2585b74e19 rewrite matrix constructors 2007-01-17 18:06:40 -07:00
Brian 4864aaeb02 handle var size > 4 in _slang_pop_var_table() 2007-01-17 18:02:44 -07:00
Brian eb0c478b17 Rewrite a bunch of constructors. It's now important that the first
constructor for any given type be the one that takes the most parameters
as this is the constructor that'll be used when there's no perfect match
to the caller's arguments.
See the _slang_adapt_call() function for details.
2007-01-17 16:29:51 -07:00
Brian 3a3bb953b6 _slang_gen_function_call_name() now tries to adapt function calls (expand
vectors, insert casts) when a perfect match isn't found.
2007-01-17 16:14:03 -07:00
Brian eabb7e66bd New _slang_adapt_call() function.
This is used to modify function calls (when possible) to make the arguments
map to the function parameters.  This includes "unrolling" vector types
and doing casts.

Example:
   vec2 v2 = vec2(1.2, 3.4)
   ivec3 iv = ivec3(false, v2);
Is converted into:
   ivec3 iv = ivec3(int(false), int(v2[0]), int(v2[1]))
2007-01-17 16:11:50 -07:00
Brian 397b807ad5 code clean-up, re-org. Added IR_F_TO_I support. 2007-01-17 16:05:03 -07:00
Brian bb53124fca added IR_F_TO_I, update comments 2007-01-17 15:58:24 -07:00
Brian 0bad236cfb Added OPCODE_INT to convert 4 floats to 4 ints. 2007-01-17 15:54:14 -07:00
Brian 811f54fa75 Fix/clean-up a number of things related to variable/temporary allocation. 2007-01-17 09:54:31 -07:00
Brian 552a65e454 Implement codegen for the selection operator ( b ? x : y ) 2007-01-16 17:38:39 -07:00
Brian 3596903068 fix typo 2007-01-16 16:53:41 -07:00
Brian 9b5dc1358a when automatically binding vertex attributes, start with attrib 1, not 0 2007-01-16 14:52:22 -07:00
Brian 4f027a33b9 remove dead code 2007-01-16 14:19:37 -07:00
Brian 0f91310bf3 comments 2007-01-16 14:17:57 -07:00
Brian d90c655b05 implement logical or, xor, not 2007-01-16 14:15:05 -07:00
Brian 99e788fe56 some additional vector constructors 2007-01-16 14:10:30 -07:00
Brian 156e583a35 fix _slang_gen_subscript() for the case when a simple vector is accessed as an array: convert index to a swizzle/writemask 2007-01-16 10:45:34 -07:00
Brian f6507157e2 Reimplement the post-increment/decrement functions.
Instead of defining functions with an extra dummy parameter to distinguish
from the pre-incr/decr functions, just use new function names: __postIncr
and __postDecr.
2007-01-15 16:54:38 -07:00
Brian c410994653 Implement the ++var and --var operators, improve some constructors. 2007-01-15 16:38:12 -07:00
Brian 0a097675f1 added vec3 constructor code 2007-01-15 16:34:33 -07:00
Brian 82258b7af3 added IR_ELEMENT 2007-01-15 16:33:54 -07:00
Brian 04ac15fd80 checkpoint: ++, -- and && operators 2007-01-15 15:51:49 -07:00
Brian 83d3ff590d Redo the way array indexes are handled. Resolve storage location at code emit time, not codegen time. 2007-01-15 13:58:45 -07:00
Brian c807169888 remove old globals 2007-01-15 11:10:11 -07:00
Brian a5bbe206a8 comments 2007-01-15 11:08:10 -07:00
Brian 8de3dc1701 Move some global vars into slang_assemble_ctx. 2007-01-15 11:07:46 -07:00
Brian 4f5901b265 fix the subassig, mulassign and divassign cases 2007-01-15 10:35:59 -07:00
Brian 629fd78f79 clean-up slang_allocate_storage() 2007-01-15 10:35:03 -07:00
Brian 691ed5e54b Rework code related to temp register allocation, both for user variables
and expression temporarires.  Much better register utilization now.
Lots of other fixes.
The OpenGL GLSL "orange book" brick shader demo works now.
2007-01-13 14:49:52 -07:00
Brian 5daa99d2a4 slang_variable_scope now stores array of pointers to slang_variables. 2007-01-13 14:47:48 -07:00
Brian 97c7937c65 added another vec4 constructor, updated += operator 2007-01-13 14:46:12 -07:00
Brian 95a441112e Fix a problem with inlined "return" statements. Make some attempt to free temporaries. 2007-01-11 11:22:26 -07:00
Brian 063f3f7fc4 disable some code that'll eventually go away 2007-01-11 11:21:38 -07:00
Brian 749ed66549 new vec3 constructor, replace float_add w/ vec4_add 2007-01-11 11:20:23 -07:00
Brian c8e148e38c tweak output 2007-01-11 11:19:11 -07:00
Brian c0c31024a3 checkpoint: codegen for global vars/constants now working 2007-01-10 13:51:48 -07:00
Brian 88e2dbfd10 checkpoint: codegen for global vars w/ initializers 2007-01-10 13:33:38 -07:00
Brian 8a48f35574 assorted code clean-ups 2007-01-10 12:18:50 -07:00
Brian ee11842bfc fix size bug in _mesa_add_attribute() 2007-01-10 12:18:33 -07:00
Brian 29bff4e12d simplify _mesa_add_state_reference() 2007-01-10 08:37:59 -07:00
Brian 88f7212312 Update _save_VertexAttrib() functions for non-aliasing behaviour. 2007-01-10 08:15:35 -07:00
Brian 01a91eb657 get rid of STATE_USER_ATTRIB/STATE_AUTO_ATTRIB 2007-01-09 19:26:22 -07:00
Brian b7978af693 clean up a bunch of program parameter stuff 2007-01-09 19:17:17 -07:00
Brian 3209c3ed0d Implement vertex attribute binding.
Users can set explicit binding with glBindAttribLocation(), otherwise the
linker will allocate generic attribute slots.
2007-01-09 17:49:24 -07:00
Brian 5e75db12d7 more debug code (disabled) 2007-01-09 17:47:13 -07:00
Brian e8673143ea add code for generic attributes 16..31 2007-01-09 17:46:45 -07:00
Brian 048412473b added _mesa_count_texture_indirections(), _mesa_count_texture_instructions() 2007-01-09 11:00:47 -07:00
Brian 21f99792a9 Moved NumTexInstructions, NumTexIndirections, etc. into gl_program since
they can now apply to vertex programs.
2007-01-09 11:00:21 -07:00
Brian ae80d13f6d remove old comment 2007-01-09 10:10:59 -07:00