platform/upstream/Vulkan-LoaderAndValidationLayers.git
9 years agoglave: Fix bug in tracing CreateRenderPass with NULL attachments
Jon Ashburn [Fri, 20 Feb 2015 17:30:32 +0000 (10:30 -0700)]
glave: Fix bug in tracing CreateRenderPass with NULL attachments

9 years agolayers: Multi-threading fixes for DrawState
Tobin Ehlis [Fri, 20 Feb 2015 16:30:06 +0000 (09:30 -0700)]
layers: Multi-threading fixes for DrawState

9 years agolayers: Disable DrawState dot file autodump and an incorrect validation check
Tobin Ehlis [Thu, 19 Feb 2015 22:26:49 +0000 (15:26 -0700)]
layers: Disable DrawState dot file autodump and an incorrect validation check

9 years agolayers: Fix DrawState bug to correctly shadow image/update structs
Tobin Ehlis [Thu, 19 Feb 2015 20:14:59 +0000 (13:14 -0700)]
layers: Fix DrawState bug to correctly shadow image/update structs

9 years agointel: enable HiZ on Gen7+
Chia-I Wu [Thu, 19 Feb 2015 18:20:38 +0000 (11:20 -0700)]
intel: enable HiZ on Gen7+

The support is restricted to Gen7+.  To support HiZ on Gen6, we need to
perform manual combined/separated stencil resolves and that may hurt the
performance instead.

Also, we do not support fast depth clears.  xglSetFastClearDepth() will be
removed in a later xgl.h revision.

9 years agointel: add cmd_meta_ds_op()
Chia-I Wu [Thu, 19 Feb 2015 18:17:45 +0000 (11:17 -0700)]
intel: add cmd_meta_ds_op()

It can perform fast depth clear, depth resolve, and hiz resolve.  There is a
TODO about fast depth clear.

With our current xgl.h revision, I have to assume a layout in
xglCmdClearDepthStencil().  It will get fixed when we are at revision 59.
Alternatively, I could also assume the worst case and always do a depth
resolve after clearing, but that may hurt the performance.

In other words, it is invalid to use XGL_IMAGE_LAYOUT_GENERAL for shadow
textures.

9 years agointel: make sense of gen6_meta_DEPTH_STENCIL_STATE()
Chia-I Wu [Thu, 19 Feb 2015 18:08:25 +0000 (11:08 -0700)]
intel: make sense of gen6_meta_DEPTH_STENCIL_STATE()

When operating on DEPTH, enable only depth write.  When operating on STENCIL,
enable only stencil test and stencil write for both faces.  The old code
should supposedly work, but it is hard to reason about it.

9 years agointel: avoid unnecessary stencil and hiz relocs
Chia-I Wu [Wed, 18 Feb 2015 19:21:22 +0000 (12:21 -0700)]
intel: avoid unnecessary stencil and hiz relocs

When the depth/stencil view does not need a separate stencil buffer or a hiz
buffer, do not set up relocs for them.

9 years agointel: add intel_format_has_depth()
Chia-I Wu [Thu, 19 Feb 2015 20:18:42 +0000 (13:18 -0700)]
intel: add intel_format_has_depth()

Replace intel_format_is_depth() by intel_format_has_depth().

9 years agointel: remove intel_format_is_stencil()
Chia-I Wu [Thu, 19 Feb 2015 20:54:35 +0000 (13:54 -0700)]
intel: remove intel_format_is_stencil()

It is not needed since the update to XGL_FORMAT by
2b7e88a1fdefc49d78e80765745e87e00034c2a0.

9 years agoloader: Fix merge of layer names from env and CreateDevice
Jon Ashburn [Wed, 18 Feb 2015 18:29:58 +0000 (11:29 -0700)]
loader: Fix merge of layer names from env and CreateDevice

9 years agoloader: initialize result for xglCreateInstance().
Ian Elliott [Thu, 19 Feb 2015 22:49:03 +0000 (15:49 -0700)]
loader: initialize result for xglCreateInstance().

9 years agonulldrv: Return proper structure size for buffer object
Ian Elliott [Thu, 19 Feb 2015 21:04:56 +0000 (14:04 -0700)]
nulldrv: Return proper structure size for buffer object

