summaryrefslogtreecommitdiff
path: root/src/mesa/state_tracker
AgeCommit message (Collapse)Author
2009-09-23st/mesa: trim calculated userbuffer sizeKeith Whitwell
In get_array_bounds we were previously defining a user buffer sized as (nr_vertices * stride). The trouble is that if the vertex data occupies less than stride bytes, the extra tailing (stride - size) bytes may extend outside the memory actually allocated by the app and caused a segfault. To fix this, define a the buffer bounds to be: ptr .. ptr + (nr-1)*stride + element_size
2009-09-20mesa/st: Initialize format bits of framebuffer renderbuffersNicolai Hähnle
Signed-off-by: Nicolai Hähnle <nhaehnle@gmail.com>
2009-09-16st/mesa: fix some incorrect branching/clean-up code in TexImage functionsBrian Paul
We need to be sure to call the _mesa_unmap_teximage_pbo() function if we called _mesa_validate_pbo_teximage().
2009-09-16st/mesa: fix texture memory allocation bugBrian Paul
The following example caused an incorrect GL_OUT_OF_MEMORY error to be raised in glTexSubImage2D: glTexImage2D(level=0, width=32, height=32, pixels=NULL); glTexImage2D(level=0, width=64, height=64, pixels=NULL); glTexSubImage2D(level=0, pixels!=NULL); The second glTexImage2D() call needs to cause the first image to be deallocated then reallocated at the new size. This was not happening because we were testing for pixels==NULL too early.
2009-09-03st/mesa: silence uninitialized var warningsBrian Paul
2009-09-03st/mesa: fix glCopyPixels(GL_STENCIL_INDEX) inverted positionBrian Paul
If the renderbuffer orientation is Y=0=TOP we need to invert the dstY position.
2009-09-02st/mesa: Do GL_RGBA->GL_RGB texsubimage on hardwareKeith Whitwell
State tracker currently backs GL_RGB textures with RGBA almost always. This means we need to maintain A==1 in these textures to give correct GL_RGB sampling results. This change offloads the RGBA->RGB copy to hardware using the new writemask version of u_blit_pixels. More src/dstLogical/dstActual triples could be shifted to hardware by this technique in future patches.
2009-08-21st/mesa: flush bitmap cache if Z value changesBrian Paul
When adding a new bitmap to the cache we have to check if the Z value is changing and flush first if it is. This is a modified version of a patch from Justin Dou <justin.dou@intel.com>
2009-08-05st/mesa: implement BlitFramebuffer() for depth/stencil (incomplete)Brian Paul
We now handle the case of blitting Z+stencil to/from combined Z/stencil surfaces. But Z-only or stencil-only and separate depth/stencil surfaces are not yet implemented.
2009-08-05st/mesa: fix Y inversion and optimize st_BlitFramebuffer()Brian Paul
Need to check for Y inversion separately for src/dest buffers. If both the src and dest regions are upside down, make them right-side up for a better chance at a fast path. progs/tests/copypixrate -blit is much faster now.
2009-08-03st/mesa: we don't support GL_NV_point_sprite (see comment)Brian Paul
2009-07-29mesa/st: short-circuit glFinish calls on WIN32 onlyKeith Whitwell
Windows opengl32.dll calls glFinish prior to every swapbuffers, which makes it pretty hard to get decent performance... Work around by mapping finish to flush on PIPE_OS_WINDOWS. This is conformant, though it might confuse poorly-written benchmarks which attempt to measure a single event rather than figuring out the rate of continuous processing.
2009-07-29mesa/st: recognize no-op scissor state when checking clear_with_quadsKeith Whitwell
Some apps enable scissor but set the rectangle to the dimensions of the window. Don't let this force us onto a slower clear path.
2009-07-27st/mesa: silence warningBrian Paul
2009-07-16mesa: Fix logbase2.José Fonseca
It was providing 1 too many for non power two values.
2009-07-14mesa: Report the true face number when flushing.José Fonseca
2009-07-11gallium: compare the actual register, not all the inputsZack Rusin
otherwise we decrement indexes for all registers
2009-07-10st/mesa: implement indirect addressing for destination registersBrian Paul
2009-07-07gallium: fixup register indexes for fog/frontface/point coordZack Rusin
2009-07-07gallium: Fixes for clobbering stencil values in combined depth/stencil textures.Michel Dänzer
Also fix one case where a 32 bit depth value was incorrectly converted to a combined depth/stencil value.
2009-07-07gallium: Only set FRONT_STATUS_COPY_OF_BACK if there is a back buffer.Michel Dänzer
Fixes potential crash when SwapBuffers is called but there's no back buffer.
2009-07-06gallium: more fog extraction fixesZack Rusin
fix the cases when fog coord/front face/point coord are used in the same shader.
2009-07-02mesa: Assume depth textures have a single level unless told otherwise.José Fonseca
2009-06-30st/gl: Add stubs for CompressedTexSubImage[1D|3D]Jakob Bornecrantz
2009-06-30st/gl: Add support for glCompressedTexSubImageJakob Bornecrantz
2009-07-01mesa: Unbind depth/stencil surface from pipe_framebuffer when none is attached.José Fonseca
2009-07-01gallium: fix the front face semanticsZack Rusin
mesa allocates both frontface and pointcoord registers within the fog coordinate register, by using swizzling. to make it cleaner and easier for drivers we want each of them in its own register. so when doing compilation from the mesa IR to tgsi allocate new registers for both and add new semantics to the respective declarations.
2009-06-30mesa: Set FLUSH_EXPLICIT_BIT flags when calling FlushMappedBufferRange.José Fonseca
As prescribed by ARB_map_buffer_range.
2009-06-26st/mesa: query PIPE_CAP_TGSI_CONT_SUPPORTEDBrian Paul
2009-06-19Always free image offsets memory when re-initializing texture image fields.Michel Dänzer
Fixes leak running compiz with direct rendering.
2009-06-17mesa: rework viewport/scissor initialization codeBrian Paul
The first time a context is bound to a drawable, the viewport and scissor bounds are initialized to the buffer's size. This is actually a bit tricky. A new _mesa_check_init_viewport() function is called in several places to check if the viewport has been initialized. We also use a new ctx->ViewportInitialized flag instead of the overloaded ctx->FirstTimeCurrent flag.
2009-06-11mesa: rework vertex shader output / fragment shader input attribute matchingBrian Paul
Before, if a vertex shader's outputs didn't exactly match a fragment shader's inputs we could wind up with invalid TGSI shader declarations. For example: Before patch: DCL OUT[0], POSITION DCL OUT[1], COLOR[1] DCL OUT[2], GENERIC[0] DCL OUT[3], GENERIC[0] <- note duplicate [0] DCL OUT[4], GENERIC[2] After patch: DCL OUT[0], POSITION DCL OUT[1], COLOR[1] DCL OUT[2], GENERIC[0] DCL OUT[3], GENERIC[1] DCL OUT[4], GENERIC[2]
2009-06-11mesa: Use new pf_is_depth_and_stencil inline.José Fonseca
2009-06-11mesa: Use PIPE_TEXTURE_USAGE_DEPTH_STENCIL for any depth or stencil format.José Fonseca
2009-06-11mesa: Remove dead code.José Fonseca
2009-06-11st/mesa: fix typo s/BFC0/BFC1/Brian Paul
2009-06-11mesa: Only do read write when we don't have a depth value to writeJakob Bornecrantz
2009-06-11mesa: Take the format from the right structure.José Fonseca
2009-06-11meas: Use a read/write transfer when writing stencil component, but not ↵José Fonseca
touching the depth component.
2009-06-10mesa: Reverse s8z24 into z24s8 as required by EXT_packed_depth_stencil.José Fonseca
Actually, after spotting this problem, I realized this is unreachable code. However don't bother to enable this fast path now, given the normal path is working just fine.
2009-06-10mesa: Fix draw_stencil_pixels for PIPE_FORMAT_Z24S8_UNORM.José Fonseca
Reversed component order. This fixes glean depthStencil test failures for PIPE_FORMAT_Z24S8_UNORM visuals.
2009-06-10mesa: Single precision constants.José Fonseca
2009-06-10mesa: Pure software accum buffer.José Fonseca
The existing implementation was already implemented on software, but relied on the pipe driver to always support the R16G16B16A16_SNORM format. This patch eliminates that, without prejudice against a future hardware-only implementation. It also avoids some of the short <-> float conversions, and only does a read transfer of the color buffer on GL_RETURN if absolutely necessary.
2009-06-09mesa/st: fix tracking of mapped buffer rangesKeith Whitwell
In st_bufferobj_map_range(), set obj->Offset consistently with its usage elsewhere.
2009-06-08st/mesa: fix incorrect bufObj Length assignment, remove unneeded assertionBrian Paul
2009-06-08st/mesa: remove invalid assertionBrian Paul
It's legal for ARB_vertex_program programs to not write to result.position. The results are undefined in that case. This assertion was causing us to abort/exit though.
2009-06-08mesa: Allocate tokens from the heap.José Fonseca
The recent increase ST_MAX_SHADER_TOKENS to 8K causes stack overflows on windows. Failure to allocate is not being propagated to the caller. This is not a regression since the previous _mesa_malloc result wasn't being checked as well. Unfortunately it is not easy to fix, as the callers of these functions do not have failure propagation mechanism either, and so on. So leaving a just fixme note for now.
2009-06-04st/mesa: increase ST_MAX_SHADER_TOKENS to 8kBrian Paul
2009-06-01mesa/st: restore flush to copy_texsubimage (was previously finish)Keith Whitwell
Need a flush here even though the original finish was overkill.
2009-06-01st/gl: Fix mip gen for compressed texturesJakob Bornecrantz