Commit Graph

797 Commits

Author SHA1 Message Date
baldurk e868280f3c Handle missing internal format case 2014-12-02 19:06:10 +00:00
baldurk 2017cdfc35 glBindBuffer sets the 'general' bindpoint buffer regardless of index 2014-12-02 19:02:53 +00:00
baldurk a9861f36bd Add list of extensions used in g_truc 430 and 440, just for now 2014-12-02 01:32:10 +00:00
baldurk 4b9854aa5e Add missing chunk handler 2014-12-02 01:32:00 +00:00
baldurk 973bfaaad0 Don't mark framebuffer itself as dirty 2014-12-02 01:31:55 +00:00
baldurk 314e9ee4db Handle NULL array of textures in glBindTextures 2014-12-02 01:31:45 +00:00
baldurk 9369c85953 Mute the spam about supported extension functions not being returned 2014-12-02 01:31:35 +00:00
baldurk ed7b394a57 Handle other object label types, and negative message lengths
* If a message length is set to a negative value, the message should be
  treated as null terminated
2014-12-02 00:50:32 +00:00
baldurk 6e213a71a7 More cheeky extensions. 2014-12-02 00:48:55 +00:00
baldurk 552581bdaa Fix wrong chunk enum being used 2014-12-02 00:37:54 +00:00
baldurk 46c06893e2 Another cheeky extension 2014-12-02 00:37:44 +00:00
baldurk 90e33ab95f Handle GL_EXT_texture_sRGB_decode. See gl-420-fbo-srgb-decode-ext 2014-12-02 00:25:49 +00:00
baldurk c1287fe853 Include SAMPLER_CUBE_MAP_ARRAY in switch (as any other sampler type) 2014-12-02 00:16:29 +00:00
baldurk 69562fb82d Handle invalid index type reasonably gracefully 2014-12-02 00:16:29 +00:00
baldurk 77db507027 Get chunk names the right way around 2014-12-02 00:16:28 +00:00
baldurk b2d3b94bdc Cheeky add a couple of supported extensions that g_truc looks for 2014-12-02 00:16:23 +00:00
baldurk 52476118de Support doubles in shader vars natively, not packed in 2*uint32 each 2014-12-02 00:16:12 +00:00
baldurk 2cdb6c6ccf Convert internal format to sized early, for making copies
* When serialising out initial states of textures, we make a duplicate to
  copy into. Since we use the storage APIs we need a sized format, so let's
  convert the format early so the stored internal format is sized. This
  doesn't cause a behaviour change as the impl is free to choose any sized
  format and we're just reading back the choice, and making it explicit.
2014-12-01 23:38:00 +00:00
baldurk d26b01ae26 Add support for texture rects & renderbuffers to histogram/minmax 2014-12-01 23:06:35 +00:00
baldurk c51fade47a Add support for texture rectangles. See gl-330-texture-rect 2014-12-01 22:55:35 +00:00
baldurk b0e36c551e Don't want to sample mipmaps even when linaer sampling 2014-12-01 22:54:52 +00:00
baldurk 4b019b059f Handle missing format. See gl-330-texture-integer-rgb10a2ui 2014-12-01 22:25:35 +00:00
baldurk c37884bdd8 Handle arrays of sampler variables. See gl-330-sampler-object 2014-12-01 22:23:49 +00:00
baldurk 116b1b1325 Serialise out scissor test enabled bit 2014-12-01 22:17:14 +00:00
baldurk 78257a1fd9 Track if transform feedback is active, and ensure we deactivate 2014-12-01 22:08:58 +00:00
baldurk 22c42d4e36 If we're going to linear sample, make sure tex is mipmap complete 2014-12-01 22:08:41 +00:00
baldurk 15e9b58317 Linux fixes for switch to UTF-8 strings. 2014-12-01 21:40:43 +00:00
baldurk 976e89787b Avoid using glGetTextureImageEXT as it might be buggy for cubemaps 2014-12-01 20:57:39 +00:00
baldurk 6557d50f29 Don't fetch TEXTURE_VIEW_MIN_LEVEL for texture buffers 2014-12-01 20:57:26 +00:00
baldurk 00e8b67950 Fix typo using non-serialised parameter 2014-12-01 20:57:17 +00:00
baldurk ad4afaf4a0 Actually break out of loop on invalid data. Oops. 2014-12-01 18:36:50 +00:00
baldurk ffdcf5444e Don't print random data as a string 2014-12-01 18:36:40 +00:00
baldurk bf5320edae Make sure queries/conditional rendering are closed properly.
* If we do a partial replay of a frame, a query might be left open. We
  track this and make sure we close any that were left open before the next
  replay.
