summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2012-06-10meta: Use sampler object in framebuffer blitHEADmasterARB_sampler_objectPauli Nieminen1-17/+14
Framebuffer blit needs to setup texture sampling to match application requested blit operation. Sampler object can be used to avoid changes to texture object. But caching sampler object doesn't make much sense when we need to synamically change it based on filtering parameters. Signed-off-by: Pauli Nieminen <pauli.nieminen@linux.intel.com>
2012-06-10meta: Add sampler object to texture decompressionPauli Nieminen1-21/+24
Sampler objects can be used to shadow texture object state without modifying original application state. Decompression path feels a bit like path where caching shouldn't happen. But as everything else is cached already I decided to cache sampler state too. Signed-off-by: Pauli Nieminen <pauli.nieminen@linux.intel.com>
2012-06-10meta: texture rectangle textures may not have mipmapsPauli Nieminen1-2/+4
Avoid INVALID_OPERATION error if decompressing rectangle texture. Setting mipmap level limits for those textures is error that must not be hit by meta code to mislead user. Signed-off-by: Pauli Nieminen <pauli.nieminen@linux.intel.com>
2012-06-10meta: Use sampler object for mipmap generationPauli Nieminen1-25/+27
Sampler objects are perfect for meta operations.Sampler object is separate state object that shadows the sampling state in texture object. With sampler object mipmap can maintain same sampling state for all subsequent generation requests. Signed-off-by: Pauli Nieminen <pauli.nieminen@linux.intel.com>
2012-06-10mesa/samplerobj: Allow meta module to call sampler functionsPauli Nieminen2-4/+15
To allow meta module to use sample objects mesa GL functions need to be visible and linkable for meta module. Signed-off-by: Pauli Nieminen <pauli.nieminen@linux.intel.com>
2012-06-10swrast: Support sampler object for texture fetching statePauli Nieminen10-358/+438
swrast needs to pass sampler object into all texture fetching functions to use correct sampling state when sampler object is bound to the unit. The changes were made using half manual regular expression replace. With the patch llvmpipe didn't get any regressions. Signed-off-by: Pauli Nieminen <pauli.nieminen@linux.intel.com>
2012-06-10mesa: Make ARB_sampler_objects mandatorPauli Nieminen6-11/+3
To allow meta acceleration operations to use sampler objects the ARB_sampler_objects extension needs to be mandator for all drivers. Because the extension doesn't have any hardware dependencies it is trivial to implement. Signed-off-by: Pauli Nieminen <pauli.nieminen@linux.intel.com>
2012-06-10mesa/program: Use sampler object state if presentPauli Nieminen1-1/+4
CompareFailValue is part of Sampler state that needs to be read from bound sampler object if present. Signed-off-by: Pauli Nieminen <pauli.nieminen@linux.intel.com>
2012-06-10mesa/ff_shader: Fix sampler state readingPauli Nieminen1-1/+4
Fixed function fragment shader generator was incorrectly read texture sampling state directly from texture object. To make sure that ARB_sampler_object works correctly shader generator has to use the bound sampler if one exist Signed-off-by: Pauli Nieminen <pauli.nieminen@linux.intel.com>
2012-06-10mesa: Check index buffer offset in DrawElementsPauli Nieminen1-1/+2
DrawElements checks for cound beeing larger than index buffer object. But application can specify offset to buffer leading to buffer overflow again. ARB_vertex_buffer_object leaves the case undefined but allows program termination. But if we do check the index buffer size it makes sense to check it correctly. " What happens when an attempt is made to access data outside the bounds of the buffer object with a command that dereferences the arrays? RESOLVED: ALLOW PROGRAM TERMINATION. In the event of a software fallback, bounds checking can become impractical. Since applications don't know the actual address of the buffer object and only provide an offset, they can't ever guarantee that out-of-bounds offsets will fall on valid memory. So it's hard to do any better than this." Signed-off-by: Pauli Nieminen <pauli.nieminen@linux.intel.com>
2012-06-10radeon&r200: Add support for ARB_shader_objectPauli Nieminen10-46/+57
Preparation for the mandator support of ARB_shader_object. I have tested this patch with rv280 only. While only compile testing radeon changes. Does someone want to run piglit tests for radeon too? Signed-off-by: Pauli Nieminen <pauli.nieminen@linux.intel.com> CC: xorg-driver-ati@lists.x.org
2012-06-10radeon: Fix printf format not to warn in 64bitPauli Nieminen1-2/+2
When I build tested radeon changes I noticed two warnings about format size missmatch in 64bit. I decided to clean them to make relevant compiler warnings easier to spot. Signed-off-by: Pauli Nieminen <pauli.nieminen@linux.intel.com> CC: xorg-driver-ati@lists.x.org
2012-06-10nouveau: Add support for ARB_sampler_objectPauli Nieminen3-31/+39
ARB_sampler_object is very simple software only extension to support. I want to make it mandator extension for Mesa drivers to allow meta module to use it. This patch add support for the extension to nouveau. It is completely untested search and replace patch. I hope someone with old NV hardware could give a try that there is no regressions and ARB_sampler_object tests passes. Signed-off-by: Pauli Nieminen <pauli.nieminen@linux.intel.com> CC: nouveau@lists.freedesktop.org
2012-06-10mesa/samplerobj: Avoid crash in sampler query if texture unit is disabledPauli Nieminen1-1/+3
Sampler queries are so far made only for enabled texture unit. But if any code would query sampler before checking texture unit state that would result to NULL deference. Making the inline helper easier to use with NULL check makes a lot sense because compiler is likely to combine the checks for the current texture. Signed-off-by: Pauli Nieminen <pauli.nieminen@linux.intel.com>
2012-06-10mesa/samplerobj: Support EXT_texture_sRGB_decodePauli Nieminen1-0/+56
sRGBDecode state is part of sampler object state but mesa was missing handlers to access the state. This patch adds the support for required state changes and queries. GL_EXT_texture_sRGB_decode issue 4: "4) Should we add forward-looking support for ARB_sampler_objects? RESOLVED: YES If ARB_sampler_objects exists in the implementation, the sampler objects should also include this parameter per sampler." Signed-off-by: Pauli Nieminen <pauli.nieminen@linux.intel.com>
2012-06-10mesa/macros: Add ARRAY_SIZE helper macro core mesaPauli Nieminen3-4/+4
The ARRAY_SIZE macro is usefull helper that is used already in many parts of core. But mesa core was missing it. I decided to add it to the macros.h when I wanted to use it in following patch. Signed-off-by: Pauli Nieminen <pauli.nieminen@linux.intel.com>
2012-06-10mesa: Move DepthMode to texture objectPauli Nieminen12-21/+19
GL_DEPTH_TEXTURE_MODE isn't meant to be part of sampler state based on compatibility profile specifications. OpenGL specification 4.1 compatibility 20100725 3.9.2: "... The values accepted in the pname parameter are TEXTURE_WRAP_S, TEXTURE_WRAP_T, TEXTURE_WRAP_R, TEXTURE_MIN_- FILTER, TEXTURE_MAG_FILTER, TEXTURE_BORDER_COLOR, TEXTURE_MIN_- LOD, TEXTURE_MAX_LOD, TEXTURE_LOD_BIAS, TEXTURE_COMPARE_MODE, and TEXTURE_COMPARE_FUNC. Texture state listed in table 6.25 but not listed here and in the sampler state in table 6.26 is not part of the sampler state, and remains in the texture object." Same can be found from 3.3 compatibility specification. That makes me think that moving DepthMode from sampler state makes sense to avoid bugs if DepthMode happens to be used with sampler objects. Signed-off-by: Pauli Nieminen <pauli.nieminen@linux.intel.com>
2012-06-10mesa: Remove unnecessary parameters CompressedTexImagePauli Nieminen6-20/+4
In tune with previous patches. Again there is duplication of information in function parameters that is good to remove. Signed-off-by: Pauli Nieminen <pauli.nieminen@linux.intel.com>
2012-06-10mesa: Remove unnecessary parameters from AllocTextureImageBufferPauli Nieminen9-56/+29
Size and format information is always stored in gl_texture_image structure. That makes it preferable to remove duplicate information from parameters to make interface easier to understand. Signed-off-by: Pauli Nieminen <pauli.nieminen@linux.intel.com>
2012-06-10mesa: Remove unnecessary parameters from TexImagePauli Nieminen9-88/+33
gl_texture_image structure always holds size and internal format before TexImage driver hook is called. Those passing same information in function parameters only duplicates information making the interface harder to understand. Signed-off-by: Pauli Nieminen <pauli.nieminen@linux.intel.com>
2012-06-10mesa/format_unpack: Fix YCBCR unpackPauli Nieminen1-36/+66
The YCBCR unpack was reading one RGBA value from 4 bytes of YCBCR texture. But single pixel is only 2 bytes in the format. After noticing that error Ville told me that second chroma sample has to be average to match video requirements. Looking at places where unpack to rgba is called it is possible to get odd X coordinate and odd number of bytes. That makes unpack operation complex problem. But I assume that source allocation is 4 byte aligned always. That should hold for most of allocations but may fail. Better solution would be threating YCBCR as compressed format internally. But I suspect that I would break a lot of assumptions everywhere with that changes. But same time as I was checking call sites I started suspecting that we can't ever hit these unpack functions for YCBCR. But I need to study the code paths a lot more to be sure if that is true. Changes to fix unpacking: * Always start reading from the start of chroma pair. * Always read to the end of chroma pair * Unpack two RGB values in single iteration * Read next chroma pair (if available) to calculate average for second sample. * Refactor shared color space conversion code to separate function. Signed-off-by: Pauli Nieminen <pauli.nieminen@linux.intel.com>
2012-06-08mesa: Fix "glCopyBuffserSubData" typos in error messages and comments.Kenneth Graunke1-10/+10
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2012-06-08glsl: Clean up warnings about deleting classes without virtual destructors.Eric Anholt1-0/+10
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-06-08glsl: fix deref_hash memory leak in constant_expression_valueMarcin Slusarz1-2/+5
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-06-08glcpp: .gitignore cleanupAndreas Boll1-3/+0
*.o, *.lo and *~ are already in toplevel .gitignore Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-06-08glapi: .gitignore cleanupAndreas Boll1-11/+0
remove archaic .cvsignore *.pyo is already in toplevel .gitignore *.pyc is already in toplevel .gitignore Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-06-08gallivm: Fix calculating rho for 3d textures for the single-quad caseRoland Scheidegger1-2/+1
Discovered by accident, this looks like a very old typo bug. Signed-off-by: José Fonseca <jfonseca@vmware.com>
2012-06-07i965: Add forgotten bitcast operations in brw_fs_channel_expressions.Kenneth Graunke1-0/+4
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2012-06-07i965/blorp: allow all buffer formats provided src and dst match.Paul Berry1-25/+7
Previously, blits using the "blorp" mechanism only worked for 8-bit RGBA color buffers, 24-bit depth buffers, and 8 bit stencil buffers. This was not enough, because the blorp mechanism must be used for blitting whenever MSAA is in use. This patch allows all formats to be used, provided the source and destination formats match. So far I have confirmed that the following formats work properly with MSAA: - GL_RGB - GL_RGBA - GL_ALPHA - GL_ALPHA4 - GL_ALPHA8 - GL_R3_G3_B2 - GL_RGB4 - GL_RGB5 - GL_RGB8 - GL_RGB10 - GL_RGB12 - GL_RGB16 - GL_RGBA2 - GL_RGBA4 - GL_RGB5_A1 - GL_RGBA8 - GL_RGB10_A2 - GL_RGBA12 - GL_RGBA16 Fixes piglit tests "EXT_framebuffer_multisample/formats {2,4}" on Sandy Bridge and Ivy Bridge. Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-06-07i965/blorp: Implement logic for additional buffer formats.Paul Berry3-7/+37
Previously the blorp engine only supported RGBA8 color buffers and 24-bit depth buffers. This patch adds support for any color buffer format that is supported as a render target, and for 16-bit and 32-bit depth buffers. This required threading the brw_context struct through into brw_blorp_surface_info::set() so that it can consult the brw->render_target_format array. Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-06-07i965/blorp: De-virtualize brw_blorp_{mip,surface}_info::set() function.Paul Berry1-4/+4
Even though brw_blorp_surface_info is derived from brw_blorp_mip_info, this function doesn't need to be virtual, because it is never accessed through a base class pointer. Making the function non-virtual will allow it to take additional parameters in the brw_blorp_surface_info case. Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-06-07i965/blorp: Refactor surface format determination.Paul Berry4-10/+10
This patch moves the responsibility for deciding on the format of the source and destination surfaces from the gen{6,7}_blorp_emit_surface_state() functions to brw_blorp_surface_info::set(), which is shared between Gen6 and Gen7. This will make it possible to add support for more surface formats without code duplication. Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-06-07i965: Enable the GL_ARB_shader_bit_encode extension.Kenneth Graunke3-0/+25
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2012-06-07st/mesa: Finally activate the ARB_shader_bit_encoding extension.Olivier Galibert1-0/+4
Signed-off-by: Olivier Galibert <galibert@pobox.com> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-06-07glsl: Bitwise conversion operator support in the software renderers.Olivier Galibert2-0/+11
TGSI doesn't need an opcode, since registers are untyped (but beware once doubles come into the scene). Mesa IR doesn't handle native integers, so trying to handle them there is worthless, the case entries are only added for warning reasons. It was only tested with softpipe, since llvmpipe doesn't support glsl 1.3 yet. Signed-off-by: Olivier Galibert <galibert@pobox.com> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-06-07glsl: Bitwise conversion operator support in ir_constant_expression.Olivier Galibert1-0/+47
A "test_out = floatBitsToUint(-1.0);" fired through the GLSL compiler gives a correct "(assign (x) (var_ref test_out) (constant uint (3212836864)))" Signed-off-by: Olivier Galibert <galibert@pobox.com> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-06-07glsl: Bitwise conversion operator support in ir_validate.Olivier Galibert1-0/+16
Signed-off-by: Olivier Galibert <galibert@pobox.com> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-06-07glsl: Bitwise conversion operator support in ir_expression.Olivier Galibert1-0/+4
Signed-off-by: Olivier Galibert <galibert@pobox.com> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-06-07glsl: New unary opcodes for ARB_shader_bit_encoding support.Olivier Galibert7-11/+125
The opcodes are bitcast_f2u, bitcast_f2i, bitcast_i2f and bitcast_u2f. Signed-off-by: Olivier Galibert <galibert@pobox.com> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-06-07glsl: Scaffolding for ARB_shader_bit_encoding.Olivier Galibert8-0/+11
That adds support for activating the extension. It doesn't actually *do* anything yet, of course. Signed-off-by: Olivier Galibert <galibert@pobox.com> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-06-07mesa: Return 8 bits for GL_TEXTURE_RED_SIZE on RGTC formats.Kenneth Graunke1-4/+4
From the issues section of the GL_ARB_texture_compression_rgtc extension: 15) What should glGetTexLevelParameter return for GL_TEXTURE_GREEN_SIZE and GL_TEXTURE_BLUE_SIZE for the RGTC1 formats? What should glGetTexLevelParameter return for GL_TEXTURE_BLUE_SIZE for the RGTC2 formats? RESOLVED: Zero bits. These formats always return 0.0 for these respective components and have no bits devoted to these components. Returning 8 bits for red size of RGTC1 and the red and green sizes of RGTC2 makes sense because that's the maximum potential precision for the uncompressed texels. Thus, we need to return 8 bits for GL_TEXTURE_RED_SIZE on all RGTC formats and 8 bits for GL_TEXTURE_GREEN_SIZE on RGTC2 formats. BLUE should be 0. Fixes oglconform/rgtc/advanced.texture_fetch.tex_param. Signed-off-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Brian Paul <brianp@vmware.com>
2012-06-07glsl: Hook up loop_variable_state destructor to plug a memory leak.Kenneth Graunke1-0/+17
While ~loop_state() is already freeing the loop_variable_state objects via ralloc_free(this->mem_ctx), the ~loop_variable_state() destructor was never getting called, so the hash table inside loop_variable_state was never getting destroyed. Fixes a memory leak in any shader with loops. NOTE: This is a candidate for stable release branches. Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2012-06-06radeon/llvm: Emulate RECIP_UINT instruction on CaymanTom Stellard2-4/+13
2012-06-06radeon/llvm: Remove some duplicate code in the R600 CodeEmitterTom Stellard1-9/+3
2012-06-06radeon/llvm: Fix MULLO* instructions on CaymanTom Stellard4-14/+53
On Cayman, the MULLO* instructions must fill all slots in an instruction group.
2012-06-06r600g: Compute support for CaymanTom Stellard5-66/+95
2012-06-06xorg: port to new compat API.Dave Airlie8-63/+162
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-06-06mesa: consolidate internal glCompressedTexSubImage1/2/3D codeBrian Paul7-138/+42
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-06-06mesa: consolidate internal glCompressedTexImage1/2/3D codeBrian Paul7-140/+44
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-06-06mesa: consolidate internal glCopyTexSubImage1/2/3D codeBrian Paul10-220/+62
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>