aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/state_tracker/st_context.c
Commit message (Collapse)AuthorAgeFilesLines
* s/Tungsten Graphics/VMware/José Fonseca2014-01-171-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Tungsten Graphics Inc. was acquired by VMware Inc. in 2008. Leaving the old copyright name is creating unnecessary confusion, hence this change. This was the sed script I used: $ cat tg2vmw.sed # Run as: # # git reset --hard HEAD && find include scons src -type f -not -name 'sed*' -print0 | xargs -0 sed -i -f tg2vmw.sed # # Rename copyrights s/Tungsten Gra\(ph\|hp\)ics,\? [iI]nc\.\?\(, Cedar Park\)\?\(, Austin\)\?\(, \(Texas\|TX\)\)\?\.\?/VMware, Inc./g /Copyright/s/Tungsten Graphics\(,\? [iI]nc\.\)\?\(, Cedar Park\)\?\(, Austin\)\?\(, \(Texas\|TX\)\)\?\.\?/VMware, Inc./ s/TUNGSTEN GRAPHICS/VMWARE/g # Rename emails s/[email protected]/[email protected]/ s/[email protected]/[email protected]/g s/jrfonseca-at-tungstengraphics-dot-com/jfonseca-at-vmware-dot-com/ s/jrfonseca\[email protected]/[email protected]/g s/keithw\[email protected]/[email protected]/g s/[email protected]/[email protected]/g s/thomas-at-tungstengraphics-dot-com/thellstom-at-vmware-dot-com/ s/[email protected]/[email protected]/ # Remove dead links s@Tungsten Graphics (http://www.tungstengraphics.com)@Tungsten Graphics@g # C string src/gallium/state_trackers/vega/api_misc.c s/"Tungsten Graphics, Inc"/"VMware, Inc"/ Reviewed-by: Brian Paul <[email protected]>
* implement NV_vdpau_interop v7Christian König2013-10-261-0/+3
| | | | | | | | | | | | | | | | | | | v2: Actually implement interop between the gallium state tracker and the VDPAU backend. v3: Make it also available in non legacy contexts, fix video buffer sharing. v4: deny interop if we don't have the same screen object v5: rebased on upstream changes v6: implemented VDPAUGetSurfaceivNV, improved error handling, unregister all surfaces in VDPAUFiniNV v7: squash merge with Mareks changes Signed-off-by: Christian König <[email protected]>
* st/mesa: add a few comments in st_create_context_priv()Brian Paul2013-10-171-1/+5
|
* mesa: renumber shader indices according to their placement in pipelineMarek Olšák2013-07-021-5/+0
| | | | | | | | | See my explanation in mtypes.h. v2: don't do this in gallium v3: also updated the comment at the gl_shader_type definition Reviewed-by: Ian Romanick <[email protected]>
* mesa: Move the mvp_with_dp4 flag to ShaderCompilerOptions.Kenneth Graunke2013-05-121-1/+1
| | | | | | | | | | | | | | | This flag essentially tells the compiler whether it prefers dot products or multiply/adds for matrix operations. As such, ShaderCompilerOptions seems like the right place for it. This also lets us specify it on a per-stage basis. This patch makes all existing users set the flag for the Vertex Shader stage only, as it's currently only used for fixed-function vertex programs. That will change soon, and I wanted to preserve the existing behavior. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* mesa: add & use a new driver flag for UBO updates instead of _NEW_BUFFER_OBJECTMarek Olšák2013-05-111-0/+1
| | | | | | | v2: move the flagging from intel_bufferobj_data to intel_bufferobj_alloc_buffer Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* mesa: convert _NEW_RASTERIZER_DISCARD to a driver flagMarek Olšák2013-04-241-0/+1
| | | | | Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* st/mesa: optionally apply texture swizzle to border color v2Christoph Bumiller2013-04-181-0/+4
| | | | | | | | | | | | This is the only sane solution for nv50 and nvc0 (really, trust me), but since on other hardware the border colour is tightly coupled with texture state they'd have to undo the swizzle, so I've added a cap. The dependency of update_sampler on the texture updates was introduced to avoid doing the apply_depthmode to the swizzle twice. v2: Moved swizzling helper to u_format.c, extended the CAP to provide more accurate information.
* st/mesa: add support for get sample positionDave Airlie2013-04-111-0/+2
| | | | | | | This just calls into the gallium interface. Reviewed-by: Marek Olšák <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* gallium,st/mesa: don't use blit-based transfers with software rasterizersMarek Olšák2013-03-231-0/+2
| | | | | | | | | The blit-based paths for TexImage, GetTexImage, and ReadPixels aren't very fast with software rasterizer. Now Gallium drivers have the ability to turn them off. Reviewed-by: Brian Paul <[email protected]> Tested-by: Brian Paul <[email protected]>
* gallium: add TGSI_SEMANTIC_TEXCOORD,PCOORD v3Christoph Bumiller2013-03-201-0/+3
| | | | | | | | | | | | | | | This makes it possible to identify gl_TexCoord and gl_PointCoord for drivers where sprite coordinate replacement is restricted. The new PIPE_CAP_TGSI_TEXCOORD decides whether these varyings should be hidden behind the GENERIC semantic or not. With this patch only nvc0 and nv30 will request that they be used. v2: introduce a CAP so other drivers don't have to bother with the new semantic v3: adapt to introduction gl_varying_slot enum
* st/mesa: remove what is left from u_blitMarek Olšák2013-02-181-2/+0
| | | | Reviewed-by: Brian Paul <[email protected]>
* st/mesa: emit saturates in the vertex shader if Shader Model 3.0 is supportedMarek Olšák2013-02-061-0/+1
| | | | v2: change the requirement from GLSL 1.30 to SM 3.0 (R500 can do this)
* mesa: Make the drivers call a non-code-generated dispatch table setup.Eric Anholt2013-01-211-1/+1
| | | | | | | I want to drive the Save dispatch table setup from this same function. Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* drivers: compute version and then initialize exec tableJordan Justen2012-12-161-0/+8
| | | | | | | | This change forces the context version to be computed before initilizing the exec dispatch tables. Signed-off-by: Jordan Justen <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* st/mesa: remove a weird msaa hackMarek Olšák2012-12-121-17/+0
| | | | | | It doesn't work and it's not clear how it's supposed to work. Reviewed-by: Brian Paul <[email protected]>
* gallium: add start_slot parameter to set_vertex_buffersMarek Olšák2012-10-311-1/+2
| | | | | | | | | | | | | | | | | | | | | This allows updating only a subrange of buffer bindings. set_vertex_buffers(pipe, start_slot, count, NULL) unbinds buffers in that range. Binding NULL resources unbinds buffers too (both buffer and user_buffer must be NULL). The meta ops are adapted to only save, change, and restore the single slot they use. The cso_context can save and restore only one vertex buffer slot. The clients can query which one it is using cso_get_aux_vertex_buffer_slot. It's currently set to 0. (the Draw module breaks if it's set to non-zero) It should decrease the CPU overhead when using a lot of meta ops, but the drivers must be able to treat each vertex buffer slot as a separate state (only r600g does so at the moment). I can imagine this also being useful for optimizing some OpenGL use cases. Reviewed-by: Brian Paul <[email protected]>
* mesa: remove the driverCtx parameter to _mesa_create/initialize_context()Brian Paul2012-10-051-1/+1
| | | | No longer used.
* st/mesa: accept and handle configuration options from st/driVadim Girlin2012-08-231-3/+7
| | | | | | Currently there is a single option - force_glsl_extensions_warn. Signed-off-by: Vadim Girlin <[email protected]>
* st/mesa: use Elements() instead of hard-coded numberBrian Paul2012-08-181-1/+4
| | | | And add a comment about the velems_util_draw[] array.
* st/mesa: combine vertex/fragment sampler state in arraysBrian Paul2012-08-161-9/+6
| | | | | | As with other recent changes, put the vertex and fragment sampler state into arrays indexed by the shader type. This will let us easily add support for other types of shaders in the future.
* st/mesa: rename some vertex/fragment state fields for better consistencyBrian Paul2012-08-061-2/+8
| | | | Reviewed-by: José Fonseca <[email protected]>
* st/mesa: use STATIC_ASSERT in a few placesBrian Paul2012-07-271-3/+3
|
* st/mesa: implement accelerated stencil blitting using shader stencil exportMarek Olšák2012-07-121-0/+2
| | | | Reviewed-by: Alex Deucher <[email protected]>
* st/mesa: use pipe_sampler_view_release() in st_destroy_context_priv()Brian Paul2012-05-191-1/+1
| | | | | | | | Fixes another case of sampler views being created by one context, shared by another, then deleted by the first, leaving a dangling pipe context pointer. Reviewed-by: José Fonseca <[email protected]>
* Merge branch 'gallium-userbuf'Marek Olšák2012-05-111-32/+21
|\ | | | | | | | | | | | | | | Conflicts: src/gallium/docs/source/screen.rst src/gallium/drivers/nv50/nv50_state.c src/gallium/include/pipe/p_defines.h src/mesa/state_tracker/st_draw.c
| * cso: cso_context should install u_vbuf by itself and not st/mesaMarek Olšák2012-04-301-27/+0
| | | | | | | | so that it's installed in the other state trackers too
| * gallium: add void *user_buffer in pipe_vertex_bufferMarek Olšák2012-04-301-5/+0
| | | | | | | | | | | | | | | | | | | | | | | | This reduces CPU overhead in st_draw_vbo and removes a lot of unnecessary code in that function which was required only to comply with the gallium interface, but wasn't any useful really. Adapted drivers: i915, llvmpipe, r300, softpipe. No changes required in: r600, radeonsi. User vertex buffers have been disabled in nv30, nv50, nvc0 and svga to keep things working.
| * st/mesa: make user constant buffers optionalMarek Olšák2012-04-301-0/+11
| |
| * st/mesa: make user index buffers optionalMarek Olšák2012-04-301-0/+10
| | | | | | | | v2: use a separate upload buffer for indices
* | mesa: add gl_context::NewDriverState and use it for vertex arraysMarek Olšák2012-05-081-0/+6
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The vbo module recomputes its states if _NEW_ARRAY is set, so it shouldn't use the same flag to notify the driver. Since we've run out of bits in NewState and NewState is for core Mesa anyway, we need to find another way. This patch is the first to start decoupling the state flags meant only for core Mesa and those only for drivers. The idea is to have two flag sets: - gl_context::NewState - used by core Mesa only - gl_context::NewDriverState - used by drivers only (the flags are defined by the driver and opaque to core Mesa) It makes perfect sense to use NewState|=_NEW_ARRAY to notify the vbo module that the user changed vertex arrays, and the vbo module in turn sets a driver-specific flag to notify the driver that it should update its vertex array bindings. The driver decides which bits of NewDriverState should be set and stores them in gl_context::DriverFlags. Then, Core Mesa can do this: ctx->NewDriverState |= ctx->DriverFlags.NewArray; This patch implements this behavior and adapts st/mesa. DriverFlags.NewArray is set to ST_NEW_VERTEX_ARRAYS. Core Mesa only sets NewDriverState. It's the driver's responsibility to read it whenever it wants and reset it to 0. Reviewed-by: Brian Paul <[email protected]>
* mesa/st: Fix derreference after free.José Fonseca2012-04-251-2/+6
|
* u_vbuf: take advantage of all new vertex fetch capsMarek Olšák2012-04-241-1/+3
|
* gallium: make user vertex buffers optionalMarek Olšák2012-04-241-0/+26
| | | | | | | | | | | This couldn't be split because it would break bisecting. Summary: * r300g,r600g: stop using u_vbuf * r300g,r600g: also report that the FIXED vertex type is unsupported * u_vbuf: refactor for use in the state tracker * cso: wire up u_vbuf with cso_context * st/mesa: conditionally install u_vbuf
* st/mesa: use u_upload_mgr to upload vertices for glBitmapMarek Olšák2012-04-181-0/+3
| | | | instead of recreating the vertex buffer for each draw_vbo call.
* st/mesa: do vertex and fragment color clamping in shadersMarek Olšák2012-01-251-0/+11
| | | | | | | | | | | | | | For ARB_color_buffer_float. Most hardware can't do it and st/mesa is the perfect place for a fallback. The exceptions are: - r500 (vertex clamp only) - nv50 (both) - nvc0 (both) - softpipe (both) We also have to take into account that r300 can do CLAMPED vertex colors only, while r600 can do UNCLAMPED vertex colors only. The difference can be expressed with the two new CAPs.
* mesa: rewrite accum buffer supportBrian Paul2011-12-081-2/+3
| | | | | | | | | | | | | Implemented in terms of renderbuffer mapping/unmapping and format packing/unpacking functions. The swrast and state tracker code for implementing accumulation are unused and will be removed in the next commit. v2: don't use memcpy() in _mesa_clear_accum_buffer() v3: don't allocate MAX_WIDTH arrays, be more careful with mapping flags Reviewed-by: Eric Anholt <[email protected]>
* st/mesa: tell VBO module to always unmap buffers before drawingBrian Paul2011-10-261-0/+4
| | | | | | Without this it's possible to wind up in a draw call with the glBegin/End VBO still in a mapped state. This is a problem for the SVGA3D driver and probably not good for other HW drivers.
* st/mesa: check if _mesa_create_context() returns NULLEmil Velikov2011-07-121-0/+3
| | | | | | | | | | | In some cases _mesa_create_context() can return NULL an in the mesa state tracker, we do not concider the case, which may cause issues within st_create_context_priv() This patch adds a simple check (similar to the one in the dri drivers) Signed-off-by: Emil Velikov <[email protected]> Signed-off-by: Brian Paul <[email protected]>
* st/mesa: overhaul vertex/fragment sampler and sampler views.Dave Airlie2011-05-161-3/+0
| | | | | | | | | | | | | | | | | | | This fixes piglits fragment-and-vertex-texturing test on llvmpipe for me. I've no idea if someone had another plan for this that is smarter than what I've done here, but what I've basically done is split fragment and vertex sampler and sampler_view setup function, factor out the common chunks of both. side-cleanups: drop st->state.sampler_list - unused don't update border color if we have no border color. should fix https://bugs.freedesktop.org/show_bug.cgi?id=35849 Signed-off-by: Dave Airlie <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: plug in new functions for GL_ARB_sampler_objectsBrian Paul2011-04-101-0/+2
| | | | | | Build the new sources, plug the new functions into the dispatch table, implement display list support. And enable extension in the gallium state tracker.
* mesa/st: Fix user buffer size computation when stride is zero.José Fonseca2011-04-071-2/+2
| | | | | | | | | | | | | | | | | | | Although for GL a zero stride means tightly packed elements, Mesa internally uses zero strides for constant arrays. Therefore user buffers need to be defined from buffer_offset + src_offset + min_index*stride to buffer_offset + src_offset + max_index*stride + elem_size Simplifying the later with (max_index + 1)*stride will give zero sized buffers. This change also aggregates the st_context's info about user buffers into a single array.
* gallium: add texture barrier support to the interface and st/mesa (v2)Marek Olšák2011-03-151-0/+2
| | | | v2: change the gallium entry point to texture_barrier.
* st/mesa: implement ARB_syncMarek Olšák2011-03-081-0/+2
| | | | | | The ServerWaitSync implementation matches Intel's driver. The extension is advertised when pipe_screen::fence_finish is set.
* gallium: notify drivers about possible changes in user buffer contentsMarek Olšák2011-02-141-0/+5
| | | | Also implement the redefine_user_buffer hook in the drivers.
* mesa: remove _mesa_create_context_for_api()Brian Paul2011-02-081-1/+1
| | | | Just add the gl_api parameter to _mesa_create_context().
* st/mesa: optimize constant buffer uploadsMarek Olšák2011-01-061-7/+0
| | | | | | | | | | | | | The overhead of resource_create, transfer_inline_write, and resource_destroy to upload constant data is very visible with some apps in sysprof, and as such should be eliminated. My approach uses a user buffer to pass a pointer to a driver. This gives the driver the freedom it needs to take the fast path, which may differ for each driver. This commit addresses the same issue as Jakob's one that suballocates out of a big constant buffer, but it also eliminates the copy to the buffer.
* Squashed commit of the following (st-mesa-per-context-shaders branch):Brian Paul2010-12-131-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | commit 4f106f44a32eaddb6cf3fea6ba5ee9787bff609a Author: Brian Paul <[email protected]> Date: Mon Dec 13 14:06:08 2010 -0700 st/mesa: reorganize vertex program translation code Now it looks like the fragment and geometry program code. Also remove the serial number fields from programs. It was used to determine when new translations were needed. Now the variant key is used for that. And the st_program_string_notify() callback removes all variants when the program's code is changed. commit e12d6791c5e4bff60bb2e6c04414b1b4d1325f3e Author: Brian Paul <[email protected]> Date: Mon Dec 13 13:38:12 2010 -0700 st/mesa: implement geometry shader varients Only needed in order to support per-context gallium shaders. commit c5751c673644808ab069259a852f24c4c0e92b9d Author: Brian Paul <[email protected]> Date: Sun Dec 12 15:28:57 2010 -0700 st/mesa: restore glDraw/CopyPixels using new fragment program variants Clean up the logic for fragment programs for glDraw/CopyPixels. We now generate fragment program variants for glDraw/CopyPixels as needed which do texture sampling, pixel scale/bias, pixelmap lookups, etc. commit 7b0bb99bab6547f503a0176b5c0aef1482b02c97 Author: Brian Paul <[email protected]> Date: Fri Dec 10 17:03:23 2010 -0700 st/mesa: checkpoint: implement fragment program variants The fragment programs variants are per-context, as the vertex programs. NOTE: glDrawPixels is totally broken at this point. commit 2cc926183f957f8abac18d71276dd5bbd1f27be2 Author: Brian Paul <[email protected]> Date: Fri Dec 10 14:59:32 2010 -0700 st/mesa: make vertex shader variants per-context Gallium shaders are per-context but OpenGL shaders aren't. So we need to make a different variant for each context. During context tear-down we need to walk over all shaders/programs and free all variants for the context being destroyed.
* st/mesa: Unbind all constant buffersJakob Bornecrantz2010-12-061-2/+2
|
* mesa: replace #defines with new gl_shader_type enumBrian Paul2010-11-231-0/+5
|