This defect was cloned from the Intel driver; and so it gets the same fix:-).

9 years agointel: ICD_EXPORT all API functions
Chia-I Wu [Wed, 18 Feb 2015 22:47:12 +0000 (15:47 -0700)]
intel: ICD_EXPORT all API functions

9 years agointel: format API functions as declared in xgl.h
Chia-I Wu [Wed, 18 Feb 2015 22:37:27 +0000 (15:37 -0700)]
intel: format API functions as declared in xgl.h

9 years agointel: rename cmd_prepare.c to cmd_barrier.c
Chia-I Wu [Wed, 18 Feb 2015 22:54:05 +0000 (15:54 -0700)]
intel: rename cmd_prepare.c to cmd_barrier.c

9 years agointel: minor improvements to fb.c
Chia-I Wu [Wed, 18 Feb 2015 22:32:06 +0000 (15:32 -0700)]
intel: minor improvements to fb.c

Less surprises when the applications do things we do not support.

9 years agoRevert "intel: Be sure to set width & height for depth-only"
Chia-I Wu [Tue, 17 Feb 2015 23:44:37 +0000 (16:44 -0700)]
Revert "intel: Be sure to set width & height for depth-only"

This reverts commit da71cc37e5ab9720cc073ac5a40866ded83cb760.  The
width and height are always set to default values since
71fcc2dae2f302fd2e52836b4098b233762d56f8.

9 years agointel: mostly cosmetic changes to fb.[ch]
Chia-I Wu [Wed, 18 Feb 2015 22:21:38 +0000 (15:21 -0700)]
intel: mostly cosmetic changes to fb.[ch]

9 years agointel: do not cast away constness in intel_cmd_begin()
Chia-I Wu [Wed, 18 Feb 2015 21:59:11 +0000 (14:59 -0700)]
intel: do not cast away constness in intel_cmd_begin()

9 years agointel: move xglCmd{Begin,End}RenderPass to cmd_pipeline.c
Chia-I Wu [Wed, 18 Feb 2015 21:51:59 +0000 (14:51 -0700)]
intel: move xglCmd{Begin,End}RenderPass to cmd_pipeline.c

All xglCmd*() functions should be defined in cmd*.c.

9 years agointel: rename intel_rp_from_obj() to intel_render_pass_from_obj()
Chia-I Wu [Wed, 18 Feb 2015 21:48:21 +0000 (14:48 -0700)]
intel: rename intel_rp_from_obj() to intel_render_pass_from_obj()

For consistency.

9 years agointel: rename intel_framebuffer to intel_fb
Chia-I Wu [Wed, 18 Feb 2015 21:46:55 +0000 (14:46 -0700)]
intel: rename intel_framebuffer to intel_fb

For consistency.

9 years agolayers: DrawState bug fixes
Tobin Ehlis [Thu, 19 Feb 2015 16:55:18 +0000 (09:55 -0700)]
layers: DrawState bug fixes

Correctly track UpdateChain per Set and free the shadowNode
Fix pTypes array to correctly track update types per descriptor
Fix upperBound code to correctly loop over all elements of layout
Various NULL ptr checks

9 years agolayers: Fix memtracker reporting related to freeing presentable image memory
Mark Lobodzinski [Thu, 19 Feb 2015 00:06:24 +0000 (18:06 -0600)]
layers: Fix memtracker reporting related to freeing presentable image memory

Output an error if presentable image memory is explicitly freed, and avoid
warnings if it is not.

9 years agoloader: do not set RTLD_DEEPBIND
Chia-I Wu [Wed, 18 Feb 2015 21:39:54 +0000 (14:39 -0700)]
loader: do not set RTLD_DEEPBIND

Instead, build layers with -Bsymbolic.  This should fix (or hide) a reported
crash with overriden malloc()/free().

9 years agoloader: Correct layer path lookup name
Courtney Goeltzenleuchter [Thu, 19 Feb 2015 03:03:02 +0000 (20:03 -0700)]
loader: Correct layer path lookup name

