Commit Graph

404 Commits

Author SHA1 Message Date
Ronie Salgado
8f538d9ae0 anv/cmd_buffer: Don't delete command buffers in ResetCommandPool()
v2 (Jason Ekstrand): Destroy command buffers in DestroyCommandPool().

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=95034
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
2016-05-27 18:56:33 -07:00
Jason Ekstrand
b93b5935a7 anv: Try the first 8 render nodes instead of just renderD128
This way, if you have other cards installed, the Vulkan driver will still
work.  No guarantees about WSI working correctly but offscreen should at
least work.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=95537
2016-05-27 17:18:33 -07:00
Jason Ekstrand
e023c104f7 anv: strdup the device path into the physical device
This way we don't have to assume that the string coming in is a piece of
constant data that exists forever.
2016-05-27 17:18:33 -07:00
Jason Ekstrand
9048dee328 anv/formats: Exit early for unsupported formats 2016-05-27 17:17:09 -07:00
Jason Ekstrand
10bc9f7024 anv/formats: Map VK_FORMAT_UNDEFINED to ISL_FORMAT_UNSUPPORTED
At one point in time, we may have used the mapping to ISL_FORMAT_RAW for
certain buffer surfaces but that time has long since passed.  This fixes a
bug where doing format queries on VK_FORMAT_UNDEFINED would assert-fail.
2016-05-27 17:17:09 -07:00
Jason Ekstrand
b16326c740 anv/clear: Remove an unused variable 2016-05-27 17:17:09 -07:00
Jason Ekstrand
fb2a5ceb32 anv: Emit DRAWING_RECTANGLE once at driver initialization
Also, we don't actually need it for clipping because meta always colors
inside the lines and, for all other operations, the user is required to set
a scissor.  Since DRAWING_RECTANGLE stalls the GPU, we want to emit it as
little as possible.

Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2016-05-27 15:18:11 -07:00
Jason Ekstrand
3a83c176ea anv/cmd_buffer: Only emit PIPE_CONTROL on-demand
This is in contrast to emitting it directly in vkCmdPipelineBarrier.  This
has a couple of advantages.  First, it means that no matter how many
vkCmdPipelineBarrier calls the application strings together it gets one or
two PIPE_CONTROLs.  Second, it allow us to better track when we need to do
stalls because we can flag when a flush has happened and we need a stall.

Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2016-05-27 15:18:09 -07:00
Jason Ekstrand
7120c75ec3 genxml: Make PIPE_CONTROL::CommandStreamerStallEnable a boolean
This has been declared as a uint since SNB but it's only one bit.

Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2016-05-27 15:18:07 -07:00
Jason Ekstrand
b26bd6790d anv/clear: Only clear the render area when doing subpass clears
Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2016-05-27 15:18:04 -07:00
Jason Ekstrand
5432487792 anv: Move push constant allocation to the command buffer
Instead of blasting it out as part of the pipeline, we put it in the
command buffer and only blast it out when it's really needed.  Since the
PUSH_CONSTANT_ALLOC commands aren't pipelined, they immediately cause a
stall which we would like to avoid.

Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2016-05-27 15:17:43 -07:00
Ben Widawsky
8314dd7ff2 isl: Fix some tautological-compare warnings
Fixes:
isl.c:62:22: warning: self-comparison always evaluates to true [-Wtautological-compare]
    assert(ISL_DEV_GEN(dev) == dev->info->gen);
                      ^~
isl.c:63:33: warning: self-comparison always evaluates to true [-Wtautological-compare]
    assert(ISL_DEV_USE_SEPARATE_STENCIL(dev) == dev->use_separate_stencil);

Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2016-05-26 21:59:17 -07:00
Jason Ekstrand
9f0bc0f2b3 anv: Stop linking against libmesa.la and libdri_test_stubs.la
This brings the final size of an optimized non-debug build of the Vulkan
driver down to 2.9 MB as opposed to 8.7 MB for the dri driver.

Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
2016-05-26 14:13:38 -07:00
Matt Turner
469a1c56a6 isl: Mark default cases unreachable.
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
2016-05-25 12:44:34 -07:00
Matt Turner
47dca31606 isl: Remove useless qualifier from return type.
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
2016-05-25 12:44:34 -07:00
Jason Ekstrand
d68acde1cb anv/formats: Use isl_format_supports* for format introspection 2016-05-23 19:12:34 -07:00
Jason Ekstrand
7374d006b6 isl: Add per-gen format introspection
This is just a copy-and-paste from brw_surface_formats.c.  For the
supports_vertex_fetch function, we do a bit more work so that it properly
handles Bay Trail.
2016-05-23 19:12:34 -07:00
Jason Ekstrand
03a82dc5d1 isl: Add the ISL_FORMAT_R32G32_FLOAT_LD format 2016-05-23 19:12:34 -07:00
Jason Ekstrand
35a514e6ff isl: Add support for quering the string name of a format 2016-05-23 19:12:34 -07:00
Nanley Chery
2ae493d686 anv/formats: Make alpha blending a property of render targets
In agreement with the SNB PRM, alpha blending is a property that render
targets may or may not support.

