aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/vc4/vc4_resource.c
Commit message (Collapse)AuthorAgeFilesLines
* vc4: fix vc4_resource_from_handle() stride calculationRob Herring2016-06-151-2/+2
| | | | | | | | | | | | | | The expected stride calculation is completely wrong. It should ultimately be multiplying cpp and width rather than dividing. The width also needs to be aligned to the tiling width first before converting to stride bytes. The whole stride check here is possibly pointless. Any buffers which were allocated outside of vc4 may have strides with larger alignment requirements. Signed-off-by: Rob Herring <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* vc4: Size transfer temporary mappings appropriately for full maps of 3D.Eric Anholt2016-05-181-2/+2
| | | | | | | | | We don't really support reading/writing of 3D textures since the hardware doesn't do 3D, but we do need to make sure that a pipe_transfer for them has enough space to store the image. This was previously not a problem because the state tracker only mapped a slice at a time until fb9fe352ea41c7e3633ba2c483c59b73c529845b. Fixes glean glsl1 tests, which all have setup of a 3D texture at the start.
* vc4: Add support for rendering to cube map surfaces.Eric Anholt2016-04-181-1/+2
| | | | | | | We need to fix up the offset to point at the face of the cube. Fixes piglit fbo-cubemap, copyteximage CUBE, and glean's fbo test. Cc: "11.1 11.2" <[email protected]>
* vc4: Don't flush on read-only access of buffers read by the CL.Eric Anholt2016-04-181-1/+6
| | | | | | Fixes piglit mixed-immediate-and-vbo, and may significantly improve performance of applications that store a 4-byte IB in the same VBO as vertex data.
* vc4: Sanity check strides for imported BOs.Eric Anholt2016-04-181-5/+18
| | | | | | | If we're going to sample from or render to them at some particular size, we'd better make sure that they actually are that size. Causes some tests under simulation to generate appropriate error messages instead of failures.
* gallium: add external usage flags to resource_from(get)_handle (v2)Marek Olšák2016-03-091-1/+2
| | | | | | | | | This will allow drivers to make better decisions about texture sharing for DRI2, DRI3, Wayland, and OpenCL. v2: add read/write flags, take advantage of __DRI_IMAGE_USE_BACKBUFFER Reviewed-by: Axel Davy <[email protected]>
* vc4: Fix build from upload changes.Eric Anholt2016-01-021-1/+1
|
* u_upload_mgr: pass alignment to u_upload_alloc manuallyMarek Olšák2016-01-021-1/+1
| | | | | | | | | | The fixed alignment of u_upload_mgr will go away. This is the first step. The motivation is that one u_upload_mgr can have multiple users, each allocating from the same buffer, but requiring a different alignment. Reviewed-by: Nicolai Hähnle <[email protected]>
* vc4: Don't consider nr_samples==1 surfaces to be MSAA.Eric Anholt2015-12-151-6/+6
| | | | | | This is apparently a weirdness of gallium -- nr_samples==1 is occasionally used and means the same thing as nr_samples==0. Fixes a bunch of ARB_framebuffer_srgb blit cases in piglit.
* vc4: Add support for mapping of MSAA resources.Eric Anholt2015-12-081-8/+102
| | | | | The pipe_transfer_map API requires that we do an implicit downsample/upsample and return a mapping of that.
* vc4: Add debug dumping of MSAA surfaces.Eric Anholt2015-12-041-6/+143
|
* vc4: Add support for laying out MSAA resources.Eric Anholt2015-12-041-5/+20
| | | | | | For MSAA, we store full resolution tile buffer contents, which have their own tiling format. Since they're full resolution buffers, we have to align their size to full tiles.
* vc4: Return GL_OUT_OF_MEMORY when buffer allocation fails.Eric Anholt2015-11-091-17/+29
| | | | | | | I was afraid our callers weren't prepared for this, but it looks like at least for resource creation, mesa/st throws an error appropriately. Cc: "11.0" <[email protected]>
* vc4: Fix a compiler warning.Eric Anholt2015-11-091-1/+1
|
* vc4: Allow user index buffers, to avoid slow readback for shadow IBs.Eric Anholt2015-10-291-6/+12
| | | | | Improves low-settings openarena performance by 31.9975% +/- 0.659931% (n=7).
* vc4: Skip re-emitting the shader_rec if it's unchanged.Eric Anholt2015-07-281-0/+8
| | | | | | | | It's a bunch of work for us to emit it (and its uniforms), more work for the kernel to validate it, and additional work for the CLE to read it. Improves es2gears framerate by about 50%. Signed-off-by: Eric Anholt <[email protected]>
* vc4: Fix write-only texsubimage when we had to align.Eric Anholt2015-06-201-1/+5
| | | | | | | | We need to make sure that when we store the aligned box, we've got initialized contents in the border. We could potentially just load the border area, but for now let's get text rendering working in X (and fix the GL_TEXTURE_2D errors in piglit's texsubimage test and gl-2.1-pbo/test_tex_image)
* vc4: Just stream out fallback IB contents.Eric Anholt2015-05-271-18/+15
| | | | | | | | | | | | | | | The idea I had when I wrote the original shadow code was that you'd see a set_index_buffer to the IB, then a bunch of draws out of it. What's actually happening in openarena is that set_index_buffer occurs at every draw, so we end up making a new shadow BO every time, and converting more of the BO than is actually used in the draw. While I could maybe come up with a better caching scheme, for now just do the simple thing that doesn't result in a new shadow IB allocation per draw. Improves performance of isosurf in drawelements mode by 58.7967% +/- 3.86152% (n=8).
* vc4: Update the shadow texture for public textures on every draw.Eric Anholt2015-04-151-1/+1
| | | | | We don't know who else has written to it, so we'd better update it every time. This makes the gears spin in X again.
* vc4: Hook up VC4_DEBUG=perf to some useful printfs.Eric Anholt2015-04-151-0/+5
|
* vc4: Move the blit code to a separate file.Eric Anholt2015-04-131-64/+0
| | | | | There will be other blit code showing up, and it seems like the place you'd look.
* vc4: Use the blit interface for updating shadow textures.Eric Anholt2015-04-131-13/+31
| | | | | This lets us plug in a better blit implementation and have it impact the shadow update, too.
* vc4: Add a dump-the-surface-contents routine.Eric Anholt2015-03-241-0/+100
| | | | | This has been useful once again while trying to debug stride issues between render targets and texturing.
* vc4: Fix pitch alignment of linear textures.Eric Anholt2015-03-241-1/+1
| | | | | Fixes some non-power-of-two texture rendering when I force ARGB8888 to raster.
* vc4: Fix use of a bool as an enum.Eric Anholt2015-03-241-1/+1
| | | | The enum compared to was 0, so it worked out, but it sure looked wrong.
* vc4: Decide the HW's format before laying out the miptree.Eric Anholt2015-03-241-3/+3
| | | | | | I'm experimenting with a workaround for raster texture misrendering on hardware, and this lets me look at the format chosen when computing strides.
* vc4: Make a new #define for making code conditional on the simulator.Eric Anholt2015-03-241-5/+5
| | | | | | I'd like to compile as much of the device-specific code as possible when building for simulator, and using if (using_simulator) instead of ifdefs helps.
* vc4: Add some useful debug printfs for miptrees.Eric Anholt2015-03-241-0/+37
| | | | I keep rewriting these.
* vc4: Drop the content of vc4_flush_resource().Eric Anholt2014-12-301-4/+4
| | | | | The callers all follow it with a flush of the context, and the flush of the context gives us more information about how things are being flushed.
* vc4: Drop a weird argument in the BOs-from-handles API.Eric Anholt2014-12-171-1/+3
|
* vc4: Update for new kernel ABI with async execution and waits.Eric Anholt2014-11-201-1/+4
| | | | | Our submits now return immediately and you have to manually wait for things to complete if you want to (like a normal driver).
* vc4: When asked to discard-map a whole resource, discard it.Eric Anholt2014-10-241-14/+28
| | | | | | | This saves a bunch of extra flushes when texsubimaging a whole texture that's been used for rendering, or subdataing a whole BO. In particular, this massively reduces the runtime of piglit texture-packed-formats (when the probes have been moved out of the inner loop).
* vc4: Refactor flushing before mapping a BO.Eric Anholt2014-10-241-2/+4
| | | | I'm going to want to make some other decisions here before flushing.
* vc4: Translate 4-byte index buffers to 2 bytes.Eric Anholt2014-10-191-0/+46
| | | | Fixes assertion failures in 14 piglit tests (half of which now pass).
* vc4: Add support for rebasing texture levels so firstlevel == 0.Eric Anholt2014-10-191-1/+36
| | | | | | GLES2 doesn't have GL_TEXTURE_BASE_LEVEL, so the hardware doesn't. Fixes piglit levelclamp, tex-miplevel-selection, and texture-storage/2D mipmap rendering.
* vc4: Mostly fix offset calculation for NPOT mipmap levels.Eric Anholt2014-10-091-2/+11
| | | | | | | | | | | | | | The non-base NPOT levels are stored as POT-aligned images. We get that POT alignment by minifying the POT-aligned base level. This means that level strides are also POT aligned, so we have to tell the rendering mode config that our resource is larger than the actual requested area. Fixes the fbo-generatemipmap-formats NPOT cases. Regresses depthstencil-render-miplevels 273 * -- the texture presentation now works (where it was completely broken before), it looks like there's some overflow of image bounds happening at the lower miplevels.
* vc4: Add support for texture cube maps.Eric Anholt2014-09-291-9/+16
| | | | | | It's not passing some of the piglit tests, because it looks like at small miplevels some contents from surrounding faces are getting filtered in at the corners. It does get 7 new tests passing.
* vc4: Rename the slice's size0.Eric Anholt2014-09-291-4/+4
| | | | | | In the other related fields, "0" refers to the size of the first miplevel, while this is a field in a slice. The other implicit slices we have (cubemap layers) don't vary in size compared to the first one.
* vc4: Handle a couple of the transfer map flags.Eric Anholt2014-09-021-4/+9
| | | | | | This is part of fixing extremely long runtimes on some piglit tests that involve streaming vertex reuploads due to format conversions, and will similarly be important for X performance, which relies on these flags.
* vc4: Fix save/restore of the VS/FS in the blitter.Eric Anholt2014-08-231-2/+2
| | | | | | When I made the shader cache take the .fs member and moved the binding point to .bind_fs, I failed to update these. Fixes crashes in copyteximage-related tests.
* vc4: Add support for all the texture and FBO formats we can.Eric Anholt2014-08-221-3/+6
| | | | | | | Now that tiling is in place, we can expose the other formats. Depth is still broken (need to make changes in the shader), but if you don't expose it things crash all over. SNORM is dropped, but we could re-add it later with some shader fixes to handle converting between [0,1] and [-1,1].
* vc4: Add support for texture tiling.Eric Anholt2014-08-221-12/+125
| | | | | | This still treats everything as RGBA8888 for the most part, same as before. This is a prerequisite for handling other texture formats, since only RGBA8888 has a raster-layout mode.
* vc4: Include stdio/stdlib in headers so I don't have to include it per file.Eric Anholt2014-08-221-2/+0
| | | | | There are a few tools I want to have always available, and fprintf() and abort() are among them.
* vc4: Don't forget to set up the offset for render targets.Eric Anholt2014-08-181-0/+2
| | | | | This almost fixes fbo-generatemipmap rendering, except that the 1x1 level isn't getting rendered.
* vc4: Fix multi-level texture setup.Eric Anholt2014-08-181-1/+11
| | | | | | | We weren't accounting for the level 0 offset in the texture setup (so it only worked if it happened to be a single-level texture), and doing so required that we get the level 0 offset page aligned so that the offset bits don't get interpreted as the texture format and such.
* vc4: Store the (currently always linear) tiling format in the resource.Eric Anholt2014-08-111-0/+2
|
* vc4: Avoid flushing when mapping buffers that aren't in the batch.Eric Anholt2014-08-111-1/+1
| | | | | This should prevent a bunch of unnecessary flushes for things like updating immediate vertex data.
* vc4: Drop the flush at the end of the drawEric Anholt2014-08-111-0/+2
| | | | Now we actally get multiple draw calls per submit.
* vc4: Initial skeleton driver import.Eric Anholt2014-08-081-0/+350
This mostly just takes every draw call and turns it into a sequence of commands that clear the FBO and draw a single shaded triangle to it, regardless of the actual input vertices or shaders. I copied the initial driver skeleton mostly from freedreno, and I've preserved Rob Clark's copyright for those. I also based my initial hardcoded shaders and command lists on Scott Mansell (phire)'s "hackdriver" project, though the bit patterns of the shaders emitted end up being different. v2: Rebase on gallium megadrivers changes. v3: Rebase on PIPE_SHADER_CAP_MAX_CONSTS change. v4: Rely on simpenrose actually being installed when building for simulation. v5: Add more header duplicate-include guards. v6: Apply Emil's review (protection against vc4 sim and ilo at the same time, and dropping the dricommon drm bits) and fix a copyright header (thanks, Roland)