2014-12-01 18:32:01 +00:00
baldurk 3dfa8f17ab Fix serialising program array uniforms. 2014-12-01 18:13:28 +00:00
baldurk 04c2bba23f Don't use mipmapping for point sampler
* This fixes issues where textures wouldn't render because they weren't
  mipmap complete, and although I was point sampling a single mip the point
  sampler was referencing the mipchain.
2014-12-01 17:50:00 +00:00
baldurk 50d6b62adf Proper SRGB handling in opengl. See gl-320-fbo-srgb
* We create fake backbuffer as SRGB if the original default backbuffer was
  SRGB in the program.
* All of our output backbuffers are also SRGB, and we enable
  GL_FRAMEBUFFER_SRGB when writing to them.
* Add the 'fake' srgb curve applied to linear data to display it as if it
  were srgb, which tends to look intuitively correct even if it's not 100%
  accurate. See the behaviour existing in D3D11 already.
2014-12-01 17:13:30 +00:00
baldurk 962ac749bc Fix mip display 2014-12-01 16:07:04 +00:00
baldurk c370c164ae Force texture completion for copy. See gl-320-fbo-multisample-explicit
* When we do glCopyImageSubData, this seems to require a complete texture
  across all mips - ie. the full mip chain (up to MAX_LEVEL) must be set.
  This requirement holds even if we only copy the mips that are present.
* However, for example attaching an image to a framebuffer, it doesn't
  have to be mipmap complete even if the min/mag filters want mipmaps.
  So in this case we have to force the texture to be complete enough for
  our purposes, and we do this just by setting MAX_LEVEL to clamp the mips
2014-12-01 15:47:27 +00:00
baldurk ba2fe1ccc3 Don't use sampler state for MS texs. See gl-320-fbo-depth-multisample 2014-12-01 14:38:37 +00:00
baldurk 7add9a63dd Better handling for renderbuffer FBO attachments. See gl-320-fbo-blit
* To display them, we create a texture of the same size/format at creation
  time and do an FBO blit to it, then display that texture
2014-12-01 14:29:43 +00:00
baldurk 829647a924 Interpret index offset in GL drawcalls as byte offset 2014-12-01 13:15:02 +00:00
baldurk 49b2b2d2df Handle empty indices array without crashing 2014-12-01 13:14:43 +00:00
baldurk 332cf73591 Handle GL_FLUSH_EXPLICIT buffer maps. See g-truc gl-320-buffer-update
* The general idea is that while idle we can handle these as normal -
  If we ignore the map we ignore the map and mark the buffer dirty etc.
  This is fine because modified but unflushed regions become undefined, and
  we just let these become the modified values.
* While capturing a frame, we do everything to set up as normal, but then
  instead of comparing the modified shadow buffer to an unmodified version,
  detecting the modified range and making one big Unmap() chunk, we make a
  chunk per Flush() call with the flushed range, and ignore the unmap.
2014-12-01 12:41:01 +00:00
baldurk b6ba100ed1 Add a couple more buffer creation flags 2014-12-01 12:41:00 +00:00
baldurk 1bbed3b880 For glVertexAttrib*Pointer, serialise GL_ARRAY_BUFFER
* When glVertexAttrib*Pointer is called it 'latches' the current binding
  of GL_ARRAY_BUFFER (it sets the attrib binding and vertex buffer on the
  VAO internally).
* So when reading, we haven't serialised all the buffer bindings, so we
  need to bind the right buffer by hand.
2014-12-01 12:41:00 +00:00
baldurk 414473b56a Handle integer and normalized vertex attributes properly 2014-12-01 12:40:59 +00:00
baldurk 7b8ad8daf9 Handle when offset is beyond buffer size or length ends up 0 2014-12-01 12:40:58 +00:00
baldurk 6498424eed Check pipeline is valid. See g-truc gl-320-caps
* If no program or pipeline is bound, need to make sure we don't try and
  query a non-existant pipeline. This could happen if e.g. state is totally
  cleared at the start of the frame.
2014-12-01 12:40:52 +00:00
baldurk 5ae4b0d649 Make sure glGetBufferSubData call doesn't overrun buffer size 2014-11-30 20:16:33 +00:00
baldurk 3fa9dcdf47 Properly initialise parent variable structure 2014-11-30 17:13:55 +00:00