Search found 4258 matches

by albinopapa
September 18th, 2020, 2:47 am
Forum: Everything
Topic: SIMD library attempt inf
Replies: 10
Views: 118

Re: SIMD library attempt inf

I brought this up a long time ago, and again, I've gotten a lot further than I have in the past. I wanted to use the template system of C++ to make a sort of programming language. Well, I'm not sure if that is an accurate description, but "it is what it is" lol. using lerp_f1 = function< float, para...
by albinopapa
September 17th, 2020, 11:20 pm
Forum: Everything
Topic: solid rectangle collision
Replies: 6
Views: 65

Re: solid rectangle collision

For left wall, test right side of wall and left side of player: if( playerX < wallX + wallWidth ) playerX = wallX + wallWidth; For right wall, test left side of wall and right side of player: if( playerX + playerWidth >= wallX ) playerX = wallX - playerWidth - 1; -1 to completely separate playerX = ...
by albinopapa
September 17th, 2020, 11:13 pm
Forum: Everything
Topic: solid rectangle collision
Replies: 6
Views: 65

Re: solid rectangle collision

Well, not sure about the IsColliding() function since you didn't post that part, so the error could be in there. Assuming it returns true if playerX >= wallX - playerWidth ( or playerX + playerWidth >= wallX ) then it should work as expected, so I'm guessing the issue is in the collision function. A...
by albinopapa
September 15th, 2020, 9:55 pm
Forum: Everything
Topic: SIMD library attempt inf
Replies: 10
Views: 118

Re: SIMD library attempt inf

Well if anyone is wondering how to do integer division without using /, here's my solution along with the helper functions required: __m128i __vectorcall mm_div_epi32( __m128i dividend, __m128i divisor ) { const auto negone = _mm_set1_epi32( -1 ); const auto posone = _mm_set1_epi32( 1 ); auto quotie...
by albinopapa
September 13th, 2020, 9:03 pm
Forum: Everything
Topic: SIMD library attempt inf
Replies: 10
Views: 118

Re: SIMD library attempt inf

How about a shuffle function that can handle all 8 16 bit elements: template< std::size_t _0, std::size_t _1, std::size_t _2, std::size_t _3, std::size_t _4, std::size_t _5, std::size_t _6, std::size_t _7> __m128i mm_shuffle_epi16( __m128i val ) { constexpr auto mask = []() { constexpr auto keep = s...
by albinopapa
September 13th, 2020, 3:51 pm
Forum: Everything
Topic: Another error message
Replies: 4
Views: 66

Re: Another error message

You haven't fixed everything I mentioned: TransformCbuf::TransformCbuf( Graphics& gfx, const Drawable& parent, UINT slot ) : parent( parent ) { if( !pVcbuf ) { pVcbuf = std::make_unique<VertexConstantBuffer<Transforms>>( gfx, slot ); } } You haven't changed anything here. I told you to look at the C...
by albinopapa
September 13th, 2020, 4:53 am
Forum: Everything
Topic: SIMD library attempt inf
Replies: 10
Views: 118

Re: SIMD library attempt inf

Okay, now I remember why I quit writing my past libs, they don't translate very well when trying to use them. I don't keep usage in mind when creating these libs. For instance, the only algorithm I know ( I'm lame I know ) is for alpha blending with the integer type. __m128i color1; __m128i color2; ...
by albinopapa
September 12th, 2020, 4:32 pm
Forum: Everything
Topic: Another error message
Replies: 4
Views: 66

Re: Another error message

Still getting error message about not including <string> in DxgiInfoManager.h Still getting error message about not including <iterator> in App.cpp And probably the thing you're asking about: TransformCbuf::TransformCbuf( Graphics& gfx, const Drawable& parent, UINT slot ) : parent( parent ) { if( !p...
by albinopapa
September 12th, 2020, 5:01 am
Forum: Everything
Topic: SIMD library attempt inf
Replies: 10
Views: 118

Re: SIMD library attempt inf

Well, I kind of saw this coming, but ignored it. All the comparison intrinsics for integral types are signed, so in order to make comparisons work for unsigned, they have to be promoted compared, then pack the comparison back into the original integer type. Example: unsigned char a = 0; unsigned cha...
by albinopapa
September 11th, 2020, 7:29 pm
Forum: Everything
Topic: SIMD library attempt inf
Replies: 10
Views: 118

Re: SIMD library attempt inf

Anyway, so far I have support for 8 SSE and SSE2 types. I separated the integer __m128i type into signed and unsigned 8, 16 and 32 bit types as well as float and double types. I haven't gotten around to division of integer types yet, well not completely. I currently am just adding rhs to itself unti...