9 years agocompiler: add support to create undefined initializer value for structs
GregF [Wed, 18 Feb 2015 22:32:12 +0000 (15:32 -0700)]
compiler: add support to create undefined initializer value for structs

This was a TODO that got tripped by dota_75.frag.

9 years agolayers: Add debug code to DrawState for alloc and free calls
Tobin Ehlis [Tue, 17 Feb 2015 23:27:03 +0000 (16:27 -0700)]
layers: Add debug code to DrawState for alloc and free calls

9 years agolayers: Fix DrawState bug in UPDATE image/buffer shadowing
Tobin Ehlis [Wed, 18 Feb 2015 21:38:11 +0000 (14:38 -0700)]
layers: Fix DrawState bug in UPDATE image/buffer shadowing

9 years agolayers: Add memory management to DrawState
Tobin Ehlis [Tue, 17 Feb 2015 16:54:13 +0000 (09:54 -0700)]
layers: Add memory management to DrawState

Added code in DrawState to free memory allocations
Updated DrawState Layout to save full CreateInfo tree

9 years agolayers: Correctly track pSetBindPoints per stage in DrawState layer
Tobin Ehlis [Mon, 16 Feb 2015 21:29:30 +0000 (14:29 -0700)]
layers: Correctly track pSetBindPoints per stage in DrawState layer

9 years agoWin: Can now use "static inline" on Windows (i.e. no code mods).
Ian Elliott [Wed, 18 Feb 2015 19:38:04 +0000 (12:38 -0700)]
Win: Can now use "static inline" on Windows (i.e. no code mods).

9 years agoloader: Windows now uses registry + env's (diff names)
Ian Elliott [Tue, 17 Feb 2015 17:33:47 +0000 (10:33 -0700)]
loader: Windows now uses registry + env's (diff names)

The loader on Windows now looks in the Windows Registry + in environment
variables for the following (Note the new names--"LIB" was dropped):

- XGL_DRIVERS_PATH
- XGL_LAYERS_PATH
- XGL_LAYER_NAMES

Linux still retains the "LIB" at the start of the environment variable names.

If both are used, they are concatenated into a semi-colon-delimited list.