Signed-off-by: Nanley Chery <nanley.g.chery@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
2016-05-23 17:26:17 -07:00
Emil Velikov
960d854a98 anv: remove define _DEFAULT_SOURCE
The build systems already add this as applicable. There's no need to
have this in the source file.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2016-05-23 12:09:11 +01:00
Eric Engestrom
7362bb3e21 vk/intel: use negative VK_NO_PROTOTYPES scheme
3d0fac7aca changed all
VK_PROTOTYPES to VK_NO_PROTOTYPES
This brings the Intel header in line with the rest of the Vulkan code.

Signed-off-by: Eric Engestrom <eric.engestrom@imgtec.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Chad Versace <chad.versace@intel.com>
2016-05-23 12:07:46 +01:00
Eduardo Lima Mitev
7dce4793b7 anv/nir_apply_pipeline_layout: Pass the nir_src from the nir_tex_src
nir_instr_rewrite_src() expects a nir_src and it is currently being fed a
nir_tex_src. This will crash something.

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
2016-05-21 19:57:31 +02:00
Kenneth Graunke
08bc74e694 i965: Delete brw_wm_prog_key::render_to_fbo and drawable_height.
Now that we handle flipping and other gl_FragCoord transformations
via a uniform, these key fields have no users.

This patch actually eliminates the associated recompiles.  The Tomb
Raider benchmark's minimum FPS increases from ~1 FPS to a reasonable
number.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2016-05-20 14:30:09 -07:00
Kenneth Graunke
dac10e8a13 i965, anv: Use NIR FragCoord re-center and y-transform passes.
This handles gl_FragCoord transformations and other window system vs.
user FBO coordinate system flipping by multiplying/adding uniform
values, rather than recompiles.

This is much better because we have no decent way to guess whether
the application is going to use a shader with the window system FBO
or a user FBO, much less the drawable height.  This led to a lot of
recompiles in many applications.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2016-05-20 14:30:08 -07:00
Kristian Høgsberg Kristensen
12dc89d844 anv: Merge in my TODO list items
Signed-off-by: Kristian Høgsberg Kristensen <krh@bitplanet.net>
2016-05-20 10:35:57 -07:00
Nanley Chery
9b8c4000d0 anv: Enable textureCompressionASTC_LDR on Gen9+
Signed-off-by: Nanley Chery <nanley.g.chery@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
2016-05-20 09:27:11 -07:00
Nanley Chery
0d2847e177 anv/format: Reorder ASTC mappings to match ISL enum ordering
Keep the lists consistent for ease of use.

Signed-off-by: Nanley Chery <nanley.g.chery@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
2016-05-20 09:27:11 -07:00
Nanley Chery
f3ed3a0a15 genxml: Expand SKL's SurfaceFormat field width for ASTC
In the expanded field, only ASTC format enums have the MSB set to 1.
Expanding the field width makes the process of handling these formats
identical to the way other formats are handled.

Signed-off-by: Nanley Chery <nanley.g.chery@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
2016-05-20 09:27:11 -07:00
Nanley Chery
a141576887 isl: Handle npot ASTC block dimensions on Gen9+
Signed-off-by: Nanley Chery <nanley.g.chery@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
2016-05-20 09:27:11 -07:00
Nanley Chery
de86fb875d isl: Add 2D ASTC format layouts and enums
Also, make changes needed for successful compilation and registration
as a texture compression mode.

