<feed xmlns='http://www.w3.org/2005/Atom'>
<title>slang.git/tools/render-test/render-d3d11.cpp, branch master</title>
<subtitle>Making it easier to work with shaders</subtitle>
<id>https://git.yummers.dev/slang.git/atom?h=master</id>
<link rel='self' href='https://git.yummers.dev/slang.git/atom?h=master'/>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/'/>
<updated>2018-06-28T18:14:48+00:00</updated>
<entry>
<title>Share graphics API layer between tests/examples (#603)</title>
<updated>2018-06-28T18:14:48+00:00</updated>
<author>
<name>Tim Foley</name>
<email>tfoleyNV@users.noreply.github.com</email>
</author>
<published>2018-06-28T18:14:48+00:00</published>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/commit/?id=dfe13b54286b27dd15f591455bbb86b7798285c2'/>
<id>urn:sha1:dfe13b54286b27dd15f591455bbb86b7798285c2</id>
<content type='text'>
The `render-test` project has an in-progress graphics API abstraction layer, and it makes sense to share this code with our examples rather than write a bunch of redundant code between examples and tests.

Most of this change is just moving files from `tools/render-test/*` to a new library project at `tools/slang-graphics/`. The most complicated code change there is renaming from `render_test` to `slang_graphics`.

The existing `hello` example was ported to use the graphics API layer instead of raw D3D11 API calls. It is still hard-coded to use the D3D11 back-end and the `SLANG_DXBC` target, so more work is needed if we want to actually support multiple APIs in the examples.

I also went ahead and implemented an extremely rudimentary set of APIs to abstract over the Windows platform calls that were being made in the example, so that we could potentially run that same example on other platforms. I did *not* port `render-test` to use those APIs, and I also did not implement them for anything but Windows (my assumption is that for most other platforms we would just use SDL2, and require people to ensure it is installed to their machine before building Slang examples).</content>
</entry>
<entry>
<title>Expose macros/functionality for defining interfaces  (#604)</title>
<updated>2018-06-22T17:09:01+00:00</updated>
<author>
<name>jsmall-nvidia</name>
<email>jsmall@nvidia.com</email>
</author>
<published>2018-06-22T17:09:01+00:00</published>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/commit/?id=d0c9571be3a2167a9f019310aca8f7cd326972c0'/>
<id>urn:sha1:d0c9571be3a2167a9f019310aca8f7cd326972c0</id>
<content type='text'>
* Added Result definitions to the slang.h

* Removed slang-result.h and added slang-com-helper.h

* Move slang-com-ptr.h to be publically available.

* Add SLANG_IUNKNOWN macros to simplify implementing interfaces.
Use the SLANG_IUNKNOWN macros to in slang.c

* Removed slang-defines.h added outstanding defines to slang.h
</content>
</entry>
<entry>
<title>Make render-test use Slang for all shader compilation (#597)</title>
<updated>2018-06-13T22:39:04+00:00</updated>
<author>
<name>Tim Foley</name>
<email>tfoleyNV@users.noreply.github.com</email>
</author>
<published>2018-06-13T22:39:04+00:00</published>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/commit/?id=77562ef82bcbab569ebbbd769957948d825c92ad'/>
<id>urn:sha1:77562ef82bcbab569ebbbd769957948d825c92ad</id>
<content type='text'>
* Make render-test use Slang for all shader compilation

This streamlines the code for render-test by having all its shader compilation go through the Slang API, so that it doesn't have to deal with custom logic to compile HLSL-&gt;DXBC and HLSL-&gt;DXIL. We were already leaning on Slang to generate SPIR-V for Vulkan, so this makes all the paths more consistent.

My original plan with this change was to make the D3D12 render path start using DXIL at this point, since the change would make that easy, but it turns out that some aspects of how we handle parameter binding are not compatible with that right now, so it would need to come as a later change.

There's a lot of details here, so I will try to walk through the changes, including the incidental ones:

* Add logic to `premake5.lua` so that we copy the necessary libraries for HLSL shader compilation to our target directory from the Windows SDK. This is necessary so that our tests can actually invoke `dxcompiler.dll`

* Re-run Premake to generate new project files. This moves around a few files that I manually added in previous changes without re-running Premake.

* When invoking `fxc` as a pass-through compiler, be sure to pass along any macros defines via API or command-line. This isn't a strictly required change with how things worked out, but it is a positive one anyway, because it makes `slangc -pass-through fxc` more useful.

* Don't print output from a downstream `fxc` invocation if it produces warnings but no errors. The main reason for this is so that our tests don't fail because of `fxc` warnings on Slang's output (which then don't match the baselines), but it can also be rationalized as not wanting to confuse users with warnings that don't come from the "real" compiler they are using. This probably needs fine-tuning as a policy.

* Add the HLSL `NonUniformResourceIndex` function. This was an oversight because it isn't documented as a builtin on MSDN, and only gets mentioned obliquely when they talk about resource indexing.

* Add `glsl_&lt;version&gt;` profiles to match our `sm_&lt;version&gt;` profiles, so that it is easy for a user to use the profile mechanism to request a specific GLSL version without also specifying a stage name.

* Update the render-test logic so that there is a single `ShaderCompiler` implementation that *always* uses Slang, and get rid of all of the renderer-specific `ShaderCompiler` implementations.

* Update logic in render-test `main.cpp` to select the options to use for the eventual Slang compile based on the choice of renderer and input language. I didn't change the options that render-test exposes, even though they are getting increasingly silly (e.g., `-glsl-rewrite` doesn't use GLSL as its input...).

* Note: the D3D12 renderer will still use fxc, DXBC, and SM 5.0 for now, since trying to update it to switch to dxc, DXIL, and SM 6.0 didn't work well at the time.

* Add a bit of supporting D3D12 code to make sure that we don't allocate a structured buffer when a buffer has a format.

* Make sure to *also* define the `__HLSL__` macro when compiling Slang code, because otherwise a bunch of tests don't work (I'm not clear on how it worked before...).