A generic loader_get_registry_and_env() func is used to perform this (only for
Windows, since Linux doesn't have a registry).

9 years agoWin: Build Glave replay on Windows (REQUIRES NEW CMAKE COMMAND).
David Pinedo [Tue, 10 Feb 2015 22:02:08 +0000 (15:02 -0700)]
Win: Build Glave replay on Windows (REQUIRES NEW CMAKE COMMAND).

Starting with this commit, building XGL on Windows requires explicitly stating
whether a "Release" or "Debug" build is desired when doing the initial cmake
command.  This is documented in the "Build.md" file.

Linux trace of cube plays to completion on windows!

Changes to the null driver:
    advertise support for both WIN WSI and X11 WSI
    added support for xglCreateBufferView
    and added a logging capability (turned off by default)

Still have some issues:
    - x11 support emulation/replacement
    - Windows null driver creates a bad device queue
    - Need to copy libraries to dir containing the .exe

Glave ext libs are now put in same dir as glvreplay64.exe...

This change only affects Windows -- on Linux the libs and
the glave replay progs were already in the same dir.

Also added a line to BUILD.md regarding the need to have XGL.dll
in PATH.

9 years agoRedo the way Glave settings are obtained.
Ian Elliott [Wed, 18 Feb 2015 22:35:00 +0000 (15:35 -0700)]
Redo the way Glave settings are obtained.

9 years agonulldrv: Creation of the nulldrv, for use on Windows.
David Pinedo [Tue, 3 Feb 2015 01:02:40 +0000 (18:02 -0700)]
nulldrv: Creation of the nulldrv, for use on Windows.

Since the sample Intel driver hasn't been ported to Windows, this nulldrv is
being used to bootstrap Windows support.  It can also provide a hint to new
IHV's for how to set the magic number.

9 years agolayers: Updated mem_tracker for new header changes.
Mark Lobodzinski [Wed, 18 Feb 2015 22:38:17 +0000 (16:38 -0600)]
layers:  Updated mem_tracker for new header changes.

Brought mem-tracker up to header rev 47. Worked over tests and
demos to remove errors.

9 years agointel: silence a compiler warning
Chia-I Wu [Wed, 18 Feb 2015 17:30:50 +0000 (10:30 -0700)]
intel: silence a compiler warning

Silence

  warning: ‘buf_format’ may be used uninitialized in this function

9 years agointel: rework command buffer waiting
Chia-I Wu [Tue, 17 Feb 2015 21:29:01 +0000 (14:29 -0700)]
intel: rework command buffer waiting

When a bo is submitted, we need the submission sequence number which we can
wait for.  However, the kernel does not return the seqno.  We have to keep the
bo around and wait for the bo.  This fixes

  xglQueueSubmit(..., cmd, ...);
  xglDeviceWaitIdle(...);
  xglDestroyObject(..., cmd);
  xglDeviceWaitIdle(...);

where the second wait waited for a destroyed cmd buffer.

9 years agointel: rework xglQueueSubmit()
Chia-I Wu [Tue, 17 Feb 2015 21:11:29 +0000 (14:11 -0700)]
intel: rework xglQueueSubmit()

cmdBufferCount is usually large.  Add queue_submit_cmd_debug() and
queue_submit_cmd() depending on whether INTEL_DEBUG is set to reduce
branching.  Error handling is also improved such that xglQueueSubmit() appears
more atomic to callers.

9 years agoicd: add likely()/unlikely()
Chia-I Wu [Tue, 17 Feb 2015 21:20:58 +0000 (14:20 -0700)]
icd: add likely()/unlikely()

They will be expanded to __builtin_expect(...) on gcc.

9 years agotests: Fix cut-and-paste error in QuadWithIndexedVertexFetch test.
Mark Lobodzinski [Mon, 16 Feb 2015 20:24:23 +0000 (14:24 -0600)]
tests:  Fix cut-and-paste error in QuadWithIndexedVertexFetch test.

Looks like the wrong memory barrier was set.

9 years agocompiler: fix "fireflies" over water in dota2 with BIL
GregF [Tue, 17 Feb 2015 23:25:34 +0000 (16:25 -0700)]
compiler: fix "fireflies" over water in dota2 with BIL

A shader with an initialized global array was causing an llvm
code sequence the glassy backend translator had not yet seen. In
particular, a store of the array constant through a local pointer
into alloca space made it into Bottom IR. Loads and stores are not
normally seen in Bottom IR. Fixed emitIRStore to deal properly with
these stores.

9 years agoWin: MUST USE "STATIC_INLINE" instead of "static inline"
Ian Elliott [Tue, 17 Feb 2015 23:44:44 +0000 (16:44 -0700)]
Win: MUST USE "STATIC_INLINE" instead of "static inline"

9 years agoloader: Enable env extensions as well as app.
Courtney Goeltzenleuchter [Tue, 17 Feb 2015 21:21:21 +0000 (14:21 -0700)]
loader: Enable env extensions as well as app.

9 years agotests: Fix XGLTriangleTest to not bind VBO since it doesn't use one
Tobin Ehlis [Tue, 17 Feb 2015 23:30:46 +0000 (16:30 -0700)]
tests: Fix XGLTriangleTest to not bind VBO since it doesn't use one

9 years agocompiler: Disable faceforward decomposition, backend handles it
Cody Northrop [Tue, 17 Feb 2015 21:06:35 +0000 (14:06 -0700)]
compiler: Disable faceforward decomposition, backend handles it

9 years agoRevert "compiler: Allow texture unit bindings to also set sampler index"
Cody Northrop [Fri, 13 Feb 2015 16:08:43 +0000 (09:08 -0700)]
Revert "compiler: Allow texture unit bindings to also set sampler index"

This reverts commit c33ac9267a70115c29f97eb20966de4c9aed6938.

9 years agoRevert "compiler: If XGL is being used, assign buffer bindings directly from the...
Cody Northrop [Fri, 13 Feb 2015 16:08:41 +0000 (09:08 -0700)]
Revert "compiler: If XGL is being used, assign buffer bindings directly from the shader"

This reverts commit 2bec741ece71b9a5deffd31227e2c7a434dfa2cd.

9 years agocompiler: Support layout(set=,binding=)
Cody Northrop [Fri, 13 Feb 2015 18:53:09 +0000 (11:53 -0700)]
compiler: Support layout(set=,binding=)

This change allows shaders to specify set and binding.
The values come from BottomIR as packed 32-bit values:
16 high bits for set, 16 low bits for binding.
We allow them to remain together through the backend, then
split apart during resource map creation.

To facilitate this change, we also switched to using the
resource mapping tracked by the compiler, rather than
forcing bindings to match the descriptor set layout, which
was a short term solution.  This results in greatly reduced
binding table size.

9 years agocompiler: Bump Mesa SamplerUnits to 32 bits
Cody Northrop [Fri, 13 Feb 2015 18:50:41 +0000 (11:50 -0700)]
compiler: Bump Mesa SamplerUnits to 32 bits

This will facilitate packing set and binding through the stack.

9 years agocmake: support clang as the compiler
Chia-I Wu [Tue, 17 Feb 2015 16:55:34 +0000 (09:55 -0700)]
cmake: support clang as the compiler

One can use clang by running cmake like

 $ cmake -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ ..

9 years agointel: fix a compile error with clang
Chia-I Wu [Tue, 17 Feb 2015 16:55:13 +0000 (09:55 -0700)]
intel: fix a compile error with clang

sizeof(ir_texture::lod_info) is considered invalid by clang because lod_info
is not a static member.

9 years agointel: fix the param type of img_type_to_view_type()
Chia-I Wu [Tue, 17 Feb 2015 16:51:00 +0000 (09:51 -0700)]
intel: fix the param type of img_type_to_view_type()

It should be XGL_IMAGE_TYPE, not XGL_IMAGE_VIEW_TYPE.

9 years agointel: fix stencil refs for stencil clears
Chia-I Wu [Tue, 17 Feb 2015 16:48:37 +0000 (09:48 -0700)]
intel: fix stencil refs for stencil clears

This was overlooked in the prior fix.

9 years agolayers: Fix compilation error on ObjectTracker and Generic layer
Jon Ashburn [Tue, 17 Feb 2015 18:03:12 +0000 (11:03 -0700)]
layers: Fix compilation error on ObjectTracker and Generic layer

9 years agointel: Add colorAttachmentCount
Courtney Goeltzenleuchter [Tue, 10 Feb 2015 21:06:25 +0000 (14:06 -0700)]
intel: Add colorAttachmentCount

bug #13268
header revision: r29554
Add colorAttachmentCount to CREATE_RENDER_PASS_INFO to aid tracing tools.

9 years agointel: Remove unnecessary dualBlendMode enable
Courtney Goeltzenleuchter [Wed, 11 Feb 2015 21:14:45 +0000 (14:14 -0700)]
intel: Remove unnecessary dualBlendMode enable

bug #12925
header version: r29511
Can determine dualBlendModeEnable from blend information provided.
Integrate review feedback.

9 years agointel: Remove scissor enable and scissor count
Courtney Goeltzenleuchter [Wed, 11 Feb 2015 21:13:34 +0000 (14:13 -0700)]
intel: Remove scissor enable and scissor count

bug #12925
header version: r29511
Remove separate scissor enable and scissor count. Scissor always
enabled and must always provide scissor rect for every viewport.

9 years agoAdd detail on cloning repo
Courtney Goeltzenleuchter [Fri, 13 Feb 2015 16:30:42 +0000 (09:30 -0700)]
Add detail on cloning repo

9 years agoglave: Fix layer settings typo.
Jeremy Hayes [Mon, 16 Feb 2015 18:22:42 +0000 (11:22 -0700)]
glave: Fix layer settings typo.

9 years agoglave: Add ObjectTracker layer.
Jon Ashburn [Mon, 16 Feb 2015 17:01:05 +0000 (10:01 -0700)]
glave: Add ObjectTracker layer.

Also remove MemTracker layer for now since it is not currently built.

9 years agolayers: Have DrawState and MemTracker use the common code for reporting
Jon Ashburn [Mon, 16 Feb 2015 15:46:53 +0000 (08:46 -0700)]
layers: Have DrawState and MemTracker use the common code for reporting

9 years agolayers: Add settings controls for the generated layers. Includes ParamChecker, Object...
Jon Ashburn [Mon, 16 Feb 2015 15:26:50 +0000 (08:26 -0700)]
layers: Add settings controls for the generated layers. Includes ParamChecker, ObjectTracker and Generic. Adds the controls for ReportingLevel, ReportingAction and log filename for these layers. Place the common callback code in a header these layers can include.

9 years agointel: fix stencil refs
Chia-I Wu [Mon, 16 Feb 2015 22:34:45 +0000 (15:34 -0700)]
intel: fix stencil refs

9 years agolayers: Add simple txt print of CmdBuffer contents
Tobin Ehlis [Fri, 13 Feb 2015 20:30:07 +0000 (13:30 -0700)]
layers: Add simple txt print of CmdBuffer contents

9 years agolayers: Track DrawState on a per-cmd-buffer basis
Tobin Ehlis [Fri, 13 Feb 2015 17:26:14 +0000 (10:26 -0700)]
layers: Track DrawState on a per-cmd-buffer basis

9 years agoloader: Change sample code to not include a pointer.
Ian Elliott [Fri, 13 Feb 2015 23:51:05 +0000 (16:51 -0700)]
loader: Change sample code to not include a pointer.

It could imply that the ICD needs to allocate space for it.  The pointer is
really to be owned by the loader.

9 years agoloader: Fix and enhance README.md.
Ian Elliott [Fri, 13 Feb 2015 18:23:05 +0000 (11:23 -0700)]
loader: Fix and enhance README.md.

Several adjustments were made, including:

1) Add some MS Windows-related information.  For example, the loader is
   "XGL.dll" on Windows, and "libSGL.so" on Linux.  Also, the separator
   character is given, for each OS, for the PATH environment variables.

