summaryrefslogtreecommitdiff
path: root/src/mesa/shader/slang/slang_link.c
AgeCommit message (Collapse)AuthorFilesLines
2010-06-10mesa: move shader/slang/* sources to main/slang/*Brian Paul1-1124/+0
Reduce the source tree depth a bit.
2010-06-10mesa: move uniforms.c to main/Brian Paul1-1/+1
2010-06-10mesa: refactor shader api / object codeBrian Paul1-2/+4
Remove the unneeded ctx->Driver hooks for shader-related functions. Move state and API-related things into main/.
2010-06-02glsl: handle indirectly indexed input registers in linkerBrian Paul1-29/+108
For example, if the fragment shader reads gl_TexCoord[i] with a dynamic index we need to set all the InputsRead bits for all texcoords. We were already doing this for shader outputs. Refactored the later code so inputs and outputs are handled with similar code. Fixes a swrast failure with piglit's glsl-texcoord-array.shader_test
2010-05-24mesa: Handle FEATURE_es2_glsl differences at runtime tooKristian Høgsberg1-7/+9
Now that we can support different APIs at runtime, we need to check the context for the API we're currently providing as well. https://bugs.freedesktop.org/show_bug.cgi?id=28194
2010-05-01glsl: s/sprintf/_mesa_snprintf/Vinson Lee1-2/+3
2010-04-29mesa: Don't overwrite a driver's shader infolog with generic failure message.Eric Anholt1-1/+4
2010-04-01glsl: fix bad return value in link_transform_feedback()Brian Paul1-1/+1
2010-04-01glsl: do extra link checking for transform feedbackBrian Paul1-3/+83
2010-04-01glsl: append built-in, used varying vars to the varying vars listBrian Paul1-0/+27
2010-04-01glsl: pass datatype to _mesa_add_varying()Brian Paul1-1/+1
Will be needed later for transform feedback support.
2010-02-19mesa: restore _mesa_snprintf() - it's needed for WindowsBrian Paul1-2/+2
This reverts part of commit 298be2b028263b2c343a707662c6fbfa18293cb2
2010-02-19Replace the _mesa_*printf() wrappers with the plain libc versionsKristian Høgsberg1-13/+13
2010-02-19Replace _mesa_malloc, _mesa_calloc and _mesa_free with plain libc versionsKristian Høgsberg1-13/+13
2010-02-19Remove _mesa_memcpy in favor of plain memcpy.Kenneth Graunke1-1/+1
This may break the SUNOS4 build, but it's no longer relevant.
2010-02-19Remove _mesa_strlen in favor of plain strlen.Kenneth Graunke1-1/+1
2010-02-19Remove _mesa_strstr in favor of plain strstr.Kenneth Graunke1-1/+1
2010-02-14glsl: use new program cloning functionsBrian Paul1-2/+2
2010-02-04mesa: change ctx->Driver.ProgramStringNotify() to return GLbooleanBrian Paul1-5/+12
GL_TRUE indicates that the driver accepts the program. GL_FALSE indicates the program can't be compiled/translated by the driver for some reason (too many resources used, etc). Propogate this result up to the GL API: set GL_INVALID_OPERATION error if glProgramString() was called. Set shader program link status to GL_FALSE if glLinkProgram() was called. At this point, drivers still don't do any program checking and always return GL_TRUE.
2010-01-22Merge branch 'mesa_7_7_branch'Brian Paul1-1/+0
Conflicts: src/gallium/auxiliary/draw/draw_context.c src/gallium/auxiliary/draw/draw_pt_fetch_shade_pipeline.c src/gallium/auxiliary/pipebuffer/Makefile src/gallium/auxiliary/pipebuffer/SConscript src/gallium/auxiliary/pipebuffer/pb_buffer_fenced.c src/gallium/auxiliary/tgsi/tgsi_scan.c src/gallium/drivers/i915/i915_surface.c src/gallium/drivers/i915/i915_texture.c src/gallium/drivers/llvmpipe/lp_setup.c src/gallium/drivers/llvmpipe/lp_tex_sample_c.c src/gallium/drivers/llvmpipe/lp_texture.c src/gallium/drivers/softpipe/sp_prim_vbuf.c src/gallium/state_trackers/xorg/xorg_dri2.c src/gallium/winsys/drm/intel/gem/intel_drm_api.c src/gallium/winsys/drm/nouveau/drm/nouveau_drm_api.c src/gallium/winsys/drm/radeon/core/radeon_drm.c src/gallium/winsys/drm/vmware/core/vmw_screen_dri.c src/mesa/state_tracker/st_cb_clear.c
2010-01-16glsl: Remove unnecessary header from slang_link.c.Vinson Lee1-1/+0
2009-11-23slang: Be more robust with memory in concat_shaders().Michal Krol1-3/+19
2009-11-17Merge branch 'outputswritten64'Ian Romanick1-10/+15
Add a GLbitfield64 type and several macros to operate on 64-bit fields. The OutputsWritten field of gl_program is changed to use that type. This results in a fair amount of fallout in drivers that use programs. No changes are strictly necessary at this point as all bits used are below the 32-bit boundary. Fairly soon several bits will be added for clip distances written by a vertex shader. This will cause several bits used for varyings to be pushed above the 32-bit boundary. This will affect any drivers that support GLSL. At this point, only the i965 driver has been modified to support this eventuality. I did this as a "squash" merge. There were several places through the outputswritten64 branch where things were broken. I foresee this causing difficulties later for bisecting. The history is still available in the branch. Conflicts: src/mesa/drivers/dri/i965/brw_wm.h
2009-10-27glsl: fix memory leakBrian Paul1-2/+6
A slightly modified version of a patch from Vinson Lee.
2009-10-01glsl: fix mem leakBrian Paul1-0/+1
2009-09-15Merge branch 'mesa_7_5_branch' into mesa_7_6_branchBrian Paul1-0/+28
2009-09-14glsl: remove extra #version directives from concatenated shader sourcesBrian Paul1-0/+28
When we concatenate shaders to do our form of poor-man linking, if there's multiple #version directives, preprocessing fails. This change disables the extra #version directives by changing the first two chars to //. This should help with some Wine issues such as bug 23946.
2009-08-25glsl: update a texture/sampler commentBrian Paul1-1/+1
2009-08-13glsl: fix incorrect attribute sizeBrian Paul1-1/+1
2009-08-12Merge branch 'new-frag-attribs'Brian Paul1-14/+0
This branch introduces new FRAG_ATTRIB_FACE and FRAG_ATTRIB_PNTC fragment program inputs for GLSL gl_FrontFacing and gl_PointCoord. Before, these attributes were packed with the FOG attribute. That made things complicated elsewhere.
2009-08-12glsl: add gl_Vertex, gl_Normal, etc to list of active attributesBrian Paul1-0/+19
If a vertex shader uses gl_Vertex, gl_Normal, etc, we need to include them when the user queries the list of active attributes. Before this we were just including the user-defined attributes.
2009-08-12glsl: move predefined shader input/output info/code to slang_builtin.cBrian Paul1-0/+1
This is a more logical place for this code. Also add some functions for querying vertex shader input names, types, etc.
2009-07-29mesa: add new FRAG_ATTRIB_FACE and FRAG_ATTRIB_PNTC fragment program inputsBrian Paul1-14/+0
Previously, the FOGC attribute contained the fragment fog coord, front/back- face flag and the gl_PointCoord.xy values. Now each of those things are separate fragment program attributes. This simplifies quite a few things in Mesa and gallium. Need to test i965 driver and fix up point coord handling in the gallium/draw module...
2009-06-26glsl: check number of varying variables against the limitBrian Paul1-4/+9
Link fails if too many varying vars. (cherry picked from master, commit cc58fbcf2c5c88f406818db60910f537e03610d6)
2009-06-22mesa: rename MAX_VERTEX_ATTRIBS to MAX_VERTEX_GENERIC_ATTRIBSBrian Paul1-4/+4
Be clearer that this is the number of generic vertex program/shader attributes, not counting the legacy attributes (pos, normal, color, etc). (cherry picked from commit 4a95185c9f30c2de7a03bb1a0653f51b53b1111d)
2009-06-17glsl: call _mesa_postprocess_program(), disabledBrian Paul1-0/+8
2009-05-22mesa: rename MAX_VERTEX_ATTRIBS to MAX_VERTEX_GENERIC_ATTRIBSBrian Paul1-4/+4
Be clearer that this is the number of generic vertex program/shader attributes, not counting the legacy attributes (pos, normal, color, etc).
2009-05-08glsl: check number of varying variables against the limitBrian Paul1-4/+9
Link fails if too many varying vars.
2009-05-08glsl: set vertex/fragment program Ids to aid with debuggingBrian Paul1-0/+4
2009-04-02glsl: fix segfault in linker when vertex or fragment shader was missingBrian Paul1-9/+14
2009-04-01glsl: implement compiling/linking of separate compilation unitsBrian Paul1-17/+115
A shader program may consist of multiple shaders (source code units). If we find there are unresolved functions after compiling the unit that defines main(), we'll concatenate all the respective vertex or fragment shaders then recompile. This isn't foolproof but should work in most cases.
2009-02-28mesa: rename, reorder FRAG_RESULT_x tokensBrian Paul1-1/+1
s/FRAG_RESULT_DEPR/FRAG_RESULT_DEPTH/ s/FRAG_RESULT_COLR/FRAG_RESULT/COLOR/ Remove FRAG_RESULT_COLH (NV half-precision) output since we never used it. Next, we might merge the COLOR and DATA outputs (COLOR0, COLOR1, etc).
2009-02-20glsl: use new IR opcodes for TEX instructions with shadow comparisonBrian Paul1-0/+3
Such TEX instructions will have the TexShadow flag set. The gl_program::ShadowSamplers field is now set in the linker. We missed that before.
2009-02-18glsl: fix link failure for variable-indexed varying output arraysBrian Paul1-0/+25
If the vertex shader writes to a varying array with a variable index, mark all the elements of that array as being written. For example, if the vertex shader does: for (i = 0; i < 4; i++) gl_TexCoord[i] = expr; Mark all texcoord outputs as being written, not just the first. Linking will fail if a fragment shader tries to read an input that's not written by the vertex shader. Before this fix, this linker test could fail.
2009-02-09mesa: merge gallium-0.2 into gallium-master-mergeBrian Paul1-1/+0
Merge commit 'origin/gallium-0.2' into gallium-master-merge Conflicts: Makefile docs/relnotes-7.4.html docs/relnotes.html src/mesa/drivers/dri/i965/brw_wm.h src/mesa/main/imports.c src/mesa/main/mtypes.h src/mesa/main/texcompress.c src/mesa/main/texenvprogram.c src/mesa/main/version.h src/mesa/vbo/vbo_exec_api.c src/mesa/vbo/vbo_save_draw.c
2009-02-06glsl: new MESA_GLSL env var for GLSL debugging featuresBrian Paul1-8/+11
Replaces the VERBOSE_GLSL, VERBOSE_GLSL_DUMP flags which only worked in debug builds. MESA_GLSL will work both in debug and non-debug builds. Also add facility to dump glUniform() calls to stdout.
2009-02-06Revert "mesa: meaningless whitespace change to see if git's working (ignore)"Brian Paul1-12/+8
This reverts commit b2e779988eeb595187933fe2122d86f8ccfe059c. I didn't mean to push this stuff yet. I'm having a bad git day...
2009-02-06mesa: meaningless whitespace change to see if git's working (ignore)Brian Paul1-8/+12
2009-02-02mesa: fix GLSL issue preventing use of all 16 generic vertex attributesBrian Paul1-2/+11
Only 15 actually worked before since we always reserved generic[0] as an alias for vertex position. The case of vertex attribute 0 is tricky. The spec says that there is no aliasing between generic vertex attributes 0..MAX_VERTEX_ATTRIBS-1 and the conventional attributes. But it also says that calls to glVertexAttrib(0, v) are equivalent to glVertex(v). The distinction seems to be in glVertex-mode versus vertex array mode. So update the VBO code so that if the shader uses generic[0] but not gl_Vertex, route the attribute data set with glVertex() to go to shader input generic[0]. No change needed for the glDrawArrays/Elements() path. This is a potentially risky change so regressions are possible. All the usual tests seem OK though.
2009-01-16Merge commit 'origin/master' into gallium-0.2Alan Hourihane1-2/+2
Conflicts: src/mesa/shader/slang/slang_compile.c