* fixup: missing file
</content>
</entry>
<entry>
<title>Fix atomic operations on RWBuffer (#593)</title>
<updated>2018-06-06T04:35:48+00:00</updated>
<author>
<name>Tim Foley</name>
<email>tfoleyNV@users.noreply.github.com</email>
</author>
<published>2018-06-06T04:35:48+00:00</published>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/commit/?id=1a698128c15bce0c05b0664bb1458842e1e55511'/>
<id>urn:sha1:1a698128c15bce0c05b0664bb1458842e1e55511</id>
<content type='text'>
* Fix atomic operations on RWBuffer

An earlier change added support for passing true pointers to `__ref` parameters to fix the global `Interlocked*()` functions when applied to `groupshared` variables or `RWStructureBuffer&lt;T&gt;` elements.
That change didn't apply to `RWBuffer&lt;T&gt;` or `RWTexture2D&lt;T&gt;`, etc. because those types had so far only declared `get` and `set` accessors, but not any `ref` accessors (which return a pointer).

The main fixes here are:

* Add `ref` accessors to the subscript oeprations on the `RW*` resource types

* Adjust the logic for emitting calls to subscript accessors so that we don't get quite as eager about invoking a `ref` accessor, and instead try to invoke just a `get` or `set` accessor when these will suffice. This is important for Vulkan cross-compilation, where we don't yet support the semantics of our `ref` accessors.

* Add a test case for atomics on a `RWBuffer`

* Fix up `render-test` so that we can specify a format for a buffer resource, which allows us to use things other than `*StructuredBuffer` and `*ByteAddressBuffer`. The work there is probably not complete; I just did what I could to get the test working.

* A bunch of files got whitespace edits thanks to the fact that I'm using editorconfig and others on the project seemingly arent...

* fixup: remove ifdefed-out code
</content>
</entry>
<entry>
<title>1st stage renderer binding refactor (#587)</title>
<updated>2018-06-01T14:41:13+00:00</updated>
<author>
<name>jsmall-nvidia</name>
<email>jsmall@nvidia.com</email>
</author>
<published>2018-06-01T14:41:13+00:00</published>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/commit/?id=698ba86962d10d927d7ac4eb781e05e33f08c9eb'/>
<id>urn:sha1:698ba86962d10d927d7ac4eb781e05e33f08c9eb</id>
<content type='text'>
* First pass at support for textures in vulkan.

* Binding state has first pass support for VkImageView VkSampler.

* Split out _calcImageViewType

* Fix bug in debug build around constant buffer being added but not part of the binding description for the test.

* Offset recalculated for vk texture construction just store the texture size for each mip level.

* When outputing a vector type with a size of 1 in GLSL, it needs to be output as the underlying type. For example vector&lt;float,1&gt; should be output as float in GLSL.

* Vulkan render-test produces right output for the test

tests/compute/textureSamplingTest.slang -slang -gcompute -o tests/compute/textureSamplingTest.slang.actual.txt -vk

* Small improvement around xml encoding a string.

* More generalized test synthesis.

* Fix image usage flags for Vulkan.

* Improvements to what gets synthesized vulkan tests.

* Do transition on all mip levels.

* Fixing problems appearing from vulkan debug layer.

* Disable Vulkan synthesized tests for now.

* Add Resource::Type member to Resource::DescBase.

* Removed the CompactIndexSlice from binding. Just bind the indices needed.

* BindingRegister -&gt; RegisterSet

* RegisterSet -&gt; RegisterRange

* Typo fix for debug build.

* Remove comment that no longer applied.
</content>
</entry>
<entry>
<title>Use Surface for screen capture in Renderer interface (#551)</title>
<updated>2018-05-04T16:00:53+00:00</updated>
<author>
<name>jsmall-nvidia</name>
<email>jsmall@nvidia.com</email>
</author>
<published>2018-05-04T16:00:53+00:00</published>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/commit/?id=ee47232fc17f31ef2bd95ca480372216a79def56'/>
<id>urn:sha1:ee47232fc17f31ef2bd95ca480372216a79def56</id>
<content type='text'>
* Remove serialization of screen captures from a renderer implementation, capture now writes to a Surface. Then client code can decide to serialize (or use as needed).

* Improved comment for captureScreenSurface.
</content>
</entry>
<entry>
<title>Added Surface type - as a simple value type to hold a 2d collection of pixels. (#548)</title>
<updated>2018-05-03T22:42:13+00:00</updated>
<author>
<name>jsmall-nvidia</name>
<email>jsmall@nvidia.com</email>
</author>
<published>2018-05-03T22:42:13+00:00</published>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/commit/?id=f8472940229e8582ec9f941069fc9576bd09b94c'/>
<id>urn:sha1:f8472940229e8582ec9f941069fc9576bd09b94c</id>
<content type='text'>
Added PngSerializeUtil allows currently for just writing Surface of RGBA format.
Removes dependency on stbi_image except for in PngSerializeUtil.
Removed use of gWindowWidth/Height globals - pass the height into initialize or Renderer.</content>
</entry>
<entry>
<title>Feature/vulkan first render (#545)</title>
<updated>2018-05-03T18:25:13+00:00</updated>
<author>
<name>jsmall-nvidia</name>
<email>jsmall@nvidia.com</email>
</author>
<published>2018-05-03T18:25:13+00:00</published>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/commit/?id=367f3a78a40731da45ee12b9a18c94707f1d1429'/>
<id>urn:sha1:367f3a78a40731da45ee12b9a18c94707f1d1429</id>
<content type='text'>
* First pass at InputLayout for Vulkan
Add support for RGBA_Float32

* Use VulkanModule and VulkanApi to handle accessing Vulkan types.

* First pass at Vulkan swap chain/Device queue.

* Added VulkanUtil for generic function functions.

* Move more functionality to VulkanApi and VulkanUtil.
Make Buffer able to initialize itself.

* More tidy up around VulkanDeviceQueue

* First pass use of VulkanDeviceQueue in VkRenderer

* First pass use of VulkanSwapChain on VkRenderer

* Added depth formats.
Binding for constant and vertex buffers for Vulkan.

* Setting up VkImageView on backbuffers.

* First pass support for setting up vkRenderPass.

* Fixes to work around Vulkan swap chain/verification issues.

* Added support for Pipeline and a pipeline cache.

* Working without waiting - because use of pipeline cache.

* Added support for VkFramebuffer in Vulkan.

* First pass at creating Vulkan graphics pipeline.

* More efforts to get Vulkan to render.

* Small improvement for checking of Binding flags.

* Removed setConstantBuffers from the Renderer interface - so that all resource binding takes place through the BindingState.
To make this work required a 'hack' in render-test main.cpp - so that the constant buffer binding that is needed in some tests is only added when it doesn't clash.

* RendererID -&gt; unified into RendererType. Added getRendererType to Renderer interface.
Added ProjectionStyle, and function to get from RendererType.
Added getIdentityProjection to RendererUtil - to get projection that is the 'identity' - but hits the same pixels for all projection styles.

* Fix build problem on Win32 on Vulkan where should use VK_NULL_HANDLE.

* Improve naming, comments. Remove dead code.

* Remove unwanted comment.
</content>
</entry>
<entry>
<title>Fixes/improvements based on feature/render-binding-resource (#511)</title>
<updated>2018-04-20T18:59:17+00:00</updated>
<author>
<name>jsmall-nvidia</name>
<email>jsmall@nvidia.com</email>
</author>
<published>2018-04-20T18:59:17+00:00</published>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/commit/?id=c73ccbc5616dff16ecacb9198f725f498a7e6c84'/>
<id>urn:sha1:c73ccbc5616dff16ecacb9198f725f498a7e6c84</id>
<content type='text'>
* Dx12 rendering works in test framework.

* Turn on dx12 render tests.

* Split out functions for construction or Renderer types into ShaderRendererUtil. Removed the serialization of buffers code into test-render

* Improvements in documentation and typename in BindingState types.

RegisterSet -&gt; CompactBindIndexSlice
RegisterList -&gt; BindIndexSlice
RegisterDesc -&gt; ShaderBindSet

* Fix debug build break.
</content>
</entry>
<entry>
<title>Separation of Binding/Resource construction on Renderer interface (#508)</title>
<updated>2018-04-19T21:47:04+00:00</updated>
<author>
<name>jsmall-nvidia</name>
<email>jsmall@nvidia.com</email>
</author>
<published>2018-04-19T21:47:04+00:00</published>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/commit/?id=4c751df1680c30fac0369171a9b8dd4bb5bb5b9f'/>
<id>urn:sha1:4c751df1680c30fac0369171a9b8dd4bb5bb5b9f</id>
<content type='text'>
* Dx12 rendering works in test framework.

* Turn on dx12 render tests.

* First pass at Resource and TextureResource/BufferResource types.

* Fix bug in Dx11 impl for BufferResource.

* Dx12 supports TextureResource and binds using TextureResource type, and all tests pass.

* Added TextureBuffer::Size type to make handling mips a little simpler.

* Small improvements to Dx12 constant buffer binding
Removed k prefix on an enum

* First pass impl of dx11 createTextureResource
Added setDefaults to TextureResource::Desc and BufferResource::Desc to simplify setup
accessFlags -&gt; cpuAccessFlags
desc -&gt; srcDesc

* Split out generateTextureResource - can produce the texture using createTextureResource on the Renderer.

* Added support for read mapping to Dx11
accessFlags -&gt; cpuAccessFlags
First pass at using TextureResource/BufferResource on Dx11
Some tests fail with this checkin

* TextureResource working on all tests on dx11.

* Construct ResourceBuffers on Dx11 and Dx12 using utility function createInputBufferResource.

* First pass at OpenGl TextureResource

* Small fixes to dx12 and dx11 setup.
Gl working working using BufferResource and TextureResource

* Tidy up around the compareSampler - looks like the previous test was incorrect.

* Small documentation /naming improvements.

* Fix some more small documentation issues.

* First pass testing out construction of binding resources external to Renderer implementation.

* Moved some BindingState::Desc types to BindingState to make easier to use.

* First pass of binding using BindingState::Desc for Dx11.

* First pass at binding with dx12.

* Fixed issues around separating dx12 binding from ShaderInputLayout

* First pass at OpenGl state binding.

* BindingState::Desc::Binding::Type -&gt; BindingType

* Use Buffer to manage life of vk resources.
Construction of buffers handled by createBufferResource (BindingState doesn't have specialized logic)

* Remove InputLayout types from binding so can create a binding independent of it.

* Added upload buffer to BufferResource - could be used for write mapping.

* m_samplers -&gt; m_samplerDescs.
First pass at Vk binding with BindingState::Desc.
Small tidy/doc improvements.

* First pass with binding all taking place through BindingState::Desc. All tests pass.

* Removed support for creating BindingState from ShaderInputLayout

* Remove serializeOutput from Renderer interface and all implementations.
Implement map/unmap on vulkan
Implement serializeBindingOutput which uses map/unmap and BindingState::Desc to write result.

* Make implementation of BindingState use the BindingState::Desc for much of state - only hold api specific in BindingDetail per implementation.

* Use Glsl binding on vulkan (was using hlsl).

* BindingState::Desc::Binding -&gt; BindingState::Binding. Made possible by impls using 'BindingDetail' for their specific needs.

* Fix compile problems on win32.

* Fix a typo in name createBindingSetDesc -&gt; createBindingStateDesc
</content>
</entry>
</feed>