2) Add some addition information about dispatching.

3) Add example code for setting the magic value in the ICD.

4) Fix the numbering that looked fine in the "mardown" website, but not on
   GitHub.

5) Try to improve grammar, punctuation, etc.

9 years agoEliminate "-Wsign-compare" warnings on Linux ...
Ian Elliott [Fri, 13 Feb 2015 21:29:21 +0000 (14:29 -0700)]
Eliminate "-Wsign-compare" warnings on Linux ...

With these being newly enabled for the loader, layers, and demos (and it turns
out, for the icd/common directory), it is appropriate to fix them.

9 years agoEnable additional Linux warnings, for loader/layers/demos.
Ian Elliott [Fri, 13 Feb 2015 21:04:01 +0000 (14:04 -0700)]
Enable additional Linux warnings, for loader/layers/demos.

The intention is for Linux developers to catch more problems (real or
annoyance) before porting to Windows.

The new warnings are:

-Wpointer-arith
-Wsign-compare

These are not used for the Intel sample driver (mostly because the Intel
compiler from Mesa3D generates lots of these warnings, which code we don't want
to modify), nor for the tests.

Not sure how this affects Glave on Linux.

9 years agoglave: Replay for UpdateDescriptor handle multiple replays
Jon Ashburn [Fri, 13 Feb 2015 18:25:53 +0000 (11:25 -0700)]
glave: Replay for UpdateDescriptor handle multiple replays

