Shaders with HLSL #02 : Applying Shader to WPF Application

In the first part of series, we wrote our first Shader Program. Now it is time to compile it so that we could use it in our WPF Application. HLSL Compiler To compile your HLSL code to a format that could be used with .Net WPF application, you would require the fxc compiler. For Windows … Continue reading Shaders with HLSL #02 : Applying Shader to WPF Application

Shaders with HLSL #01 : Shaders with HLSL for WPF Developers

Complete Tutorial Series * Shaders with HLSL #01 : Introduction to Shaders and HLSL * Shaders with HLSL #02 : Applying Shader to WPF¬†Application In this first part of our tutorial, we will briefly enlighten ourselves on key concepts involving shaders and why it is required. We will also write our first shader application, introducing … Continue reading Shaders with HLSL #01 : Shaders with HLSL for WPF Developers

Early Exceptions for Iterator and async Methods

One of the first things you would need to be vary of while working with Iterator methods and async methods is exception handling. Both Iterator methods and async methods delay the execution of your code, right until you need the result, but it also results in delayed exceptions. Late Exception With Iterator Methods Let's consider … Continue reading Early Exceptions for Iterator and async Methods

Allocation free ‘async’ Methods

Task Asynchronous Programming (TAP) model will go down as one of the landmark of C# language revolution. The typical method signature with return type Task/Task<T> has since then made significant appearances in our programming life. But despite all its glorious functionalities, it needs to be noted that it comes at a certain cost - performance … Continue reading Allocation free ‘async’ Methods

Updated Span API : NonPortableCast and AsReadOnlySpan to MemoryMarshal.Cast and AsSpan

One of the interesting changes (not sure why Microsoft changed this) was moving/changing the Span<T> API's a bit. For example, the Span<T>.NonPortableCast Method was moved as an extension method under MemoryMarshal. Previous API Current API Similarly, the string.AsReadonlySpan method has been renamed. The new API is as follows. Previous API Current API The MemoryMarshal extensions … Continue reading Updated Span API : NonPortableCast and AsReadOnlySpan to MemoryMarshal.Cast and AsSpan

The new String Interpolation and Ternary Operator

A quick tip for the new C# string interpolation. The new string interpolation has made things more simpler and readable. One might be tempted to include ternary operators within string interpolation. However if you attempt something like following, the compiler would throw an error The fix is as simple as it can get. Just include … Continue reading The new String Interpolation and Ternary Operator

Deconstruct and Extension Methods

In an earlier post, we explored the Deconstruct feature for Non-Tuples. It was a pretty useful feature that came along in the 7.x series . If one does have access to source, adding deconstruct is quite easy. But what about classes we do not have (source code) access to ? For example, the .Net framework … Continue reading Deconstruct and Extension Methods