aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/main
Commit message (Collapse)AuthorAgeFilesLines
* CopyTexImage: Don't check sRGB vs LINEAR for desktop GLJordan Justen2013-02-121-18/+10
| | | | | | | | | | | | | | In OpenGL 4.3, new language was added that would require this check. But, if this check results in broken applications then perhaps it will be reversed. For now, remove this check and re-evaluate when desktop GL 4.3 is closer. NOTE: This is a candidate for the 9.1 branch. Signed-off-by: Jordan Justen <[email protected]> Reviewed-by: Anuj Phogat <[email protected]>
* mesa: fix GetTexImage if mesa format and internal format don't matchMarek Olšák2013-02-112-0/+71
| | | | | | | | Tested with softpipe only exposing RGBA formats. NOTE: This is a candidate for the stable branches. Reviewed-by: Brian Paul <[email protected]>
* mesa: don't use memcpy fast path for GetTexImage if base format is differentMarek Olšák2013-02-111-4/+6
| | | | | | | | | | | The Mesa format can be RGBA8888_REV, the format/type can be GL_RGBA/GL_UNSIGNED_BYTE, but the actual texture internal format can be LUMINANCE_ALPHA, INTENSITY, etc. Therefore we should look at the base internal format as well. NOTE: This is a candidate for the stable branches. Reviewed-by: Brian Paul <[email protected]>
* mesa: don't use _mesa_base_tex_format for format parameter of GetTexImageMarek Olšák2013-02-111-1/+36
| | | | | | | | | | _mesa_base_tex_format doesn't accept GL_BGR and GL_ABGR_EXT, etc. v2: add a (now hopefully complete) helper function to deal with this NOTE: This is a candidate for the stable branches. Reviewed-by: Brian Paul <[email protected]>
* mesa: adjust usage of swapBytes/littleEndian in format_matches_format_and_typeMarek Olšák2013-02-111-25/+17
| | | | | | | | | | - swapBytes has no effect on 8-bit single-component formats - GL_SHORT is in host byte order, so checking for littleEndian is unnecessary, I decided to make the change for single-component formats only Based on suggestions from Michel Dänzer. Reviewed-by: Michel Dänzer <[email protected]>
* mesa: remove per-format memcpy codepaths from texstore functionsMarek Olšák2013-02-111-590/+64
| | | | | | It's obsoleted by the common function _mesa_texstore_memcpy. Reviewed-by: Brian Paul <[email protected]>
* mesa: implement common texstore memcpy function for all formatsMarek Olšák2013-02-111-0/+60
| | | | Reviewed-by: Brian Paul <[email protected]>
* mesa: fill in Z32_FLOAT_X24S8 in _mesa_format_matches_format_and_typeMarek Olšák2013-02-111-1/+2
| | | | Reviewed-by: Brian Paul <[email protected]>
* mesa: fill in signed cases and RGBA16 in _mesa_format_matches_format_and_typeMarek Olšák2013-02-111-4/+26
| | | | | Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Michel Dänzer <[email protected]>
* mesa: fill in INT/UINT format cases in _mesa_format_matches_format_and_typeMarek Olšák2013-02-111-6/+61
| | | | | Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Michel Dänzer <[email protected]>
* mesa: fill in YCBCR cases in _mesa_format_matches_format_and_typeMarek Olšák2013-02-111-1/+6
| | | | | | | based on the texstore code Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Michel Dänzer <[email protected]>
* mesa: fill in SRGB cases in _mesa_format_matches_format_and_typeMarek Olšák2013-02-111-5/+5
| | | | | | Texstore takes the same codepath as the corresponding linear formats. Reviewed-by: Brian Paul <[email protected]>
* Consolidate some redundant definitions of ARRAY_SIZE() macro.Paul Berry2013-02-083-4/+5
| | | | | | | | | | | | | | | | | | | | | Previous to this patch, there were 13 identical definitions of this macro in Mesa source. That's ridiculous. This patch consolidates 6 of them to a single definition in src/mesa/main/macros.h. Unfortunately, I wasn't able to eliminate the remaining definitions, since they occur in places that don't include src/mesa/main/macros.h: - include/pci_ids/pci_id_driver_map.h - src/egl/drivers/dri2/egl_dri2.h - src/egl/main/egldefines.h - src/gbm/main/backend.c - src/gbm/main/gbm.c - src/glx/glxclient.h - src/mapi/mapi/stub.c I'm open to suggestions as to how to deal with the remaining redundancy. Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Don't check (offset + size <= bufObj->Size) in BindBufferRange.Paul Berry2013-02-071-7/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In the documentation for BindBufferRange, OpenGL specs from 3.0 through 4.1 contain this language: "The error INVALID_VALUE is generated if size is less than or equal to zero or if offset + size is greater than the value of BUFFER_SIZE." This text was dropped from OpenGL 4.2, and it does not appear in the GLES 3.0 spec. Presumably the reason for the change is because come clients change the size of the buffer after calling BindBufferRange. We don't want to generate an error at the time of the BindBufferRange call just because the old size of the buffer was too small, when the buffer is about to be resized. Since this is a deliberate relaxation of error conditions in order to allow clients to work, it seems sensible to apply it to all versions of GL, not just GL 4.2 and above. (Note that there is no danger of this change allowing a client to access data beyond the end of a buffer. We already have code to ensure that that doesn't happen in the case where the client shrinks the buffer after calling BindBufferRange). Eliminates a spurious error message in the gles3 conformance test "transform_feedback_offset_size". Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* mesa: Allow glGet* queries of MAX_VARYING_COMPONENTS in ES 3Matt Turner2013-02-071-3/+1
| | | | | | | | | Should have been done in d9948e49 but I missed it because MAX_VARYING_FLOATS doesn't appear in the ES 3 spec, but is the same value as MAX_VARYING_COMPONENTS. NOTE: Candidate for the 9.1 branch Reviewed-by: Ian Romanick <[email protected]>
* mesa: add RGBX formats for existing GL RGB texture formatsMarek Olšák2013-02-075-47/+869
| | | | v2: fix compilation of swrast
* mesa: Put extern "C" guards in renderbuffer.h.Kenneth Graunke2013-02-061-1/+7
| | | | | | | | | I need to use this from C++ code. NOTE: This is a candidate for the 9.1 branch. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* mesa: fixup inconsistent naming of RG16 formatsMarek Olšák2013-02-067-28/+28
| | | | Reviewed-by: Brian Paul <[email protected]>
* mesa/glsl: Separate parsing logic from _mesa_get_uniform_location.Paul Berry2013-02-042-61/+28
| | | | | | | | | | | | | | | | The parsing logic is moved to a new function in the GLSL module, parse_program_resource_name(). This name was chosen because it should eventually be useful for handling everything that OpenGL 4.3 calls "program resources" (e.g. uniforms, vertex inputs, fragment outputs, and transform feedback varyings). Future patches will make use of this function for linking transform feedback varyings. NOTE: This is a candidate for the 9.1 branch. Reviewed-by: Jordan Justen <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* mesa: don't use format chooser code for glCompressedTexImageBrian Paul2013-02-041-2/+12
| | | | | | | | | | When glCompressedTexImage is called the internalFormat is a specific format for the incoming image and the the hardware format should be the same (since we never do format transcoding). So use the simpler _mesa_glenum_to_compressed_format() function. This change is also needed for the next patch. Note: This is a candidate for the stable branches.
* mesa: don't expose IBM_rasterpos_clip in a core contextMarek Olšák2013-02-011-1/+1
| | | | | | | | | glRasterPos doesn't exist in the core profile. NOTE: This is a candidate for the stable branches (9.0 and 9.1). Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* mesa: bump version to 9.2 (devel)Andreas Boll2013-01-311-2/+2
| | | | | | | Now that branch 9.1 is created, bump the minor version in master. Reviewed-by: Kenneth Graunke <[email protected]>
* Revert "mesa: Return INVALID_OPERATION when type is known but not allowed"Matt Turner2013-01-301-11/+1
| | | | | | | | | | | | This reverts commit 2906e2034c9d674601960a5b586b6e986e6ef04f. Fixes a regression in the glean depthStencil test. Reverting this does not affect any tests in es3conform, so a more recent patch must have also fixed the failure this one was intended to fix. Reported-by: lu hua <[email protected]> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=59494
* mesa: Add TexBufferRange to dispatch_sanity.Kenneth Graunke2013-01-301-1/+1
| | | | | | Christoph implemented this, so we should expect it to be present now. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=60082
* mesa: implement GL_ARB_texture_buffer_rangeChristoph Bumiller2013-01-308-17/+103
| | | | | | | | | | | | | | | | | | | | | | | v2: Record texObj.BufferSize as -1 in TexBuffer(non-Range) instead of the buffer's current size so we know we always have to use the full size of the buffer object (i.e. even if it changes without the user calling TexBuffer again) for the texture. Clarify invalid offset alignment error message. v3: Use extra GL_CORE-only section in get_hash_params.py for TEXTURE_BUFFER_OFFSET_ALIGNMENT. v4: Remove unnecessary check for profile in _mesa_TexBufferRange. Add check for extension enable in get_tex_level_parameter_buffer. v5: Fix position in gl_API.xml. Add comment about meaning of BufferSize == -1. v6: Add back checks for core profile and add a note about it. Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* mesa: remove ctx->Driver.Error() hookBrian Paul2013-01-292-11/+0
| | | | | | Not used by any driver anymore. Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: fix comment typo: s/formaat/format/Brian Paul2013-01-291-1/+1
|
* mesa: don't enable GL_EXT_framebuffer_multisample for software driversBrian Paul2013-01-291-1/+0
| | | | | | Note: This is a candidate for the 9.0 branch. Reviewed-by: Jose Fonseca <[email protected]>
* Remove APIspec.dtdMatt Turner2013-01-281-52/+0
| | | | Left behind by a8ab7e33.
* mesa: add casts in _mesa_GetTexParameterfv() to silence warningsBrian Paul2013-01-251-4/+4
| | | | | | There are other similar int->float casts elsewhere in the function. Reviewed-by: José Fonseca <[email protected]>
* glsl: Add infrastructure for ARB_shading_language_packingMatt Turner2013-01-252-0/+2
| | | | | Reviewed-by: Chad Versace <[email protected]> Reviewed-by: Paul Berry <[email protected]>
* mesa: Print more informative debug for _mesa_do_init_remap_table().Eric Anholt2013-01-251-2/+4
| | | | | | This is the same logic from _mesa_map_function_array(). Reviewed-by: Kenneth Graunke <[email protected]>
* glsl: Add gl_uniform_buffer_variable::IndexName fieldIan Romanick2013-01-252-1/+14
| | | | | | | | | | | | | glGetUniformIndices requires that the block instance index not be present in the name of queried uniforms. However, gl_uniform_buffer_variable::Name will include the instance index. The IndexName field is added to handle this difference. Note that currently IndexName will always point to the same string as Name. This will change soon. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Carl Worth <[email protected]>
* mesa: Track the packing mode of a UBO in gl_uniform_bufferIan Romanick2013-01-251-0/+14
| | | | | | | | | This allows the next patch to verify that two uniform blocks match without first calculating the locations of the fields. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Chad Versace <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa/es3: Enable ES 3.0 API and shading language versionIan Romanick2013-01-252-2/+27
| | | | | | | | v2: Add ARB_internalformat_query to the list of required extensions. v3: Add OES_depth_texture_cube_map to the list of required extensions. Signed-off-by: Ian Romanick <[email protected]>
* mesa: Remove rounding bias in _mesa_float_to_half()Chad Versace2013-01-241-29/+37
| | | | | | | | | | | | | | | | | | | | | | | Not all float32 values can be exactly represented as a float16. _mesa_float_to_half() rounded such intermediate float32 values to zero by truncating unrepresentable bits in the mantissa. This patch improves _mesa_float_to_half() by rounding intermediate float32 values to the nearest float16; when the float32 is exactly between two float16 values we round to the one with an even mantissa. This behavior is preferred over the old behavior because: - It has reduced bias relative to the old behavior. - It reproduces the behavior of real hardware: opcode F32TO16 in Intel's GPU ISA. - By reproducing the behavior of the GPU (at least on Intel hardware), compile-time evaluation of constant packHalf2x16 GLSL expressions will result in the same value as if the expression were executed on the GPU. Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Paul Berry <[email protected]> Signed-off-by: Chad Versace <[email protected]>
* mesa,glsl: Move round_to_even() from glsl to mesa/main (v2)Chad Versace2013-01-242-0/+23
| | | | | | | | | | | | | Move round_to_even's definition to mesa/main so that _mesa_float_to_half() can use it in order to eliminate rounding bias. In additon to moving the fuction definition, prefix its name with "_mesa", just as all other functions in mesa/main are prefixed. v2: Fix Android build. Reviewed-by: Ian Romanick <[email protected]> Signed-off-by: Chad Versace <[email protected]>
* glsl: Eliminate ambiguity between function ins/outs and shader ins/outsPaul Berry2013-01-241-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch replaces the three ir_variable_mode enums: - ir_var_in - ir_var_out - ir_var_inout with the following five: - ir_var_shader_in - ir_var_shader_out - ir_var_function_in - ir_var_function_out - ir_var_function_inout This eliminates a frustrating ambiguity: it used to be impossible to tell whether an ir_var_{in,out} variable was a shader in/out or a function in/out without seeing where the variable was declared in the IR. This complicated some optimization and lowering passes, and would have become a problem for implementing varying structs. In the lisp-style serialization of GLSL IR to strings performed by ir_print_visitor.cpp and ir_reader.cpp, I've retained the names "in", "out", and "inout" for function parameters, to avoid introducing code churn to the src/glsl/builtins/ir/ directory. Note: a couple of comments in the code seemed to indicate that we were planning for a possible future in which geometry shaders could have shader-scope inout variables. Our GLSL grammar rejects shader-scope inout variables, and I've been unable to find any evidence in the GLSL standards documents (or extensions) that this will ever be allowed, so I've eliminated these comments. Reviewed-by: Carl Worth <[email protected]> Reviewed-by: Jordan Justen <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* mesa: Like EXT_texture_compression_dxt1, advertise ↵Ian Romanick2013-01-233-20/+8
| | | | | | | | | | | | | | | ANGLE_texture_compression_dxt in all APIs This is technically outside the ANGLE spec, but it seems unlikely to cause any harm. v2: Simplify the extension checks by assuming the ANGLE extension will always be enabled by any driver that enables the EXT. Suggested by Eric Anholt. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Acked-by: Lee Salzman <[email protected]>
* mesa: Simplify _mesa_choose_tex_format handling of compressed formatsIan Romanick2013-01-231-167/+75
| | | | | | | | | | | | | For non-generic compressed format we assert two things: 1. The format has already been validated against the set of available extensions. 2. The driver only enables the extension if it supports all of the formats that are part of that extension. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* mesa: Use a single flag for the S3TC extensions that don't require on-line ↵Ian Romanick2013-01-236-9/+13
| | | | | | | | compression Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Acked-by: Lee Salzman <[email protected]>
* ReadPixels: Force ALPHA to 1 while rebasing RGBA values for GL_RGB formatCarl Worth2013-01-231-0/+10
| | | | | | | | | | | | | | | | | | | | | | When performing a ReadPixels operation, we may be reading from a buffer that stores alpha values, but that is actually representing a buffer with no alpha channel. In this case, while rebasing the values, touch up all alpha values read to 1.0. This commit fixes the following piglit (sub) tests: ARB_texture_float/fbo-colormask-formats GL_RBG16F_ARB EXT_texture_snorm/fbo-colormask-formats GL_RGB16_SNORM GL_RGB8_SNORM GL_RGB_SNORM It likely improves the results of other tests as well, but a PASS remains elusive due to additional bugs. Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Anuj Phogat <[email protected]>
* mesa/es3: Apply stricter multisample blit rules for ES3.Ian Romanick2013-01-221-13/+48
| | | | | | | | Fixes gles3conform framebuffer_blit_error_blitframebuffer_multisampled_read_buffer_different_origins. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* mesa/es3: Disallow FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE query of ↵Ian Romanick2013-01-221-0/+16
| | | | | | | | | | DEPTH_STENCIL_ATTACHMENT This error was added in the 3.0.1 update to the OpenGL ES 3.0 spec. Fixes the updated gles3conform packed_depth_stencil_parameters test. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* mesa: Don't allow blits to / from the same buffer in OpenGL ES 3.0Ian Romanick2013-01-221-0/+31
| | | | | | | | | | Fixes gles3conform test CoverageES30. It temporarily regresses some framebuffer_blit tests, but the failing subcases have been determined to be invalid for OpenGL ES 3.0. v2: Fix typo in depth (and stencil) RB checking. Noticed by Ken. Signed-off-by: Ian Romanick <[email protected]>
* mesa: Remove exec thunks from the dlist.c module.Eric Anholt2013-01-211-870/+0
| | | | | | | | | | | | | | | | These were introduced in 2000 during a rework of the TNL module (commit cab974cf6c2dbfbf5dd5d291e1aae0f8eeb34290), though I'm having a hard time finding an instance there of one of these Exec functions being changed at runtime. Regardless, as far as I can tell now, these functions don't get changed, by grepping for calls to SET_* to change the dispatch table (we do change functions in GLvertexformat at runtime, but those don't overlap with this set of functions). Remove them and just let them be initialized to the same functions as are in the Exec table. Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* mesa: Initially populate the display list with the exec list.Eric Anholt2013-01-2111-284/+8
| | | | | | | | This cuts out a ton of code to make functions not set to a save_ variant match. Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* mesa: Delay display list save dispatch setup until Exec is set up.Eric Anholt2013-01-213-11/+8
| | | | | | | | This will let us copy from the Exec dispatch to deal with our commands that don't get compiled into display lists. Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* mesa: Make the drivers call a non-code-generated dispatch table setup.Eric Anholt2013-01-213-1/+10
| | | | | | | 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]>
* mesa: Remove the size argument from _mesa_alloc_dispatch_table().Eric Anholt2013-01-213-8/+5
| | | | | | | | All callers are in Mesa core and all use _gloffset_COUNT, so just rely on the already baked-in use of _gloffset_COUNT in the function. Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Ian Romanick <[email protected]>