The local chain copy had embedded pointers into the original chain. So
multiple replays/remaps weren't working.  Simplify code to just save a queue
of the actaul objects that need to be remapped  and restore them  after making
the call to xglUpdateDescriptors().

9 years agoMinor fix/enhancement to BUILD.md.
Ian Elliott [Fri, 13 Feb 2015 17:57:55 +0000 (10:57 -0700)]
Minor fix/enhancement to BUILD.md.

1) Point CMake to www.cmake.org insead of www.python.org.

2) Give a couple of helpful pointers for ICD developers.

9 years agoWin: Attempt to keep from using Linux functions.
Ian Elliott [Fri, 13 Feb 2015 00:08:34 +0000 (17:08 -0700)]
Win: Attempt to keep from using Linux functions.

This is a hopefully-temporary solution to prevent some of the problems of
people breaking the Windows build while developing on Linux (or vice-versa).

This uses macros of the names of Linux/Windows-specific functions in order to
catch people who use those functions directly, instead of using the
platform-compatibility-layer functions.

In order to avoid problems with the layers #include'ing "loader_platform.h"
before they #include system files (which can mess them up), I #include
"loader_platform.h" twice.  The 2nd time, it #define's the hopefully-temporary
macros.

Note: For some reason, we can't #define LoadLibrary().  It generates warnings
on Windows.