Signed-off-by: Nanley Chery <nanley.g.chery@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
2016-05-20 09:27:11 -07:00
Jason Ekstrand
ea8c11fdc2 anv/pipeline: Bounds-check resource indices when robuts_buffer_access is enabled 2016-05-19 21:18:59 -07:00
Jason Ekstrand
902628bce6 anv/pipeline: Only do buffer bounds checks if robustBufferAccess is enabled 2016-05-19 21:18:59 -07:00
Jason Ekstrand
23090b51e0 anv/apply_dynamic_offsets: Use rewrite_src instead of a regular assignment
Originally we removed the instruction, changed the source, and then
re-inserted it.  This works, but nir_instr_rewrite_src is a bit more
obviously correct.
2016-05-19 21:18:59 -07:00
Jason Ekstrand
c29ffea6d1 anv/device: Add a boolean for robust buffer access 2016-05-19 21:18:59 -07:00
Jason Ekstrand
d5b4638d6a anv: Add a TODO file 2016-05-19 20:09:31 -07:00
Nanley Chery
7ac08adfb4 anv/device: Fix viewportBoundsRange
Align with the spec requirement that the range must be at least
[−2 × maxViewportDimensions, 2 × maxViewportDimensions − 1]. Our
hardware supports this.

Fixes dEQP-VK.api.info.device.properties

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=94896
Signed-off-by: Nanley Chery <nanley.g.chery@intel.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2016-05-18 16:01:50 -07:00
Mark Janes
4dfa89e33c anv/batch_chain: free pointers for error cases
Trivial fix to improperly handled cleanup during
VK_ERROR_OUT_OF_HOST_MEMORY.

Identified by Coverity: CID 1358908 and 1358909
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
2016-05-18 15:14:22 -07:00
Matt Turner
0a548eb56f isl: Mark default cases in switch unreachable.
To silence -Wmaybe-uninitialized warnings.
2016-05-18 11:09:37 -07:00
Jordan Justen
1ff212bfd3 anv: Fix warning: unused variable ‘cs_prog_data’
This was introduced in 8a80af2820.

Reported-by: Jason Ekstrand <jason@jlekstrand.net>
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
2016-05-17 14:09:56 -07:00
Jordan Justen
6c9f35bb73 Revert "HACK: Don't re-configure L3$ in render stages pre-BDW"
This reverts commit 41af9b2e51.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=94468
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
2016-05-17 13:04:03 -07:00
Jordan Justen
8a80af2820 anv: Port L3 cache programming from i965
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Acked-by: Jason Ekstrand <jason@jlekstrand.net>
2016-05-17 13:04:03 -07:00
Jordan Justen
aa41de080d anv/gen7: Add memory barrier to vkCmdWaitEvents call
We also have this barrier call for gen8 vkCmdWaitEvents.

We don't implement waiting on events for gen7 yet, but this barrier at
least helps to not regress CTS cases when data caching is enabled.
Without this, the tests would intermittently report a failure when the
data cache was enabled.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
2016-05-17 13:04:03 -07:00
Jordan Justen
8ee31828c6 anv: Keep track of whether the data cache should be enabled in L3
If images or shader buffers are used, we will enable the data cache in
the the L3 config.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
2016-05-17 13:04:03 -07:00
Jordan Justen
ff41738871 genxml/hsw: Add L3 cache control registers
These were added to the i965 driver in
5912da45a6.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
2016-05-17 13:04:03 -07:00
Jason Ekstrand
b6c4d46a58 anv/formats: Add support for VK_FORMAT_B4G4R4A4_UNORM pre-gen8 2016-05-17 12:17:22 -07:00
Jason Ekstrand
45c93384e5 anv: Add a devinfo argument to the get_format functions 2016-05-17 12:17:22 -07:00
Jason Ekstrand
100db3d31c anv/formats: Set the swizzle to RGB1 when using an RGBA format to fake RGB
This way we get correct sampling from RGB formats that are faked as RGBA.
This should also cause it to disable rendering and blending on those
formats.  We should be able to render to them and, on Broadwell and above,
we can blend on them with work-arounds.  However, we'll add support for
that more properly later when it's deemed useful.  For now, disabling
rendering and blending should be safe.
2016-05-17 12:17:22 -07:00
Jason Ekstrand
ce375fba41 anv/formats: Refactor anv_get_format
The new code removes the switch statement and instead handles depth/stencil
as up-front special cases.  This allows for potentially more complicated
color format handling in the future.
2016-05-17 12:17:22 -07:00
Jason Ekstrand
34198d798c anv: Use 16 bits for the isl_format in anv_format
This way the entire anv_format structure fits in 32 bits
2016-05-17 12:17:22 -07:00