summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* gallivm: split sampler and texture stateRoland Scheidegger2013-01-2820-357/+709
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Split the sampler interface to use separate sampler and texture (sampler_view) state. This is needed to support dx10-style sampling instructions. This is not quite complete since both draw/llvmpipe don't really track textures/samplers independently yet, as well as the gallivm code not quite using the right sampler or texture index respectively (but it should work for the sampling codes used by opengl). We are however losing some optimizations in the process, apply_max_lod will no longer work, and we potentially could end up with more (unnecessary) recompiles (if switching textures with/without mipmaps only so it shouldn't be too bad). v2: don't use different callback structs for sampler/sampler view functions (which just complicates things), fix up sampling code to actually use the right texture or sampler index, and similar for llvmpipe/draw actually distinguish between samplers and sampler views. v3: fix more of PIPE_MAX_SAMPLER / PIPE_MAX_SHADER_SAMPLER_VIEWS mismatches (both in draw and llvmpipe), based on feedback from José get rid of unneeded static sampler derived state.(which also fixes the only 2 piglit regressions due to a forgotten assignment), fix comments based on Brian's feedback. v4: remove some accidental unrelated whitespace changes Reviewed-by: José Fonseca <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* gallium/u_upload_mgr: fix a serious memory leakMarek Olšák2013-01-281-2/+1
| | | | It can eat all memory and crash in a matter of minutes with r600g.
* nouveau: don't try to use push_data if it's not implementedChristoph Bumiller2013-01-271-0/+3
|
* gles3: Update gl3.hMatt Turner2013-01-261-2/+2
| | | | | | Contains a fix for Khronos bug 9557. Reviewed-by: Jordan Justen <[email protected]>
* r600g: add more cases for copying unsupported formats to resource_copy_regionMarek Olšák2013-01-261-0/+12
| | | | just in case a new format is added to gallium
* r600g: don't use radeon_surface_level::npix_x/y/zMarek Olšák2013-01-264-32/+27
| | | | | | | npix_x/y/z is wrong with NPOT textures, since it's always aligned to POT if the level is non-zero, so we can't use that. This fixes piglit/spec/EXT_texture_shared_exponent/fbo-generatemipmap-formats.
* r600g: fix compile warnings in r600_cp_dma_copy_buffer on 32-bit gccMarek Olšák2013-01-262-4/+4
|
* r600g: fix up CP DMA for VM on cayman and TNAlex Deucher2013-01-252-6/+9
| | | | | | | Need to add the virtual address. Reviewed-by: Marek Olšák <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
* svga: use pipe_sampler_view_release() in svga_cleanup_tss_binding()Brian Paul2013-01-251-1/+1
| | | | | | | | | | | | | | Fixes a crash when the Redway3D Turbine demo exits. We've made this change in other places in the past. The root issue is texture objects are being shared by multiple contexts and sampler views get shared too. Sampler views have a context pointer and if that context gets deleted we may try to reference that context when finally deleting the sampler view. pipe_sampler_view_release() avoids this problem because it takes an explicit context. Reviewed-by: Zack Rusin <[email protected]>
* st/mesa: handle new GLSL IR enumerants in switch statementsBrian Paul2013-01-251-2/+16
| | | | To silence warnings about unhandled cases.
* svga: add NULL pointer check in svga_create_sampler_state()Brian Paul2013-01-251-0/+3
| | | | Note: This is a candidate for the 9.0 branch.
* vbo: add a null pointer check to handle OOM instead of crashingBrian Paul2013-01-251-0/+5
| | | | Note: This is a candidate for the 9.0 branch.
* util: add new error checking code in vbuf helperBrian Paul2013-01-251-27/+49
| | | | | | | | | | | Check the return value of calls to u_upload_alloc() and u_upload_data() and return early if needed. Since we don't have a way to propagate errors all the way up to Mesa through pipe_context::draw_vbo(), call debug_warn_once() so the user might have some clue about OOM errors. Note: This is a candidate for the 9.0 branch.
* st/mesa: do proper error checking for u_upload_alloc() callsBrian Paul2013-01-255-17/+26
| | | | | | | | | We weren't properly checking the return value of these calls (and calls to u_upload_data()) to detect OOM errors. Note: This is a candidate for the 9.0 branch. Reviewed-by: Jose Fonseca <[email protected]>
* util: add some defensive coding in u_upload_alloc()Brian Paul2013-01-251-1/+7
| | | | | | | | | | | | | | Some callers of this function were checking the 'ptr' result to see if the function failed. But the correct way is to check the regular return value for PIPE_ERROR_x. Now we initialize all the returned values at the top of the function in case we do hit an error (like OOM). Callers are more likely to detect OOM conditions now. But there are some callers which don't do any error checking... Note: This is a candidate for the 9.0 branch. Reviewed-by: Jose Fonseca <[email protected]>
* glsl: use glsl_strtof() instead of glsl_strtod()Brian Paul2013-01-252-8/+8
| | | | | | Since the result of those calls is always assigned to a float. Reviewed-by: Ian Romanick <[email protected]>
* glsl: add new glsl_strtof() functionBrian Paul2013-01-252-0/+25
| | | | | | | Note, we could alternately implement this in terms of glsl_strtod() with a (float) cast. Reviewed-by: Ian Romanick <[email protected]>
* softpipe: add casts to silence MSVC warningsBrian Paul2013-01-251-2/+2
| | | | Reviewed-by: José Fonseca <[email protected]>
* util: silence MSVC signed/unsigned comparison warningsBrian Paul2013-01-251-4/+4
| | | | Reviewed-by: José Fonseca <[email protected]>
* util: silence MSVC double->float conversion warningsBrian Paul2013-01-251-2/+2
| | | | Reviewed-by: José Fonseca <[email protected]>
* util: silence MSVC signed/unsigned warnings in debug_get_flags_option()Brian Paul2013-01-251-1/+1
| | | | Reviewed-by: José Fonseca <[email protected]>
* st/mesa: silence assorted MSVC warnings in DrawPixels codeBrian Paul2013-01-251-2/+2
| | | | Reviewed-by: José Fonseca <[email protected]>
* swrast: silence a bunch of MSVC warningsBrian Paul2013-01-251-19/+19
| | | | Reviewed-by: José Fonseca <[email protected]>
* mesa: use GLbitfield64 when copying program inputsBrian Paul2013-01-251-2/+2
| | | | | | Note: This is a candidate for the 9.0 branch. Reviewed-by: José Fonseca <[email protected]>
* mesa: add some casts to silence MSVC warningsBrian Paul2013-01-251-14/+14
| | | | Reviewed-by: José Fonseca <[email protected]>
* 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]>
* i965: Enable ARB_shading_language_packingMatt Turner2013-01-251-0/+1
| | | | | Reviewed-by: Chad Versace <[email protected]> Reviewed-by: Paul Berry <[email protected]>
* i965: Assert that the 4x8 pack/unpack operations have been loweredMatt Turner2013-01-253-0/+12
| | | | | Reviewed-by: Chad Versace <[email protected]> Reviewed-by: Paul Berry <[email protected]>
* i965: Lower the 4x8 pack/unpack operationsMatt Turner2013-01-251-1/+5
| | | | | Reviewed-by: Chad Versace <[email protected]> Reviewed-by: Paul Berry <[email protected]>
* glsl: Add support for lowering 4x8 pack/unpack operationsMatt Turner2013-01-252-0/+285
| | | | | | | Lower them to arithmetic and bit manipulation expressions. Reviewed-by: Chad Versace <[email protected]> Reviewed-by: Paul Berry <[email protected]>
* glsl: Evaluate constant pack/unpack 4x8 expressionsMatt Turner2013-01-251-0/+166
| | | | | | | | | That is, evaluate constant expressions for the following functions: packSnorm4x8, unpackSnorm4x8 packUnorm4x8, unpackUnorm4x8 Reviewed-by: Chad Versace <[email protected]> Reviewed-by: Paul Berry <[email protected]>
* glsl: Extend ir_expression_operation for ARB_shading_language_packingMatt Turner2013-01-254-0/+31
| | | | | | | | | For each function {pack,unpack}{Snorm,Unorm}4x8, add a corresponding opcode to enum ir_expression_operation. Validate the new opcodes in ir_validate.cpp. Reviewed-by: Chad Versace <[email protected]> Reviewed-by: Paul Berry <[email protected]>
* glsl: Add IR lisp for ARB_shading_language_packingMatt Turner2013-01-255-0/+38
| | | | | Reviewed-by: Chad Versace <[email protected]> Reviewed-by: Paul Berry <[email protected]>
* glsl: Add infrastructure for ARB_shading_language_packingMatt Turner2013-01-257-0/+10
| | | | | Reviewed-by: Chad Versace <[email protected]> Reviewed-by: Paul Berry <[email protected]>
* configure.ac: Don't set LLVM_LIBS when llvm is disabledTom Stellard2013-01-251-16/+19
|
* r600g: Don't build llvm_wrapper.cpp when we aren't using LLVMTom Stellard2013-01-251-1/+3
| | | | | | | | | | | | | | | | | | We were using the NEED_RADEON_GALLIUM conditional to decide whether or not to build llvm_wrapper.cpp, which is required for using the LLVM backend. llvm_wrapper.cpp needs to be linked against the LLVM IPO libary and this library is only added to LLVM_LIBS if either opencl or the r600-llvm-compiler is enabled. The NEED_RADEON_GALLIUM conditional is set to true when enabling the radeonsi driver, so if the radeonsi and r600 drivers are enabled without also enabling opencl or r600-llvm-compiler, llvm_wrapper.cpp will be built, but the IPO library won't be added to LLVM_LIBS. This was causing unresolved symbol errors when buiding with this configuration. https://bugs.freedesktop.org/show_bug.cgi?id=59831 Tested-by: Alex Deucher <[email protected]>
* i965: Pass in the glarray to get_surface_type.Eric Anholt2013-01-251-29/+22
| | | | | | | Dereffing all the values in the two callers was just pointless, and the function isn't inlined so there was actual code impact. Reviewed-by: Kenneth Graunke <[email protected]>
* i965: Remove nonsense comment.Eric Anholt2013-01-251-2/+0
| | | | | | vb.inputs_read has never been a thing, even in the initial import. Reviewed-by: Kenneth Graunke <[email protected]>
* i965: Remove NDEBUG undef that was snuck in.Eric Anholt2013-01-251-2/+0
| | | | | | If you want debug, set --enable-debug in your config flags. Reviewed-by: Kenneth Graunke <[email protected]>
* i965: reuse _mesa_sizeof_type for index buffer types.Eric Anholt2013-01-251-24/+2
| | | | | | | The core Mesa code has just one more case than this (GL_BITMAP), so I don't see any cause to special-case it. Reviewed-by: Kenneth Graunke <[email protected]>
* i965: Reuse precalculated ib_type_size value.Eric Anholt2013-01-251-1/+1
| | | | Reviewed-by: Kenneth Graunke <[email protected]>
* i965: Drop debug check for knowing the size of a type.Eric Anholt2013-01-251-2/+1
| | | | | | | | This was added in b93684f5f311f89c965960ab42bfea71a397b180, but there's no need for it -- get_size has to succeed, and it has an assert for us in debug builds. Reviewed-by: Kenneth Graunke <[email protected]>
* i965: Stop worrying about alignment of vertex data.Eric Anholt2013-01-251-7/+1
| | | | | | | | | For our current types, the required alignment is actually just 1 byte. When we get doubles, we have to worry (those have to be aligned to the natural size), but we don't have doubles yet and they'll just be a special case. Reviewed-by: Kenneth Graunke <[email protected]>
* i965: Use the glarray _ElementSize that Mesa tracks for us.Eric Anholt2013-01-252-8/+4
| | | | Reviewed-by: Kenneth Graunke <[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: Remove ir_variable::uniform_blockIan Romanick2013-01-255-14/+0
| | | | | | | | | v2: A previous patch contained a spurious hunk that removed an assignment to ir_variable::uniform_block. That hunk was moved to this patch. Suggested by Carl Worth. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* glsl: Allow dereferencing fields of an interface instanceIan Romanick2013-01-251-1/+2
| | | | | Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Jordan Justen <[email protected]>
* glsl: Allow elimination of uniform block membersIan Romanick2013-01-251-6/+1
| | | | | | | | | | | | | | | | | | | glGetActiveUniform is not supposed to report block members that are not active even if they are included in the layout of the block. The block layout is determined from the GLSL_TYPE_INTERFACE that defines the block, so eliminating the ir_variables that correspond to the individual fields is safe. Fixes gles3conform test uniform_buffer_object_getuniformindices_for_for_nonexistent_or_not_active_uniform_names. This also fixes the assertion failures (added in the previous commit) in gles3conform uniform_buffer_object_index_of_not_active_block, uniform_buffer_object_inherit_and_override_layouts, and uniform_buffer_object_repeat_global_scope_layouts. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Jordan Justen <[email protected]>
* glsl: Calculate UBO data at link-timeIan Romanick2013-01-253-77/+44
| | | | | | | | | | | | | Use the function added in the previous commit. This temporarily causes gles3conform uniform_buffer_object_index_of_not_active_block, uniform_buffer_object_inherit_and_override_layouts, and uniform_buffer_object_repeat_global_scope_layouts to assertion fail. This is fixed in the next commit. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Jordan Justen <[email protected]>
* glsl: Add link_uniform_blocks to calculate all UBO data at link-timeIan Romanick2013-01-252-0/+255
| | | | | | | | Calculate all of the block member offsets, the IndexNames, and everything else to do with every UBO. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Jordan Justen <[email protected]>