9 years agoLinux: Add back the "C99" comment within "loader_platform.h"
Ian Elliott [Thu, 12 Feb 2015 23:44:56 +0000 (16:44 -0700)]
Linux: Add back the "C99" comment within "loader_platform.h"

9 years agoicd: add loader magic word to verify ICD is compatible
Courtney Goeltzenleuchter [Wed, 11 Feb 2015 01:40:14 +0000 (18:40 -0700)]
icd: add loader magic word to verify ICD is compatible

We wanted a more explicit way to determine if the driver
ICD being loaded is providing compatible objects. To do
that we check for a magic dword value at the beginning
of the object. Non-compliant ICDs will assert in the loader
or the loader's dispatch functions if an object does
not have the correct value.
Dispatch checks are debug only.

9 years agoWin/icd: Move STATIC_INLINE macro, and use for magic funcs.
Ian Elliott [Thu, 12 Feb 2015 20:20:10 +0000 (13:20 -0700)]
Win/icd: Move STATIC_INLINE macro, and use for magic funcs.

The STATIC_INLINE macro is now in "xglPlatform.h".  It is also now being used
by the *_loader_magic_value() functions.  This allows it to be compiled on
Windows.

9 years agoglave: Unregister debug callback on DestroyInstance()
Jon Ashburn [Thu, 12 Feb 2015 19:37:46 +0000 (12:37 -0700)]
glave: Unregister debug callback on DestroyInstance()

9 years agoicd: Fix removing callback from global list
Jon Ashburn [Thu, 12 Feb 2015 19:36:37 +0000 (12:36 -0700)]
icd: Fix removing callback from global list

Callback wasn't getting actually removed from the list.

9 years agoglave: Handle null pointers in stringify of entrypoint parameters
Jon Ashburn [Thu, 12 Feb 2015 17:38:36 +0000 (10:38 -0700)]
glave: Handle null pointers in stringify of entrypoint parameters

Also add "*" for those pointers that are dereferenced.

9 years agoUpdate BUILD.md
Jens Owen [Thu, 12 Feb 2015 22:38:13 +0000 (15:38 -0700)]
Update BUILD.md

Update to build steps from Mike Sartain

9 years agointel: fix mulitple descriptor sets/regions
Chia-I Wu [Thu, 12 Feb 2015 17:15:42 +0000 (10:15 -0700)]
intel: fix mulitple descriptor sets/regions

Without adding set->pool_begin to the offsets provided by rmap, we always read
from the beginning of the descriptor pool.  Replace the error-prone
intel_desc_pool_read_*() by intel_desc_set_read_*() to get automatic
offsetting.

9 years agointel: fix -Wmaybe-uninitialized warnings
Chia-I Wu [Wed, 11 Feb 2015 20:19:39 +0000 (13:19 -0700)]
intel: fix -Wmaybe-uninitialized warnings

9 years agointel: fix -Wunused-(but-set-)variable warnings
Chia-I Wu [Wed, 11 Feb 2015 20:44:50 +0000 (13:44 -0700)]
intel: fix -Wunused-(but-set-)variable warnings

9 years agoicd: add U_ASSERT_ONLY
Chia-I Wu [Wed, 11 Feb 2015 20:23:57 +0000 (13:23 -0700)]
icd: add U_ASSERT_ONLY

It can be applied to variables that are only used in assert().

9 years agointel: add INTEL_DEBUG=hang
Chia-I Wu [Wed, 11 Feb 2015 18:27:06 +0000 (11:27 -0700)]
intel: add INTEL_DEBUG=hang

