Commit Graph
30 Commits
Author SHA1 Message Date
baldurk bda809f9dc Allow GL driver to switch current contexts when really necessary 2014-12-06 20:25:48 +00:00
baldurk 3c05059529 Track our minimal shadow state on a per-context basis
* We track as little state as possible - basically only objects bound to
  binding points that we need to identify for old-style non-DSA functions.
  This is mostly for convenience - the best balance between tracking GL's
  _insane_ state vector and having to query everything we want every time.
* Although we don't properly handle multiple contexts, we need to make sure
  this state is tracked per context otherwise we can get weird mismatches
  and get crashes with e.g. invalid VAOs.
2014-12-03 23:40:03 +00:00
baldurk 61909e56c9 Handle shader being deleted before detach (just drop the detach) 2014-12-03 10:29:31 +00:00
baldurk 6039958ba1 Check for validity of params before trying to serialise 2014-12-03 09:23:30 +00:00
baldurk d7485ad466 Correctly replay glUseProgram(0) 2014-12-03 09:23:19 +00:00
baldurk 9748813eb1 Use serialised program initial states to translate uniform locations
* If you're capturing and replaying on the same driver it's insanely
  unlikely that this translation will be anything other than the identity
  map, although it wouldn't be illegal to renumber locations. However this
  should allow moving captures between vendors/driver versions/platforms,
  which in the past wasn't possible because locations would change (quite
  validly) when the programs were recompiled. There might be other issues,
  but at least this one is fixed.
2014-11-30 16:05:01 +00:00
baldurk 237744a6dd Simple implementation of capturing transform feedback
* This won't work if the feedback is started before the captured frame then
  captured inside it, either by being paused or actually active across the
  SwapBuffers call.
2014-11-27 08:29:38 +00:00
baldurk 3f33541132 Implement glBindFragDataLocationIndexed and glUniformSubroutines
* Note that the uniform subroutines are saved and restored by the render
  state, but they are not properly restored anywhere where we fetch &
  restore the current program. Will probably need a special helper class
  to push/pop that correctly.
2014-11-25 22:18:24 +00:00
baldurk ee5a81739b "Implement" shader/program binary functions, but don't allow them
* We want the application to pass us real GLSL shaders so we can do all
  kinds of juicy things to them. This is generally indicated by the program
  having a LINK_STATUS of FALSE or similar, and we can pretty much get that
  by just not passing through the call.
2014-11-25 21:03:38 +00:00
baldurk 841d77485c Add glActiveShaderProgram and direct glUniform* to right program 2014-11-23 16:37:23 +00:00
baldurk 2484bc8bc7 Use UTF-8 everywhere possible and only use wchar_t where required.
* This means that all APIs pass byte string types. ALL strings everywhere
  in the entire codebase must be assumed to be and treated as UTF-8 content
  not ASCII.
* Gets rid of all the horrible %hs specifiers that caused warnings on
  linux! Hooray.
* We convert to wide strings, or use wide characters, only when necessary
  to use the Win32 API. Some windows specific code will stay in wide chars
  just for convenience.
* Files are already serialised as UTF-8 strings for linux/windows binary
  compatibility, so this change doesn't break backwards compatibility.
2014-11-23 14:45:16 +00:00
baldurk c273073935 Proper record deletion and record parenting 2014-11-12 00:48:56 +00:00
baldurk b8f74610b4 Implement glShaderStorageBlockBinding 2014-11-11 22:54:56 +00:00
baldurk f13f07ee4e Implement remaining functions that UE4 uses
* glBindFragDataLocation
* glMultiDraw* (non indirect)
* glDraw*Indirect
* glDispatchComputeIndirect
2014-11-08 23:00:13 +00:00
valeriog f9c0436360 Serialize glUniform* to the current program resource record as glProgramUniform* while in idle state. 2014-10-28 17:31:32 +01:00
baldurk efbc27909c [Refs #87: Static Analysis] Couple of cases that confused the analyser 2014-10-05 19:01:21 +01:00
baldurk 61eba9a460 Add utility functions globally for mapping shader enums <-> idx 2014-08-18 11:18:39 +01:00
baldurk 0a83acef51 Pre-bake into pipeline and program data shader IDs per stage 2014-08-15 11:15:38 +01:00
baldurk 7ab9815aaf Introduce a bindpoint mapping as part of the pipeline state
* For APIs where the shader namespace/bindpoint (which may be arbitrary
  like 'the Nth texture resource' can be mapped, at each event, to the
  actual API bind point where the object is.
* On D3D11 this is pass-through, on GL this returns the value of each
  uniform.
* This also means GL shader reflection structures are properly immutable
  and the variance in the uniform values is handled elsewhere.
* In future this might need to be expanded to support more complex binding
  methods, where the mapping returns the resource rather than just mapping
  to an integer bind ponit.
2014-08-13 15:56:55 +01:00
baldurk 8158af7a9f Attempt to make separable shader prog, add input/output fetching
* Also moved shader reflection code into separate file
2014-08-12 17:01:18 +01:00
Baldur Karlsson 9eb007f04d Sort of handle separable programs and program pipelines
* Need to find a better way of solving the non-immutable-shader-reflection
  given baked in uniform values. Probably expose the uniform values mapping
  to the user, and for D3D it just becomes trivial and unchanging.
* Also I need to create separable programs per-shader for use for
  reflection in that case, but thanks to the stupid gl_PerVertex
  redeclaration that becomes a nightmare.
2014-08-08 14:00:32 +01:00
Baldur Karlsson 5e32950195 Change GLResource tuple to be three components including Context
* This lets us distinguish framebuffer object 1 on context A from
  FBO 1 on context B.
* At the moment we assume that all shareable objects are shared between
  all contexts. I think this is sensible and fairly common, but it will
  break if some contexts don't share as the objects will alias.
2014-06-27 13:24:19 +01:00
Baldur Karlsson fdbced5292 glUseProgramStages should always go into pipeline record 2014-06-24 16:00:24 +01:00
Baldur Karlsson e757f0aad6 Fix using wrong program name (parameter not valid when reading) 2014-06-24 16:00:23 +01:00
Baldur Karlsson 9441c0aa1d glDetachShader should remove, not add the shader if unlinked 2014-06-24 16:00:23 +01:00
Baldur Karlsson e778ad7b74 Create map for pipeline objects to store child programs 2014-06-24 16:00:22 +01:00
Baldur Karlsson f53f79c2ad Handle calls to bind 0 object (unbinding) 2014-06-24 16:00:17 +01:00
Baldur Karlsson acb36a5308 A few more assorted functions wrapped.
* Also rearranged and organised the ProcessChunk() switch to match the
  enum in gl_common.h for easier reference
2014-06-18 17:23:07 +01:00
Baldur Karlsson eeadec99f6 Tidy up RDCUNIMPLEMENTED() macros, adding text comments to each 2014-06-18 16:08:21 +01:00
Baldur Karlsson 72de770e22 Tidy up wrapped functions and reorganise into logical files
* Remove legacy wrapped functions that were only hacked-in to get
  glxgears working as a proof of concept.
* Split out groups of wrapped functions into separate files by type
2014-06-18 15:19:56 +01:00