summaryrefslogtreecommitdiffstats
path: root/src/mesa/main
Commit message (Collapse)AuthorAgeFilesLines
* mesa: Fix glGetVertexAttribi(GL_VERTEX_ATTRIB_ARRAY_SIZE)Anuj Phogat2014-04-161-1/+1
| | | | | | | | | | | | | | | mesa currently returns 4 when GL_VERTEX_ATTRIB_ARRAY_SIZE is queried for a vertex array initially set up with size=GL_BGRA. This patch makes changes to return size=GL_BGRA as required by the spec. Fixes Khronos OpenGL CTS test: vertex_array_bgra_basic.test V2: Use array->Format instead of adding a new variable Signed-off-by: Anuj Phogat <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Ian Romanick <[email protected]> Cc: <[email protected]>
* mesa: Consider gl_VertexID and gl_InstanceID active attribsChris Forbes2014-04-131-0/+9
| | | | | | | Fixes piglit's spec/gl-3.2/get-active-attrib-returns-all-inputs. Signed-off-by: Chris Forbes <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Extract is_active_attrib() in shaderapiChris Forbes2014-04-131-8/+19
| | | | | | | | | | The rules are about to get a bit more complex to account for gl_InstanceID and gl_VertexID, which are system values. Extracting this first avoids introducing duplication. Signed-off-by: Chris Forbes <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Fix typo in error messageChris Forbes2014-04-131-1/+1
| | | | Signed-off-by: Chris Forbes <[email protected]>
* glsl: Drop do_common_optimization's max_unroll_iterations parameter.Kenneth Graunke2014-04-111-1/+1
| | | | | | | | | | | | Now that we pass in gl_shader_compiler_options, it makes sense to just use options->MaxUnrollIterations, rather than passing a separate parameter. Half of the invocations already passed options->MaxUnrollIterations, while the other half passed in a hardcoded value of 32. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* mesa: use _mesa_get_srgb_format_linear() in sRGB texstore functionsBrian Paul2014-04-111-25/+5
| | | | | | | Instead of switch statements. Reviewed-by: Chris Forbes <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* mesa: remove the MALLOC, CALLOC and FREE macrosBrian Paul2014-04-101-6/+0
| | | | | | | | | | No longer used anywhere. These also caused trouble in the Gallium state tracker code where we include both core Mesa and Gallium util headers (and the macros were defined differently in each world.) Removing these macros should help avoid macro mix-ups in the future. Reviewed-by: Jakob Bornecrantz <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: s/FREE/free/ in vdpau codeBrian Paul2014-04-101-4/+4
| | | | | | Reviewed-by: Reviewed-by: Jakob Bornecrantz <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Christian König <[email protected]>
* mesa: s/FREE/free/ in _mesa_free_errors_data()Brian Paul2014-04-101-1/+1
| | | | | Reviewed-by: Jakob Bornecrantz <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: use malloc/free instead of MALLOC/FREE in attrib stack codeBrian Paul2014-04-101-10/+10
| | | | | | | We moved away from MALLOC/FREE in the rest of core Mesa a while ago. Reviewed-by: Jakob Bornecrantz <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Adjust _MaxLevel computation to account for viewsChris Forbes2014-04-101-0/+7
| | | | | | | Signed-off-by: Chris Forbes <[email protected]> Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Acked-by: Eric Anholt <[email protected]>
* mesa: Prefer non-swizzled formats for most sized internalformatsChris Forbes2014-04-101-4/+18
| | | | | | | | | | | | | | | | These formats can be cast to others (with different component types or sizes) via ARB_texture_view or ARB_shader_image_load_store. We want them to be laid out consistently so that we can just reinterpret the memory with a different format. In V1, this was done conditionally on a 'prefer_no_swizzle' flag which was set in TexStorage/TextureView paths, but we need the same behavior for ARB_shader_image_load_store (which also works with images created via TexImage, so we don't want it to be conditional. Signed-off-by: Chris Forbes <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Acked-by: Eric Anholt <[email protected]>
* mesa: fix packing of float texels to GL_SHORT/GL_BYTEChris Forbes2014-04-101-58/+58
| | | | | | | | | | | | | | | | | Previously, we would unpack the texels to floats using *_TO_FLOAT_TEX, and then pack them into the desired format using FLOAT_TO_*. Unfortunately, this isn't quite the inverse operation, and so some texel values would end up off-by-one. This fixes the GL_RGB8_SNORM and GL_RGB16_SNORM subcases in piglit's arb_texture_view-format-consistency-get test on i965. The similar 1-, 2- and 4-component cases already worked because they took the memcpy path rather than repacking. Signed-off-by: Chris Forbes <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Acked-by: Eric Anholt <[email protected]>
* mesa: move declaration before code in etc2_unpack_rgb8()Brian Paul2014-04-081-3/+3
| | | | To fix MSVC build since cb4ad1368551b.
* mesa: add bounds checking to eliminate buffer overrunCourtney Goeltzenleuchter2014-04-081-24/+54
| | | | | | | | | | | | | | | | | Decompressing ETC2 textures was causing intermitent segfault by copying resulting 4x4 texel block to the destination texture regardless of the size of the destination texture. Issue found via application crash in GLBenchmark 3.0's Manhattan test. v2: add more detail comment. Compute limit outside inner loops. v3: add bugzilla reference v4: Correct cc syntax in commit log v5: really grab the right patch Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=74988 Cc: "9.2 10.0 10.1" <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Ian Romanick <[email protected]> [v1, suggested v2-3]
* glsl: Pass ctx->Const.NativeIntegers to do_common_optimization().Kenneth Graunke2014-04-081-1/+2
| | | | | | | | | | | The next few patches will introduce an optimization that only works when integers are not represented as floating point values. v2: Re-word-wrap a line, as requested by Ian Romanick. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* mesa: Move is_power_of_two() function from brw_context.h to macros.h.Kenneth Graunke2014-04-081-0/+11
| | | | | | | | | This makes the function available from core Mesa code, including the GLSL compiler. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* mesa: rename stencil/Z functions in format_unpack.cBrian Paul2014-04-071-40/+40
| | | | | | So the function names match the format names. Reviewed-by: Ian Romanick <[email protected]>
* mesa/soft/llvmpipe: add fake MSAA supportDave Airlie2014-04-022-1/+3
| | | | | | | | This adds a gallium cap that allows us to fake GL3.0 by not exposing MSAA on sw rendering. It also forces the extra extensions needed for GL3.2. Signed-off-by: Dave Airlie <[email protected]>
* mesa: Allow setting GL_TEXTURE_MAX_LEVEL to 0 with GL_TEXTURE_RECTANGLE.Iago Toral Quiroga2014-04-011-1/+2
| | | | | | | | | | | | | | | | | Currently, we raise an error when doing this which breaks a conformance test from the OpenGL samples pack. Even if this is a bit silly it is not an error. From http://www.opengl.org/wiki/Rectangle_Texture: "Rectangle textures contain exactly one image; they cannot have mipmaps. Therefore, any texture parameters that depend on LODs are irrelevant when used with rectangle textures; attempting to set these parameters to any value other than 0 will result in an error." Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=76496 Reviewed-by: Brian Paul <[email protected]>
* glsl: remove UBO fields from _mesa_glsl_parse_stateChia-I Wu2014-04-011-2/+1
| | | | | | | They are not needed since 514f8c7ec7cc1ab18be93cebb5b9bf970b1955a9. Signed-off-by: Chia-I Wu <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* mesa/st: Accelerate ARB_clear_buffer_object with clear_bufferIlia Mirkin2014-03-312-3/+10
| | | | | Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* mesa: Fix format matching checks for GL_INTENSITY* internalformats.Chris Forbes2014-04-011-8/+12
| | | | | | | | | | | | GL_INTENSITY has never been valid as a pixel format -- to get the memcpy pack/unpack paths, the app needs to specify GL_RED as the pixel format (or GL_RED_INTEGER for the integer formats). Note: This was briefly merged before, but exposed some breakage in gallium, so was reverted. Hopefully it will stick this time. Signed-off-by: Chris Forbes <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: fix texstore for MESA_FORMAT_R8G8B8A8_SRGBChris Forbes2014-04-011-4/+6
| | | | | | | | The case for this was in the wrong function, and this format's store func was not set in the table at all. Signed-off-by: Chris Forbes <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: fix glMultiDrawArrays inside a display listBrian Paul2014-03-271-3/+4
| | | | | | | | | | | | | | | The underlying glDrawArrays() calls weren't getting compiled into the display list. We simply need to use the current dispatch table so the CALL_DrawArrays() is routed to the display list save function. This patch also fixes glMultiModeDrawArraysIBM and glMultiModeDrawElementsIBM. Fixes the new piglit gl-1.4-dlist-multidrawarrays test. Cc: "10.0" "10.1" <[email protected]> Reviewed-by: José Fonseca <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* mesa: fix unpack_Z32_FLOAT_X24S8() / unpack_Z32_FLOAT() mix-upBrian Paul2014-03-261-4/+4
| | | | | | | And use the z32f_x24s8 helper struct in unpack_Z32_FLOAT_X24S8(). Cc: "10.0" "10.1" <[email protected]> Reviewed-by: Roland Scheidegger <[email protected]>
* mesa: fix indentation, formatting, etc in fbobject.cBrian Paul2014-03-261-38/+56
|
* mesa: rename format_(un)pack.c functions to match format names (pt. 7)Brian Paul2014-03-262-34/+34
| | | | | | | | | | | sed commands: s/z_Z24_S8\b/S8_UINT_Z24_UNORM/g s/z_S8_Z24\b/Z24_UNORM_S8_UINT/g s/z_Z16\b/Z_UNORM16/g s/z_Z32\b/Z_UNORM32/g s/z_Z32_FLOAT/Z_FLOAT32/g Reviewed-by: Reviewed-by: Roland Scheidegger <[email protected]>
* mesa: rename format_(un)pack.c functions to match format names (pt. 6)Brian Paul2014-03-262-12/+12
| | | | | | | | sed commands: s/ARGB2101010_UINT\b/B10G10R10A2_UINT/g s/ABGR2101010_UINT\b/R10G10B10A2_UINT/g Reviewed-by: Reviewed-by: Roland Scheidegger <[email protected]>
* mesa: rename format_(un)pack.c functions to match format names (pt. 5)Brian Paul2014-03-262-72/+72
| | | | | | | | | | | | | | | | | | | | | | | | | | | | sed commands: s/SIGNED_R_UNORM8\b/R_SNORM8/g s/SIGNED_RG88_REV\b/R8G8_SNORM/g s/SIGNED_RGBX8888\b/X8B8G8R8_SNORM/g s/SIGNED_A8B8G8R8_UNORM\b/A8B8G8R8_SNORM/g s/SIGNED_R8G8B8A8_UNORM\b/R8G8B8A8_SNORM/g s/SIGNED_R_UNORM16\b/R_SNORM16/g s/SIGNED_R16G16_UNORM\b/R16G16_SNORM/g s/SIGNED_RGB_16\b/RGB_SNORM16/g s/SIGNED_RGBA_16\b/RGBA_SNORM16/g s/SIGNED_A_UNORM8\b/A_SNORM8/g s/SIGNED_L_UNORM8\b/L_SNORM8/g s/SIGNED_L8A8_UNORM\b/L8A8_SNORM/g s/SIGNED_L_UNORM8\b/I_SNORM8/g s/SIGNED_A_UNORM16\b/A_SNORM16/g s/SIGNED_L_UNORM16\b/L_SNORM16/g s/SIGNED_L16A16_UNORM\b/LA_SNORM16/g s/SIGNED_L_UNORM16\b/I_SNORM16/g s/XBGR16161616_SNORM\b/RGBX_SNORM16/g s/SIGNED_G8R8_UNORM\b/G8R8_SNORM/g s/SIGNED_G16R16_UNORM\b/G16R16_SNORM/g s/SIGNED_I_UNORM8\b/I_SNORM8/g s/SIGNED_I_UNORM16\b/I_SNORM16/g Reviewed-by: Reviewed-by: Roland Scheidegger <[email protected]>
* mesa: rename format_(un)pack.c functions to match format names (pt. 4)Brian Paul2014-03-262-44/+44
| | | | | | | | | | | | | | | sed commands: s/SRGBA_UNORM8\b/A8B8G8R8_SRGB/g s/SABGR_UNORM8\b/R8G8B8A8_SRGB/g s/SARGB8\b/B8G8R8A8_SRGB/g s/XBGR8888_SRGB\b/R8G8B8X8_SRGB/g s/XRGB8888_SRGB\b/B8G8R8X8_SRGB/g s/SL_UNORM8\b/L_SRGB8/g s/SLA_UNORM8\b/L8A8_SRGB/g manually changed SRGB8 -> BGR_SRGB8 Reviewed-by: Reviewed-by: Roland Scheidegger <[email protected]>
* mesa: rename format_(un)pack.c functions to match format names (pt. 3)Brian Paul2014-03-262-67/+67
| | | | | | | | | | | | | | | | | | | sed commands: s/LUMINANCE_FLOAT32\b/L_FLOAT32/g s/LUMINANCE_FLOAT16\b/L_FLOAT16/g s/LUMINANCE_ALPHA_FLOAT32\b/LA_FLOAT32/g s/LUMINANCE_ALPHA_FLOAT16\b/LA_FLOAT16/g s/ALPHA_FLOAT32\b/A_FLOAT32/g s/ALPHA_FLOAT16\b/A_FLOAT16/g s/XBGR32323232_FLOAT\b/RGBX_FLOAT32/g s/RGB9_E5_FLOAT\b/R9G9B9E5_FLOAT/g s/R11_G11_B10_FLOAT\b/R11G11B10_FLOAT/g s/INTENSITY_FLOAT16\b/I_FLOAT16/g s/INTENSITY_FLOAT32\b/I_FLOAT32/g v2: removed a few redundant/no-op substitutions Reviewed-by: Reviewed-by: Roland Scheidegger <[email protected]>
* mesa: rename format_(un)pack.c functions to match format names (pt. 2)Brian Paul2014-03-262-36/+36
| | | | | | | | | | | | sed commands: s/ABGR2101010\b/R10G10B10A2_UNORM/g s/XRGB2101010_UNORM\b/B10G10R10X2_UNORM/g s/XBGR16161616_UNORM\b/RGBX_UNORM16/g s/ABGR2101010\b/R10G10B10A2_UNORM/g s/I8\b/I_UNORM8/g s/I16\b/I_UNORM16/g Reviewed-by: Reviewed-by: Roland Scheidegger <[email protected]>
* mesa: rename format_(un)pack.c functions to match format names (pt. 1)Brian Paul2014-03-262-403/+403
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | sed commands: s/RGBA8888\b/A8B8G8R8_UNORM/g s/RGBA8888_REV\b/R8G8B8A8_UNORM/g s/ARGB8888\b/B8G8R8A8_UNORM/g s/ARGB8888_REV\b/A8R8G8B8_UNORM/g s/RGBA8888\b/X8B8G8R8_UNORM/g s/RGBA8888_REV\b/R8G8B8X8_UNORM/g s/XRGB8888\b/B8G8R8X8_UNORM/g s/XRGB8888_REV\b/X8R8G8B8_UNORM/g s/RGB888\b/BGR_UNORM8/g s/BGR888\b/RGB_UNORM8/g s/RGB565\b/B5G6R5_UNORM/g s/RGB565_REV\b/R5G6B5_UNORM/g s/ARGB4444\b/B4G4R4A4_UNORM/g s/ARGB4444_REV\b/A4R4G4B4_UNORM/g s/RGBA5551\b/A1B5G5R5_UNORM/g s/ARGB1555\b/B5G5R5A1_UNORM/g s/ARGB1555_REV\b/A1R5G5B5_UNORM/g s/AL44\b/L4A4_UNORM/g s/AL88\b/L8A8_UNORM/g s/AL88_REV\b/A8L8_UNORM/g s/AL1616\b/L16A16_UNORM/g s/AL1616_REV\b/A16L16_UNORM/g s/RGB332\b/B2G3R3_UNORM/g s/A8\b/A_UNORM8/g s/A16\b/A_UNORM16/g s/L8\b/L_UNORM8/g s/L16\b/L_UNORM16/g s/L8\b/I_UNORM8/g s/L16\b/I_UNORM16/g s/R8\b/R_UNORM8/g s/GR88\b/R8G8_UNORM/g s/RG88\b/G8R8_UNORM/g s/R16\b/R_UNORM16/g s/GR1616\b/R16G16_UNORM/g s/RG1616\b/G16R16_UNORM/g s/ARGB2101010\b/B10G10R10A2_UNORM/g Reviewed-by: Reviewed-by: Roland Scheidegger <[email protected]>
* mesa: In core profile, refuse to draw unless a VAO is bound.Kenneth Graunke2014-03-251-1/+4
| | | | | | | | | | | | Core profile requires a non-default VAO to be bound. Currently, calls to glVertexAttribPointer raise INVALID_OPERATION unless a VAO is bound, and we never actually get any vertex data set. Trying to draw without any vertex data can only cause problems. In i965, it causes a crash. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=76400 Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Ian Romanick <[email protected]> Cc: [email protected]
* Revert "mesa: Fix format matching checks for GL_INTENSITY* internalformats."Chris Forbes2014-03-261-12/+8
| | | | This reverts commit 40d7b5195351d3e4199e7a840615a595a6dbaefc.
* mesa: move GLbitfield any_valid_stages declaration before codeBrian Paul2014-03-251-1/+2
| | | | To fix MSVC build.
* mesa/sso: Implement ValidateProgramPipelineGregory Hainaut2014-03-254-3/+203
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Implementation note: I don't use context for ralloc (don't know how). The check on PROGRAM_SEPARABLE flags is also done when the pipeline isn't bound. It doesn't make any sense in a DSA style API. Maybe we could replace _mesa_validate_program by _mesa_validate_program_pipeline. For example we could recreate a dummy pipeline object. However the new function checks also the TEXTURE_IMAGE_UNIT number not sure of the impact. V2: Fix memory leak with ralloc_strdup Formatting improvement V3 (idr): * Actually fix the leak of the InfoLog. :) * Directly generate logs in to gl_pipeline_object::InfoLog via ralloc_asprintf isntead of using a temporary buffer. * Split out from previous uber patch. * Change spec references to include section numbers, etc. * Fix a bug in checking that a different program isn't active in a stage between two stages that have the same program. Specifically, if (pipe->CurrentVertexProgram->Name == pipe->CurrentGeometryProgram->Name && pipe->CurrentGeometryProgram->Name != pipe->CurrentVertexProgram->Name) should have been if (pipe->CurrentVertexProgram->Name == pipe->CurrentFragmentProgram->Name && pipe->CurrentGeometryProgram->Name != pipe->CurrentVertexProgram->Name) v4 (idr): Rework to use CurrentProgram array in loops. Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* mesa/sso: Add _mesa_sampler_uniforms_pipeline_are_validGregory Hainaut2014-03-252-0/+79
| | | | | | | | | | | | | | | | | | This is much like _mesa_sampler_uniforms_are_valid, but it operates across an entire pipeline object. This function differs from _mesa_sampler_uniforms_are_valid in that it directly creates the gl_pipeline_object::InfoLog instead of writing to some temporary buffer. This was originally included in another patch, but it was split out by Ian Romanick. v2 (idr): Fix the loop bounds. shProg isn't an array, so ARRAY_SIZE(shProg) was 1, so only the vertex program was validated. Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* mesa/sso: Add gl_pipeline_object::InfoLog supportGregory Hainaut2014-03-252-3/+24
| | | | | | | | | | | V2 (idr): * Keep the behavior of other info logs in Mesa: and empty info log reports a GL_INFO_LOG_LENGTH of zero. * Use a NULL pointer to denote an empty info log. * Split out from previous uber patch. Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* mesa/sso: Implement GL_PROGRAM_PIPELINE_BINDING for glGetGregory Hainaut2014-03-252-0/+12
| | | | | Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* mesa/sso: Implement _mesa_BindProgramPipelineGregory Hainaut2014-03-251-0/+69
| | | | | | | | | | | | | | | | | | | | Test become green in piglit: The updated ext_transform_feedback-api-errors:useprogstage_noactive useprogstage_active bind_pipeline arb_separate_shader_object-GetProgramPipelineiv arb_separate_shader_object-IsProgramPipeline For the moment I reuse Driver.UseProgram but I guess it will be better to create a UseProgramStages functions. Opinion is welcome V2: formatting & rename V3 (idr): * Change spec references to core OpenGL versions instead of issues in the extension spec. Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* mesa/sso: Implement _mesa_UseProgramStagesGregory Hainaut2014-03-251-0/+102
| | | | | | | | | | | | | | | | | | | Now arb_separate_shader_object-GetProgramPipelineiv should pass. V3 (idr): * Change spec references to core OpenGL versions instead of issues in the extension spec. * Split out from previous uber patch. v4 (idr): Use _mesa_has_geometry_shaders in _mesa_UseProgramStages to detect availability of geometry shaders. v5 (idr): Whitespace cleanup, use _mesa_lookup_shader_program_err instead of open-coding it again, and update some comments at the end of _mesa_UseProgramStages. All suggested by Eric. Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* mesa/sso: Add gl_pipeline_object parameter to _mesa_use_shader_programGregory Hainaut2014-03-252-12/+18
| | | | | | | | | | | | | Extend use_shader_program to support a different target. Allow to reuse the function to update the pipeline state. Note I bypass the flush when target isn't current. Maybe it would be better to create a new UseProgramStages driver function This was originally included in another patch, but it was split out by Ian Romanick. Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* mesa/sso: rename Shader to the pointer _ShaderGregory Hainaut2014-03-2510-76/+90
| | | | | | | | | | | | | | | | Basically a sed but shaderapi.c and get.c. get.c => GL_CURRENT_PROGAM always refer to the "old" UseProgram behavior shaderapi.c => the old api stil update the Shader object directly V2: formatting improvement V3 (idr): * Rebase fixes after a block of code was moved from ir_to_mesa.cpp to shaderapi.c. * Trivial reformatting. Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* mesa/sso: replace Shader binding point with _ShaderGregory Hainaut2014-03-253-3/+125
| | | | | | | | | | | | | | | | | | | | | | | | | | | To avoid NULL pointer check a default pipeline object is installed in _Shader when no program is current The spec say that UseProgram/UseShaderProgramEXT/ActiveProgramEXT got an higher priority over the pipeline object. When default program is uninstall, the pipeline is used if any was bound. Note: A careful rename need to be done now... V2: formating improvement V3 (idr): * Build fix. The original patch added calls to _mesa_use_shader_program with 4 parameters, but the fourth parameter isn't added to that function until a much later patch. Just drop that parameter for now. * Trivial reformatting. * Updated comment of gl_context::_Shader v4 (idr): Reformat spec quotations to look like spec quotations. Update comments describing what gl_context::_Shader can point to. Bot suggested by Eric. Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* mesa: Skip clearing color buffers when color writes are disabled.Kenneth Graunke2014-03-241-1/+26
| | | | | | | | | | | | | | | | | | WebGL Aquarium in Chrome 24 actually hits this. v2: Move to core Mesa (wisely suggested by Ian); only consider components which actually exist. v3: Use _mesa_format_has_color_component to determine whether components actually exist, fixing alpha format handling. v4: Add a comment, as requested by Brian. No actual code changes. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Ian Romanick <[email protected]> Tested-by: Dylan Baker <[email protected]>
* mesa: Introduce a _mesa_format_has_color_component() helper.Kenneth Graunke2014-03-242-0/+33
| | | | | | | | | | | | | When considering color write masks, we often want to know whether an RGBA component actually contains any meaningful data. This function provides an easy way to answer that question, and handles luminance, intensity, and alpha formats correctly. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Ian Romanick <[email protected]> Tested-by: Dylan Baker <[email protected]>
* mesa: Stop skipping the FinishRenderTexture calls for winsys FBOs.Eric Anholt2014-03-241-2/+3
| | | | | | | | | | Now that BindRenderbufferTexImage() is a thing that drivers can do, winsys FBOs *can* have NeedsFinishRenderTexture set. v2: Keep the short-circuit for non-BindRenderbufferTexImage() drivers (review by Ken). Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Generate FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT earlierChris Forbes2014-03-251-6/+6
| | | | | | | | | | | | | | The ARB_framebuffer_object spec lists this case before the FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER and FRAMEBUFFER_INCOMPLETE_READ_BUFFER cases. Fixes two broken cases in piglit's fbo-incomplete test, if ARB_ES2_compatibility is not advertised. (If it is, this is masked because the FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER / FRAMEBUFFER_INCOMPLETE_READ_BUFFER cases are removed by that extension) Signed-off-by: Chris Forbes <[email protected]> Reviewed-by: Brian Paul <[email protected]>