When enabled, make command buffer submission synchronous and decode the
command buffer that hangs the GPU.

9 years agointel: add intel_winsys_read_reset_stats()
Chia-I Wu [Wed, 11 Feb 2015 18:26:44 +0000 (11:26 -0700)]
intel: add intel_winsys_read_reset_stats()

It can be used to read how many active and pending batch buffers are discarded
so far due to GPU resets.

9 years agointel: do not submit invalid command buffers
Chia-I Wu [Wed, 11 Feb 2015 18:23:52 +0000 (11:23 -0700)]
intel: do not submit invalid command buffers

We do not know what are in an invalid command buffer and we should not submit
it to GPU.

9 years agointel: add cmd_fail() to signal command buffer errors
Chia-I Wu [Tue, 10 Feb 2015 18:04:44 +0000 (11:04 -0700)]
intel: add cmd_fail() to signal command buffer errors

The main purpose is have a place to set breakpoing on on command buffer
errors.

9 years agointel: always emit "post" WAs
Chia-I Wu [Wed, 11 Feb 2015 18:19:34 +0000 (11:19 -0700)]
intel: always emit "post" WAs

For workaround PIPE_CONTROLs that are needed "after" commands, they should
never be skipped.

9 years agointel: set up mappable and total aperture sizes
Chia-I Wu [Wed, 11 Feb 2015 18:10:14 +0000 (11:10 -0700)]
intel: set up mappable and total aperture sizes

The mappable size is usually 256MB.  This is the amount of memories that can
be simultaneously mapped.  The total size is usually 2GB.  This is the amount
of memories that can be referenced in a command buffer.  The real limit
imposed by intel_winsys_can_submit_bo() is lower: 3/4 the total size minus fb
and etc.

These are set up but not used.  Not sure if we want to expose a separate heap
for mappable memories.

9 years agointel: use the same PCB alloc setup for normal and meta paths
Chia-I Wu [Thu, 5 Feb 2015 18:14:01 +0000 (11:14 -0700)]
intel: use the same PCB alloc setup for normal and meta paths

Eventually, we will set up PCB alloc once per command buffer.  Let both paths
agree with each other for now.

9 years agointel: double PCB alloc on GT3
Chia-I Wu [Wed, 11 Feb 2015 18:04:05 +0000 (11:04 -0700)]
intel: double PCB alloc on GT3

The available space is doubled on GT3.

9 years agointel: set up dummy drawing rect when unused in meta
Chia-I Wu [Wed, 28 Jan 2015 16:35:56 +0000 (00:35 +0800)]
intel: set up dummy drawing rect when unused in meta

We do not want it to have misleading values when analysizing the batch buffer
dumps.

9 years agointel: do not emit 3DSTATE_SBE on Gen6
Chia-I Wu [Wed, 28 Jan 2015 16:34:24 +0000 (00:34 +0800)]
intel: do not emit 3DSTATE_SBE on Gen6

The commands in intel_pipeline are copied into the batch buffer directly.  We
should not have 3DSTATE_SBE in it on Gen6.

9 years agoWin: "layers_config.cpp" must #include "loader_platform.h"
Ian Elliott [Thu, 12 Feb 2015 18:36:03 +0000 (11:36 -0700)]
Win: "layers_config.cpp" must #include "loader_platform.h"

9 years agoWin: Build both "layer_utils.lib" and "layer_utils.dll".
Ian Elliott [Thu, 12 Feb 2015 18:36:44 +0000 (11:36 -0700)]
Win: Build both "layer_utils.lib" and "layer_utils.dll".

9 years agointel: increase max_batch_buffer_size to 150K dwords
Mike Stroyan [Mon, 9 Feb 2015 20:08:26 +0000 (13:08 -0700)]
intel: increase max_batch_buffer_size to 150K dwords

Increasing the max batch buffer size allows more relocations per command buffer.

9 years agointel: suppress PIPE_CONTROL with 0 flags
Mike Stroyan [Sat, 31 Jan 2015 00:21:08 +0000 (17:21 -0700)]
intel: suppress PIPE_CONTROL with 0 flags