summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/svga
Commit message (Collapse)AuthorAgeFilesLines
* svga: print warning for unsupported indirect dest reg indexingBrian Paul2013-11-151-0/+4
| | | | | | | | | For DX9-level shaders, there's only limited support for indirect indexing of registers (with the loop counter register, not the general address register.) Reviewed-by: José Fonseca <[email protected]> Reviewed-by: Roland Scheidegger <[email protected]>
* svga: mark dest image as defined in svga_surface_copy()Brian Paul2013-11-151-0/+2
| | | | | | | | | | | | After we blit/copy to a dest texture image we need to mark it as being defined. This fixes broken mipmap generation for quite a few texture formats. Mipgen involves making texture views and svga_texture_view_surface() skips texture images that are undefined. Cc: "10.0" <[email protected]> Reviewed-by: José Fonseca <[email protected]> Reviewed-by: Roland Scheidegger <[email protected]>
* svga: do primitive trimming in translate_indices()Brian Paul2013-11-151-3/+12
| | | | | | | | | | | | | | The index translation code expects the number of indexes to be consistent with the primitive type (ex: a multiple of 3 for PIPE_PRIM_TRIANGLES). If it's not, we can write out of bounds in the destination buffer. Fixes failed assertions in the pipebuffer debug code found with Piglit primitive-restart-draw-mode test. Cc: "10.0" <[email protected]> Reviewed-by: José Fonseca <[email protected]>
* svga: improve loops over color buffersBrian Paul2013-11-116-10/+20
| | | | | | | Only loop over the actual number of color buffers supported, not PIPE_MAX_COLOR_BUFS. Reviewed-by: José Fonseca <[email protected]>
* svga: document magic number of 8 render targets per batchBrian Paul2013-11-111-1/+13
| | | | | Grab the comments from commit message b84b7f19dfdc0 to explain what the code is doing.
* svga: always return 4 for PIPE_MAX_COLOR_BUFSBrian Paul2013-11-071-5/+4
| | | | | | Even if the query returns 8, only 4 really work. Reviewed-by: José Fonseca <[email protected]>
* svga: return true for the PIPE_CAP_SM3 queryBrian Paul2013-11-071-1/+3
| | | | | | | | | | This just tells the state tracker to turn on the GL_ARB_shader_texture_lod extension. This simply allows the GLSL compiler to emit TXL and TXD instructions for both vertex and fragment shaders. We already support these opcodes in the svga driver. Though, the shadow2DGrad() Piglit tests are failing. Reviewed-by: José Fonseca <[email protected]>
* draw,llvmpipe,util: add depth bias calculation for arb_depth_buffer_floatMatthew McClure2013-11-071-2/+8
| | | | | | | | | | | | | | | With this patch, the llvmpipe and draw modules will calculate the depth bias according to floating point depth buffer semantics described in the arb_depth_buffer_float specification, when the driver has a z buffer bound with a format type of UTIL_FORMAT_TYPE_FLOAT. By default, the driver will use the existing UNORM calculation for depth bias. A new function, draw_set_zs_format, was added to calculate the Minimum Resolvable Depth value and floating point depth sense for the draw module. Reviewed-by: Jose Fonseca <[email protected]> Reviewed-by: Roland Scheidegger <[email protected]>
* gallium/auxiliary/indices: add start paramRob Clark2013-10-292-2/+2
| | | | | | | Add 'start' parameter to generator/translator. Signed-off-by: Rob Clark <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* svga: reindent drawing codeBrian Paul2013-10-293-266/+199
|
* gallium: add PIPE_CAP_MIXED_FRAMEBUFFER_SIZESIlia Mirkin2013-10-261-0/+1
| | | | | | | | | This CAP will determine whether ARB_framebuffer_object can be enabled. The nv30 driver does not allow mixing swizzled and linear zsbuf/cbuf textures. Signed-off-by: Ilia Mirkin <[email protected]> Signed-off-by: Marek Olšák <[email protected]>
* svga: remove user-space vertex/index buffer codeBrian Paul2013-10-246-259/+13
| | | | | | | | The gallium vbuf module, which we've been using for some time now, takes care of uploading user-space vertex/index data into real buffers. The upload code in the svga driver was unused. Reviewed-by: José Fonseca <[email protected]>
* gallium: new, unified pipe_context::set_sampler_views() functionBrian Paul2013-10-231-10/+1
| | | | | | | | | | | | The new function replaces four old functions: set_fragment/vertex/ geometry/compute_sampler_views(). Note: at this time, it's expected that the 'start' parameter will always be zero. Reviewed-by: Roland Scheidegger <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Tested-by: Emil Velikov <[email protected]>
* svga: remove unneeded include of u_double_list.hBrian Paul2013-10-231-2/+0
|
* svga: minor fix-ups in svga_get_shader_param()Brian Paul2013-10-161-2/+3
| | | | | Fix debug error message. Add switch case for PIPE_SHADER_COMPUTE. Trivial.
* svga: s/0/FALSE/Brian Paul2013-10-111-2/+2
|
* svga: fix incorrect memcpy src in svga_buffer_upload_piecewise()Brian Paul2013-10-041-1/+1
| | | | | | | | | As we march over the source buffer we're uploading in pieces, we need to memcpy from the current offset, not the start of the buffer. Fixes graphical corruption when drawing very large vertex buffers. Cc: "9.2" <[email protected]> Reviewed-by: Matthew McClure <[email protected]>
* svga: don't hook in old bind_fragment_sampler_states() functionsBrian Paul2013-10-031-9/+0
|
* svga: implement pipe_context::bind_sampler_states()Brian Paul2013-10-031-0/+1
|
* svga: fix pixel center integerBrian Paul2013-09-301-2/+4
| | | | | | | The svga/d3d9 convention is that pixel centers are at integer coordinates. Fixes piglit glsl-arb-fragment-coord-conventions test. Reviewed-by: José Fonseca <[email protected]>
* svga: return 0 for PIPE_CAP_PREFER_BLIT_BASED_TEXTURE_TRANSFERBrian Paul2013-09-301-1/+1
| | | | | | | | | Using the map/unmap path for glTexImage is a little bit faster than blitting. Also, this fixes about 50 assorted piglit failures that seem to be related to the blit version of glReadPixels. Reviewed-by: Thomas Hellstrom <[email protected]> Reviewed-by: José Fonseca <[email protected]>
* svga: we don't support TGSI_OPCODE_CONTBrian Paul2013-09-302-2/+5
| | | | So return PIPE_SHADER_CAP_TGSI_CONT_SUPPORTED = 0.
* gallium: add flush_resource context functionMarek Olšák2013-09-201-0/+8
| | | | | | | | | r600g needs explicit flushing before DRI2 buffers are presented on the screen. v2: add (stub) implementations for all drivers, fix frontbuffer flushing v3: fix galahad Signed-off-by: Marek Olšák <[email protected]>
* svga: replace 0 with PIPE_OK in a few placesBrian Paul2013-08-263-5/+5
|
* svga: minor clean-ups in emit_hw_vs_vdecl()Brian Paul2013-08-211-6/+6
|
* draw: inject frontface info into wireframe outputsZack Rusin2013-08-021-0/+1
| | | | | | | | | | | | | | Draw module can decompose primitives into wireframe models, which is a fancy word for 'lines', unfortunately that decomposition means that we weren't able to preserve the original front-face info which could be derived from the original primitives (lines don't have a 'face'). To fix it allow draw module to inject a fake face semantic into outputs from which the backends can figure out the original frontfacing info of the primitives. Signed-off-by: Zack Rusin <[email protected]> Reviewed-by: Roland Scheidegger <[email protected]> Reviewed-by: Jose Fonseca <[email protected]>
* gallium: Add PIPE_CAP_ENDIANNESSTom Stellard2013-07-221-0/+2
| | | | | | Cc: [email protected] [ Francisco Jerez: Fix "PIPE_ENDIAN_SMALL" in the documentation, define PIPE_ENDIAN_NATIVE. ]
* tgsi: rename the TGSI fragment kill opcodesBrian Paul2013-07-121-9/+9
| | | | | | | | | | | | | | | | | | | | | TGSI_OPCODE_KIL and KILP had confusing names. The former was conditional kill (if any src component < 0). The later was unconditional kill. At one time KILP was supposed to work with NV-style condition codes/predicates but we never had that in TGSI. This patch renames both opcodes: TGSI_OPCODE_KIL -> KILL_IF (kill if src.xyzw < 0) TGSI_OPCODE_KILP -> KILL (unconditional kill) Note: I didn't just transpose the opcode names to help ensure that I didn't miss updating any code anywhere. I believe I've updated all the relevant code and comments but I'm not 100% sure that some drivers had this right in the first place. For example, the radeon driver might have llvm.AMDGPU.kill and llvm.AMDGPU.kilp mixed up. Driver authors should review their code. Reviewed-by: Jose Fonseca <[email protected]>
* mesa,glsl,gallium: remove GLSLSkipStrictMaxVaryingLimitCheck and dependenciesMarek Olšák2013-07-021-1/+0
| | | | | | Not needed with do_dead_builtin_varyings. Reviewed-by: Ian Romanick <[email protected]>
* svga: pass svga_compile_key by reference instead of valueBrian Paul2013-06-281-7/+7
| | | | Reviewed-by: Jose Fonseca <[email protected]>
* svga: use switch statement in svga_shader_type()Brian Paul2013-06-281-5/+10
| | | | | | | Safer in case the PIPE_SHADER_x tokens get renumbered (as Marek wanted to do). Reviewed-by: Jose Fonseca <[email protected]>
* svga: allow 3D transfers in svga_texture_transfer_map()Brian Paul2013-06-251-4/+3
| | | | Reviewed-by: Jose Fonseca <[email protected]>
* svga: use new svga_define_texture_level() helperBrian Paul2013-06-252-2/+15
| | | | | | To get array bounds checking. Reviewed-by: Jose Fonseca <[email protected]>
* svga: fix layer/level mix-up in svga_mark_surface_dirty()Brian Paul2013-06-251-1/+1
| | | | Reviewed-by: Jose Fonseca <[email protected]>
* svga: use new svga_age_texture_view() helperBrian Paul2013-06-252-1/+14
| | | | | | | | | The function does array bounds checking. Note, this exposes a bug in the svga_mark_surface_dirty() function: we're calling svga_age_texture_view() with a texture slice instead of mipmap level. This can lead to a failed assertion. That'll be fixed next. Reviewed-by: Jose Fonseca <[email protected]>
* svga: add array index assertion in svga_validate_sampler_view()Brian Paul2013-06-251-0/+1
|
* svga: use svga_texture() helper instead of castingBrian Paul2013-06-251-1/+1
|
* svga: minor cleanups, comments in svga_tgsi_insn.cBrian Paul2013-06-221-8/+19
|
* svga: add null ptr check in svga_get_tex_sampler_view()Brian Paul2013-06-221-0/+3
| | | | Trivial.
* svga: add some comments about primitive conversionBrian Paul2013-06-192-11/+26
| | | | | | | And clean up the svga_translate_prim() function with better variable names. Reviewed-by: Jose Fonseca <[email protected]>
* svga: reindent svga_tgsi.cBrian Paul2013-06-191-63/+65
| | | | Reviewed-by: Jose Fonseca <[email protected]>
* svga: whitespace, comment, formatting fixes in svga_tgsi_emit.hBrian Paul2013-06-191-42/+56
| | | | Reviewed-by: Jose Fonseca <[email protected]>
* svga: move some svga/tgsi functionsBrian Paul2013-06-193-125/+149
| | | | | | | | Move some functions from the svga_tgsi_insn.h header into the svga_tgsi_insn.c file since they're only used there. Plus, add comments and fix formatting. Reviewed-by: Jose Fonseca <[email protected]>
* svga: formatting fixes in svga_tgsi_insn.cBrian Paul2013-06-191-260/+395
| | | | Reviewed-by: Jose Fonseca <[email protected]>
* gallium: add condition parameter to render_conditionRoland Scheidegger2013-06-181-1/+1
| | | | | | | | | | | | | For conditional rendering this makes it possible to skip rendering if either the predicate is true or false, as supported by d3d10 (in fact previously it was sort of implied skip rendering if predicate is false for occlusion predicate, and true for so_overflow predicate). There's no cap bit for this as presumably all drivers could do it trivially (but this patch does not implement it for the drivers using true hw predicates, nvxx, r600, radeonsi, no change is expected for OpenGL functionality). Reviewed-by: Jose Fonseca <[email protected]>
* svga: add PIPE_CAP_MAX_VIEWPORTS to switch to silence warningBrian Paul2013-05-291-0/+2
|
* gallium: Add support for multiple viewportsZack Rusin2013-05-252-9/+13
| | | | | | | | | | | | Gallium supported only a single viewport/scissor combination. This commit changes the interface to allow us to add support for multiple viewports/scissors. Signed-off-by: Zack Rusin <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Reviewed-by: José Fonseca<[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Roland Scheidegger <[email protected]>
* draw: try to prevent overflows on index buffersZack Rusin2013-05-141-2/+2
| | | | | | | | | | | | Pass in the size of the index buffer, when available, and use it to handle out of bounds conditions. The behavior in the case of an overflow needs to be the same as with other overflows in the vertex processing pipeline meaning that a vertex should still be generated but all attributes in it set to zero. Signed-off-by: Zack Rusin <[email protected]> Reviewed-by: José Fonseca <[email protected]> Reviewed-by: Roland Scheidegger <[email protected]>
* draw: don't crash on vertex buffer overflowZack Rusin2013-05-141-2/+2
| | | | | | | | | | | | | | We would crash when stride was bigger than the size of the buffer. The correct behavior is to just fetch zero's in this case. Unfortunatly with user_buffer's there's no way to validate the size because currently we're just not getting it. Adjust the draw interface to pass the size along the mapped buffer, which works perfectly for buffer backed vertex_buffers and, in future, it will allow us to plumb user_buffer sizes through the same interface. Signed-off-by: Zack Rusin <[email protected]> Reviewed-by: José Fonseca <[email protected]> Reviewed-by: Roland Scheidegger <[email protected]>
* gallium: add PIPE_CAP_MAX_TEXTURE_BUFFER_SIZE for GLMarek Olšák2013-05-111-0/+1
| | | | | | v2: fix typo 65535 -> 65536 Reviewed-by: Brian Paul <[email protected]>